WebKit Bugzilla
Attachment 360021 Details for
Bug 193773
: [css-logical] inset shorthand should not accept unitless length quirk
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193773-20190124193441.patch (text/plain), 14.15 KB, created by
Oriol Brufau
on 2019-01-24 10:34:43 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Oriol Brufau
Created:
2019-01-24 10:34:43 PST
Size:
14.15 KB
patch
obsolete
>Subversion Revision: 240330 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 63df039537c5a5419da98370c054b5686f230209..81204c1e23b7a07b7b79783337b9bc0e92221ece 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2019-01-24 Oriol Brufau <obrufau@igalia.com> >+ >+ [css-logical] Reject unitless length quirk in 'inset' shorthand >+ https://bugs.webkit.org/show_bug.cgi?id=193773 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Even though its longhands ('top', 'right', 'bottom', 'left') accept the >+ unitless length quirk, the 'inset' shorthand is a new CSS property and >+ should reject it. >+ >+ Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html >+ imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html >+ >+ * css/parser/CSSPropertyParser.cpp: >+ (WebCore::CSSPropertyParser::parseSingleValue): >+ > 2018-11-15 Oriol Brufau <obrufau@igalia.com> > > [css-logical] Implement flow-relative inset properties >diff --git a/Source/WebCore/css/parser/CSSPropertyParser.cpp b/Source/WebCore/css/parser/CSSPropertyParser.cpp >index 1f795d9032171bfded08548ab1eb8c2735c56b17..76c8ec73987fda57b4ff857778764d4831148777 100644 >--- a/Source/WebCore/css/parser/CSSPropertyParser.cpp >+++ b/Source/WebCore/css/parser/CSSPropertyParser.cpp >@@ -3999,8 +3999,10 @@ RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSS > case CSSPropertyBottom: > case CSSPropertyLeft: > case CSSPropertyRight: >- case CSSPropertyTop: >- return consumeMarginOrOffset(m_range, m_context.mode, UnitlessQuirk::Allow); >+ case CSSPropertyTop: { >+ UnitlessQuirk unitless = currentShorthand != CSSPropertyInset ? UnitlessQuirk::Allow : UnitlessQuirk::Forbid; >+ return consumeMarginOrOffset(m_range, m_context.mode, unitless); >+ } > case CSSPropertyInsetInlineStart: > case CSSPropertyInsetInlineEnd: > case CSSPropertyInsetBlockStart: >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 0cd89ff9b6159150cb7a6ed24776f1ae948ac68b..d183573557d53921777d917fbae76f72b3158905 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,20 @@ >+2019-01-24 Oriol Brufau <obrufau@igalia.com> >+ >+ [css-logical] Reject unitless length quirk in 'inset' shorthand >+ https://bugs.webkit.org/show_bug.cgi?id=193773 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Import WPT tests that check that the unitless length quirk is not >+ allowed in the 'inset' shorthand. >+ >+ * resources/import-expectations.json: >+ * web-platform-tests/quirks/unitless-length/excluded-properties-001-expected.txt: Added. >+ * web-platform-tests/quirks/unitless-length/excluded-properties-001.html: Added. >+ * web-platform-tests/quirks/unitless-length/excluded-properties-003-expected.txt: Added. >+ * web-platform-tests/quirks/unitless-length/excluded-properties-003.html: Added. >+ * web-platform-tests/quirks/unitless-length/w3c-import.log: Added. >+ > 2018-11-15 Oriol Brufau <obrufau@igalia.com> > > [css-logical] Implement flow-relative inset properties >diff --git a/LayoutTests/imported/w3c/resources/import-expectations.json b/LayoutTests/imported/w3c/resources/import-expectations.json >index 995219326a93eec7b52b0578350d5c90fa98e5e7..715ae693426978de283dc3a4b4a490f096e3d404 100644 >--- a/LayoutTests/imported/w3c/resources/import-expectations.json >+++ b/LayoutTests/imported/w3c/resources/import-expectations.json >@@ -291,6 +291,7 @@ > "web-platform-tests/progress-events": "skip", > "web-platform-tests/proximity": "skip", > "web-platform-tests/quirks-mode": "skip", >+ "web-platform-tests/quirks/unitless-length": "import", > "web-platform-tests/referrer-policy": "skip", > "web-platform-tests/remote-playback": "skip", > "web-platform-tests/requestidlecallback": "skip", >diff --git a/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5e60db28c7d4401b30859279877e29e9d0da0012 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001-expected.txt >@@ -0,0 +1,57 @@ >+ >+PASS Property background-position-x does not support quirky length >+PASS Property background-position-y does not support quirky length >+PASS Property block-size does not support quirky length >+PASS Property border-bottom-left-radius does not support quirky length >+PASS Property border-bottom-right-radius does not support quirky length >+PASS Property border-top-left-radius does not support quirky length >+PASS Property border-top-right-radius does not support quirky length >+PASS Property column-gap does not support quirky length >+PASS Property column-rule-width does not support quirky length >+PASS Property column-width does not support quirky length >+PASS Property flex-basis does not support quirky length >+FAIL Property grid-auto-columns does not support quirky length assert_equals: expected "567px" but got "1234px" >+FAIL Property grid-auto-rows does not support quirky length assert_equals: expected "567px" but got "1234px" >+FAIL Property grid-template-columns does not support quirky length assert_equals: expected "567px" but got "1234px" >+FAIL Property grid-template-rows does not support quirky length assert_equals: expected "567px" but got "1234px" >+PASS Property inline-size does not support quirky length >+PASS Property inset does not support quirky length >+PASS Property inset-block does not support quirky length >+PASS Property inset-block-end does not support quirky length >+PASS Property inset-block-start does not support quirky length >+PASS Property inset-inline does not support quirky length >+PASS Property inset-inline-end does not support quirky length >+PASS Property inset-inline-start does not support quirky length >+PASS Property margin-block-end does not support quirky length >+PASS Property margin-block-start does not support quirky length >+PASS Property margin-inline-end does not support quirky length >+PASS Property margin-inline-start does not support quirky length >+PASS Property min-block-size does not support quirky length >+PASS Property min-inline-size does not support quirky length >+PASS Property offset-distance does not support quirky length >+PASS Property outline-offset does not support quirky length >+PASS Property outline-width does not support quirky length >+PASS Property padding-block-end does not support quirky length >+PASS Property padding-block-start does not support quirky length >+PASS Property padding-inline-end does not support quirky length >+PASS Property padding-inline-start does not support quirky length >+FAIL Property perspective does not support quirky length assert_equals: expected "567px" but got "1234px" >+PASS Property row-gap does not support quirky length >+PASS Property scroll-margin-block-end does not support quirky length >+PASS Property scroll-margin-block-start does not support quirky length >+PASS Property scroll-margin-bottom does not support quirky length >+PASS Property scroll-margin-inline-end does not support quirky length >+PASS Property scroll-margin-inline-start does not support quirky length >+PASS Property scroll-margin-left does not support quirky length >+PASS Property scroll-margin-right does not support quirky length >+PASS Property scroll-margin-top does not support quirky length >+PASS Property scroll-padding-block-end does not support quirky length >+PASS Property scroll-padding-block-start does not support quirky length >+PASS Property scroll-padding-bottom does not support quirky length >+PASS Property scroll-padding-inline-end does not support quirky length >+PASS Property scroll-padding-inline-start does not support quirky length >+PASS Property scroll-padding-left does not support quirky length >+PASS Property scroll-padding-right does not support quirky length >+PASS Property scroll-padding-top does not support quirky length >+PASS Property shape-margin does not support quirky length >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d5525aaed30e69eb7e4a24d25baf4757dc023ea7 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html >@@ -0,0 +1,85 @@ >+<html> <!-- webkit-test-runner [ internal:CSSLogicalEnabled=true ] --> >+<head> >+<meta charset="utf-8"> >+<title>Many properties do not support quirky-length</title> >+<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> >+<link rel="help" href="https://quirks.spec.whatwg.org/#the-unitless-length-quirk"> >+<meta name="assert" content="quirky-length is not supported by properties not listed."> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+</head> >+<body> >+<div id="target"></div> >+<script> >+'use strict'; >+ >+var properties = [ >+ 'background-position-x', >+ 'background-position-y', >+ 'block-size', >+ 'border-bottom-left-radius', >+ 'border-bottom-right-radius', >+ 'border-top-left-radius', >+ 'border-top-right-radius', >+ 'column-gap', >+ 'column-rule-width', >+ 'column-width', >+ 'flex-basis', >+ 'grid-auto-columns', >+ 'grid-auto-rows', >+ 'grid-template-columns', >+ 'grid-template-rows', >+ 'inline-size', >+ 'inset', >+ 'inset-block', >+ 'inset-block-end', >+ 'inset-block-start', >+ 'inset-inline', >+ 'inset-inline-end', >+ 'inset-inline-start', >+ 'margin-block-end', >+ 'margin-block-start', >+ 'margin-inline-end', >+ 'margin-inline-start', >+ 'min-block-size', >+ 'min-inline-size', >+ 'offset-distance', >+ 'outline-offset', >+ 'outline-width', >+ 'padding-block-end', >+ 'padding-block-start', >+ 'padding-inline-end', >+ 'padding-inline-start', >+ 'perspective', >+ 'row-gap', >+ 'scroll-margin-block-end', >+ 'scroll-margin-block-start', >+ 'scroll-margin-bottom', >+ 'scroll-margin-inline-end', >+ 'scroll-margin-inline-start', >+ 'scroll-margin-left', >+ 'scroll-margin-right', >+ 'scroll-margin-top', >+ 'scroll-padding-block-end', >+ 'scroll-padding-block-start', >+ 'scroll-padding-bottom', >+ 'scroll-padding-inline-end', >+ 'scroll-padding-inline-start', >+ 'scroll-padding-left', >+ 'scroll-padding-right', >+ 'scroll-padding-top', >+ 'shape-margin' >+]; >+ >+for (let property of properties) { >+ test(() => { >+ if (!getComputedStyle(target)[property]) >+ return; >+ target.style[property] = '567px'; >+ target.style[property] = '1234'; >+ assert_equals(target.style[property], '567px'); >+ }, 'Property ' + property + ' does not support quirky length'); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7a0a64ed7994e0a0427d607560f599056965df5b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS inset does not support quirky length values >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a5f87a7e5738fc3715e6777f6d88f9b322944eb9 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html >@@ -0,0 +1,42 @@ >+<html> <!-- webkit-test-runner [ internal:CSSLogicalEnabled=true ] --> >+<head> >+<meta charset="utf-8"> >+<title>inset does not support quirky-length</title> >+<link rel="help" href="https://quirks.spec.whatwg.org/#the-unitless-length-quirk"> >+<meta name="assert" content="quirky-length is not supported by inset."> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+</head> >+<body> >+<div id="target"></div> >+<script> >+'use strict'; >+ >+test(() => { >+ const quirky_values = [ >+ '1', >+ '1 2px', >+ '1px 2', >+ '1 2', >+ '1 2px 3px', >+ '1px 2 3px', >+ '1px 2px 3', >+ '1 2 3', >+ '1 2px 3px 4px', >+ '1px 2 3px 4px', >+ '1px 2px 3 4px', >+ '1px 2px 3px 4', >+ '1 2 3 4' >+ ]; >+ >+ target.style['inset'] = '5px 6px 7px 8px'; >+ >+ for (let value of quirky_values) { >+ target.style['inset'] = value; >+ assert_equals(target.style['inset'], '5px 6px 7px 8px', 'inset rejects quirky length "' + value + '"'); >+ } >+}, 'inset does not support quirky length values'); >+ >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..d5a5c1204fe80312617332a5799f4172debaa9bf >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/w3c-import.log >@@ -0,0 +1,18 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html >+/LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
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 193773
:
360021
|
360335