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

Unified Diff: Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp

Issue 1292513002: Create custom scrollbars when html element has overflow:scroll (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp b/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
index 75b2999646e092109c931114f7a27add34ba4c50..cb96550357f76c0ff46d4b17c0e2a2b989927d16 100644
--- a/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
+++ b/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
@@ -646,6 +646,16 @@ void DeprecatedPaintLayerScrollableArea::updateAfterLayout()
{
ASSERT(box().hasOverflowClip());
+ bool isScrollbarReconstructionRequired = needsScrollbarReconstruction();
+ if (m_hBar && !m_hBar->isCustomScrollbar() && isScrollbarReconstructionRequired) {
+ destroyScrollbar(HorizontalScrollbar);
MuVen 2015/08/13 19:36:32 !m_hBar->isCustomScrollbar() This condition wont t
skobes 2015/08/13 19:53:43 Yes, to make it easier to follow, needsScrollbarRe
+ setHasHorizontalScrollbar(true);
+ }
+ if (m_vBar && !m_vBar->isCustomScrollbar() && isScrollbarReconstructionRequired) {
+ destroyScrollbar(VerticalScrollbar);
+ setHasVerticalScrollbar(true);
+ }
+
DoubleSize originalScrollOffset = adjustedScrollOffset();
computeScrollDimensions();
@@ -958,6 +968,12 @@ static inline LayoutObject* layoutObjectForScrollbar(LayoutObject& layoutObject)
return &layoutObject;
}
+bool DeprecatedPaintLayerScrollableArea::needsScrollbarReconstruction() const
+{
+ LayoutObject* actualLayoutObject = layoutObjectForScrollbar(box());
+ return actualLayoutObject->isBox() && actualLayoutObject->style()->hasPseudoStyle(SCROLLBAR);
skobes 2015/08/13 18:12:40 This will reconstruct custom scrollbars after ever
+}
+
PassRefPtrWillBeRawPtr<Scrollbar> DeprecatedPaintLayerScrollableArea::createScrollbar(ScrollbarOrientation orientation)
{
RefPtrWillBeRawPtr<Scrollbar> widget = nullptr;
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698