WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-220940-20210125125925.patch (text/plain), 9.41 KB, created by
Sam Weinig
on 2021-01-25 12:59:26 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sam Weinig
Created:
2021-01-25 12:59:26 PST
Size:
9.41 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 271808) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2021-01-25 Sam Weinig <weinig@apple.com> >+ >+ Support percentages when parsing color(srgb ...) and color(display-p3 ...) per-spec >+ https://bugs.webkit.org/show_bug.cgi?id=220940 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add support for using percentages when using the color(srgb ) and color(display-p3 ) syntax. Also >+ fix color(lab ) to allow elliding parameters and defaulting them to 0 as per-spec. >+ >+ Unfails some WPT tests and adds additional parsing tests for lab to fast/css/parsing-lab-colors.html >+ >+ * css/parser/CSSPropertyParserHelpers.cpp: >+ (WebCore::CSSPropertyParserHelpers::parseColorFunctionForSRGBOrDisplayP3Parameters): >+ (WebCore::CSSPropertyParserHelpers::parseColorFunctionForLabParameters): >+ > 2021-01-25 Chris Dumez <cdumez@apple.com> > > Support AbortSignal in addEventListenerOptions to unsubscribe from events >Index: Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp >=================================================================== >--- Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (revision 271796) >+++ Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (working copy) >@@ -885,6 +885,8 @@ static Color parseColorFunctionForSRGBOr > double value; > if (consumeNumberRaw(args, value)) > colorChannels[i] = value; >+ else if (auto percent = consumePercentRaw(args)) >+ colorChannels[i] = *percent / 100.0; > else > break; > } >@@ -901,23 +903,29 @@ static Color parseColorFunctionForLabPar > ASSERT(args.peek().id() == CSSValueLab); > consumeIdentRaw(args); > >- auto lightness = consumePercentRaw(args, ValueRangeAll); >- if (!lightness) >- return { }; >- >- double aValue; >- if (!consumeNumberRaw(args, aValue, ValueRangeAll)) >- return { }; >- >- double bValue; >- if (!consumeNumberRaw(args, bValue, ValueRangeAll)) >- return { }; >+ double colorChannels[3] = { 0, 0, 0 }; >+ [&] { >+ auto lightness = consumePercentRaw(args, ValueRangeAll); >+ if (!lightness) >+ return; >+ colorChannels[0] = static_cast<float>(*lightness); >+ >+ double aValue; >+ if (!consumeNumberRaw(args, aValue, ValueRangeAll)) >+ return; >+ colorChannels[1] = aValue; >+ >+ double bValue; >+ if (!consumeNumberRaw(args, bValue, ValueRangeAll)) >+ return; >+ colorChannels[2] = bValue; >+ }(); > > auto alpha = parseOptionalAlpha(args); > if (!alpha) > return { }; > >- return Lab<float> { static_cast<float>(*lightness), static_cast<float>(aValue), static_cast<float>(bValue), *alpha }; >+ return Lab<float> { static_cast<float>(colorChannels[0]), static_cast<float>(colorChannels[1]), static_cast<float>(colorChannels[2]), *alpha }; > } > > static Color parseColorFunctionParameters(CSSParserTokenRange& range) >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 271808) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2021-01-25 Sam Weinig <weinig@apple.com> >+ >+ Support percentages when parsing color(srgb ...) and color(display-p3 ...) per-spec >+ https://bugs.webkit.org/show_bug.cgi?id=220940 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add support for using percentages when using the color(srgb ) and color(display-p3 ) syntax. Also >+ fix color(lab ) to allow elliding parameters and defaulting them to 0 as per-spec. >+ >+ * TestExpectations: >+ * fast/css/parsing-lab-colors-expected.txt: >+ * fast/css/parsing-lab-colors.html: >+ > 2021-01-25 Ryan Haddad <ryanhaddad@apple.com> > > Many WPT tests in css/css-color/predefined-*.html failing >Index: LayoutTests/TestExpectations >=================================================================== >--- LayoutTests/TestExpectations (revision 271803) >+++ LayoutTests/TestExpectations (working copy) >@@ -4576,17 +4576,15 @@ webkit.org/b/217931 imported/w3c/web-pla > webkit.org/b/220325 http/wpt/css/css-highlight-api/highlight-text-cascade.html [ ImageOnlyFailure ] > > # Unsupported css color() variants >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-002.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-003.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-004.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-006.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-007.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-008.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-009.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-010.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-011.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-012.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-014.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-015.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-016.html [ Failure ] >-webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-017.html [ Failure ] >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-003.html [ Failure ] # Invalid test, no colorspace specfied >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-004.html [ Failure ] # Invalid test, no colorspace specfied >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-007.html [ Failure ] # Requires a98-rgb support >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-008.html [ Failure ] # Requires a98-rgb support >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-009.html [ Failure ] # Requires prophoto-rgb support >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-010.html [ Failure ] # Requires prophoto-rgb support >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-011.html [ Failure ] # Requires rec2020 support >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-012.html [ Failure ] # Requires rec2020 support >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-014.html [ Failure ] # Requires fallback (at parse time) support >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-015.html [ Failure ] # Requires fallback (at parse time) support (unclear if this makes sense) >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-016.html [ Failure ] # Requires xyz support >+webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-017.html [ Failure ] # Requires xyz support >Index: LayoutTests/fast/css/parsing-lab-colors-expected.txt >=================================================================== >--- LayoutTests/fast/css/parsing-lab-colors-expected.txt (revision 271803) >+++ LayoutTests/fast/css/parsing-lab-colors-expected.txt (working copy) >@@ -46,6 +46,12 @@ PASS computedStyle("background-color", " > PASS computedStyle("background-color", "color(lab 0% 0 0 / -10%)") is "lab(0% 0 0 / 0)" > PASS computedStyle("background-color", "color(lab 0% 0 0 / 110%)") is "lab(0% 0 0)" > PASS computedStyle("background-color", "color(lab 0% 0 0 / 300%)") is "lab(0% 0 0)" >+PASS computedStyle("background-color", "color(lab 50% -200)") is "lab(50% -200 0)" >+PASS computedStyle("background-color", "color(lab 50%)") is "lab(50% 0 0)" >+PASS computedStyle("background-color", "color(lab)") is "lab(0% 0 0)" >+PASS computedStyle("background-color", "color(lab 50% -200 / 0.5)") is "lab(50% -200 0 / 0.5)" >+PASS computedStyle("background-color", "color(lab 50% / 0.5)") is "lab(50% 0 0 / 0.5)" >+PASS computedStyle("background-color", "color(lab / 0.5)") is "lab(0% 0 0 / 0.5)" > > Test invalid values > PASS computedStyle("background-color", "lab(0 0 0)") is "rgba(0, 0, 0, 0)" >Index: LayoutTests/fast/css/parsing-lab-colors.html >=================================================================== >--- LayoutTests/fast/css/parsing-lab-colors.html (revision 271803) >+++ LayoutTests/fast/css/parsing-lab-colors.html (working copy) >@@ -80,6 +80,12 @@ > testComputed("background-color", "color(lab 0% 0 0 / -10%)", "lab(0% 0 0 / 0)"); > testComputed("background-color", "color(lab 0% 0 0 / 110%)", "lab(0% 0 0)"); > testComputed("background-color", "color(lab 0% 0 0 / 300%)", "lab(0% 0 0)"); >+ testComputed("background-color", "color(lab 50% -200)", "lab(50% -200 0)"); >+ testComputed("background-color", "color(lab 50%)", "lab(50% 0 0)"); >+ testComputed("background-color", "color(lab)", "lab(0% 0 0)"); >+ testComputed("background-color", "color(lab 50% -200 / 0.5)", "lab(50% -200 0 / 0.5)"); >+ testComputed("background-color", "color(lab 50% / 0.5)", "lab(50% 0 0 / 0.5)"); >+ testComputed("background-color", "color(lab / 0.5)", "lab(0% 0 0 / 0.5)"); > > debug(''); > debug('Test invalid values');
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 220940
:
418325
|
418326
|
418335