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

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

Issue 21625003: StyleBuilder should not know about StyleResolver. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 5 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/scripts/templates/StyleBuilder.cpp.tmpl » ('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 319b5ef5b57a3f5294f49f43e57b022f2fca713d..059d57dacc3372df21f43b2b528fd23f08390479 100644
--- a/Source/core/css/resolver/StyleResolverState.cpp
+++ b/Source/core/css/resolver/StyleResolverState.cpp
@@ -29,18 +29,20 @@
namespace WebCore {
-StyleResolverState::StyleResolverState(const Document* newDocument, Element* newElement, RenderStyle* parentStyle, RenderRegion* regionForStyling)
+StyleResolverState::StyleResolverState(Document* document, Element* element, RenderStyle* parentStyle, RenderRegion* regionForStyling)
: m_regionForStyling(0)
, m_applyPropertyToRegularStyle(true)
, m_applyPropertyToVisitedLinkStyle(false)
, m_lineHeightValue(0)
, m_styleMap(*this, m_elementStyleResources)
{
- ASSERT(!element() || document() == newDocument);
- if (newElement)
- m_elementContext = ElementResolveContext(newElement);
- else
+ if (element) {
+ m_elementContext = ElementResolveContext(element);
+ m_document = m_elementContext.document();
+ } else {
m_elementContext = ElementResolveContext();
+ m_document = document;
+ }
m_regionForStyling = regionForStyling;
@@ -60,7 +62,7 @@ StyleResolverState::StyleResolverState(const Document* newDocument, Element* new
// 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 = newDocument->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/scripts/templates/StyleBuilder.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698