Remove ForVTT codepath in SelectorMatcher
Having a separate copy-pasted codepath for selector matching is not acceptable for maintainability reasons. Instead we can lazily create an actual Element to represent the almost-featureless element described by the spec [1], and use this as the originating element during selector matching. The element has no ID, no classes, no attributes, no tag name, no namespace, no parent, no siblings; so it should be pretty hard to match against it. Longer term it would be nice to make the originating element actually featureless [2]. Bug: 1137349 TEST=external/wpt/webvtt/rendering/cues-with-video/processing-model/support/embedded_style_selectors.html [1] https://w3c.github.io/webvtt/#obtaining-css-boxes [2] https://github.com/w3c/webvtt/issues/477 Change-Id: I06d618546893be3942ea5406507a01bc508340d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462274 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by:Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#816299}
Showing
This diff is collapsed.
Please register or sign in to comment