Specificity of :not() selector wrong in the presence of a default namespace
Reported by
r...@opera.com,
Mar 28 2017
|
|||
Issue descriptionWhen a stylesheet has a default namespace, we prepend a universal selector with that default namespace to any compound selectors without a type selector. That is not necessary for compounds as parameters to pseudo selectors. For :not() it causes an issue with computing specificity because we assume there is only one simple selector inside the :not(). In the case of the type selector prepend that's not the case.
,
Mar 29 2017
,
Mar 29 2017
,
Mar 29 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/76f8029bef50611fdddf565925b9420bdac05021 commit 76f8029bef50611fdddf565925b9420bdac05021 Author: rune <rune@opera.com> Date: Wed Mar 29 11:42:47 2017 Corrected specificity for :not for default @namespace. The argument to :not() consists of a universal, type, or a simple selector. However, we prepend an implicit universal selector with the default namespace URI to all compound selectors to correctly match only elements in the default namespace. That is not necessary for compounds inside pseudo argument lists, but we do in those cases as well. When calculating the specificity for :not(), we assume its argument consists of a single simple selectors, but in the case where we have a default namespace, a namespaced universal selector is prepended. We only added the specificity for the universal selector in that case. Instead, walk all sub-selectors of the :not() compound when calculating the specificity. R=meade@chromium.org BUG= 706206 Review-Url: https://codereview.chromium.org/2777063007 Cr-Commit-Position: refs/heads/master@{#460355} [add] https://crrev.com/76f8029bef50611fdddf565925b9420bdac05021/third_party/WebKit/LayoutTests/fast/css/specificity-not-and-default-ns.html [modify] https://crrev.com/76f8029bef50611fdddf565925b9420bdac05021/third_party/WebKit/Source/core/css/CSSSelector.cpp [modify] https://crrev.com/76f8029bef50611fdddf565925b9420bdac05021/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
,
Mar 29 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by r...@opera.com
, Mar 29 2017