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

Unified Diff: Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 192373005: Use new is*Element() helper functions in CSS code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | « Source/core/css/StyleSheetList.cpp ('k') | Source/core/css/resolver/SharedStyleFinder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/ScopedStyleResolver.cpp
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index 693ab410ff7fb60e999c4b0cb499a512c0ce0af8..5763d0d923e72ee9ec79b7b92f5b30ebbf234451 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -50,17 +50,17 @@ ContainerNode* ScopedStyleResolver::scopingNodeFor(Document& document, const CSS
if (!sheetDocument)
return 0;
Node* ownerNode = sheet->ownerNode();
- if (!ownerNode || !ownerNode->hasTagName(HTMLNames::styleTag))
+ if (!isHTMLStyleElement(ownerNode))
return &document;
- HTMLStyleElement* styleElement = toHTMLStyleElement(ownerNode);
- if (!styleElement->scoped()) {
- if (styleElement->isInShadowTree())
- return styleElement->containingShadowRoot();
+ HTMLStyleElement& styleElement = toHTMLStyleElement(*ownerNode);
+ if (!styleElement.scoped()) {
+ if (styleElement.isInShadowTree())
+ return styleElement.containingShadowRoot();
return &document;
}
- ContainerNode* parent = styleElement->parentNode();
+ ContainerNode* parent = styleElement.parentNode();
if (!parent)
return 0;
« no previous file with comments | « Source/core/css/StyleSheetList.cpp ('k') | Source/core/css/resolver/SharedStyleFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698