Changeset 242340 in webkit
- Timestamp:
- Mar 3, 2019, 10:05:44 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/dom/Document.cpp (modified) (4 diffs)
-
WebCore/dom/Document.h (modified) (3 diffs)
-
WebCore/page/DOMTimer.cpp (modified) (3 diffs)
-
WebCore/page/Frame.cpp (modified) (2 diffs)
-
WebCore/page/Page.cpp (modified) (2 diffs)
-
WebCore/page/Page.h (modified) (3 diffs)
-
WebCore/page/ios/ContentChangeObserver.cpp (modified) (12 diffs)
-
WebCore/page/ios/ContentChangeObserver.h (modified) (4 diffs)
-
WebCore/page/ios/EventHandlerIOS.mm (modified) (1 diff)
-
WebCore/rendering/updating/RenderTreeUpdater.cpp (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/WebProcess/WebPage/WebPage.h (modified) (1 diff)
-
WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (10 diffs)
-
WebKitLegacy/ios/ChangeLog (modified) (1 diff)
-
WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r242333 r242340 1 2019-03-03 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Content observation should be limited to the current document. 4 https://bugs.webkit.org/show_bug.cgi?id=195256 5 <rdar://problem/48544402> 6 7 Move ContentChangeObserver from Page to Document. 8 It limits content observation to the target node's owner document. 9 10 Reviewed by Simon Fraser. 11 12 * dom/Document.cpp: 13 (WebCore::m_contentChangeObserver): 14 (WebCore::Document::updateStyleIfNeeded): 15 (WebCore::Document::willDetachPage): 16 (WebCore::Document::platformSuspendOrStopActiveDOMObjects): 17 (WebCore::m_undoManager): Deleted. 18 * dom/Document.h: 19 (WebCore::Document::contentChangeObserver): 20 * page/DOMTimer.cpp: 21 (WebCore::DOMTimer::install): 22 (WebCore::DOMTimer::removeById): 23 (WebCore::DOMTimer::fired): 24 * page/Frame.cpp: 25 (WebCore::Frame::willDetachPage): 26 * page/Page.cpp: 27 (WebCore::Page::Page): 28 * page/Page.h: 29 (WebCore::Page::pointerLockController const): 30 (WebCore::Page::contentChangeObserver): Deleted. 31 * page/ios/ContentChangeObserver.cpp: 32 (WebCore::ContentChangeObserver::ContentChangeObserver): 33 (WebCore::ContentChangeObserver::didInstallDOMTimer): 34 (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): 35 (WebCore::ContentChangeObserver::stopObservingStyleRecalc): 36 (WebCore::ContentChangeObserver::clearTimersAndReportContentChange): 37 (WebCore::ContentChangeObserver::startObservingMouseMoved): 38 (WebCore::ContentChangeObserver::hasDeterminateState const): 39 (WebCore::ContentChangeObserver::adjustObservedState): 40 (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded): 41 (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope): 42 (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope): 43 (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope): 44 (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope): 45 (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope): 46 (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope): 47 (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope): 48 (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope): 49 (WebCore::hasPendingStyleRecalc): Deleted. 50 * page/ios/ContentChangeObserver.h: 51 * page/ios/EventHandlerIOS.mm: 52 (WebCore::EventHandler::mouseMoved): 53 * rendering/updating/RenderTreeUpdater.cpp: 54 (WebCore::RenderTreeUpdater::updateElementRenderer): 55 1 56 2019-03-02 Simon Fraser <simon.fraser@apple.com> 2 57 -
trunk/Source/WebCore/dom/Document.cpp
r242308 r242340 2052 2052 2053 2053 #if PLATFORM(IOS_FAMILY) 2054 ContentChangeObserver::StyleRecalcScope observingScope( page());2054 ContentChangeObserver::StyleRecalcScope observingScope(*this); 2055 2055 #endif 2056 2056 // The early exit above for !needsStyleRecalc() is needed when updateWidgetPositions() is called in runOrScheduleAsynchronousTasks(). … … 2384 2384 { 2385 2385 FrameDestructionObserver::willDetachPage(); 2386 2386 #if PLATFORM(IOS_FAMILY) 2387 contentChangeObserver().willDetachPage(); 2388 #endif 2387 2389 if (domWindow() && frame()) 2388 2390 InspectorInstrumentation::frameWindowDiscarded(*frame(), domWindow()); … … 2633 2635 { 2634 2636 #if PLATFORM(IOS_FAMILY) 2635 if (auto* page = this->page()) 2636 page->contentChangeObserver().didSuspendActiveDOMObjects(); 2637 contentChangeObserver().didSuspendActiveDOMObjects(); 2637 2638 #endif 2638 2639 } … … 8684 8685 #endif 8685 8686 8687 #if PLATFORM(IOS_FAMILY) 8688 ContentChangeObserver& Document::contentChangeObserver() 8689 { 8690 if (!m_contentChangeObserver) 8691 m_contentChangeObserver = std::make_unique<ContentChangeObserver>(*this); 8692 return *m_contentChangeObserver; 8693 } 8694 #endif 8695 8686 8696 } // namespace WebCore -
trunk/Source/WebCore/dom/Document.h
r242137 r242340 100 100 class Comment; 101 101 class ConstantPropertyMap; 102 class ContentChangeObserver; 102 103 class DOMImplementation; 103 104 class DOMSelection; … … 872 873 // Called when <meta name="apple-mobile-web-app-orientations"> changes. 873 874 void processWebAppOrientations(); 875 876 ContentChangeObserver& contentChangeObserver(); 874 877 #endif 875 878 … … 2078 2081 2079 2082 Ref<UndoManager> m_undoManager; 2083 #if PLATFORM(IOS_FAMILY) 2084 std::unique_ptr<ContentChangeObserver> m_contentChangeObserver; 2085 #endif 2080 2086 }; 2081 2087 -
trunk/Source/WebCore/page/DOMTimer.cpp
r242253 r242340 223 223 nestedTimers->add(timer->m_timeoutId, *timer); 224 224 #if PLATFORM(IOS_FAMILY) 225 if (is<Document>(context) && downcast<Document>(context).page())226 downcast<Document>(context). page()->contentChangeObserver().didInstallDOMTimer(*timer, timeout, singleShot);225 if (is<Document>(context)) 226 downcast<Document>(context).contentChangeObserver().didInstallDOMTimer(*timer, timeout, singleShot); 227 227 #endif 228 228 return timer->m_timeoutId; … … 238 238 239 239 #if PLATFORM(IOS_FAMILY) 240 if (is<Document>(context) && downcast<Document>(context).page()) {240 if (is<Document>(context)) { 241 241 auto& document = downcast<Document>(context); 242 242 if (auto* timer = document.findTimeout(timeoutId)) 243 document. page()->contentChangeObserver().didRemoveDOMTimer(*timer);243 document.contentChangeObserver().didRemoveDOMTimer(*timer); 244 244 } 245 245 #endif … … 344 344 345 345 #if PLATFORM(IOS_FAMILY) 346 ContentChangeObserver::DOMTimerScope observingScope(is<Document>(context) ? downcast<Document>(context).page() : nullptr, *this);346 ContentChangeObserver::DOMTimerScope observingScope(is<Document>(context) ? &downcast<Document>(context) : nullptr, *this); 347 347 #endif 348 348 m_action->execute(context); -
trunk/Source/WebCore/page/Frame.cpp
r242317 r242340 108 108 #include <wtf/text/StringBuilder.h> 109 109 110 #if PLATFORM(IOS_FAMILY)111 #include "ContentChangeObserver.h"112 #endif113 114 110 namespace WebCore { 115 111 … … 844 840 page()->scrollingCoordinator()->willDestroyScrollableArea(*m_view); 845 841 846 #if PLATFORM(IOS_FAMILY)847 if (auto* page = this->page())848 page->contentChangeObserver().willDetachPage();849 #endif850 851 842 script().clearScriptObjects(); 852 843 script().updatePlatformScriptObjects(); -
trunk/Source/WebCore/page/Page.cpp
r242113 r242340 150 150 #endif 151 151 152 #if PLATFORM(IOS_FAMILY)153 #include "ContentChangeObserver.h"154 #endif155 156 152 namespace WebCore { 157 153 … … 236 232 , m_webGLStateTracker(WTFMove(pageConfiguration.webGLStateTracker)) 237 233 , m_libWebRTCProvider(WTFMove(pageConfiguration.libWebRTCProvider)) 238 #if PLATFORM(IOS_FAMILY)239 , m_contentChangeObserver(std::make_unique<ContentChangeObserver>(*this))240 #endif241 234 , m_verticalScrollElasticity(ScrollElasticityAllowed) 242 235 , m_horizontalScrollElasticity(ScrollElasticityAllowed) -
trunk/Source/WebCore/page/Page.h
r242113 r242340 87 87 class ChromeClient; 88 88 class Color; 89 #if PLATFORM(IOS_FAMILY)90 class ContentChangeObserver;91 #endif92 89 class ContextMenuClient; 93 90 class ContextMenuController; … … 256 253 PointerLockController& pointerLockController() const { return *m_pointerLockController; } 257 254 #endif 258 #if PLATFORM(IOS_FAMILY)259 ContentChangeObserver& contentChangeObserver() { return *m_contentChangeObserver; }260 #endif261 255 LibWebRTCProvider& libWebRTCProvider() { return m_libWebRTCProvider.get(); } 262 256 RTCController& rtcController() { return m_rtcController; } … … 819 813 #if PLATFORM(IOS_FAMILY) 820 814 bool m_enclosedInScrollableAncestorView { false }; 821 std::unique_ptr<ContentChangeObserver> m_contentChangeObserver;822 815 #endif 823 816 -
trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp
r242324 r242340 30 30 #include "ChromeClient.h" 31 31 #include "DOMTimer.h" 32 #include "Document.h" 32 33 #include "Logging.h" 33 34 #include "NodeRenderStyle.h" … … 36 37 namespace WebCore { 37 38 38 static bool hasPendingStyleRecalc(const Page& page) 39 { 40 for (auto* frame = &page.mainFrame(); frame; frame = frame->tree().traverseNext()) { 41 if (auto* document = frame->document()) { 42 if (document->hasPendingStyleRecalc()) 43 return true; 44 } 45 } 46 return false; 47 } 48 49 ContentChangeObserver::ContentChangeObserver(Page& page) 50 : m_page(page) 39 ContentChangeObserver::ContentChangeObserver(Document& document) 40 : m_document(document) 51 41 { 52 42 } … … 54 44 void ContentChangeObserver::didInstallDOMTimer(const DOMTimer& timer, Seconds timeout, bool singleShot) 55 45 { 56 if (!m_page.mainFrame().document()) 57 return; 58 if (m_page.mainFrame().document()->activeDOMObjectsAreSuspended()) 46 if (m_document.activeDOMObjectsAreSuspended()) 59 47 return; 60 48 if (timeout > 250_ms || !singleShot) … … 96 84 m_isObservingContentChanges = false; 97 85 unregisterDOMTimer(timer); 98 setShouldObserveStyleRecalc( WebCore::hasPendingStyleRecalc(m_page));86 setShouldObserveStyleRecalc(m_document.hasPendingStyleRecalc()); 99 87 notifyContentChangeIfNeeded(); 100 88 } … … 118 106 119 107 setShouldObserveStyleRecalc(false); 108 m_isObservingContentChanges = false; 120 109 adjustObservedState(Event::StyleRecalcFinished); 121 110 notifyContentChangeIfNeeded(); … … 129 118 130 119 clearObservedDOMTimers(); 131 m_page.chrome().client().observedContentChange(m_page.mainFrame()); 120 ASSERT(m_document.page()); 121 ASSERT(m_document.frame()); 122 m_document.page()->chrome().client().observedContentChange(*m_document.frame()); 132 123 } 133 124 … … 150 141 void ContentChangeObserver::startObservingMouseMoved() 151 142 { 152 ASSERT(! hasPendingStyleRecalc(m_page));143 ASSERT(!m_document.hasPendingStyleRecalc()); 153 144 clearObservedDOMTimers(); 154 145 startObservingDOMTimerScheduling(); … … 191 182 if (hasVisibleChangeState()) 192 183 return true; 193 return observedContentChange() == WKContentNoChange && !hasObservedDOMTimer() && ! hasPendingStyleRecalc(m_page);184 return observedContentChange() == WKContentNoChange && !hasObservedDOMTimer() && !m_document.hasPendingStyleRecalc(); 194 185 } 195 186 … … 208 199 case Event::StyleRecalcFinished: 209 200 // Demote to "no change" when there's no pending activity anymore. 210 if (observedContentChange() == WKContentIndeterminateChange && !hasObservedDOMTimer() && ! hasPendingStyleRecalc(m_page))201 if (observedContentChange() == WKContentIndeterminateChange && !hasObservedDOMTimer() && !m_document.hasPendingStyleRecalc()) 211 202 setHasNoChangeState(); 212 203 break; … … 224 215 } 225 216 LOG_WITH_STREAM(ContentObservation, stream << "notifyContentChangeIfNeeded: sending observedContentChange ->" << observedContentChange()); 226 m_page.chrome().client().observedContentChange(m_page.mainFrame()); 217 ASSERT(m_document.page()); 218 ASSERT(m_document.frame()); 219 m_document.page()->chrome().client().observedContentChange(*m_document.frame()); 227 220 } 228 221 … … 251 244 } 252 245 253 ContentChangeObserver::StyleChangeScope::StyleChangeScope( Page* page, const Element& element)254 : m_contentChangeObserver( page ? &page->contentChangeObserver() : nullptr)246 ContentChangeObserver::StyleChangeScope::StyleChangeScope(Document& document, const Element& element) 247 : m_contentChangeObserver(document.contentChangeObserver()) 255 248 , m_element(element) 256 , m_needsObserving(m_contentChangeObserver && m_contentChangeObserver->isObservingContentChanges() && m_contentChangeObserver->observedContentChange() != WKContentVisibilityChange)249 , m_needsObserving(m_contentChangeObserver.isObservingContentChanges() && m_contentChangeObserver.observedContentChange() != WKContentVisibilityChange) 257 250 { 258 251 if (m_needsObserving) { … … 285 278 || (m_previousVisibility == Visibility::Hidden && style->visibility() != Visibility::Hidden) 286 279 || (m_previousImplicitVisibility == Visibility::Hidden && elementImplicitVisibility(m_element) == Visibility::Visible)) 287 m_contentChangeObserver->contentVisibilityDidChange(); 288 } 289 290 ContentChangeObserver::MouseMovedScope::MouseMovedScope(Page* page) 291 : m_contentChangeObserver(page ? &page->contentChangeObserver() : nullptr) 292 { 293 if (m_contentChangeObserver) 294 m_contentChangeObserver->startObservingMouseMoved(); 280 m_contentChangeObserver.contentVisibilityDidChange(); 281 } 282 283 ContentChangeObserver::MouseMovedScope::MouseMovedScope(Document& document) 284 : m_contentChangeObserver(document.contentChangeObserver()) 285 { 286 m_contentChangeObserver.startObservingMouseMoved(); 295 287 } 296 288 297 289 ContentChangeObserver::MouseMovedScope::~MouseMovedScope() 298 290 { 299 if (m_contentChangeObserver) 300 m_contentChangeObserver->stopObservingMouseMoved(); 301 } 302 303 ContentChangeObserver::StyleRecalcScope::StyleRecalcScope(Page* page) 304 : m_contentChangeObserver(page ? &page->contentChangeObserver() : nullptr) 305 { 306 if (m_contentChangeObserver) 307 m_contentChangeObserver->startObservingStyleRecalc(); 291 m_contentChangeObserver.stopObservingMouseMoved(); 292 } 293 294 ContentChangeObserver::StyleRecalcScope::StyleRecalcScope(Document& document) 295 : m_contentChangeObserver(document.contentChangeObserver()) 296 { 297 m_contentChangeObserver.startObservingStyleRecalc(); 308 298 } 309 299 310 300 ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope() 311 301 { 312 if (m_contentChangeObserver) 313 m_contentChangeObserver->stopObservingStyleRecalc(); 314 } 315 316 ContentChangeObserver::DOMTimerScope::DOMTimerScope(Page* page, const DOMTimer& domTimer) 317 : m_contentChangeObserver(page ? &page->contentChangeObserver() : nullptr) 302 m_contentChangeObserver.stopObservingStyleRecalc(); 303 } 304 305 ContentChangeObserver::DOMTimerScope::DOMTimerScope(Document* document, const DOMTimer& domTimer) 306 : m_contentChangeObserver(document ? &document->contentChangeObserver() : nullptr) 318 307 , m_domTimer(domTimer) 319 308 { -
trunk/Source/WebCore/page/ios/ContentChangeObserver.h
r242324 r242340 33 33 34 34 class DOMTimer; 35 class Page;35 class Document; 36 36 37 37 class ContentChangeObserver { 38 38 public: 39 ContentChangeObserver( Page&);39 ContentChangeObserver(Document&); 40 40 41 41 WEBCORE_EXPORT WKContentChange observedContentChange() const; … … 49 49 class StyleChangeScope { 50 50 public: 51 StyleChangeScope( Page*, const Element&);51 StyleChangeScope(Document&, const Element&); 52 52 ~StyleChangeScope(); 53 53 54 54 private: 55 ContentChangeObserver * m_contentChangeObserver { nullptr };55 ContentChangeObserver& m_contentChangeObserver; 56 56 const Element& m_element; 57 57 bool m_needsObserving { false }; … … 63 63 class MouseMovedScope { 64 64 public: 65 WEBCORE_EXPORT MouseMovedScope( Page*);65 WEBCORE_EXPORT MouseMovedScope(Document&); 66 66 WEBCORE_EXPORT ~MouseMovedScope(); 67 67 private: 68 ContentChangeObserver * m_contentChangeObserver { nullptr };68 ContentChangeObserver& m_contentChangeObserver; 69 69 }; 70 70 71 71 class StyleRecalcScope { 72 72 public: 73 StyleRecalcScope( Page*);73 StyleRecalcScope(Document&); 74 74 ~StyleRecalcScope(); 75 75 private: 76 ContentChangeObserver * m_contentChangeObserver { nullptr };76 ContentChangeObserver& m_contentChangeObserver; 77 77 }; 78 78 79 79 class DOMTimerScope { 80 80 public: 81 DOMTimerScope( Page*, const DOMTimer&);81 DOMTimerScope(Document*, const DOMTimer&); 82 82 ~DOMTimerScope(); 83 83 private: … … 131 131 void adjustObservedState(Event); 132 132 133 Page& m_page;133 Document& m_document; 134 134 HashSet<const DOMTimer*> m_DOMTimerList; 135 135 bool m_shouldObserveStyleRecalc { false }; -
trunk/Source/WebCore/page/ios/EventHandlerIOS.mm
r242324 r242340 497 497 CurrentEventScope scope(event); 498 498 { 499 ContentChangeObserver::MouseMovedScope observingScope(document .page());499 ContentChangeObserver::MouseMovedScope observingScope(document); 500 500 event.wasHandled = mouseMoved(currentPlatformMouseEvent()); 501 501 // Run style recalc to be able to capture content changes as the result of the mouse move event. -
trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
r242234 r242340 294 294 { 295 295 #if PLATFORM(IOS_FAMILY) 296 ContentChangeObserver::StyleChangeScope observingScope(m_document .page(), element);296 ContentChangeObserver::StyleChangeScope observingScope(m_document, element); 297 297 #endif 298 298 -
trunk/Source/WebKit/ChangeLog
r242339 r242340 1 2019-03-03 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Content observation should be limited to the current document. 4 https://bugs.webkit.org/show_bug.cgi?id=195256 5 <rdar://problem/48544402> 6 7 Reviewed by Simon Fraser. 8 9 * WebProcess/WebPage/WebPage.h: 10 * WebProcess/WebPage/ios/WebPageIOS.mm: 11 (WebKit::WebPage::handleSyntheticClick): 12 (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): 13 (WebKit::WebPage::completeSyntheticClick): 14 (WebKit::WebPage::handleTap): 15 (WebKit::WebPage::handleTwoFingerTapAtPoint): 16 (WebKit::WebPage::commitPotentialTap): 17 1 18 2019-03-03 Tim Horton <timothy_horton@apple.com> 2 19 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r242317 r242340 1190 1190 void getFocusedElementInformation(FocusedElementInformation&); 1191 1191 void platformInitializeAccessibility(); 1192 void handleSyntheticClick(WebCore::Node *nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>);1193 void completeSyntheticClick(WebCore::Node *nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::SyntheticClickType);1192 void handleSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>); 1193 void completeSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::SyntheticClickType); 1194 1194 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*); 1195 1195 void resetTextAutosizing(); -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r242324 r242340 536 536 } 537 537 538 void WebPage::handleSyntheticClick(Node *nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers)538 void WebPage::handleSyntheticClick(Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers) 539 539 { 540 540 IntPoint roundedAdjustedPoint = roundedIntPoint(location); 541 auto& mainframe = m_page->mainFrame(); 542 auto& contentChangeObserver = m_page->contentChangeObserver(); 543 541 auto& respondingDocument = nodeRespondingToClick.document(); 544 542 // FIXME: Pass caps lock state. 545 543 bool shiftKey = modifiers.contains(WebEvent::Modifier::ShiftKey); … … 548 546 bool metaKey = modifiers.contains(WebEvent::Modifier::MetaKey); 549 547 { 550 LOG_WITH_STREAM(ContentObservation, stream << "handleSyntheticClick: node(" << nodeRespondingToClick << ") " << location); 551 ContentChangeObserver::MouseMovedScope observingScope(m_page.get()); 548 LOG_WITH_STREAM(ContentObservation, stream << "handleSyntheticClick: node(" << &nodeRespondingToClick << ") " << location); 549 ContentChangeObserver::MouseMovedScope observingScope(respondingDocument); 550 auto& mainframe = m_page->mainFrame(); 552 551 mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap)); 553 552 mainframe.document()->updateStyleIfNeeded(); … … 561 560 return; 562 561 563 switch ( contentChangeObserver.observedContentChange()) {562 switch (respondingDocument.contentChangeObserver().observedContentChange()) { 564 563 case WKContentVisibilityChange: 565 564 // The move event caused new contents to appear. Don't send the click event. … … 568 567 case WKContentIndeterminateChange: { 569 568 // Wait for callback to completePendingSyntheticClickForContentChangeObserver() to decide whether to send the click event. 570 m_pendingSyntheticClickNode = nodeRespondingToClick;569 m_pendingSyntheticClickNode = &nodeRespondingToClick; 571 570 m_pendingSyntheticClickLocation = location; 572 571 m_pendingSyntheticClickModifiers = modifiers; … … 586 585 if (!m_pendingSyntheticClickNode) 587 586 return; 587 auto observedContentChange = m_pendingSyntheticClickNode->document().contentChangeObserver().observedContentChange(); 588 588 // Only dispatch the click if the document didn't get changed by any timers started by the move event. 589 if ( m_page->contentChangeObserver().observedContentChange()== WKContentNoChange) {589 if (observedContentChange == WKContentNoChange) { 590 590 LOG(ContentObservation, "No chage was observed -> click."); 591 completeSyntheticClick( m_pendingSyntheticClickNode.get(), m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers, WebCore::OneFingerTap);591 completeSyntheticClick(*m_pendingSyntheticClickNode, m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers, WebCore::OneFingerTap); 592 592 } else 593 593 LOG(ContentObservation, "Observed meaningful visible change -> hover."); … … 598 598 } 599 599 600 void WebPage::completeSyntheticClick(Node *nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers, SyntheticClickType syntheticClickType)600 void WebPage::completeSyntheticClick(Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers, SyntheticClickType syntheticClickType) 601 601 { 602 602 IntPoint roundedAdjustedPoint = roundedIntPoint(location); … … 635 635 elementDidRefocus(*newFocusedElement); 636 636 637 if (!tapWasHandled || !nodeRespondingToClick || !nodeRespondingToClick->isElementNode())637 if (!tapWasHandled || !nodeRespondingToClick.isElementNode()) 638 638 send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(location))); 639 639 … … 658 658 #endif 659 659 else 660 handleSyntheticClick( nodeRespondingToClick, adjustedPoint, modifiers);660 handleSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers); 661 661 } 662 662 … … 769 769 } else 770 770 #endif 771 completeSyntheticClick( nodeRespondingToClick, adjustedPoint, modifiers, WebCore::TwoFingerTap);771 completeSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers, WebCore::TwoFingerTap); 772 772 } 773 773 … … 838 838 } else 839 839 #endif 840 handleSyntheticClick( nodeRespondingToClick, adjustedPoint, modifiers);840 handleSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers); 841 841 } else 842 842 commitPotentialTapFailed(); -
trunk/Source/WebKitLegacy/ios/ChangeLog
r242108 r242340 1 2019-03-03 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Content observation should be limited to the current document. 4 https://bugs.webkit.org/show_bug.cgi?id=195256 5 <rdar://problem/48544402> 6 7 Reviewed by Simon Fraser. 8 9 * WebCoreSupport/WebChromeClientIOS.mm: 10 (WebChromeClientIOS::observedContentChange): 11 1 12 2019-02-26 Zalan Bujtas <zalan@apple.com> 2 13 -
trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm
r242108 r242340 185 185 void WebChromeClientIOS::observedContentChange(WebCore::Frame& frame) 186 186 { 187 if (!frame. page())187 if (!frame.document()) 188 188 return; 189 [[webView() _UIKitDelegateForwarder] webView:webView() didObserveDeferredContentChange:frame. page()->contentChangeObserver().observedContentChange() forFrame:kit(&frame)];189 [[webView() _UIKitDelegateForwarder] webView:webView() didObserveDeferredContentChange:frame.document()->contentChangeObserver().observedContentChange() forFrame:kit(&frame)]; 190 190 } 191 191
Note:
See TracChangeset
for help on using the changeset viewer.