Changeset 244588 in webkit
- Timestamp:
- Apr 24, 2019 8:38:23 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r244587 r244588 1 2019-04-24 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Do not use the global _WKContentChange in WebKitLegacy 4 https://bugs.webkit.org/show_bug.cgi?id=196286 5 <rdar://problem/49364417> 6 7 Reviewed by Simon Fraser. 8 9 By reporting WKContentIndeterminateChange in sendMouseMoveEvent enables us to remove the global _WKContentChange state. 10 Using _WKContentChange is fine as long as only the observed frame reports content change during the synthetic click event. 11 In case of multiple frames, we should really consult the local state instead. 12 Unfortunately sendMouseMoveEvent has no access to the observed Document object so we can't really identify the observed content change. 13 WKContentIndeterminateChange triggers asynchronous decision making at the callsite and in the callback we have access 14 to the active Document/ContentChangeObverver object and can report the correct state. 15 This is inline with current WebKit(WK2) behaviour. 16 17 Manually tested with a WebKitLegacy test app. 18 19 * SourcesCocoa.txt: 20 * WebCore.xcodeproj/project.pbxproj: 21 * page/ios/ContentChangeObserver.h: 22 (WebCore::ContentChangeObserver::setHasNoChangeState): 23 (WebCore::ContentChangeObserver::setHasIndeterminateState): 24 (WebCore::ContentChangeObserver::setHasVisibleChangeState): 25 (WebCore::ContentChangeObserver::setObservedContentState): Deleted. 26 * page/ios/EventHandlerIOS.mm: 27 (WebCore::EventHandler::mouseMoved): 28 * platform/ios/wak/WAKWindow.mm: 29 (-[WAKWindow sendMouseMoveEvent:contentChange:]): 30 * platform/ios/wak/WKContentObservation.cpp: Removed. 31 * platform/ios/wak/WKContentObservation.h: 32 1 33 2019-04-24 Philippe Normand <pnormand@igalia.com> 2 34 -
trunk/Source/WebCore/SourcesCocoa.txt
r244439 r244588 418 418 platform/ios/wak/WebCoreThreadRun.cpp 419 419 platform/ios/wak/WebCoreThreadSystemInterface.cpp 420 platform/ios/wak/WKContentObservation.cpp421 420 platform/ios/wak/WKGraphics.mm 422 421 platform/ios/wak/WKView.mm -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r244582 r244588 11078 11078 A14832A0187F508700DA63A6 /* WebCoreThreadSystemInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreThreadSystemInterface.cpp; sourceTree = "<group>"; }; 11079 11079 A14832A1187F508700DA63A6 /* WebCoreThreadSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreThreadSystemInterface.h; sourceTree = "<group>"; }; 11080 A14832A2187F508700DA63A6 /* WKContentObservation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKContentObservation.cpp; sourceTree = "<group>"; };11081 11080 A14832A3187F508700DA63A6 /* WKContentObservation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentObservation.h; sourceTree = "<group>"; }; 11082 11081 A14832A4187F508700DA63A6 /* WKGraphics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKGraphics.h; sourceTree = "<group>"; }; … … 22068 22067 A14832A0187F508700DA63A6 /* WebCoreThreadSystemInterface.cpp */, 22069 22068 A14832A1187F508700DA63A6 /* WebCoreThreadSystemInterface.h */, 22070 A14832A2187F508700DA63A6 /* WKContentObservation.cpp */,22071 22069 A14832A3187F508700DA63A6 /* WKContentObservation.h */, 22072 22070 A14832A4187F508700DA63A6 /* WKGraphics.h */, -
trunk/Source/WebCore/page/ios/ContentChangeObserver.h
r244182 r244588 155 155 void reset(); 156 156 157 void setHasNoChangeState() { setObservedContentState(WKContentNoChange); }158 void setHasIndeterminateState() { setObservedContentState(WKContentIndeterminateChange); }159 void setHasVisibleChangeState() { setObservedContentState(WKContentVisibilityChange); }157 void setHasNoChangeState() { m_observedContentState = WKContentNoChange; } 158 void setHasIndeterminateState() { m_observedContentState = WKContentIndeterminateChange; } 159 void setHasVisibleChangeState() { m_observedContentState = WKContentVisibilityChange; } 160 160 161 161 bool hasVisibleChangeState() const { return observedContentChange() == WKContentVisibilityChange; } … … 171 171 172 172 void completeDurationBasedContentObservation(); 173 void setObservedContentState(WKContentChange);174 173 175 174 void renderTreeUpdateDidStart(); … … 218 217 }; 219 218 220 inline void ContentChangeObserver::setObservedContentState(WKContentChange observedContentChange)221 {222 m_observedContentState = observedContentChange;223 WKSetObservedContentChange(observedContentChange);224 }225 226 219 inline bool ContentChangeObserver::isObservingContentChanges() const 227 220 { -
trunk/Source/WebCore/page/ios/EventHandlerIOS.mm
r243043 r244588 488 488 // Reject a mouse moved if the button is down - screws up tracking during autoscroll 489 489 // These happen because WebKit sometimes has to fake up moved events. 490 if (!m_frame. view() || m_mousePressed || m_sendingEventToSubview)490 if (!m_frame.document() || !m_frame.view() || m_mousePressed || m_sendingEventToSubview) 491 491 return; 492 492 … … 501 501 // Run style recalc to be able to capture content changes as the result of the mouse move event. 502 502 document.updateStyleIfNeeded(); 503 callOnMainThread([protectedFrame = makeRef(m_frame)] { 504 if (auto* document = protectedFrame->document()) 505 document->page()->chrome().client().observedContentChange(*document->frame()); 506 }); 503 507 } 504 508 -
trunk/Source/WebCore/platform/ios/wak/WAKWindow.mm
r240355 r244588 362 362 [self sendEvent:anEvent]; 363 363 364 if (aContentChange) 365 *aContentChange = WKObservedContentChange(); 364 if (aContentChange) { 365 // We always make the decision asynchronously. See EventHandler::mouseMoved. 366 *aContentChange = WKContentIndeterminateChange; 367 } 366 368 }); 367 369 } -
trunk/Source/WebCore/platform/ios/wak/WKContentObservation.h
r242190 r244588 40 40 } WKContentChange; 41 41 42 WEBCORE_EXPORT WKContentChange WKObservedContentChange(void);43 WEBCORE_EXPORT void WKSetObservedContentChange(WKContentChange);44 45 42 #ifdef __cplusplus 46 43 }
Note: See TracChangeset
for help on using the changeset viewer.