Changeset 201292 in webkit


Ignore:
Timestamp:
May 23, 2016 1:25:03 PM (8 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r200414.

This change appears to have broken the 'write a reply' field
on Nextdoor.com

Reverted changeset:

"Clicks inside button elements are sometimes discarded when
the mouse moves"
https://bugs.webkit.org/show_bug.cgi?id=39620
http://trac.webkit.org/changeset/200414

Location:
trunk
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201289 r201292  
     12016-05-23  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r200414.
     4
     5        This change appears to have broken the 'write a reply' field
     6        on Nextdoor.com
     7
     8        Reverted changeset:
     9
     10        "Clicks inside button elements are sometimes discarded when
     11        the mouse moves"
     12        https://bugs.webkit.org/show_bug.cgi?id=39620
     13        http://trac.webkit.org/changeset/200414
     14
    1152016-05-23  Ryan Haddad  <ryanhaddad@apple.com>
    216
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r201237 r201292  
    16551655fast/events/tab-focus-link-in-canvas.html [ Failure ]
    16561656fast/events/tabindex-focus-blur-all.html [ Failure ]
    1657 fast/events/click-over-descendant-elements.html [ Failure ]
    16581657
    16591658# Ref-test imported from W3C that is failing because type=image input elements have rounded corners on iOS.
  • trunk/Source/WebCore/ChangeLog

    r201290 r201292  
     12016-05-23  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r200414.
     4
     5        This change appears to have broken the 'write a reply' field
     6        on Nextdoor.com
     7
     8        Reverted changeset:
     9
     10        "Clicks inside button elements are sometimes discarded when
     11        the mouse moves"
     12        https://bugs.webkit.org/show_bug.cgi?id=39620
     13        http://trac.webkit.org/changeset/200414
     14
    1152016-05-23  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/dom/Node.cpp

    r201205 r201292  
    938938}
    939939
    940 static inline Node* ancestor(Node* node, unsigned depth)
    941 {
    942     for (unsigned i = 0; i < depth; ++i)
    943         node = node->parentNode();
    944     return node;
    945 }
    946 
    947 Node* commonAncestor(Node& thisNode, Node& otherNode)
    948 {
    949     unsigned thisDepth = 0;
    950     for (auto node = &thisNode; node; node = node->parentNode()) {
    951         if (node == &otherNode)
    952             return node;
    953         thisDepth++;
    954     }
    955     unsigned otherDepth = 0;
    956     for (auto node = &otherNode; node; node = node->parentNode()) {
    957         if (node == &thisNode)
    958             return &thisNode;
    959         otherDepth++;
    960     }
    961 
    962     Node* thisAncestor = &thisNode;
    963     Node* otherAncestor = &otherNode;
    964     if (thisDepth > otherDepth)
    965         thisAncestor = ancestor(thisAncestor, thisDepth - otherDepth);
    966     else if (otherDepth > thisDepth)
    967         otherAncestor = ancestor(otherAncestor, otherDepth - thisDepth);
    968 
    969     for (; thisAncestor; thisAncestor = thisAncestor->parentNode()) {
    970         if (thisAncestor == otherAncestor)
    971             return thisAncestor;
    972         otherAncestor = otherAncestor->parentNode();
    973     }
    974     ASSERT(!otherAncestor);
    975     return nullptr;
    976 }
    977 
    978 Node* commonAncestorCrossingShadowBoundary(Node& node, Node& other)
    979 {
    980     if (&node == &other)
    981         return &node;
    982 
    983     Element* shadowHost = node.shadowHost();
    984     // FIXME: This test might be wrong for user-authored shadow trees.
    985     if (shadowHost && shadowHost == other.shadowHost())
    986         return shadowHost;
    987 
    988     TreeScope* scope = commonTreeScope(&node, &other);
    989     if (!scope)
    990         return nullptr;
    991 
    992     Node* parentNode = scope->ancestorInThisScope(&node);
    993     ASSERT(parentNode);
    994     Node* parentOther = scope->ancestorInThisScope(&other);
    995     ASSERT(parentOther);
    996     return commonAncestor(*parentNode, *parentOther);
    997 }
    998 
    999940Node* Node::pseudoAwarePreviousSibling() const
    1000941{
  • trunk/Source/WebCore/dom/Node.h

    r200964 r201292  
    785785#endif
    786786
    787 Node* commonAncestor(Node&, Node&);
    788 Node* commonAncestorCrossingShadowBoundary(Node&, Node&);
    789 
    790787} // namespace WebCore
    791788
  • trunk/Source/WebCore/page/EventHandler.cpp

    r201213 r201292  
    19561956}
    19571957
     1958static Node* targetNodeForClickEvent(Node* mousePressNode, Node* mouseReleaseNode)
     1959{
     1960    if (!mousePressNode || !mouseReleaseNode)
     1961        return nullptr;
     1962
     1963    if (mousePressNode == mouseReleaseNode)
     1964        return mouseReleaseNode;
     1965
     1966    Element* mouseReleaseShadowHost = mouseReleaseNode->shadowHost();
     1967    if (mouseReleaseShadowHost && mouseReleaseShadowHost == mousePressNode->shadowHost()) {
     1968        // We want to dispatch the click to the shadow tree host element to give listeners the illusion that the
     1969        // shadom tree is a single element. For example, we want to give the illusion that <input type="range">
     1970        // is a single element even though it is a composition of multiple shadom tree elements.
     1971        return mouseReleaseShadowHost;
     1972    }
     1973    return nullptr;
     1974}
     1975
    19581976bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& platformMouseEvent)
    19591977{
     
    20172035    bool contextMenuEvent = platformMouseEvent.button() == RightButton;
    20182036
    2019     Node* targetNode = mouseEvent.targetNode();
    2020     Node* nodeToClick = (m_clickNode && targetNode) ? commonAncestorCrossingShadowBoundary(*m_clickNode, *targetNode) : nullptr;
     2037    Node* nodeToClick = targetNodeForClickEvent(m_clickNode.get(), mouseEvent.targetNode());
    20212038    bool swallowClickEvent = m_clickCount > 0 && !contextMenuEvent && nodeToClick && !dispatchMouseEvent(eventNames().clickEvent, nodeToClick, true, m_clickCount, platformMouseEvent, true);
    20222039
Note: See TracChangeset for help on using the changeset viewer.