U+212A in CSS selectors match to wrong elements/attributes |
|||||
Issue description
Chrome Version: 60 Canary
OS: All but iOS
What steps will reproduce the problem?
(1) Open the following HTML document.
<!-- quirks mode -->
<style>
\212a bd:after {
content: " (CSS matched)";
color: red;
}
div[\212alass]:after {
content: " (CSS matched)";
color: red;
}
</style>
<body>
<kbd>KBD</kbd>
<div klass>klass</div>
</body>
What is the expected result?
The page just show the following black text:
KBD
klass
What happens instead?
Chrome 60 shows the following:
KBD (CSS matched)
klass (CSS matched)
Please use labels and text to provide additional information.
Firefox and Safari work correctly.
According to the standard, we should apply ASCII lowercase, but we apply Unicode lowercase.
https://html.spec.whatwg.org/multipage/scripting.html#selectors
,
May 26 2017
,
May 26 2017
,
May 26 2017
,
May 26 2017
Sorry, forgot to set the status when I started on this: chromium-review.googlesource.com/c/517105/
,
May 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2779cf5d3b716f5a0f6ef37cf0bd20ee764d675e commit 2779cf5d3b716f5a0f6ef37cf0bd20ee764d675e Author: Rune Lillesveen <rune@opera.com> Date: Fri May 26 16:08:05 2017 Use LowerASCII instead of DeprecatedLower in css/ Incorrectly folded upper-case non-ascii characters into ascii for type, attribute, id, and class selectors causing non-matching selectors to match. Also fixed for media types and features. BUG= 726176 Change-Id: I5a6f813b2722ee4efcff2ab933f5ad075faadcbb Reviewed-on: https://chromium-review.googlesource.com/517105 Commit-Queue: Rune Lillesveen <rune@opera.com> Reviewed-by: Morten Stenshorne <mstensho@opera.com> Cr-Commit-Position: refs/heads/master@{#475021} [modify] https://crrev.com/2779cf5d3b716f5a0f6ef37cf0bd20ee764d675e/third_party/WebKit/Source/core/css/MediaQuery.cpp [modify] https://crrev.com/2779cf5d3b716f5a0f6ef37cf0bd20ee764d675e/third_party/WebKit/Source/core/css/MediaQueryExp.cpp [modify] https://crrev.com/2779cf5d3b716f5a0f6ef37cf0bd20ee764d675e/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp [modify] https://crrev.com/2779cf5d3b716f5a0f6ef37cf0bd20ee764d675e/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp [modify] https://crrev.com/2779cf5d3b716f5a0f6ef37cf0bd20ee764d675e/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp [modify] https://crrev.com/2779cf5d3b716f5a0f6ef37cf0bd20ee764d675e/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIContent.cpp
,
May 26 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by shans@chromium.org
, May 26 2017Status: Available (was: Untriaged)