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

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

Issue 23601011: Have StyleResolver / StyleResolverState deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update StyleResolverState as well 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/StyleResolverState.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolverState.cpp
diff --git a/Source/core/css/resolver/StyleResolverState.cpp b/Source/core/css/resolver/StyleResolverState.cpp
index caefee7f02b5c2591f28120c6f49ba400abefb28..b98a30c462b6c895bc825bfdc876da8421f1ac68 100644
--- a/Source/core/css/resolver/StyleResolverState.cpp
+++ b/Source/core/css/resolver/StyleResolverState.cpp
@@ -29,21 +29,15 @@
namespace WebCore {
-StyleResolverState::StyleResolverState(Document* document, Element* element, RenderStyle* parentStyle, RenderRegion* regionForStyling)
- : m_regionForStyling(0)
+StyleResolverState::StyleResolverState(Document& document, Element* element, RenderStyle* parentStyle, RenderRegion* regionForStyling)
+ : m_elementContext(element ? ElementResolveContext(element) : ElementResolveContext())
+ , m_document(element ? m_elementContext.document() : document)
+ , m_regionForStyling(0)
, m_applyPropertyToRegularStyle(true)
, m_applyPropertyToVisitedLinkStyle(false)
, m_lineHeightValue(0)
, m_styleMap(*this, m_elementStyleResources)
{
- if (element) {
- m_elementContext = ElementResolveContext(element);
- m_document = &m_elementContext.document();
- } else {
- m_elementContext = ElementResolveContext();
- m_document = document;
- }
-
m_regionForStyling = regionForStyling;
if (m_elementContext.resetStyleInheritance())
@@ -62,7 +56,7 @@ StyleResolverState::StyleResolverState(Document* document, Element* element, Ren
// FIXME: StyleResolverState is never passed between documents
// so we should be able to do this initialization at StyleResolverState
// createion time instead of now, correct?
- if (Page* page = document->page())
+ if (Page* page = document.page())
m_elementStyleResources.setDeviceScaleFactor(page->deviceScaleFactor());
}
« no previous file with comments | « Source/core/css/resolver/StyleResolverState.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698