Diff
Modified: trunk/Source/WebCore/ChangeLog (259596 => 259597)
--- trunk/Source/WebCore/ChangeLog 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/ChangeLog 2020-04-06 21:59:37 UTC (rev 259597)
@@ -1,3 +1,39 @@
+2020-04-06 Simon Fraser <[email protected]>
+
+ Make ScrollableArea TextStream-loggable
+ https://bugs.webkit.org/show_bug.cgi?id=210042
+
+ Reviewed by Darin Adler.
+
+ ScrollableArea is a pure virtual base class, so has to dump via a virtual function,
+ so add debugDescription() and implement it in derived classes.
+
+ Make the common pattern be that operator<<(TextStream&, ...) calls debugDescription.
+
+ * page/Frame.cpp:
+ (WebCore::Frame::debugDescription const):
+ (WebCore::operator<<):
+ * page/Frame.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::debugDescription const):
+ (WebCore::operator<<):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::debugDescription const):
+ * platform/ScrollView.h:
+ * platform/ScrollableArea.cpp:
+ (WebCore::operator<<):
+ * platform/ScrollableArea.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::debugDescription const):
+ (WebCore::RenderLayer::calculateClipRects const):
+ * rendering/RenderLayer.h:
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateCompositingLayers):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::debugDescription const):
+ * rendering/RenderListBox.h:
+
2020-04-06 Jack Lee <[email protected]>
Nullptr crash in CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary with draggable text
Modified: trunk/Source/WebCore/page/Frame.cpp (259596 => 259597)
--- trunk/Source/WebCore/page/Frame.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/page/Frame.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -103,6 +103,7 @@
#include "npruntime_impl.h"
#include "runtime_root.h"
#include <_javascript_Core/RegularExpression.h>
+#include <wtf/HexNumber.h>
#include <wtf/RefCountedLeakCounter.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/StringBuilder.h>
@@ -1058,9 +1059,23 @@
deref();
}
+String Frame::debugDescription() const
+{
+ StringBuilder builder;
+
+ builder.append("Frame 0x"_s, hex(reinterpret_cast<uintptr_t>(this), Lowercase));
+ if (isMainFrame())
+ builder.append(" (main frame)"_s);
+
+ if (auto document = this->document())
+ builder.append(' ', document->documentURI());
+
+ return builder.toString();
+}
+
TextStream& operator<<(TextStream& ts, const Frame& frame)
{
- ts << "Frame " << &frame << " view " << frame.view() << " (is main frame " << frame.isMainFrame() << ") " << (frame.document() ? frame.document()->documentURI() : emptyString());
+ ts << frame.debugDescription();
return ts;
}
Modified: trunk/Source/WebCore/page/Frame.h (259596 => 259597)
--- trunk/Source/WebCore/page/Frame.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/page/Frame.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -190,6 +190,8 @@
bool requestDOMPasteAccess();
+ String debugDescription() const;
+
// ======== All public functions below this point are candidates to move out of Frame into another class. ========
WEBCORE_EXPORT void injectUserScripts(UserScriptInjectionTime);
Modified: trunk/Source/WebCore/page/FrameView.cpp (259596 => 259597)
--- trunk/Source/WebCore/page/FrameView.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/page/FrameView.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -103,13 +103,13 @@
#include "VelocityData.h"
#include "VisualViewport.h"
#include "WheelEventTestMonitor.h"
-#include <wtf/text/TextStream.h>
-
+#include <wtf/HexNumber.h>
#include <wtf/IsoMallocInlines.h>
#include <wtf/MemoryPressureHandler.h>
#include <wtf/Ref.h>
#include <wtf/SetForScope.h>
#include <wtf/SystemTracing.h>
+#include <wtf/text/TextStream.h>
#if USE(COORDINATED_GRAPHICS)
#include "TiledBackingStore.h"
@@ -1423,11 +1423,15 @@
StringBuilder builder;
if (frame().isMainFrame())
builder.appendLiteral("Main");
- builder.appendLiteral("FrameView: ");
- builder.append(message);
+ builder.append("FrameView: ", message);
document->addConsoleMessage(MessageSource::Other, MessageLevel::Debug, builder.toString());
}
+String FrameView::debugDescription() const
+{
+ return makeString("FrameView 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase), ' ', frame().debugDescription());
+}
+
bool FrameView::styleHidesScrollbarWithOrientation(ScrollbarOrientation orientation) const
{
auto element = rootElementForCustomScrollbarPartStyle(PseudoId::Scrollbar);
@@ -5458,7 +5462,7 @@
TextStream& operator<<(TextStream& ts, const FrameView& view)
{
- ts << "FrameView " << &view << " frame " << view.frame();
+ ts << view.debugDescription();
return ts;
}
Modified: trunk/Source/WebCore/page/FrameView.h (259596 => 259597)
--- trunk/Source/WebCore/page/FrameView.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/page/FrameView.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -664,6 +664,8 @@
bool inUpdateEmbeddedObjects() const { return m_inUpdateEmbeddedObjects; }
+ String debugDescription() const final;
+
protected:
bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) final;
void scrollContentsSlowPath(const IntRect& updateRect) final;
Modified: trunk/Source/WebCore/platform/ScrollView.cpp (259596 => 259597)
--- trunk/Source/WebCore/platform/ScrollView.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/platform/ScrollView.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -35,6 +35,7 @@
#include "ScrollAnimator.h"
#include "Scrollbar.h"
#include "ScrollbarTheme.h"
+#include <wtf/HexNumber.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/TextStream.h>
@@ -1532,6 +1533,11 @@
return result;
}
+String ScrollView::debugDescription() const
+{
+ return makeString("ScrollView 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase));
+}
+
#if !PLATFORM(COCOA)
void ScrollView::platformAddChild(Widget*)
@@ -1542,10 +1548,6 @@
{
}
-#endif
-
-#if !PLATFORM(COCOA)
-
void ScrollView::platformSetScrollbarsSuppressed(bool)
{
}
@@ -1558,10 +1560,6 @@
{
}
-#endif
-
-#if !PLATFORM(COCOA)
-
void ScrollView::platformSetScrollbarModes()
{
}
@@ -1652,6 +1650,6 @@
return false;
}
-#endif
+#endif // !PLATFORM(COCOA)
}
Modified: trunk/Source/WebCore/platform/ScrollView.h (259596 => 259597)
--- trunk/Source/WebCore/platform/ScrollView.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/platform/ScrollView.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -449,6 +449,7 @@
bool setHasScrollbarInternal(RefPtr<Scrollbar>&, ScrollbarOrientation, bool hasBar, bool* contentSizeAffected);
bool isScrollView() const final { return true; }
+ String debugDescription() const override;
void init();
void destroy();
Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (259596 => 259597)
--- trunk/Source/WebCore/platform/ScrollableArea.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -769,4 +769,10 @@
}
}
+TextStream& operator<<(TextStream& ts, const ScrollableArea& scrollableArea)
+{
+ ts << scrollableArea.debugDescription();
+ return ts;
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/ScrollableArea.h (259596 => 259597)
--- trunk/Source/WebCore/platform/ScrollableArea.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/platform/ScrollableArea.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -31,6 +31,10 @@
#include <wtf/Forward.h>
#include <wtf/WeakPtr.h>
+namespace WTF {
+class TextStream;
+}
+
namespace WebCore {
class FloatPoint;
@@ -345,6 +349,8 @@
virtual void logMockScrollAnimatorMessage(const String&) const { };
virtual bool shouldPlaceBlockDirectionScrollbarOnLeft() const = 0;
+
+ virtual String debugDescription() const = 0;
protected:
WEBCORE_EXPORT ScrollableArea();
@@ -414,4 +420,6 @@
unsigned m_currentScrollBehaviorStatus : 1;
};
+WTF::TextStream& operator<<(WTF::TextStream&, const ScrollableArea&);
+
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/win/PopupMenuWin.cpp (259596 => 259597)
--- trunk/Source/WebCore/platform/win/PopupMenuWin.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/platform/win/PopupMenuWin.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -49,7 +49,9 @@
#include "ScrollbarThemeWin.h"
#include "TextRun.h"
#include "WebCoreInstanceHandle.h"
+#include <wtf/HexNumber.h>
#include <wtf/WindowsExtras.h>
+#include <wtf/text/StringBuilder.h>
#include <windows.h>
#include <windowsx.h>
@@ -1082,6 +1084,11 @@
return lResult;
}
+String PopupMenuWin::debugDescription() const
+{
+ return makeString("PopupMenuWin 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase));
+}
+
AccessiblePopupMenu::AccessiblePopupMenu(const PopupMenuWin& popupMenu)
: m_popupMenu(popupMenu)
{
Modified: trunk/Source/WebCore/platform/win/PopupMenuWin.h (259596 => 259597)
--- trunk/Source/WebCore/platform/win/PopupMenuWin.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/platform/win/PopupMenuWin.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -49,6 +49,8 @@
static LPCWSTR popupClassName();
+ String debugDescription() const final;
+
private:
PopupMenuClient* client() const { return m_popupClient; }
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (259596 => 259597)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -127,6 +127,7 @@
#include "TranslateTransformOperation.h"
#include "WheelEventTestMonitor.h"
#include <stdio.h>
+#include <wtf/HexNumber.h>
#include <wtf/MonotonicTime.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
@@ -3625,6 +3626,36 @@
renderer().document().addConsoleMessage(MessageSource::Other, MessageLevel::Debug, "RenderLayer: " + message);
}
+String RenderLayer::debugDescription() const
+{
+ StringBuilder builder;
+ builder.append("RenderLayer 0x"_s, hex(reinterpret_cast<uintptr_t>(this), Lowercase), ' ', size().width(), 'x', size().height());
+
+ if (transform())
+ builder.append(" has transform"_s);
+
+ if (hasFilter())
+ builder.append(" has filter"_s);
+
+ if (hasBackdropFilter())
+ builder.append(" has backdrop filter"_s);
+
+ if (hasBlendMode())
+ builder.append(" has blend mode"_s);
+
+ if (isolatesBlending())
+ builder.append(" isolates blending"_s);
+
+ if (isComposited()) {
+ // Oh for better StringBuilder/TextStream integration.
+ TextStream stream;
+ stream << *backing();
+ builder.append(stream.release());
+ }
+
+ return builder.toString();
+}
+
int RenderLayer::verticalScrollbarWidth(OverlayScrollbarSizeRelevancy relevancy) const
{
if (!m_vBar
@@ -7011,19 +7042,7 @@
TextStream& operator<<(TextStream& ts, const RenderLayer& layer)
{
- ts << "RenderLayer " << &layer << " " << layer.size();
- if (layer.transform())
- ts << " has transform";
- if (layer.hasFilter())
- ts << " has filter";
- if (layer.hasBackdropFilter())
- ts << " has backdrop filter";
- if (layer.hasBlendMode())
- ts << " has blend mode";
- if (layer.isolatesBlending())
- ts << " isolates blending";
- if (layer.isComposited())
- ts << " " << *layer.backing();
+ ts << layer.debugDescription();
return ts;
}
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (259596 => 259597)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -926,6 +926,8 @@
void invalidateEventRegion();
+ String debugDescription() const final;
+
private:
void setNextSibling(RenderLayer* next) { m_next = next; }
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (259596 => 259597)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -710,7 +710,7 @@
// Returns true on a successful update.
bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
{
- LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " updateCompositingLayers " << updateType << " contentLayersCount " << m_contentLayersCount);
+ LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " [" << m_renderView.frameView() << "] updateCompositingLayers " << updateType << " contentLayersCount " << m_contentLayersCount);
TraceScope tracingScope(CompositingUpdateStart, CompositingUpdateEnd);
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (259596 => 259597)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -910,6 +910,11 @@
document().addConsoleMessage(MessageSource::Other, MessageLevel::Debug, "RenderListBox: " + message);
}
+String RenderListBox::debugDescription() const
+{
+ return RenderObject::debugDescription();
+}
+
Ref<Scrollbar> RenderListBox::createScrollbar()
{
RefPtr<Scrollbar> widget;
Modified: trunk/Source/WebCore/rendering/RenderListBox.h (259596 => 259597)
--- trunk/Source/WebCore/rendering/RenderListBox.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebCore/rendering/RenderListBox.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -141,6 +141,7 @@
IntRect scrollableAreaBoundingBox(bool* = nullptr) const final;
bool usesMockScrollAnimator() const final;
void logMockScrollAnimatorMessage(const String&) const final;
+ String debugDescription() const final;
// NOTE: This should only be called by the overridden setScrollOffset from ScrollableArea.
void scrollTo(int newOffset);
Modified: trunk/Source/WebKit/ChangeLog (259596 => 259597)
--- trunk/Source/WebKit/ChangeLog 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebKit/ChangeLog 2020-04-06 21:59:37 UTC (rev 259597)
@@ -1,3 +1,22 @@
+2020-04-06 Simon Fraser <[email protected]>
+
+ Make ScrollableArea TextStream-loggable
+ https://bugs.webkit.org/show_bug.cgi?id=210042
+
+ Reviewed by Darin Adler.
+
+ ScrollableArea is a pure virtual base class, so has to dump via a virtual function,
+ so add debugDescription() and implement it in derived classes.
+
+ Make the common pattern be that operator<<(TextStream&, ...) calls debugDescription.
+
+ * UIProcess/win/WebPopupMenuProxyWin.cpp:
+ (WebKit::WebPopupMenuProxyWin::debugDescription const):
+ * UIProcess/win/WebPopupMenuProxyWin.h:
+ * WebProcess/Plugins/PDF/PDFPlugin.h:
+ * WebProcess/Plugins/PDF/PDFPlugin.mm:
+ (WebKit::PDFPlugin::debugDescription const):
+
2020-04-06 Commit Queue <[email protected]>
Unreviewed, reverting r259469.
Modified: trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp (259596 => 259597)
--- trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp 2020-04-06 21:59:37 UTC (rev 259597)
@@ -41,6 +41,8 @@
#include <WebCore/ScrollbarThemeWin.h>
#include <WebCore/WebCoreInstanceHandle.h>
#include <windowsx.h>
+#include <wtf/HexNumber.h>
+#include <wtf/text/StringBuilder.h>
#if USE(DIRECT2D)
#include <WebCore/Direct2DUtilities.h>
@@ -1033,4 +1035,10 @@
m_immediateContext->ClearRenderTargetView(m_renderTargetView.get(), DirectX::Colors::BlanchedAlmond);
}
#endif
+
+String WebPopupMenuProxyWin::debugDescription() const
+{
+ return makeString("WebPopupMenuProxyWin 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase));
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h (259596 => 259597)
--- trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -59,6 +59,8 @@
void hide() { hidePopupMenu(); }
+ String debugDescription() const final;
+
private:
WebPopupMenuProxyWin(WebView*, WebPopupMenuProxy::Client&);
Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h (259596 => 259597)
--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h 2020-04-06 21:59:37 UTC (rev 259597)
@@ -246,6 +246,7 @@
WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::Scrollbar&, const WebCore::IntPoint& parentPoint) const final;
bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const final;
bool shouldPlaceBlockDirectionScrollbarOnLeft() const final { return false; }
+ String debugDescription() const final;
// PDFPlugin functions.
void updateScrollbars();
Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (259596 => 259597)
--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm 2020-04-06 21:59:15 UTC (rev 259596)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm 2020-04-06 21:59:37 UTC (rev 259597)
@@ -89,6 +89,7 @@
#import <WebCore/WheelEventTestMonitor.h>
#import <pal/spi/cg/CoreGraphicsSPI.h>
#import <pal/spi/mac/NSMenuSPI.h>
+#import <wtf/HexNumber.h>
#import <wtf/UUID.h>
#import <wtf/WTFSemaphore.h>
#import <wtf/WorkQueue.h>
@@ -1283,6 +1284,11 @@
return point;
}
+String PDFPlugin::debugDescription() const
+{
+ return makeString("PDFPlugin 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase));
+}
+
bool PDFPlugin::handleScroll(ScrollDirection direction, ScrollGranularity granularity)
{
return scroll(direction, granularity);