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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolverState.h

Issue 2450093005: Support display: contents for elements, first-line and first-letter pseudos. (Closed)
Patch Set: Support display: contents for elements, first-line and first-letter pseudos. Created 3 years, 10 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
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;

Powered by Google App Engine
This is Rietveld 408576698