WebKit Bugzilla
Attachment 348343 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-20180828231902.patch (text/plain), 5.70 KB, created by
Oriol Brufau
on 2018-08-28 14:19:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Oriol Brufau
Created:
2018-08-28 14:19:03 PDT
Size:
5.70 KB
patch
obsolete
>Subversion Revision: 235256 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c48feb6a82d7678456f6cb52a11f244fd5a7c623..16ccc85e359453103bbcba3e1ee64701807dfa64 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=188984 >+ but without this patch it would fail earlier. >+ >+ * css/StyleProperties.cpp: >+ (WebCore::StyleProperties::get4Values const): >+ > 2018-08-23 Daniel Bates <dabates@apple.com> > > [iOS] Test editing/undo/replace-text-in-node-preserving-markers-crash.html crashes >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 a927bc968fb726b01ddc658465521fb717a73e6a..ada46cbae5e19d024bc682d03a243198c928758d 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=188984 >+ 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-23 Aditya Keerthi <akeerthi@apple.com> > > [iOS] Support the inputmode attribute on contenteditable elements >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..df71259a667dd5838308d73ea558f98bb8c7d992 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,6 @@ 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 "" > >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..44af6737e3ef3b3c71ccd259b1d75104c4a92061 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,20 @@ > 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."); > </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