WebKit Bugzilla
Attachment 348820 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-20180904184810.patch (text/plain), 6.11 KB, created by
Oriol Brufau
on 2018-09-04 09:48:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Oriol Brufau
Created:
2018-09-04 09:48:11 PDT
Size:
6.11 KB
patch
obsolete
>Subversion Revision: 235612 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d63bca0e358f679ecc711030661f56a4aae59940..be5c22db99fe3e89ee5e0f8069f848274ebb437e 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-09-04 Zan Dobersek <zdobersek@igalia.com> and Ms2ger <Ms2ger@igalia.com> > > Implement support for passing ImageBitmap to texImage2D/texSubImage2D >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 e33449a3d041bd8f81395b29c624effca29e28d9..52374a1e68de7906da4c1b8b7f33ede553174aea 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-09-03 Andy Estes <aestes@apple.com> > > [Payment Request] Implement the MerchantValidationEvent constructor >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..eaead319a709e68ae33eec13ad66fbe720404f39 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 "" >+PASS Shorthand serialization with 'initial' value, one longhand with important flag. >+PASS Shorthand serialization with 'initial' value, longhands set individually, one with important flag. > >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..97e11da8b8a266c7efa3826272e3fdb7ce55ed86 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,29 @@ > 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, ""); >+ }, "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, ""); >+ }, "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