Index: Source/core/css/resolver/StyleResolverState.h |
diff --git a/Source/core/css/resolver/StyleResolverState.h b/Source/core/css/resolver/StyleResolverState.h |
index 18095bd28dd93d9a5515eb82ccbedf770c0f6518..a4f7171b36d1e14bd98f93139d0ae8aa8c059a2c 100644 |
--- a/Source/core/css/resolver/StyleResolverState.h |
+++ b/Source/core/css/resolver/StyleResolverState.h |
@@ -31,7 +31,9 @@ |
#include "core/css/resolver/ElementResolveContext.h" |
#include "core/css/resolver/ElementStyleResources.h" |
#include "core/css/resolver/FontBuilder.h" |
+#include "core/dom/Document.h" |
#include "core/dom/Element.h" |
+#include "core/dom/TreeScope.h" |
#include "core/rendering/style/CachedUAStyle.h" |
#include "core/rendering/style/RenderStyle.h" |
#include "core/rendering/style/StyleInheritedData.h" |
@@ -45,11 +47,12 @@ class StyleRule; |
class StyleResolverState { |
WTF_MAKE_NONCOPYABLE(StyleResolverState); |
public: |
- StyleResolverState(Document&, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); |
+ StyleResolverState(TreeScope&, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); |
// In FontFaceSet and CanvasRenderingContext2D, we don't have an element to grab the document from. |
// This is why we have to store the document separately. |
- Document& document() const { return m_document; } |
+ Document& document() const { return m_treeScope.document(); } |
+ TreeScope& treeScope() const { return m_treeScope; } |
// These are all just pass-through methods to ElementResolveContext. |
Element* element() const { return m_elementContext.element(); } |
const ContainerNode* parentNode() const { return m_elementContext.parentNode(); } |
@@ -136,7 +139,7 @@ private: |
friend class StyleResolveScope; |
ElementResolveContext m_elementContext; |
- Document& m_document; |
+ TreeScope& m_treeScope; |
// m_style is the primary output for each element's style resolve. |
RefPtr<RenderStyle> m_style; |