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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2523533002: Call scrollbarsChanged in PLSA::updateAfterStyleChange. (Closed)
Patch Set: fix test Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index 39afec388f4d7474c38c75129680c3a7ad0b2719..cc1d21de14da403b9b9871ab94e30b2e66360a3c 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -926,8 +926,17 @@ void PaintLayerScrollableArea::updateAfterStyleChange(
if (!hasScrollbar() && !needsHorizontalScrollbar && !needsVerticalScrollbar)
return;
- setHasHorizontalScrollbar(needsHorizontalScrollbar);
- setHasVerticalScrollbar(needsVerticalScrollbar);
+ bool horizontalScrollbarChanged =
+ setHasHorizontalScrollbar(needsHorizontalScrollbar);
+ bool verticalScrollbarChanged =
+ setHasVerticalScrollbar(needsVerticalScrollbar);
+
+ if (box().isLayoutBlock() &&
+ (horizontalScrollbarChanged || verticalScrollbarChanged)) {
+ toLayoutBlock(box()).scrollbarsChanged(
+ horizontalScrollbarChanged, verticalScrollbarChanged,
+ LayoutBlock::ScrollbarChangeContext::StyleChange);
+ }
// With overflow: scroll, scrollbars are always visible but may be disabled.
// When switching to another value, we need to re-enable them (see bug 11985).
@@ -1174,12 +1183,12 @@ void PaintLayerScrollableArea::computeScrollbarExistence(
}
}
-void PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) {
+bool PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) {
if (FreezeScrollbarsScope::scrollbarsAreFrozen())
- return;
+ return false;
if (hasScrollbar == hasHorizontalScrollbar())
- return;
+ return false;
setScrollbarNeedsPaintInvalidation(HorizontalScrollbar);
@@ -1199,14 +1208,15 @@ void PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) {
// Force an update since we know the scrollbars have changed things.
if (box().document().hasAnnotatedRegions())
box().document().setAnnotatedRegionsDirty(true);
+ return true;
}
-void PaintLayerScrollableArea::setHasVerticalScrollbar(bool hasScrollbar) {
+bool PaintLayerScrollableArea::setHasVerticalScrollbar(bool hasScrollbar) {
if (FreezeScrollbarsScope::scrollbarsAreFrozen())
- return;
+ return false;
if (hasScrollbar == hasVerticalScrollbar())
- return;
+ return false;
setScrollbarNeedsPaintInvalidation(VerticalScrollbar);
@@ -1226,6 +1236,7 @@ void PaintLayerScrollableArea::setHasVerticalScrollbar(bool hasScrollbar) {
// Force an update since we know the scrollbars have changed things.
if (box().document().hasAnnotatedRegions())
box().document().setAnnotatedRegionsDirty(true);
+ return true;
}
int PaintLayerScrollableArea::verticalScrollbarWidth(
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698