Modified: trunk/Source/WebCore/ChangeLog (261056 => 261057)
--- trunk/Source/WebCore/ChangeLog 2020-05-03 03:49:16 UTC (rev 261056)
+++ trunk/Source/WebCore/ChangeLog 2020-05-03 03:53:40 UTC (rev 261057)
@@ -1,5 +1,28 @@
2020-05-02 Simon Fraser <[email protected]>
+ Add a log channel for OverlayScrollbars
+ https://bugs.webkit.org/show_bug.cgi?id=211329
+
+ Reviewed by Zalan Bujtas.
+
+ Overlay scrollbar behavior is opaque. This log channel will add clarity.
+
+ * platform/Logging.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (operator<<):
+ (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
+ (-[WebScrollbarPartAnimation startAnimation]):
+ (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
+ (WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
+ (WebCore::ScrollAnimatorMac::mouseExitedContentArea):
+ (WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
+ (WebCore::ScrollAnimatorMac::didBeginScrollGesture const):
+ (WebCore::ScrollAnimatorMac::didEndScrollGesture const):
+ (WebCore::ScrollAnimatorMac::mayBeginScrollGesture const):
+ (WebCore::ScrollAnimatorMac::handleWheelEventPhase):
+
+2020-05-02 Simon Fraser <[email protected]>
+
Make it possible to test overlay scrollbar interactions
https://bugs.webkit.org/show_bug.cgi?id=211342
Modified: trunk/Source/WebCore/platform/Logging.h (261056 => 261057)
--- trunk/Source/WebCore/platform/Logging.h 2020-05-03 03:49:16 UTC (rev 261056)
+++ trunk/Source/WebCore/platform/Logging.h 2020-05-03 03:53:40 UTC (rev 261057)
@@ -83,6 +83,7 @@
M(MessagePorts) \
M(Network) \
M(NotYetImplemented) \
+ M(OverlayScrollbars) \
M(PerformanceLogging) \
M(PlatformLeaks) \
M(Plugins) \
Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (261056 => 261057)
--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm 2020-05-03 03:49:16 UTC (rev 261056)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm 2020-05-03 03:53:40 UTC (rev 261057)
@@ -71,6 +71,10 @@
using WebCore::ThumbPart;
using WebCore::CubicBezierTimingFunction;
+#if !LOG_DISABLED
+using WebCore::LogOverlayScrollbars;
+#endif
+
@interface NSObject (ScrollAnimationHelperDetails)
- (id)initWithDelegate:(id)delegate;
- (void)_stopRun;
@@ -288,6 +292,19 @@
ExpansionTransition
};
+#if !LOG_DISABLED
+static TextStream& operator<<(TextStream& ts, FeatureToAnimate feature)
+{
+ switch (feature) {
+ case ThumbAlpha: ts << "ThumbAlpha" ; break;
+ case TrackAlpha: ts << "TrackAlpha" ; break;
+ case UIStateTransition: ts << "UIStateTransition" ; break;
+ case ExpansionTransition: ts << "ExpansionTransition" ; break;
+ }
+ return ts;
+}
+#endif
+
#if !ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
@interface WebScrollbarPartAnimation : NSAnimation
#else
@@ -333,6 +350,8 @@
_timingFunction = CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseInOut);
#endif
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "Creating WebScrollbarPartAnimation for " << featureToAnimate << " from " << startValue << " to " << endValue);
+
_scrollbar = scrollbar;
_featureToAnimate = featureToAnimate;
_startValue = startValue;
@@ -351,6 +370,8 @@
_scrollerImp = scrollerImpForScrollbar(*_scrollbar);
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "-[WebScrollbarPartAnimation " << self << "startAnimation] for " << _featureToAnimate);
+
#if !ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
[super startAnimation];
#else
@@ -393,6 +414,8 @@
#endif
ASSERT(_scrollbar);
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "-[WebScrollbarPartAnimation " << self << "setCurrentProgress:" << progress <<"] for " << _featureToAnimate);
+
CGFloat currentValue;
if (_startValue > _endValue)
currentValue = 1 - progress;
@@ -912,6 +935,7 @@
void ScrollAnimatorMac::mouseEnteredContentArea()
{
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "ScrollAnimatorMac for [" << scrollableArea() << "] mouseEnteredContentArea");
if ([m_scrollerImpPair overlayScrollerStateIsLocked])
return;
@@ -920,6 +944,7 @@
void ScrollAnimatorMac::mouseExitedContentArea()
{
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "ScrollAnimatorMac for [" << scrollableArea() << "] mouseExitedContentArea");
if ([m_scrollerImpPair overlayScrollerStateIsLocked])
return;
@@ -928,6 +953,7 @@
void ScrollAnimatorMac::mouseMovedInContentArea()
{
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "ScrollAnimatorMac for [" << scrollableArea() << "] mouseMovedInContentArea");
if ([m_scrollerImpPair overlayScrollerStateIsLocked])
return;
@@ -1016,6 +1042,8 @@
void ScrollAnimatorMac::didBeginScrollGesture() const
{
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "ScrollAnimatorMac for [" << scrollableArea() << "] didBeginScrollGesture");
+
if ([m_scrollerImpPair overlayScrollerStateIsLocked])
return;
@@ -1029,6 +1057,8 @@
void ScrollAnimatorMac::didEndScrollGesture() const
{
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "ScrollAnimatorMac for [" << scrollableArea() << "] didEndScrollGesture");
+
if ([m_scrollerImpPair overlayScrollerStateIsLocked])
return;
@@ -1042,6 +1072,8 @@
void ScrollAnimatorMac::mayBeginScrollGesture() const
{
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "ScrollAnimatorMac for [" << scrollableArea() << "] mayBeginScrollGesture");
+
if ([m_scrollerImpPair overlayScrollerStateIsLocked])
return;
@@ -1206,10 +1238,13 @@
void ScrollAnimatorMac::handleWheelEventPhase(PlatformWheelEventPhase phase)
{
+ LOG_WITH_STREAM(OverlayScrollbars, stream << "ScrollAnimatorMac " << this << " scrollableArea " << m_scrollableArea << " handleWheelEventPhase " << phase);
+
// This may not have been set to true yet if the wheel event was handled by the ScrollingTree,
// So set it to true here.
m_haveScrolledSincePageLoad = true;
+// FIXME: Need to ensure we get PlatformWheelEventPhaseEnded.
if (phase == PlatformWheelEventPhaseBegan)
didBeginScrollGesture();
else if (phase == PlatformWheelEventPhaseEnded || phase == PlatformWheelEventPhaseCancelled)