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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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/resolver/ScopedStyleResolver.cpp ('k') | Source/core/css/resolver/StyleAdjuster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/SharedStyleFinder.cpp
diff --git a/Source/core/css/resolver/SharedStyleFinder.cpp b/Source/core/css/resolver/SharedStyleFinder.cpp
index 781998a2c83dacee132a399b423896bf215895ff..2cbc11f8bec7a4a49438de5d3018d5c837d9ff2e 100644
--- a/Source/core/css/resolver/SharedStyleFinder.cpp
+++ b/Source/core/css/resolver/SharedStyleFinder.cpp
@@ -142,7 +142,7 @@ bool SharedStyleFinder::canShareStyleWithControl(const ElementResolveContext& co
if (element->isDefaultButtonForForm() != context.element()->isDefaultButtonForForm())
return false;
- if (context.document()->containsValidityStyleRules()) {
+ if (context.document().containsValidityStyleRules()) {
bool willValidate = element->willValidate();
if (willValidate != context.element()->willValidate())
@@ -238,7 +238,7 @@ bool SharedStyleFinder::canShareStyleWithElement(const ElementResolveContext& co
return false;
if (element->shadowPseudoId() != context.element()->shadowPseudoId())
return false;
- if (element == element->document()->cssTarget())
+ if (element == element->document().cssTarget())
return false;
if (!sharingCandidateHasIdenticalStyleAffectingAttributes(context, element))
return false;
@@ -290,7 +290,7 @@ bool SharedStyleFinder::canShareStyleWithElement(const ElementResolveContext& co
if (element->isWebVTTElement() && context.element()->isWebVTTElement() && toWebVTTElement(element)->isPastNode() != toWebVTTElement(context.element())->isPastNode())
return false;
- if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExists(context.document())) {
+ if (FullscreenElementStack* fullscreen = FullscreenElementStack::fromIfExists(&context.document())) {
if (element == fullscreen->webkitCurrentFullScreenElement() || context.element() == fullscreen->webkitCurrentFullScreenElement())
return false;
}
@@ -314,7 +314,7 @@ inline Element* SharedStyleFinder::findSiblingForStyleSharing(const ElementResol
#ifdef STYLE_STATS
Element* SharedStyleFinder::searchDocumentForSharedStyle(const ElementResolveContext& context) const
{
- for (Element* element = context.element()->document()->documentElement(); element; element = ElementTraversal::next(element)) {
+ for (Element* element = context.element()->document().documentElement(); element; element = ElementTraversal::next(element)) {
if (canShareStyleWithElement(context, element))
return element;
}
@@ -349,7 +349,7 @@ RenderStyle* SharedStyleFinder::locateSharedStyle(const ElementResolveContext& c
return 0;
if (context.element()->hasScopedHTMLStyleChild())
return 0;
- if (context.element() == context.document()->cssTarget())
+ if (context.element() == context.document().cssTarget())
return 0;
if (elementHasDirectionAuto(context.element()))
return 0;
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.cpp ('k') | Source/core/css/resolver/StyleAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698