Title: [246934] trunk/Source/WebCore
Revision
246934
Author
simon.fra...@apple.com
Date
2019-06-28 13:23:12 -0700 (Fri, 28 Jun 2019)

Log Message

REGRESSION (r239984): pages with custom scrollbars also show normal scrollbars
https://bugs.webkit.org/show_bug.cgi?id=199321
<rdar://problem/52308095>

Reviewed by Timothy Hatcher.

Revert the part of r239984 that made isCustomScrollbar() virtual, since theme().registerScrollbar()
calls it from the base class constructor.

I wasn't able to make a test that tests rendering of overlay scrollbars (webkit.org/b/199323).

* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):
* platform/Scrollbar.h:
(WebCore::Scrollbar::isCustomScrollbar const):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::RenderScrollbar):
* rendering/RenderScrollbar.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (246933 => 246934)


--- trunk/Source/WebCore/ChangeLog	2019-06-28 20:15:33 UTC (rev 246933)
+++ trunk/Source/WebCore/ChangeLog	2019-06-28 20:23:12 UTC (rev 246934)
@@ -1,3 +1,24 @@
+2019-06-28  Simon Fraser  <simon.fra...@apple.com>
+
+        REGRESSION (r239984): pages with custom scrollbars also show normal scrollbars
+        https://bugs.webkit.org/show_bug.cgi?id=199321
+        <rdar://problem/52308095>
+
+        Reviewed by Timothy Hatcher.
+
+        Revert the part of r239984 that made isCustomScrollbar() virtual, since theme().registerScrollbar()
+        calls it from the base class constructor.
+
+        I wasn't able to make a test that tests rendering of overlay scrollbars (webkit.org/b/199323).
+
+        * platform/Scrollbar.cpp:
+        (WebCore::Scrollbar::Scrollbar):
+        * platform/Scrollbar.h:
+        (WebCore::Scrollbar::isCustomScrollbar const):
+        * rendering/RenderScrollbar.cpp:
+        (WebCore::RenderScrollbar::RenderScrollbar):
+        * rendering/RenderScrollbar.h:
+
 2019-06-28  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Need a way for SPI clients to know when to avoid resizing to accommodate for the input view bounds

Modified: trunk/Source/WebCore/platform/Scrollbar.cpp (246933 => 246934)


--- trunk/Source/WebCore/platform/Scrollbar.cpp	2019-06-28 20:15:33 UTC (rev 246933)
+++ trunk/Source/WebCore/platform/Scrollbar.cpp	2019-06-28 20:23:12 UTC (rev 246934)
@@ -54,11 +54,12 @@
     return maxOverlapBetweenPages;
 }
 
-Scrollbar::Scrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, ScrollbarTheme* customTheme)
+Scrollbar::Scrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, ScrollbarTheme* customTheme, bool isCustomScrollbar)
     : m_scrollableArea(scrollableArea)
     , m_orientation(orientation)
     , m_controlSize(controlSize)
     , m_theme(customTheme ? *customTheme : ScrollbarTheme::theme())
+    , m_isCustomScrollbar(isCustomScrollbar)
     , m_scrollTimer(*this, &Scrollbar::autoscrollTimerFired)
 {
     theme().registerScrollbar(*this);

Modified: trunk/Source/WebCore/platform/Scrollbar.h (246933 => 246934)


--- trunk/Source/WebCore/platform/Scrollbar.h	2019-06-28 20:15:33 UTC (rev 246933)
+++ trunk/Source/WebCore/platform/Scrollbar.h	2019-06-28 20:23:12 UTC (rev 246934)
@@ -56,7 +56,7 @@
 
     ScrollableArea& scrollableArea() const { return m_scrollableArea; }
 
-    virtual bool isCustomScrollbar() const { return false; }
+    bool isCustomScrollbar() const { return m_isCustomScrollbar; }
     ScrollbarOrientation orientation() const { return m_orientation; }
 
     int value() const { return lroundf(m_currentPos); }
@@ -132,7 +132,7 @@
     bool supportsUpdateOnSecondaryThread() const;
 
 protected:
-    Scrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = nullptr);
+    Scrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = nullptr, bool isCustomScrollbar = false);
 
     void updateThumb();
     virtual void updateThumbPosition();
@@ -165,6 +165,7 @@
     int m_documentDragPos { 0 };
 
     bool m_enabled { true };
+    bool m_isCustomScrollbar { false };
 
     Timer m_scrollTimer;
 

Modified: trunk/Source/WebCore/rendering/RenderScrollbar.cpp (246933 => 246934)


--- trunk/Source/WebCore/rendering/RenderScrollbar.cpp	2019-06-28 20:15:33 UTC (rev 246933)
+++ trunk/Source/WebCore/rendering/RenderScrollbar.cpp	2019-06-28 20:23:12 UTC (rev 246934)
@@ -42,7 +42,7 @@
 }
 
 RenderScrollbar::RenderScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, Element* ownerElement, Frame* owningFrame)
-    : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme())
+    : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme(), true)
     , m_ownerElement(ownerElement)
     , m_owningFrame(owningFrame)
 {

Modified: trunk/Source/WebCore/rendering/RenderScrollbar.h (246933 => 246934)


--- trunk/Source/WebCore/rendering/RenderScrollbar.h	2019-06-28 20:15:33 UTC (rev 246933)
+++ trunk/Source/WebCore/rendering/RenderScrollbar.h	2019-06-28 20:23:12 UTC (rev 246934)
@@ -61,7 +61,6 @@
 private:
     RenderScrollbar(ScrollableArea&, ScrollbarOrientation, Element*, Frame*);
 
-    bool isCustomScrollbar() const override { return true; }
     bool isOverlayScrollbar() const override { return false; }
 
     void setParent(ScrollView*) override;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to