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

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: Put opt-out behind RuntimeEnabledFeature and update tests 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 8ed3874c6cb42ba1c1c0a98de220ed8b4775be8f..f1cda58caa1a06aa48d220bc7b2ae05dc242d865 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1578,10 +1578,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':
@@ -1589,6 +1591,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();
@@ -1603,6 +1607,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
@@ -1614,6 +1619,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);
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp ('k') | third_party/WebKit/Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698