Changeset 186531 in webkit
- Timestamp:
- Jul 8, 2015, 4:02:43 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r186530 r186531 1 2015-07-07 Andy Estes <aestes@apple.com> 2 3 [iOS][WK2] Ignore synthetic clicks in subframes initiated on a previous page 4 https://bugs.webkit.org/show_bug.cgi?id=146712 5 6 Reviewed by Benjamin Poulain. 7 8 r178980 fixed an issue where, if a main frame navigation occurs in response to a touch event, a synthetic click 9 event could fire on the navigated-to page. This change extends this fix to apply to subframes. 10 11 * WebProcess/WebPage/WebFrame.cpp: 12 (WebKit::WebFrame::WebFrame): 13 * WebProcess/WebPage/WebFrame.h: 14 (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad): 15 (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad): 16 * WebProcess/WebPage/WebPage.cpp: 17 (WebKit::WebPage::didCommitLoad): Stored the next layer tree transaction ID, and called cancelPotentialTapInFrame(), for the committed frame. 18 * WebProcess/WebPage/WebPage.h: 19 * WebProcess/WebPage/ios/WebPageIOS.mm: 20 (WebKit::WebPage::handleTap): Determined the first post-commit layer tree transaction ID from the tap target node's frame. 21 (WebKit::WebPage::commitPotentialTap): Ditto. 22 (WebKit::WebPage::cancelPotentialTap): Called cancelPotentialTapInFrame(), passing m_mainFrame. 23 (WebKit::WebPage::cancelPotentialTapInFrame): Taught to only cancel a potential tap whose target node is a descendant of the given frame. 24 (WebKit::WebPage::updateVisibleContentRects): Updated to use the main frame's first post-commit layer tree transaction ID. 25 1 26 2015-07-08 Brady Eidson <beidson@apple.com> 2 27 -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
r183105 r186531 156 156 , m_loadListener(0) 157 157 , m_frameID(generateFrameID()) 158 #if PLATFORM(IOS) 159 , m_firstLayerTreeTransactionIDAfterDidCommitLoad(0) 160 #endif 158 161 { 159 162 m_frameLoaderClient->setWebFrame(this); -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h
r183105 r186531 156 156 PassRefPtr<ShareableBitmap> createSelectionSnapshot() const; 157 157 158 #if PLATFORM(IOS) 159 uint64_t firstLayerTreeTransactionIDAfterDidCommitLoad() const { return m_firstLayerTreeTransactionIDAfterDidCommitLoad; } 160 void setFirstLayerTreeTransactionIDAfterDidCommitLoad(uint64_t transactionID) { m_firstLayerTreeTransactionIDAfterDidCommitLoad = transactionID; } 161 #endif 162 158 163 private: 159 164 static PassRefPtr<WebFrame> create(std::unique_ptr<WebFrameLoaderClient>); … … 170 175 171 176 uint64_t m_frameID; 177 178 #if PLATFORM(IOS) 179 uint64_t m_firstLayerTreeTransactionIDAfterDidCommitLoad; 180 #endif 172 181 }; 173 182 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r186304 r186531 318 318 #if PLATFORM(IOS) 319 319 , m_selectionAnchor(Start) 320 , m_firstLayerTreeTransactionIDAfterDidCommitLoad(0)321 320 , m_hasReceivedVisibleContentRectsAfterDidCommitLoad(false) 322 321 , m_scaleWasSetByUIProcess(false) … … 4613 4612 void WebPage::didCommitLoad(WebFrame* frame) 4614 4613 { 4614 #if PLATFORM(IOS) 4615 frame->setFirstLayerTreeTransactionIDAfterDidCommitLoad(downcast<RemoteLayerTreeDrawingArea>(*m_drawingArea).nextTransactionID()); 4616 cancelPotentialTapInFrame(*frame); 4617 #endif 4618 4615 4619 if (!frame->isMainFrame()) 4616 4620 return; … … 4631 4635 m_hasReceivedVisibleContentRectsAfterDidCommitLoad = false; 4632 4636 m_scaleWasSetByUIProcess = false; 4633 m_firstLayerTreeTransactionIDAfterDidCommitLoad = downcast<RemoteLayerTreeDrawingArea>(*m_drawingArea).nextTransactionID();4634 4637 m_userHasChangedPageScaleFactor = false; 4635 4638 m_estimatedLatency = std::chrono::milliseconds(1000 / 60); 4636 cancelPotentialTap();4637 4639 4638 4640 #if ENABLE(IOS_TOUCH_EVENTS) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r186304 r186531 490 490 void commitPotentialTapFailed(); 491 491 void cancelPotentialTap(); 492 void cancelPotentialTapInFrame(WebFrame&); 492 493 void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&); 493 494 … … 1331 1332 1332 1333 WebCore::ViewportConfiguration m_viewportConfiguration; 1333 uint64_t m_firstLayerTreeTransactionIDAfterDidCommitLoad;1334 1334 bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad; 1335 1335 bool m_scaleWasSetByUIProcess; -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r186522 r186531 611 611 void WebPage::handleTap(const IntPoint& point, uint64_t lastLayerTreeTransactionId) 612 612 { 613 if (lastLayerTreeTransactionId < m_firstLayerTreeTransactionIDAfterDidCommitLoad) {614 send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(m_potentialTapLocation)));615 return;616 }617 618 613 FloatPoint adjustedPoint; 619 614 Node* nodeRespondingToClick = m_page->mainFrame().nodeRespondingToClickEvents(point, adjustedPoint); 620 handleSyntheticClick(nodeRespondingToClick, adjustedPoint); 615 Frame* frameRespondingToClick = nodeRespondingToClick ? nodeRespondingToClick->document().frame() : nullptr; 616 617 if (!frameRespondingToClick || lastLayerTreeTransactionId < WebFrame::fromCoreFrame(*frameRespondingToClick)->firstLayerTreeTransactionIDAfterDidCommitLoad()) 618 send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(m_potentialTapLocation))); 619 else 620 handleSyntheticClick(nodeRespondingToClick, adjustedPoint); 621 621 } 622 622 … … 665 665 void WebPage::commitPotentialTap(uint64_t lastLayerTreeTransactionId) 666 666 { 667 if (!m_potentialTapNode || !m_potentialTapNode->renderer() || lastLayerTreeTransactionId < m_firstLayerTreeTransactionIDAfterDidCommitLoad) {667 if (!m_potentialTapNode || !m_potentialTapNode->renderer()) { 668 668 commitPotentialTapFailed(); 669 669 return; … … 672 672 FloatPoint adjustedPoint; 673 673 Node* nodeRespondingToClick = m_page->mainFrame().nodeRespondingToClickEvents(m_potentialTapLocation, adjustedPoint); 674 Frame* frameRespondingToClick = nodeRespondingToClick ? nodeRespondingToClick->document().frame() : nullptr; 675 676 if (!frameRespondingToClick || lastLayerTreeTransactionId < WebFrame::fromCoreFrame(*frameRespondingToClick)->firstLayerTreeTransactionIDAfterDidCommitLoad()) { 677 commitPotentialTapFailed(); 678 return; 679 } 674 680 675 681 if (m_potentialTapNode == nodeRespondingToClick) … … 690 696 void WebPage::cancelPotentialTap() 691 697 { 698 cancelPotentialTapInFrame(*m_mainFrame); 699 } 700 701 void WebPage::cancelPotentialTapInFrame(WebFrame& frame) 702 { 703 if (m_potentialTapNode) { 704 Frame* potentialTapFrame = m_potentialTapNode->document().frame(); 705 if (potentialTapFrame && !potentialTapFrame->tree().isDescendantOf(frame.coreFrame())) 706 return; 707 } 708 692 709 m_potentialTapNode = nullptr; 693 710 m_potentialTapLocation = FloatPoint(); … … 2797 2814 { 2798 2815 // Skip any VisibleContentRectUpdate that have been queued before DidCommitLoad suppresses the updates in the UIProcess. 2799 if (visibleContentRectUpdateInfo.lastLayerTreeTransactionID() < m_ firstLayerTreeTransactionIDAfterDidCommitLoad)2816 if (visibleContentRectUpdateInfo.lastLayerTreeTransactionID() < m_mainFrame->firstLayerTreeTransactionIDAfterDidCommitLoad()) 2800 2817 return; 2801 2818
Note:
See TracChangeset
for help on using the changeset viewer.