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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2716583005: Do not promote position sticky or fixed elements unless they move with scroll. (Closed)
Patch Set: Avoid computing constraints for non-anchored sticky and add/update tests. Created 3 years, 9 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/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index f65eff3634047a68b26a93060453eab516b77654..9fc57ab2fb7a18c0a1b36749a7ba33e944ab0e24 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -3124,7 +3124,12 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
position() == EPosition::kSticky;
}
bool hasViewportConstrainedPosition() const {
- return position() == EPosition::kFixed || position() == EPosition::kSticky;
+ return position() == EPosition::kFixed;
+ }
+ bool hasStickyConstrainedPosition() const {
+ return position() == EPosition::kSticky &&
+ (!top().isAuto() || !left().isAuto() || !right().isAuto() ||
+ !bottom().isAuto());
}
// Clip utility functions.

Powered by Google App Engine
This is Rietveld 408576698