Title: [245664] trunk
- Revision
- 245664
- Author
- [email protected]
- Date
- 2019-05-22 17:43:09 -0700 (Wed, 22 May 2019)
Log Message
Subselectors not searched when determining property whitelist for selector
https://bugs.webkit.org/show_bug.cgi?id=198147
<rdar://problem/50405208>
Reviewed by Zalan Bujtas.
Source/WebCore:
This can cause marker elements get style they shouldn't.
Test: fast/lists/marker-style-subselector-whitelist.html
* css/RuleSet.cpp:
(WebCore::determinePropertyWhitelistType):
Check subselectors too.
LayoutTests:
* fast/lists/marker-style-subselector-whitelist-expected.txt: Added.
* fast/lists/marker-style-subselector-whitelist.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (245663 => 245664)
--- trunk/LayoutTests/ChangeLog 2019-05-23 00:41:47 UTC (rev 245663)
+++ trunk/LayoutTests/ChangeLog 2019-05-23 00:43:09 UTC (rev 245664)
@@ -1,3 +1,14 @@
+2019-05-22 Antti Koivisto <[email protected]>
+
+ Subselectors not searched when determining property whitelist for selector
+ https://bugs.webkit.org/show_bug.cgi?id=198147
+ <rdar://problem/50405208>
+
+ Reviewed by Zalan Bujtas.
+
+ * fast/lists/marker-style-subselector-whitelist-expected.txt: Added.
+ * fast/lists/marker-style-subselector-whitelist.html: Added.
+
2019-05-22 Wenson Hsieh <[email protected]>
[iOS] The shouldIgnoreMetaViewport test option incorrectly persists across layout tests
Added: trunk/LayoutTests/fast/lists/marker-style-subselector-whitelist-expected.txt (0 => 245664)
--- trunk/LayoutTests/fast/lists/marker-style-subselector-whitelist-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/lists/marker-style-subselector-whitelist-expected.txt 2019-05-23 00:43:09 UTC (rev 245664)
@@ -0,0 +1 @@
+List item marker should not be blockified. This test passes if it doesn't assert.
Added: trunk/LayoutTests/fast/lists/marker-style-subselector-whitelist.html (0 => 245664)
--- trunk/LayoutTests/fast/lists/marker-style-subselector-whitelist.html (rev 0)
+++ trunk/LayoutTests/fast/lists/marker-style-subselector-whitelist.html 2019-05-23 00:43:09 UTC (rev 245664)
@@ -0,0 +1,16 @@
+<li><span>List item marker should not be blockified. This test passes if it doesn't assert.</span></li>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+setTimeout(function() {
+ let css = document.createElement("style");
+ css.type = 'text/css';
+ css.appendChild(document.createTextNode(":matches(::marker) { display: block; }"));
+ document.getElementsByTagName("head")[0].appendChild(css);
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+</script>
Modified: trunk/Source/WebCore/ChangeLog (245663 => 245664)
--- trunk/Source/WebCore/ChangeLog 2019-05-23 00:41:47 UTC (rev 245663)
+++ trunk/Source/WebCore/ChangeLog 2019-05-23 00:43:09 UTC (rev 245664)
@@ -1,3 +1,20 @@
+2019-05-22 Antti Koivisto <[email protected]>
+
+ Subselectors not searched when determining property whitelist for selector
+ https://bugs.webkit.org/show_bug.cgi?id=198147
+ <rdar://problem/50405208>
+
+ Reviewed by Zalan Bujtas.
+
+ This can cause marker elements get style they shouldn't.
+
+ Test: fast/lists/marker-style-subselector-whitelist.html
+
+ * css/RuleSet.cpp:
+ (WebCore::determinePropertyWhitelistType):
+
+ Check subselectors too.
+
2019-05-22 Saam barati <[email protected]>
WHLSL: fix enum parsing
Modified: trunk/Source/WebCore/css/RuleSet.cpp (245663 => 245664)
--- trunk/Source/WebCore/css/RuleSet.cpp 2019-05-23 00:41:47 UTC (rev 245663)
+++ trunk/Source/WebCore/css/RuleSet.cpp 2019-05-23 00:43:09 UTC (rev 245664)
@@ -144,6 +144,14 @@
#endif
if (component->match() == CSSSelector::PseudoElement && component->pseudoElementType() == CSSSelector::PseudoElementMarker)
return PropertyWhitelistMarker;
+
+ if (const auto* selectorList = selector->selectorList()) {
+ for (const auto* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(subSelector)) {
+ auto whitelistType = determinePropertyWhitelistType(subSelector);
+ if (whitelistType != PropertyWhitelistNone)
+ return whitelistType;
+ }
+ }
}
return PropertyWhitelistNone;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes