|
Fix selector namespace prefix resolution.
When parsed without a stylesheet context, there are no prefix to
namespace URI mapping, so a ns name prefixed selector should be
invalid. Instead, we mapped "ns|e" to "*|e".
Here, we instead make "ns|e" invalid in contexts where there is no
stylesheet. However, "|e" and "*|e" should still be valid, so that part
of the prefix resolution is moved from the stylesheet to the selector
parser.
This meant that prefix resolution was incorrect for the select
attribute of the content element.
Also, prefixes in Selectors API were handled outside of the selector
parsing instead. Now we handle it inside the selector parsing instead
which means that we throw a SyntaxError instead of a NamespaceError for
unresolved namespace prefixes in the Selectors API. This is in line
with the specifications[1][2] and Gecko.
Another issue, was that setting selectorText of StyleRule did not pass
a stylesheet to the selector parser, so namespace resolution did not
work for setting selectorText.
[1] https://www.w3.org/TR/selectors-api2/#resolving-namespaces
[2] https://dom.spec.whatwg.org/#scope-match-a-selectors-string
R=timloh@chromium.org
BUG= 580023, 580445
Committed: https://crrev.com/8ccb69f37572249545fc7b1b8bab97fe71910321
Cr-Commit-Position: refs/heads/master@{#371275}
Total comments: 1
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+95 lines, -63 lines) |
Patch |
|
M |
third_party/WebKit/LayoutTests/fast/css/css-set-selector-text.html
|
View
|
1
2
|
2 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/LayoutTests/fast/css/css-set-selector-text-expected.txt
|
View
|
1
2
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/fast/css/stylerule-set-selectortext-ns.html
|
View
|
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/fast/css/stylerule-set-selectortext-ns-expected.txt
|
View
|
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/not-supported-namespace-in-selector-expected.txt
|
View
|
|
1 chunk |
+13 lines, -13 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-select-namespace.html
|
View
|
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-select-namespace-expected.html
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/LayoutTests/fast/dom/shadow/content-selector-query.html
|
View
|
1
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/LayoutTests/fast/dom/shadow/content-selector-query-expected.txt
|
View
|
1
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSPageRule.cpp
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSSelectorList.h
|
View
|
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSSelectorList.cpp
|
View
|
|
1 chunk |
+0 lines, -10 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSStyleRule.cpp
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/StyleSheetContents.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/StyleSheetContents.cpp
|
View
|
|
1 chunk |
+2 lines, -8 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/parser/CSSParser.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/parser/CSSParser.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
|
View
|
1
2
3
|
1 chunk |
+8 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/SelectorQuery.cpp
|
View
|
|
1 chunk |
+1 line, -7 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/html/HTMLContentElement.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/web/WebSelector.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 27 (12 generated)
|