diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/chromium/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp b/chromium/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp index 6df80021ba5..f0efa4a7d8a 100644 --- a/chromium/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp +++ b/chromium/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp @@ -22,33 +22,48 @@ #include "config.h" #include "core/css/resolver/StyleResolverState.h" +#include "core/animation/css/CSSAnimations.h" #include "core/dom/Node.h" #include "core/dom/NodeRenderStyle.h" -#include "core/page/Page.h" +#include "core/frame/FrameHost.h" namespace WebCore { -StyleResolverState::StyleResolverState(Document& document, Element* element, RenderStyle* parentStyle, RenderRegion* regionForStyling) +StyleResolverState::StyleResolverState(Document& document, Element* element, RenderStyle* parentStyle) : m_elementContext(element ? ElementResolveContext(*element) : ElementResolveContext()) , m_document(document) - , m_style(0) - , m_cssToLengthConversionData(0, rootElementStyle()) + , m_style(nullptr) + , m_cssToLengthConversionData(0, rootElementStyle(), document.renderView()) , m_parentStyle(parentStyle) - , m_regionForStyling(regionForStyling) , m_applyPropertyToRegularStyle(true) , m_applyPropertyToVisitedLinkStyle(false) - , m_lineHeightValue(0) + , m_lineHeightValue(nullptr) , m_styleMap(*this, m_elementStyleResources) - , m_currentRule(0) + , m_currentRule(nullptr) { - if (m_elementContext.resetStyleInheritance()) - m_parentStyle = 0; - else if (!parentStyle && m_elementContext.parentNode()) + if (!parentStyle && m_elementContext.parentNode()) m_parentStyle = m_elementContext.parentNode()->renderStyle(); - // FIXME: How can we not have a page here? - if (Page* page = document.page()) - m_elementStyleResources.setDeviceScaleFactor(page->deviceScaleFactor()); + // FIXME: Animation unitests will start animations on non-active documents! + // http://crbug.com/330095 + // ASSERT(document.isActive()); + if (!document.isActive()) + return; + m_elementStyleResources.setDeviceScaleFactor(document.frameHost()->deviceScaleFactor()); +} + +StyleResolverState::~StyleResolverState() +{ +} + +void StyleResolverState::setAnimationUpdate(PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> update) +{ + m_animationUpdate = update; +} + +PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> StyleResolverState::takeAnimationUpdate() +{ + return m_animationUpdate.release(); } } // namespace WebCore |