Index: third_party/WebKit/Source/core/css/resolver/StyleResolverState.h |
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h |
index 83f5cf6be160ab2ad3a6b48d97f7c37dcd2edc67..71db9de71bb1a42a5fcf85619e767b942e7370f4 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h |
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h |
@@ -50,8 +50,12 @@ class CORE_EXPORT StyleResolverState { |
public: |
StyleResolverState(Document&, |
const ElementResolveContext&, |
- const ComputedStyle* parentStyle); |
- StyleResolverState(Document&, Element*, const ComputedStyle* parentStyle = 0); |
+ const ComputedStyle* parentStyle, |
+ const ComputedStyle* layoutParentStyle); |
+ StyleResolverState(Document&, |
+ Element*, |
+ const ComputedStyle* parentStyle = nullptr, |
+ const ComputedStyle* layoutParentStyle = nullptr); |
~StyleResolverState(); |
// In FontFaceSet and CanvasRenderingContext2D, we don't have an element to |
@@ -120,6 +124,13 @@ class CORE_EXPORT StyleResolverState { |
const ComputedStyle* parentStyle() const { return m_parentStyle.get(); } |
ComputedStyle* parentStyle() { return m_parentStyle.get(); } |
+ void setLayoutParentStyle(PassRefPtr<ComputedStyle> parentStyle) { |
+ m_layoutParentStyle = parentStyle; |
+ } |
+ const ComputedStyle* layoutParentStyle() const { |
+ return m_layoutParentStyle.get(); |
+ } |
+ |
// FIXME: These are effectively side-channel "out parameters" for the various |
// map functions. When we map from CSS to style objects we use this state |
// object to track various meta-data about that mapping (e.g. if it's |
@@ -216,6 +227,10 @@ class CORE_EXPORT StyleResolverState { |
// m_parentStyle is not always just ElementResolveContext::parentStyle, |
// so we keep it separate. |
RefPtr<ComputedStyle> m_parentStyle; |
+ // This will almost-always be the same that m_parentStyle, except in the |
+ // presence of display: contents. This is the style against which we have to |
+ // do adjustment. |
+ RefPtr<const ComputedStyle> m_layoutParentStyle; |
CSSAnimationUpdate m_animationUpdate; |
bool m_isAnimationInterpolationMapReady; |