Commit 50afd4c0 authored by mstensho's avatar mstensho Committed by Commit bot

Don't include LayoutViewItem.h from StyleResolverState.h

This reduces the number of compilation units that depend on files like
LayoutBlock.h by more than 200 (from around 500 to around 280).

Review-Url: https://codereview.chromium.org/2348853003
Cr-Commit-Position: refs/heads/master@{#419202}
parent c960f497
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "core/dom/Node.h" #include "core/dom/Node.h"
#include "core/dom/NodeComputedStyle.h" #include "core/dom/NodeComputedStyle.h"
#include "core/frame/FrameHost.h" #include "core/frame/FrameHost.h"
#include "core/layout/api/LayoutViewItem.h"
namespace blink { namespace blink {
...@@ -59,6 +60,13 @@ StyleResolverState::~StyleResolverState() ...@@ -59,6 +60,13 @@ StyleResolverState::~StyleResolverState()
m_animationUpdate.clear(); m_animationUpdate.clear();
} }
void StyleResolverState::setStyle(PassRefPtr<ComputedStyle> style)
{
// FIXME: Improve RAII of StyleResolverState to remove this function.
m_style = style;
m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), rootElementStyle(), document().layoutViewItem(), m_style->effectiveZoom());
}
CSSToLengthConversionData StyleResolverState::fontSizeConversionData() const CSSToLengthConversionData StyleResolverState::fontSizeConversionData() const
{ {
float em = parentStyle()->specifiedFontSize(); float em = parentStyle()->specifiedFontSize();
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "core/css/resolver/FontBuilder.h" #include "core/css/resolver/FontBuilder.h"
#include "core/dom/Document.h" #include "core/dom/Document.h"
#include "core/dom/Element.h" #include "core/dom/Element.h"
#include "core/layout/api/LayoutViewItem.h"
#include "core/style/CachedUAStyle.h" #include "core/style/CachedUAStyle.h"
#include "core/style/ComputedStyle.h" #include "core/style/ComputedStyle.h"
#include "core/style/StyleInheritedData.h" #include "core/style/StyleInheritedData.h"
...@@ -63,12 +62,7 @@ public: ...@@ -63,12 +62,7 @@ public:
const ElementResolveContext& elementContext() const { return m_elementContext; } const ElementResolveContext& elementContext() const { return m_elementContext; }
void setStyle(PassRefPtr<ComputedStyle> style) void setStyle(PassRefPtr<ComputedStyle>);
{
// FIXME: Improve RAII of StyleResolverState to remove this function.
m_style = style;
m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), rootElementStyle(), document().layoutViewItem(), m_style->effectiveZoom());
}
const ComputedStyle* style() const { return m_style.get(); } const ComputedStyle* style() const { return m_style.get(); }
ComputedStyle* style() { return m_style.get(); } ComputedStyle* style() { return m_style.get(); }
PassRefPtr<ComputedStyle> takeStyle() { return m_style.release(); } PassRefPtr<ComputedStyle> takeStyle() { return m_style.release(); }
......
...@@ -47,10 +47,12 @@ ...@@ -47,10 +47,12 @@
#include "core/html/HTMLTagCollection.h" #include "core/html/HTMLTagCollection.h"
#include "core/html/RadioNodeList.h" #include "core/html/RadioNodeList.h"
#include "core/inspector/InspectorInstrumentation.h" #include "core/inspector/InspectorInstrumentation.h"
#include "core/layout/LayoutBlockFlow.h"
#include "core/layout/LayoutInline.h" #include "core/layout/LayoutInline.h"
#include "core/layout/LayoutText.h" #include "core/layout/LayoutText.h"
#include "core/layout/LayoutTheme.h" #include "core/layout/LayoutTheme.h"
#include "core/layout/line/InlineTextBox.h" #include "core/layout/line/InlineTextBox.h"
#include "core/layout/line/RootInlineBox.h"
#include "platform/EventDispatchForbiddenScope.h" #include "platform/EventDispatchForbiddenScope.h"
#include "platform/ScriptForbiddenScope.h" #include "platform/ScriptForbiddenScope.h"
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "core/dom/custom/V0CustomElementDefinition.h" #include "core/dom/custom/V0CustomElementDefinition.h"
#include "core/dom/shadow/ElementShadow.h" #include "core/dom/shadow/ElementShadow.h"
#include "core/html/ClassList.h" #include "core/html/ClassList.h"
#include "core/layout/LayoutObject.h"
#include "core/style/StyleInheritedData.h" #include "core/style/StyleInheritedData.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/HashSet.h" #include "wtf/HashSet.h"
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "core/css/CSSImportRule.h" #include "core/css/CSSImportRule.h"
#include "core/css/CSSMediaRule.h" #include "core/css/CSSMediaRule.h"
#include "core/css/CSSStyleRule.h" #include "core/css/CSSStyleRule.h"
#include "core/css/CSSStyleSheet.h"
#include "core/css/MediaList.h" #include "core/css/MediaList.h"
#include "core/dom/NodeComputedStyle.h" #include "core/dom/NodeComputedStyle.h"
#include "core/dom/StaticNodeList.h" #include "core/dom/StaticNodeList.h"
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "core/dom/NodeComputedStyle.h" #include "core/dom/NodeComputedStyle.h"
#include "core/frame/FrameView.h" #include "core/frame/FrameView.h"
#include "core/layout/LayoutObject.h" #include "core/layout/LayoutObject.h"
#include "core/layout/api/LayoutViewItem.h"
#include "core/style/ComputedStyle.h" #include "core/style/ComputedStyle.h"
#include "core/svg/SVGSVGElement.h" #include "core/svg/SVGSVGElement.h"
#include "platform/LengthFunctions.h" #include "platform/LengthFunctions.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment