WebKit Bugzilla
Attachment 348400 Details for
Bug 188984
: Serializing shorthand with "initial" values should check important flags
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188984-20180829153520.patch (text/plain), 6.62 KB, created by
Oriol Brufau
on 2018-08-29 06:35:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Oriol Brufau
Created:
2018-08-29 06:35:21 PDT
Size:
6.62 KB
patch
obsolete
>Subversion Revision: 235441 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d32b1dc07369d47866848d155dce693de9aeed4e..304bbbc4b81a22eb326e77d4989d9a5a2a42d191 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-08-28 Oriol Brufau <obrufau@igalia.com> >+ >+ Check important flags when serializing shorthand with "initial" values >+ https://bugs.webkit.org/show_bug.cgi?id=188984 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html >+ >+ The test still has some failures due to https://bugs.webkit.org/show_bug.cgi?id=185953 >+ but without this patch it would fail earlier. >+ >+ * css/StyleProperties.cpp: >+ (WebCore::StyleProperties::get4Values const): >+ > 2018-08-28 Youenn Fablet <youenn@apple.com> > > MediaDevices should be collectable as soon as its document is stopped >diff --git a/Source/WebCore/css/StyleProperties.cpp b/Source/WebCore/css/StyleProperties.cpp >index 345013961a16262ad7208b3beebb8f487bfe6b6a..7408177375757ccce5fce32fd8513202f090f375 100644 >--- a/Source/WebCore/css/StyleProperties.cpp >+++ b/Source/WebCore/css/StyleProperties.cpp >@@ -374,6 +374,10 @@ String StyleProperties::get4Values(const StylePropertyShorthand& shorthand) cons > if (!top.value() || !right.value() || !bottom.value() || !left.value()) > return String(); > >+ // Important flags must be the same >+ if (top.isImportant() != right.isImportant() || right.isImportant() != bottom.isImportant() || bottom.isImportant() != left.isImportant()) >+ return String(); >+ > if (top.isInherited() && right.isInherited() && bottom.isInherited() && left.isInherited()) > return getValueName(CSSValueInherit); > >@@ -384,8 +388,6 @@ String StyleProperties::get4Values(const StylePropertyShorthand& shorthand) cons > } > return String(); > } >- if (top.isImportant() != right.isImportant() || right.isImportant() != bottom.isImportant() || bottom.isImportant() != left.isImportant()) >- return String(); > > bool showLeft = !right.value()->equals(*left.value()); > bool showBottom = !top.value()->equals(*bottom.value()) || showLeft; >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 0365e46f7d61dcddd5b023a99f20339964943aec..64140c9bc9201a3c9c22533825787dbffbe36d5d 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,16 @@ >+2018-08-28 Oriol Brufau <obrufau@igalia.com> >+ >+ Check important flags when serializing shorthand with "initial" values >+ https://bugs.webkit.org/show_bug.cgi?id=188984 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The test still has some failures due to https://bugs.webkit.org/show_bug.cgi?id=185953 >+ but without this patch it would fail earlier. >+ >+ * web-platform-tests/css/cssom/shorthand-serialization-expected.txt: >+ * web-platform-tests/css/cssom/shorthand-serialization.html: >+ > 2018-08-28 Aditya Keerthi <akeerthi@apple.com> > > [iOS] Support inputmode=none >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/shorthand-serialization-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/cssom/shorthand-serialization-expected.txt >index 369d53047d26d136b6316e5321357b732bfebea6..203ad8e64a9ef8666c67e902ff6a7e744f688534 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/shorthand-serialization-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom/shorthand-serialization-expected.txt >@@ -10,4 +10,7 @@ PASS Shorthand serialization with shorthand and longhands mixed. > PASS Shorthand serialization with just longhands. > FAIL Shorthand serialization with variable and variable from other shorthand. assert_equals: expected "var(--a)" but got "" > PASS Shorthand serialization after setting >+FAIL Shorthand serialization with 'initial' value. assert_equals: expected "margin: initial;" but got "" >+FAIL Shorthand serialization with 'initial' value, one longhand with important flag. assert_equals: expected "margin-top: initial !important; margin-right: initial; margin-bottom: initial; margin-left: initial;" but got "" >+FAIL Shorthand serialization with 'initial' value, longhands set individually, one with important flag. assert_equals: expected "margin-top: initial; margin-right: initial; margin-bottom: initial; margin-left: initial !important;" but got "" > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html b/LayoutTests/imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html >index 2178ba37a959fc56537c7cc164d423d14563881f..74b499934bb8b60bb014abcd4a06d1f35456c014 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html >@@ -58,6 +58,31 @@ > assert_equals(testElem.style.margin, "20px"); > assert_equals(testElem.style.cssText, "margin: 20px;") > }, "Shorthand serialization after setting"); >+ >+ test(function() { >+ const testElem = document.getElementById("test"); >+ testElem.style.cssText = "margin: initial;"; >+ assert_equals(testElem.style.margin, "initial"); >+ assert_equals(testElem.style.cssText, "margin: initial;"); >+ }, "Shorthand serialization with 'initial' value."); >+ >+ test(function() { >+ const testElem = document.getElementById("test"); >+ testElem.style.setProperty("margin-top", "initial", "important"); >+ assert_equals(testElem.style.margin, ""); >+ assert_equals(testElem.style.cssText, "margin-top: initial !important; margin-right: initial; margin-bottom: initial; margin-left: initial;"); >+ }, "Shorthand serialization with 'initial' value, one longhand with important flag."); >+ >+ test(function() { >+ const testElem = document.getElementById("test"); >+ testElem.style.cssText = ""; >+ testElem.style.setProperty("margin-top", "initial"); >+ testElem.style.setProperty("margin-right", "initial"); >+ testElem.style.setProperty("margin-bottom", "initial"); >+ testElem.style.setProperty("margin-left", "initial", "important"); >+ assert_equals(testElem.style.margin, ""); >+ assert_equals(testElem.style.cssText, "margin-top: initial; margin-right: initial; margin-bottom: initial; margin-left: initial !important;"); >+ }, "Shorthand serialization with 'initial' value, longhands set individually, one with important flag."); > </script> > </body> > </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 188984
:
348318
|
348319
|
348343
|
348400
|
348820