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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 2825343003: Clean compositing inputs for location APIs for sticky-affected elements. (Closed)
Patch Set: Add test for sticky subtrees Created 3 years, 8 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/StyleBuilderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
index b44925bed08f099a2ad791ae7fb6780cdcfc35e9..38515931c17f1dc4006c96b4eb4bf5ebafed77fc 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -966,10 +966,26 @@ void StyleBuilderFunctions::applyValueCSSPropertyBaselineShift(
}
}
+void StyleBuilderFunctions::applyInitialCSSPropertyPosition(
+ StyleResolverState& state) {
+ state.Style()->SetPosition(ComputedStyle::InitialPosition());
+ state.Style()->SetIsInStickySubtree(state.ParentStyle()->IsInStickySubtree());
fs 2017/04/29 09:59:06 Do you even need this? Your bit should essentially
smcgruer 2017/05/01 20:15:15 Done.
+}
+
void StyleBuilderFunctions::applyInheritCSSPropertyPosition(
StyleResolverState& state) {
if (!state.ParentNode()->IsDocumentNode())
state.Style()->SetPosition(state.ParentStyle()->GetPosition());
+ state.Style()->SetIsInStickySubtree(state.ParentStyle()->IsInStickySubtree());
fs 2017/04/29 09:59:06 Ditto.
smcgruer 2017/05/01 20:15:15 Done.
+}
+
+void StyleBuilderFunctions::applyValueCSSPropertyPosition(
+ StyleResolverState& state,
+ const CSSValue& value) {
+ EPosition position = ToCSSIdentifierValue(value).ConvertTo<EPosition>();
+ state.Style()->SetPosition(position);
+ state.Style()->SetIsInStickySubtree(position == EPosition::kSticky ||
fs 2017/04/29 12:10:31 Thinking about it some more, maybe this should rat
smcgruer 2017/05/01 20:15:15 Done. Based on my tests it appears to work, so I a
fs 2017/05/01 21:19:33 Yes, since the flag is part of (rare) inherited, a
+ state.ParentStyle()->IsInStickySubtree());
}
void StyleBuilderFunctions::applyInitialCSSPropertyCaretColor(

Powered by Google App Engine
This is Rietveld 408576698