Add use-counter for unknown namespace usage in selector lists |
|||||
Issue descriptionTagname selectors in CSS can have a namespace prefix supplied. This prefix has to be declared earlier in the stylesheet with a @namespace rule, associating it with a namespace url. Using a namespace prefix that's not declared currently counts as a *syntax error* in the selector, rather than just not matching anything. This combines with the annoying selector behavior that one invalid selector in a list invalidates the entire list. This all means that you have to carry around the namespace map when *parsing* selectors (not just evaluating them), and infects some other APIs involving selectors. It would be much more convenient if unknown namespace selectors just caused the selector to not match anything. This should only cause a significant behavior change for cases where there is a selector list, and one of the selectors in the list has an unknown namespace prefix, thus throwing away the other selectors in the list. Could we add a use-counter for that case? I expect this will be absolutely miniscule. (setting Chris as owner because he suggested making the bug for this; feel free to reassign as needed)
,
Nov 6
,
Nov 6
,
Nov 6
,
Nov 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3c413c91c21481af23cfb54d742e80fd2b589608 commit 3c413c91c21481af23cfb54d742e80fd2b589608 Author: Anders Hartvoll Ruud <andruud@chromium.org> Date: Fri Nov 09 15:21:02 2018 Add UseCounter for unknown namespace usage in selectors. R=chrishtr@chromium.org Bug: 901938 Change-Id: I9e20fe19f2c97b98f8250c6c9914512b5a73d8c7 Reviewed-on: https://chromium-review.googlesource.com/c/1318891 Commit-Queue: Anders Ruud <andruud@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Cr-Commit-Position: refs/heads/master@{#606845} [modify] https://crrev.com/3c413c91c21481af23cfb54d742e80fd2b589608/third_party/blink/public/platform/web_feature.mojom [modify] https://crrev.com/3c413c91c21481af23cfb54d742e80fd2b589608/third_party/blink/renderer/core/css/parser/css_selector_parser.cc [modify] https://crrev.com/3c413c91c21481af23cfb54d742e80fd2b589608/third_party/blink/renderer/core/frame/use_counter_test.cc [modify] https://crrev.com/3c413c91c21481af23cfb54d742e80fd2b589608/tools/metrics/histograms/enums.xml
,
Nov 13
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by chrishtr@chromium.org
, Nov 6