Commit ac2d9581 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Collect type selector rules case-sensitively in UA sheets.

Selectors in UA sheets are added case-sensitively to RuleSet buckets as
if they were sheets in non-HTML documents in order to match correctly
for xhtml and svg documents. That means we should not use the lower-case
element name to lookup element rules as the lower-case of foreignObject
would not find the foreignObject rules from the element bucket in the
svg.css UA stylesheet.

Bug: 819814
Change-Id: I2064f6669f6b7021feab2c93dd6b4d8a5c749b77
Reviewed-on: https://chromium-review.googlesource.com/c/1290849Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601116}
parent e799b882
...@@ -3487,7 +3487,6 @@ crbug.com/626703 external/wpt/html/form-elements/the-textarea-element/multiline- ...@@ -3487,7 +3487,6 @@ crbug.com/626703 external/wpt/html/form-elements/the-textarea-element/multiline-
crbug.com/626703 external/wpt/svg/path/bearing/zero.svg [ Failure ] crbug.com/626703 external/wpt/svg/path/bearing/zero.svg [ Failure ]
crbug.com/626703 external/wpt/svg/path/bearing/relative.svg [ Failure ] crbug.com/626703 external/wpt/svg/path/bearing/relative.svg [ Failure ]
crbug.com/626703 external/wpt/svg/path/bearing/absolute.svg [ Failure ] crbug.com/626703 external/wpt/svg/path/bearing/absolute.svg [ Failure ]
crbug.com/626703 external/wpt/svg/extensibility/foreignObject/foreign-object-size.html [ Failure ]
crbug.com/626703 [ Linux ] external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c.xht [ Failure ] crbug.com/626703 [ Linux ] external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c.xht [ Failure ]
crbug.com/626703 [ Linux ] external/wpt/css/css-color/t425-hsla-onscreen-multiple-boxes-c.xht [ Failure ] crbug.com/626703 [ Linux ] external/wpt/css/css-color/t425-hsla-onscreen-multiple-boxes-c.xht [ Failure ]
crbug.com/626703 [ Linux Win ] external/wpt/css/css-color/t425-hsla-onscreen-b.xht [ Failure ] crbug.com/626703 [ Linux Win ] external/wpt/css/css-color/t425-hsla-onscreen-b.xht [ Failure ]
...@@ -5336,4 +5335,4 @@ crbug.com/891155 [ Linux ] fast/events/middleClickAutoscroll-drag.html [ Failure ...@@ -5336,4 +5335,4 @@ crbug.com/891155 [ Linux ] fast/events/middleClickAutoscroll-drag.html [ Failure
crbug.com/895777 external/wpt/infrastructure/assumptions/blank.html [ Failure Crash ] crbug.com/895777 external/wpt/infrastructure/assumptions/blank.html [ Failure Crash ]
#Sheriff 2018-10-18 #Sheriff 2018-10-18
crbug.com/896765 [ Linux Mac ] http/tests/performance-timing/element-timing/observe-child-element.html [ Failure Pass ] crbug.com/896765 [ Linux Mac ] http/tests/performance-timing/element-timing/observe-child-element.html [ Failure Pass ]
\ No newline at end of file
...@@ -6,6 +6,6 @@ ...@@ -6,6 +6,6 @@
<p>PASS if no crash or assertion failure.</p> <p>PASS if no crash or assertion failure.</p>
<div style="-webkit-column-count:2;"> <div style="-webkit-column-count:2;">
<svg style="display:block; -webkit-column-span:all;"> <svg style="display:block; -webkit-column-span:all;">
<foreignObject>&nbsp;</foreignObject> <foreignObject style="overflow:visible">&nbsp;</foreignObject>
</svg> </svg>
</div> </div>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</script> </script>
<body> <body>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<foreignObject width="100" height="100"> <foreignObject width="100" height="100" style="overflow:visible">
<div xmlns="http://www.w3.org/1999/xhtml" style="width: 100px; height: 100px; background-color: green;"></div> <div xmlns="http://www.w3.org/1999/xhtml" style="width: 100px; height: 100px; background-color: green;"></div>
</foreignObject> </foreignObject>
</svg> </svg>
......
CONSOLE WARNING: line 6: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details. CONSOLE WARNING: line 6: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
Passes if it does not crash. Passes if it does not crash.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<rect width="200" height="50"/> <rect width="200" height="50"/>
</clipPath> </clipPath>
</defs> </defs>
<foreignObject width="200" height="100" clip-path="url(#clip)" opacity=".5"> <foreignObject width="200" height="100" clip-path="url(#clip)" opacity=".5" style="overflow:visible">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<body> <body>
<div style="background: #00FE00; height: 50px;"></div> <div style="background: #00FE00; height: 50px;"></div>
......
...@@ -235,9 +235,11 @@ void ElementRuleCollector::CollectMatchingRules( ...@@ -235,9 +235,11 @@ void ElementRuleCollector::CollectMatchingRules(
if (SelectorChecker::MatchesFocusPseudoClass(element)) if (SelectorChecker::MatchesFocusPseudoClass(element))
CollectMatchingRulesForList(match_request.rule_set->FocusPseudoClassRules(), CollectMatchingRulesForList(match_request.rule_set->FocusPseudoClassRules(),
cascade_order, match_request); cascade_order, match_request);
CollectMatchingRulesForList( AtomicString element_name = matching_ua_rules_
match_request.rule_set->TagRules(element.LocalNameForSelectorMatching()), ? element.localName()
cascade_order, match_request); : element.LocalNameForSelectorMatching();
CollectMatchingRulesForList(match_request.rule_set->TagRules(element_name),
cascade_order, match_request);
CollectMatchingRulesForList(match_request.rule_set->UniversalRules(), CollectMatchingRulesForList(match_request.rule_set->UniversalRules(),
cascade_order, match_request); cascade_order, match_request);
} }
......
...@@ -166,7 +166,7 @@ TEST_F(LayoutSVGForeignObjectTest, HitTestZoomedForeignObject) { ...@@ -166,7 +166,7 @@ TEST_F(LayoutSVGForeignObjectTest, HitTestZoomedForeignObject) {
SetBodyInnerHTML(R"HTML( SetBodyInnerHTML(R"HTML(
<style>* { margin: 0; zoom: 150% }</style> <style>* { margin: 0; zoom: 150% }</style>
<svg id='svg' style='width: 200px; height: 200px'> <svg id='svg' style='width: 200px; height: 200px'>
<foreignObject id='foreign' x='10' y='10' width='100' height='150'> <foreignObject id='foreign' x='10' y='10' width='100' height='150' style='overflow: visible'>
<div id='div' style='margin: 50px; width: 50px; height: 50px'> <div id='div' style='margin: 50px; width: 50px; height: 50px'>
</div> </div>
</foreignObject> </foreignObject>
......
...@@ -1061,7 +1061,7 @@ TEST_P(PaintPropertyTreeBuilderTest, EffectNodesAcrossHTMLSVGBoundary) { ...@@ -1061,7 +1061,7 @@ TEST_P(PaintPropertyTreeBuilderTest, EffectNodesAcrossHTMLSVGBoundary) {
TEST_P(PaintPropertyTreeBuilderTest, EffectNodesAcrossSVGHTMLBoundary) { TEST_P(PaintPropertyTreeBuilderTest, EffectNodesAcrossSVGHTMLBoundary) {
SetBodyInnerHTML(R"HTML( SetBodyInnerHTML(R"HTML(
<svg id='svgRootWithOpacity' style='opacity: 0.3;'> <svg id='svgRootWithOpacity' style='opacity: 0.3;'>
<foreignObject id='foreignObjectWithOpacity' opacity='0.4'> <foreignObject id='foreignObjectWithOpacity' opacity='0.4' style='overflow: visible;'>
<body> <body>
<span id='spanWithOpacity' style='opacity: 0.5'/> <span id='spanWithOpacity' style='opacity: 0.5'/>
</body> </body>
...@@ -1624,7 +1624,7 @@ TEST_P(PaintPropertyTreeBuilderTest, ControlClipInsideForeignObject) { ...@@ -1624,7 +1624,7 @@ TEST_P(PaintPropertyTreeBuilderTest, ControlClipInsideForeignObject) {
<div style='column-count:2;'> <div style='column-count:2;'>
<div style='columns: 2'> <div style='columns: 2'>
<svg style='width: 500px; height: 500px;'> <svg style='width: 500px; height: 500px;'>
<foreignObject> <foreignObject style='overflow: visible;'>
<input id='button' style='width:345px; height:123px' <input id='button' style='width:345px; height:123px'
value='some text'/> value='some text'/>
</foreignObject> </foreignObject>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment