WebKit Bugzilla
Attachment 356389 Details for
Bug 192312
: [iOS] Add logging channel for hover related content observation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192312-20181203114056.patch (text/plain), 11.29 KB, created by
zalan
on 2018-12-03 11:40:57 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-12-03 11:40:57 PST
Size:
11.29 KB
patch
obsolete
>Subversion Revision: 238797 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 953a769ebcf63567756cfb643f077422d23900e1..564851063dcb2f68860fd52e1eec96c4214a6f17 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-12-03 Zalan Bujtas <zalan@apple.com> >+ >+ [iOS] Add logging channel for hover related content observation >+ https://bugs.webkit.org/show_bug.cgi?id=192312 >+ >+ Reviewed by Simon Fraser. >+ >+ * dom/Document.cpp: >+ (WebCore::Document::scheduleStyleRecalc): >+ (WebCore::Document::updateStyleIfNeeded): >+ (WebCore::Document::platformSuspendOrStopActiveDOMObjects): >+ * page/DOMTimer.cpp: >+ (WebCore::DOMTimer::install): >+ (WebCore::DOMTimer::fired): >+ * page/DOMWindow.cpp: >+ (WebCore::DOMWindow::clearTimeout): >+ * page/Frame.cpp: >+ (WebCore::Frame::willDetachPage): >+ * platform/Logging.h: >+ > 2018-12-03 Eric Carlson <eric.carlson@apple.com> > > [MediaStream] 'devicechange' event when more capture device information are revealed. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index bbd98215365f216a76b9d8433e7cc8984bdf3d22..b32578d49b446a3e725e32e64d8b958776412143 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,14 @@ >+2018-12-03 Zalan Bujtas <zalan@apple.com> >+ >+ [iOS] Add logging channel for hover related content observation >+ https://bugs.webkit.org/show_bug.cgi?id=192312 >+ >+ Reviewed by Simon Fraser. >+ >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::handleSyntheticClick): >+ (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): >+ > 2018-12-03 Darin Adler <darin@apple.com> > > [Cocoa] Streamline sandbox code a tiny bit >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index b446f2af7747662ccc172d49f94852c3014b98c2..e334adbeaeb02add8a305829c9b6f2eeb4e5fae2 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -1796,8 +1796,10 @@ void Document::scheduleStyleRecalc() > ASSERT(childNeedsStyleRecalc() || m_pendingStyleRecalcShouldForce); > > #if PLATFORM(IOS_FAMILY) >- if (WKIsObservingStyleRecalcScheduling()) >+ if (WKIsObservingStyleRecalcScheduling()) { >+ LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: register this style recalc schedule and observe when it fires."); > WKSetObservedContentChange(WKContentIndeterminateChange); >+ } > #endif > > // FIXME: Why on earth is this here? This is clearly misplaced. >@@ -2037,6 +2039,7 @@ bool Document::updateStyleIfNeeded() > #if PLATFORM(IOS_FAMILY) > auto observingContentChange = WKShouldObserveNextStyleRecalc(); > if (observingContentChange) { >+ LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: start observing content change."); > WKSetShouldObserveNextStyleRecalc(false); > WKStartObservingContentChanges(); > } >@@ -2048,12 +2051,16 @@ bool Document::updateStyleIfNeeded() > > #if PLATFORM(IOS_FAMILY) > if (observingContentChange) { >+ LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: stop observing content change."); > WKStopObservingContentChanges(); > > auto inDeterminedState = WKObservedContentChange() == WKContentVisibilityChange || !WebThreadCountOfObservedDOMTimers(); > if (inDeterminedState) { >+ LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: notify the pending synthetic click handler."); > if (auto* page = this->page()) > page->chrome().client().observedContentChange(*frame()); >+ } else { >+ LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: can't decided it yet."); > } > } > #endif >@@ -2627,6 +2634,7 @@ void Document::platformSuspendOrStopActiveDOMObjects() > { > #if PLATFORM(IOS_FAMILY) > if (WebThreadCountOfObservedDOMTimers() > 0) { >+ LOG_WITH_STREAM(ContentObservation, stream << "Document::platformSuspendOrStopActiveDOMObjects: remove registered timers."); > if (auto* frame = this->frame()) { > if (auto* page = frame->page()) > page->chrome().client().clearContentChangeObservers(*frame); >diff --git a/Source/WebCore/page/DOMTimer.cpp b/Source/WebCore/page/DOMTimer.cpp >index 73ae60ada960e530721673dd9e6f71b67ff87baf..f225adea819ac853be4d5bf651bf8f1b8c27e4b6 100644 >--- a/Source/WebCore/page/DOMTimer.cpp >+++ b/Source/WebCore/page/DOMTimer.cpp >@@ -225,6 +225,7 @@ int DOMTimer::install(ScriptExecutionContext& context, std::unique_ptr<Scheduled > if (!didDeferTimeout && timeout <= 250_ms && singleShot) { > WKSetObservedContentChange(WKContentIndeterminateChange); > WebThreadAddObservedDOMTimer(timer); >+ LOG_WITH_STREAM(ContentObservation, stream << "DOMTimer::install: registed this timer: (" << timer << ") and observe when it fires."); > } > } > #endif >@@ -349,6 +350,7 @@ void DOMTimer::fired() > } > > if (shouldBeginObservingChanges) { >+ LOG_WITH_STREAM(ContentObservation, stream << "DOMTimer::fired: start observing (" << timer << ") timer callback."); > WKStartObservingContentChanges(); > WKStartObservingStyleRecalcScheduling(); > WebThreadRemoveObservedDOMTimer(this); >@@ -364,6 +366,7 @@ void DOMTimer::fired() > > #if PLATFORM(IOS_FAMILY) > if (shouldBeginObservingChanges) { >+ LOG_WITH_STREAM(ContentObservation, stream << "DOMTimer::fired: stop observing (" << timer << ") timer callback."); > WKStopObservingStyleRecalcScheduling(); > WKStopObservingContentChanges(); > >@@ -371,11 +374,13 @@ void DOMTimer::fired() > // Check if the timer callback triggered either a sync or async style update. > auto inDeterminedState = observedContentChange == WKContentVisibilityChange || (isObversingLastTimer && observedContentChange == WKContentNoChange); > if (inDeterminedState) { >+ LOG(ContentObservation, "DOMTimer::fired: in determined state."); > auto& document = downcast<Document>(context); > if (auto* page = document.page()) > page->chrome().client().observedContentChange(*document.frame()); > } else if (observedContentChange == WKContentIndeterminateChange) { > // An async style recalc has been scheduled. Let's observe it. >+ LOG(ContentObservation, "DOMTimer::fired: wait until next style recalc fires."); > WKSetShouldObserveNextStyleRecalc(true); > } > } >diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp >index 9ed4101a2af9952226b066d72c55a5707d8708ac..793f7aae9ebaa1d7751e4a1287e227dae7625612 100644 >--- a/Source/WebCore/page/DOMWindow.cpp >+++ b/Source/WebCore/page/DOMWindow.cpp >@@ -1679,6 +1679,7 @@ void DOMWindow::clearTimeout(int timeoutId) > if (timeoutId > 0 && document) { > DOMTimer* timer = document->findTimeout(timeoutId); > if (timer && WebThreadContainsObservedDOMTimer(timer)) { >+ LOG_WITH_STREAM(ContentObservation, stream << "DOMWindow::clearTimeout: remove registered timer (" << timer << ")"); > WebThreadRemoveObservedDOMTimer(timer); > > if (!WebThreadCountOfObservedDOMTimers()) { >diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp >index cd96b00d69898d25a91e01f8b21b45d2a7683fdc..8d2c3ef583b2799a3fd1c69ec82e971ad9fe4e19 100644 >--- a/Source/WebCore/page/Frame.cpp >+++ b/Source/WebCore/page/Frame.cpp >@@ -805,8 +805,10 @@ void Frame::willDetachPage() > page()->scrollingCoordinator()->willDestroyScrollableArea(*m_view); > > #if PLATFORM(IOS_FAMILY) >- if (WebThreadCountOfObservedDOMTimers() > 0 && m_page) >+ if (WebThreadCountOfObservedDOMTimers() > 0 && m_page) { >+ LOG(ContentObservation, "Frame::willDetachPage: remove registered timers."); > m_page->chrome().client().clearContentChangeObservers(*this); >+ } > #endif > > script().clearScriptObjects(); >diff --git a/Source/WebCore/platform/Logging.h b/Source/WebCore/platform/Logging.h >index 17450dab99aca5f7b0797c3947676a4b4a1c7370..04cb7435d85a412b7477c8c58e2629e57eebaa93 100644 >--- a/Source/WebCore/platform/Logging.h >+++ b/Source/WebCore/platform/Logging.h >@@ -42,6 +42,7 @@ namespace WebCore { > M(Archives) \ > M(Compositing) \ > M(ContentFiltering) \ >+ M(ContentObservation) \ > M(DatabaseTracker) \ > M(DisplayLists) \ > M(DOMTimers) \ >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 5cd71eb08ea05ca780cef90fd4e7faa7fcd067a0..9df618a4d9ad8e9b1d63206c60051dafb76db235 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -535,6 +535,7 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F > IntPoint roundedAdjustedPoint = roundedIntPoint(location); > Frame& mainframe = m_page->mainFrame(); > >+ LOG_WITH_STREAM(ContentObservation, stream << "handleSyntheticClick: node(" << nodeRespondingToClick << ") " << location); > WKStartObservingContentChanges(); > WKStartObservingDOMTimerScheduling(); > >@@ -553,13 +554,16 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F > switch (WKObservedContentChange()) { > case WKContentVisibilityChange: > // The move event caused new contents to appear. Don't send the click event. >+ LOG(ContentObservation, "handleSyntheticClick: Observed meaningful visible change -> hover."); > return; > case WKContentIndeterminateChange: > // Wait for callback to completePendingSyntheticClickForContentChangeObserver() to decide whether to send the click event. > m_pendingSyntheticClickNode = nodeRespondingToClick; > m_pendingSyntheticClickLocation = location; >+ LOG(ContentObservation, "handleSyntheticClick: Observed some change, but can't decide it yet -> wait."); > return; > case WKContentNoChange: >+ LOG(ContentObservation, "handleSyntheticClick: No change was observed -> click."); > completeSyntheticClick(nodeRespondingToClick, location, WebCore::OneFingerTap); > return; > } >@@ -568,11 +572,15 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F > > void WebPage::completePendingSyntheticClickForContentChangeObserver() > { >+ LOG_WITH_STREAM(ContentObservation, stream << "completePendingSyntheticClickForContentChangeObserver: pending target node(" << m_pendingSyntheticClickNode << ")"); > if (!m_pendingSyntheticClickNode) > return; > // Only dispatch the click if the document didn't get changed by any timers started by the move event. >- if (WKObservedContentChange() == WKContentNoChange) >+ if (WKObservedContentChange() == WKContentNoChange) { >+ LOG(ContentObservation, "No chage was observed -> click."); > completeSyntheticClick(m_pendingSyntheticClickNode.get(), m_pendingSyntheticClickLocation, WebCore::OneFingerTap); >+ } else >+ LOG(ContentObservation, "Observed meaningful visible change -> hover."); > > m_pendingSyntheticClickNode = nullptr; > m_pendingSyntheticClickLocation = FloatPoint();
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192312
:
356383
| 356389