WebKit Bugzilla
Attachment 371811 Details for
Bug 198739
: Add logging for UI-side compositing hit-testing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198739-20190610193828.patch (text/plain), 13.93 KB, created by
Simon Fraser (smfr)
on 2019-06-10 19:38:29 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-06-10 19:38:29 PDT
Size:
13.93 KB
patch
obsolete
>Subversion Revision: 246278 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 7324451308cbbffcdceed99a1780ae7fff1fb139..e2783f6c2491203c87e514ec48e1302594bff05e 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,21 @@ >+2019-06-10 Simon Fraser <simon.fraser@apple.com> >+ >+ Add logging for UI-side compositing hit-testing >+ https://bugs.webkit.org/show_bug.cgi?id=198739 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make it possible to output an Objective-C object to TextStream, which will >+ log its -description. >+ >+ Also add a template for OptionSet<> printing. >+ >+ * WTF.xcodeproj/project.pbxproj: >+ * wtf/text/TextStream.h: >+ (WTF::operator<<): >+ * wtf/text/cocoa/TextStreamCocoa.mm: Added. >+ (WTF::TextStream::operator<<): >+ > 2019-06-10 Timothy Hatcher <timothy@apple.com> > > Integrate dark mode support for iOS. >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9fe43aea33c596a282c80ec202e15199c425a5e4..c85f500ba53caab4319c5885250119c2653e0429 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,14 @@ >+2019-06-10 Simon Fraser <simon.fraser@apple.com> >+ >+ Add logging for UI-side compositing hit-testing >+ https://bugs.webkit.org/show_bug.cgi?id=198739 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Export the TextStream output operator. >+ >+ * platform/TouchAction.h: >+ > 2019-06-10 Antti Koivisto <antti@apple.com> > > Event region should be set on scrolledContentsLayer if it exists >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 98c6ebab6b5446f5eafc3aee3924902c180986d7..9df45f5c8c74b53d12d004b42641200c31eff534 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,24 @@ >+2019-06-10 Simon Fraser <simon.fraser@apple.com> >+ >+ Add logging for UI-side compositing hit-testing >+ https://bugs.webkit.org/show_bug.cgi?id=198739 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make it easier to debug UI-side compositing hit-testing issues with a UIHitTesting log >+ channel, which logs information about the UIView hierarchy, which views are found by >+ hit-testing, and what touch-actions apply. >+ >+ This log channel can be set by passing the argument '-WebKit2Logging "UIHitTesting"' when >+ launching a debug iOS MobileSafari instance. >+ >+ * Platform/Logging.h: >+ * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: >+ (-[UIView _web_findDescendantViewAtPoint:withEvent:]): >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView hitTest:withEvent:]): >+ (-[WKContentView _handleTouchActionsForTouchEvent:]): >+ > 2019-06-10 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] fast/xsl tests are flaky when run after certain viewport shrink-to-fit tests >diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj >index 8824535a3622581a8d87144b6b10700d47117203..26344ac725ac93d02eab93c44e5ecf3e3dafc8dd 100644 >--- a/Source/WTF/WTF.xcodeproj/project.pbxproj >+++ b/Source/WTF/WTF.xcodeproj/project.pbxproj >@@ -23,6 +23,7 @@ > /* Begin PBXBuildFile section */ > 0F30BA901E78708E002CA847 /* GlobalVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F30BA8A1E78708E002CA847 /* GlobalVersion.cpp */; }; > 0F30CB5A1FCDF134004B5323 /* ConcurrentPtrHashSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F30CB581FCDF133004B5323 /* ConcurrentPtrHashSet.cpp */; }; >+ 0F3492D722AF431C004F85FC /* TextStreamCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F3492D622AF42F1004F85FC /* TextStreamCocoa.mm */; }; > 0F43D8F11DB5ADDC00108FB6 /* AutomaticThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F43D8EF1DB5ADDC00108FB6 /* AutomaticThread.cpp */; }; > 0F5BF1761F23D49A0029D91D /* Gigacage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5BF1741F23D49A0029D91D /* Gigacage.cpp */; }; > 0F60F32F1DFCBD1B00416D6C /* LockedPrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F60F32D1DFCBD1B00416D6C /* LockedPrintStream.cpp */; }; >@@ -202,6 +203,7 @@ > 0F30CB581FCDF133004B5323 /* ConcurrentPtrHashSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConcurrentPtrHashSet.cpp; sourceTree = "<group>"; }; > 0F30CB591FCDF133004B5323 /* ConcurrentPtrHashSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConcurrentPtrHashSet.h; sourceTree = "<group>"; }; > 0F31DD701F1308BC0072EB4A /* LockAlgorithmInlines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LockAlgorithmInlines.h; sourceTree = "<group>"; }; >+ 0F3492D622AF42F1004F85FC /* TextStreamCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TextStreamCocoa.mm; sourceTree = "<group>"; }; > 0F3501631BB258C800F0A2A3 /* WeakRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakRandom.h; sourceTree = "<group>"; }; > 0F43D8EF1DB5ADDC00108FB6 /* AutomaticThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AutomaticThread.cpp; sourceTree = "<group>"; }; > 0F43D8F01DB5ADDC00108FB6 /* AutomaticThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutomaticThread.h; sourceTree = "<group>"; }; >@@ -832,6 +834,7 @@ > A5BA15F41824348000A82E69 /* StringImplCocoa.mm */, > 93934BD218A1E8C300D0D6A1 /* StringViewCocoa.mm */, > 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp */, >+ 0F3492D622AF42F1004F85FC /* TextStreamCocoa.mm */, > ); > path = cocoa; > sourceTree = "<group>"; >@@ -1622,6 +1625,7 @@ > 1C181C7F1D3078DA00F5FA16 /* TextBreakIterator.cpp in Sources */, > 1C181C961D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp in Sources */, > A3E4DD931F3A803400DED0B4 /* TextStream.cpp in Sources */, >+ 0F3492D722AF431C004F85FC /* TextStreamCocoa.mm in Sources */, > E311FB171F0A568B003C08DE /* ThreadGroup.cpp in Sources */, > A8A4744A151A825B004123FF /* Threading.cpp in Sources */, > A32D8FA521FFFAB400780662 /* ThreadingPOSIX.cpp in Sources */, >diff --git a/Source/WTF/wtf/text/TextStream.h b/Source/WTF/wtf/text/TextStream.h >index ec7f26c4860514096e2cb020348bb5bfc1b34740..4fc0b2451a5ebe6ee386cfa90fc5bd98f400154d 100644 >--- a/Source/WTF/wtf/text/TextStream.h >+++ b/Source/WTF/wtf/text/TextStream.h >@@ -70,6 +70,10 @@ public: > // Deprecated. Use the NumberRespectingIntegers FormattingFlag instead. > WTF_EXPORT_PRIVATE TextStream& operator<<(const FormatNumberRespectingIntegers&); > >+#ifdef __OBJC__ >+ WTF_EXPORT_PRIVATE TextStream& operator<<(id<NSObject>); >+#endif >+ > FormattingFlags formattingFlags() const { return m_formattingFlags; } > void setFormattingFlags(FormattingFlags flags) { m_formattingFlags = flags; } > >@@ -180,6 +184,20 @@ TextStream& operator<<(TextStream& ts, const Vector<Item>& vector) > return ts << "]"; > } > >+template<typename Option> >+TextStream& operator<<(TextStream& ts, const OptionSet<Option>& options) >+{ >+ ts << "["; >+ bool needComma = false; >+ for (auto option : options) { >+ if (needComma) >+ ts << ", "; >+ needComma = true; >+ ts << option; >+ } >+ return ts << "]"; >+} >+ > // Deprecated. Use TextStream::writeIndent() instead. > WTF_EXPORT_PRIVATE void writeIndent(TextStream&, int indent); > >diff --git a/Source/WTF/wtf/text/cocoa/TextStreamCocoa.mm b/Source/WTF/wtf/text/cocoa/TextStreamCocoa.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..15af4bb1d43b695b3001a00bd4990dd1a15c00d4 >--- /dev/null >+++ b/Source/WTF/wtf/text/cocoa/TextStreamCocoa.mm >@@ -0,0 +1,32 @@ >+/* >+ * Copyright (C) 2006-2018 Apple Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ * >+ */ >+ >+#include "config.h" >+#include <wtf/text/TextStream.h> >+ >+namespace WTF { >+ >+TextStream& TextStream::operator<<(id<NSObject> object) >+{ >+ m_text.append([object description]); >+ return *this; >+} >+ >+} >diff --git a/Source/WebCore/platform/TouchAction.h b/Source/WebCore/platform/TouchAction.h >index 25454783b561033a39ee45a750aaaaed23b6a778..69b86fa02edda5b06637bc0e38df3d43492fd2e4 100644 >--- a/Source/WebCore/platform/TouchAction.h >+++ b/Source/WebCore/platform/TouchAction.h >@@ -40,7 +40,7 @@ enum class TouchAction : uint8_t { > PinchZoom = 1 << 5, > }; > >-TextStream& operator<<(TextStream&, TouchAction); >+WEBCORE_EXPORT TextStream& operator<<(TextStream&, TouchAction); > > } > >diff --git a/Source/WebKit/Platform/Logging.h b/Source/WebKit/Platform/Logging.h >index 4b8a6d25e838b7cc6364c2dae8cac35b33d03b0e..ccf4c782f1430e3e25d058c61c5e06c1cb6ed611 100644 >--- a/Source/WebKit/Platform/Logging.h >+++ b/Source/WebKit/Platform/Logging.h >@@ -84,6 +84,7 @@ extern "C" { > M(SessionState) \ > M(StorageAPI) \ > M(TextInput) \ >+ M(UIHitTesting) \ > M(ViewGestures) \ > M(ViewState) \ > M(ViewportSizing) \ >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm b/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm >index 2a5f11b48bbf180aa46ba48178bee9155620da04..8357e13237099c29fc36073dc6f0c3bcf35f4bf7 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm >@@ -28,6 +28,7 @@ > > #if PLATFORM(IOS_FAMILY) > >+#import "Logging.h" > #import "RemoteLayerTreeHost.h" > #import "RemoteLayerTreeNode.h" > #import "UIKitSPI.h" >@@ -132,20 +133,31 @@ - (UIView *)_web_findDescendantViewAtPoint:(CGPoint)point withEvent:(UIEvent *)e > Vector<UIView *, 16> viewsAtPoint; > WebKit::collectDescendantViewsAtPoint(viewsAtPoint, self, point, event); > >+ LOG_WITH_STREAM(UIHitTesting, stream << (void*)self << "_web_findDescendantViewAtPoint " << WebCore::FloatPoint(point) << " found " << viewsAtPoint.size() << " views"); >+ > for (auto *view : WTF::makeReversedRange(viewsAtPoint)) { >- if (!view.isUserInteractionEnabled) >+ if (!view.isUserInteractionEnabled) { >+ LOG_WITH_STREAM(UIHitTesting, stream << " " << (void*)view << " !isUserInteractionEnabled - skipping"); > continue; >+ } > > if ([view conformsToProtocol:@protocol(WKNativelyInteractible)]) { >+ LOG_WITH_STREAM(UIHitTesting, stream << " " << (void*)view << " is natively interactible"); > CGPoint subviewPoint = [view convertPoint:point fromView:self]; > return [view hitTest:subviewPoint withEvent:event]; > } > > if ([view isKindOfClass:[WKChildScrollView class]]) { >- if (WebKit::isScrolledBy((WKChildScrollView *)view, viewsAtPoint.last())) >+ if (WebKit::isScrolledBy((WKChildScrollView *)view, viewsAtPoint.last())) { >+ LOG_WITH_STREAM(UIHitTesting, stream << " " << (void*)view << " is child scroll view and scrolled by " << (void*)viewsAtPoint.last() << " - using"); > return view; >+ } > } >+ >+ LOG_WITH_STREAM(UIHitTesting, stream << " " << [view class] << " " << (void*)view << " - ignoring"); > } >+ >+ LOG_WITH_STREAM(UIHitTesting, stream << (void*)self << "_web_findDescendantViewAtPoint found no interactive views"); > return nil; > } > >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index ca87bf3d2e6baf129c3f2191553d83551a7f8a16..4f97be1248a0b4bffac6b6e41b2b8952732e7f37 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -1077,10 +1077,16 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(::UIEvent *)event > { > for (UIView *subView in [_interactionViewsContainerView.get() subviews]) { > UIView *hitView = [subView hitTest:[subView convertPoint:point fromView:self] withEvent:event]; >- if (hitView) >+ if (hitView) { >+ LOG_WITH_STREAM(UIHitTesting, stream << self << "hitTest at " << WebCore::FloatPoint(point) << " found interaction view " << hitView); > return hitView; >+ } > } >- return [super hitTest:point withEvent:event]; >+ >+ LOG_WITH_STREAM(UIHitTesting, stream << "hit-testing WKContentView subviews " << [[self recursiveDescription] UTF8String]); >+ UIView* hitView = [super hitTest:point withEvent:event]; >+ LOG_WITH_STREAM(UIHitTesting, stream << " found view " << [hitView class] << " " << (void*)hitView); >+ return hitView; > } > > - (const WebKit::InteractionInformationAtPosition&)positionInformation >@@ -1348,8 +1354,10 @@ - (void)_handleTouchActionsForTouchEvent:(const WebKit::NativeWebTouchEvent&)tou > auto phase = touchPoint.phase(); > if (phase == WebKit::WebPlatformTouchPoint::TouchPressed) { > auto touchActions = WebKit::touchActionsForPoint(self, touchPoint.location()); >+ LOG_WITH_STREAM(UIHitTesting, stream << "touchActionsForPoint " << touchPoint.location() << " found " << touchActions); > if (!touchActions || touchActions.containsAny({ WebCore::TouchAction::Auto, WebCore::TouchAction::Manipulation })) > continue; >+ > scrollingCoordinator->setTouchActionsForTouchIdentifier(touchActions, touchPoint.identifier()); > > if (!touchActions.contains(WebCore::TouchAction::PinchZoom))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198739
: 371811