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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2145823002: Implement the overflow-anchor CSS property as an opt-out for ScrollAnchoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index a49ef639f5d79ea62091a133211aff1bd8104ad3..7a364ff4826aa0b53d18590fd437ac8bb26e8a94 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1582,10 +1582,12 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
documentElement()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FontSizeChange));
}
+ EOverflowAnchor overflowAnchor = AnchorAuto;
EOverflow overflowX = OverflowAuto;
EOverflow overflowY = OverflowAuto;
float columnGap = 0;
if (overflowStyle) {
+ overflowAnchor = overflowStyle->overflowAnchor();
overflowX = overflowStyle->overflowX();
overflowY = overflowStyle->overflowY();
// Visible overflow on the viewport is meaningless, and the spec says to treat it as 'auto':
@@ -1593,6 +1595,8 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
overflowX = OverflowAuto;
if (overflowY == OverflowVisible)
overflowY = OverflowAuto;
+ if (overflowAnchor == AnchorVisible)
+ overflowAnchor = AnchorAuto;
// Column-gap is (ab)used by the current paged overflow implementation (in lack of other
// ways to specify gaps between pages), so we have to propagate it too.
columnGap = overflowStyle->columnGap();
@@ -1607,6 +1611,7 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
|| documentStyle->visitedDependentColor(CSSPropertyBackgroundColor) != backgroundColor
|| documentStyle->backgroundLayers() != backgroundLayers
|| documentStyle->imageRendering() != imageRendering
+ || documentStyle->overflowAnchor() != overflowAnchor
|| documentStyle->overflowX() != overflowX
|| documentStyle->overflowY() != overflowY
|| documentStyle->columnGap() != columnGap
@@ -1618,6 +1623,7 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
newStyle->setBackgroundColor(backgroundColor);
newStyle->accessBackgroundLayers() = backgroundLayers;
newStyle->setImageRendering(imageRendering);
+ newStyle->setOverflowAnchor(overflowAnchor);
newStyle->setOverflowX(overflowX);
newStyle->setOverflowY(overflowY);
newStyle->setColumnGap(columnGap);

Powered by Google App Engine
This is Rietveld 408576698