Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 2787823002: Rephrased documentation about VTT, ::cue, and custom pseudo scopes. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index ac4174a99979dee637be416d28c072496aeea7dd..872faf947d14b545413bff7c8f1fe6031887654c 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -222,13 +222,15 @@ void StyleResolver::clearStyleSharingList() {
}
static inline ScopedStyleResolver* scopedResolverFor(const Element& element) {
- // Ideally, returning element->treeScope().scopedStyleResolver() should be
- // enough, but ::cue and custom pseudo elements like ::-webkit-meter-bar
- // pierce through a shadow dom boundary, yet they are not part of boundary
- // crossing rules. The assumption here is that these rules only pierce through
- // one boundary and that the scope of these elements do not have a style
- // resolver due to the fact that VTT scopes and UA shadow trees don't have
- // <style> elements. This is backed up by the DCHECKs below.
+ // For normal elements, returning element->treeScope().scopedStyleResolver()
+ // is enough. Rules for ::cue and custom pseudo elements like
+ // ::-webkit-meter-bar pierce through a single shadow dom boundary and apply
+ // to elements in sub-scopes.
+ //
+ // An assumption here is that these elements belong to scopes without a
+ // ScopedStyleResolver due to the fact that VTT scopes and UA shadow trees
+ // don't have <style> or <link> elements. This is backed up by the DCHECKs
+ // below.
TreeScope* treeScope = &element.treeScope();
if (ScopedStyleResolver* resolver = treeScope->scopedStyleResolver()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698