Changeset 246937 in webkit


Ignore:
Timestamp:
Jun 28, 2019 2:01:59 PM (5 years ago)
Author:
Alan Coon
Message:

Cherry-pick r246835. rdar://problem/51787961

[ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=199220
<rdar://problem/51787961>

Reviewed by Simon Fraser.

Source/WebKit:

WebPage::completePendingSyntheticClickForContentChangeObserver should not dispatch mouse events synchronously.
Mouse events, through style updates could destroy the element that initiated this change.
WebPage::handleSyntheticClick() already implements this pattern.

  • WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):

LayoutTests:

  • fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash-expected.txt: Added.
  • fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246835 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
tags/Safari-608.1.32.1
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • tags/Safari-608.1.32.1/LayoutTests/ChangeLog

    r246830 r246937  
     12019-06-28  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r246835. rdar://problem/51787961
     4
     5    [ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
     6    https://bugs.webkit.org/show_bug.cgi?id=199220
     7    <rdar://problem/51787961>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    Source/WebKit:
     12   
     13    WebPage::completePendingSyntheticClickForContentChangeObserver should not dispatch mouse events synchronously.
     14    Mouse events, through style updates could destroy the element that initiated this change.
     15    WebPage::handleSyntheticClick() already implements this pattern.
     16   
     17    * WebProcess/WebPage/ios/WebPageIOS.mm:
     18    (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
     19   
     20    LayoutTests:
     21   
     22    * fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash-expected.txt: Added.
     23    * fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash.html: Added.
     24   
     25   
     26    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     27
     28    2019-06-26  Zalan Bujtas  <zalan@apple.com>
     29
     30            [ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
     31            https://bugs.webkit.org/show_bug.cgi?id=199220
     32            <rdar://problem/51787961>
     33
     34            Reviewed by Simon Fraser.
     35
     36            * fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash-expected.txt: Added.
     37            * fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash.html: Added.
     38
    1392019-06-25  Russell Epstein  <russell_e@apple.com>
    240
  • tags/Safari-608.1.32.1/Source/WebKit/ChangeLog

    r246936 r246937  
     12019-06-28  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r246835. rdar://problem/51787961
     4
     5    [ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
     6    https://bugs.webkit.org/show_bug.cgi?id=199220
     7    <rdar://problem/51787961>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    Source/WebKit:
     12   
     13    WebPage::completePendingSyntheticClickForContentChangeObserver should not dispatch mouse events synchronously.
     14    Mouse events, through style updates could destroy the element that initiated this change.
     15    WebPage::handleSyntheticClick() already implements this pattern.
     16   
     17    * WebProcess/WebPage/ios/WebPageIOS.mm:
     18    (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
     19   
     20    LayoutTests:
     21   
     22    * fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash-expected.txt: Added.
     23    * fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash.html: Added.
     24   
     25   
     26    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     27
     28    2019-06-26  Zalan Bujtas  <zalan@apple.com>
     29
     30            [ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
     31            https://bugs.webkit.org/show_bug.cgi?id=199220
     32            <rdar://problem/51787961>
     33
     34            Reviewed by Simon Fraser.
     35
     36            WebPage::completePendingSyntheticClickForContentChangeObserver should not dispatch mouse events synchronously.
     37            Mouse events, through style updates could destroy the element that initiated this change.
     38            WebPage::handleSyntheticClick() already implements this pattern.
     39
     40            * WebProcess/WebPage/ios/WebPageIOS.mm:
     41            (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
     42
    1432019-06-28  Kocsen Chung  <kocsen_chung@apple.com>
    244
  • tags/Safari-608.1.32.1/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r246757 r246937  
    715715        return;
    716716    auto observedContentChange = m_pendingSyntheticClickNode->document().contentChangeObserver().observedContentChange();
    717     // Only dispatch the click if the document didn't get changed by any timers started by the move event.
    718     if (observedContentChange == WKContentNoChange) {
    719         LOG(ContentObservation, "No chage was observed -> click.");
    720         completeSyntheticClick(*m_pendingSyntheticClickNode, m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers, WebCore::OneFingerTap, m_pendingSyntheticClickPointerId);
    721     } else {
     717    callOnMainThread([protectedThis = makeRefPtr(this), targetNode = Ref<Node>(*m_pendingSyntheticClickNode), originalDocument = makeWeakPtr(m_pendingSyntheticClickNode->document()), observedContentChange, location = m_pendingSyntheticClickLocation, modifiers = m_pendingSyntheticClickModifiers, pointerId = m_pendingSyntheticClickPointerId] {
     718        if (protectedThis->m_isClosed || !protectedThis->corePage())
     719            return;
     720        if (!originalDocument || &targetNode->document() != originalDocument)
     721            return;
     722
     723        // Only dispatch the click if the document didn't get changed by any timers started by the move event.
     724        if (observedContentChange == WKContentNoChange) {
     725            LOG(ContentObservation, "No chage was observed -> click.");
     726            protectedThis->completeSyntheticClick(targetNode, location, modifiers, WebCore::OneFingerTap, pointerId);
     727            return;
     728        }
    722729        // Ensure that the mouse is on the most recent content.
    723         dispatchSyntheticMouseMove(m_page->mainFrame(), m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers, m_pendingSyntheticClickPointerId);
    724730        LOG(ContentObservation, "Observed meaningful visible change -> hover.");
    725     }
    726 
     731        dispatchSyntheticMouseMove(protectedThis->corePage()->mainFrame(), location, modifiers, pointerId);
     732    });
    727733    m_pendingSyntheticClickNode = nullptr;
    728     m_pendingSyntheticClickLocation = FloatPoint();
     734    m_pendingSyntheticClickLocation = { };
    729735    m_pendingSyntheticClickModifiers = { };
    730736    m_pendingSyntheticClickPointerId = 0;
Note: See TracChangeset for help on using the changeset viewer.