Changeset 148672 in webkit


Ignore:
Timestamp:
Apr 18, 2013 6:37:24 AM (11 years ago)
Author:
allan.jensen@digia.com
Message:

Unset :hover in inner documents
https://bugs.webkit.org/show_bug.cgi?id=114446

Reviewed by Antonio Gomes.

Source/WebCore:

Fixes a regression from r145126 where hover nodes in inner documents was sometimes
not unset. Additionally it uses the new api from r145126 to avoid an unnecessary
hit test in touch-event handling.

Test: fast/events/touch/frame-hover-update.html

  • dom/Document.cpp:

(WebCore::Document::updateHoverActiveState):

  • page/EventHandler.cpp:

(WebCore::shouldGesturesTriggerActive):
(WebCore::EventHandler::handleTouchEvent):

LayoutTests:

Test expected effect of touch events on hover state.

  • fast/events/touch/frame-hover-update-expected.txt: Added.
  • fast/events/touch/frame-hover-update.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148664 r148672  
     12013-04-18  Allan Sandfeld Jensen  <allan.jensen@digia.com>
     2
     3        Unset :hover in inner documents
     4        https://bugs.webkit.org/show_bug.cgi?id=114446
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Test expected effect of touch events on hover state.
     9
     10        * fast/events/touch/frame-hover-update-expected.txt: Added.
     11        * fast/events/touch/frame-hover-update.html: Added.
     12
    1132013-04-18  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r148668 r148672  
     12013-04-18  Allan Sandfeld Jensen  <allan.jensen@digia.com>
     2
     3        Unset :hover in inner documents
     4        https://bugs.webkit.org/show_bug.cgi?id=114446
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Fixes a regression from r145126 where hover nodes in inner documents was sometimes
     9        not unset. Additionally it uses the new api from r145126 to avoid an unnecessary
     10        hit test in touch-event handling.
     11
     12        Test: fast/events/touch/frame-hover-update.html
     13
     14        * dom/Document.cpp:
     15        (WebCore::Document::updateHoverActiveState):
     16        * page/EventHandler.cpp:
     17        (WebCore::shouldGesturesTriggerActive):
     18        (WebCore::EventHandler::handleTouchEvent):
     19
    1202013-04-18  Seokju Kwon  <seokju.kwon@gmail.com>
    221
  • trunk/Source/WebCore/dom/Document.cpp

    r148618 r148672  
    59825982                nodesToRemoveFromChain.append(curr->node());
    59835983        }
     5984        // Unset hovered nodes in sub frame documents if the old hovered node was a frame owner.
     5985        if (oldHoverNode && oldHoverNode->isFrameOwnerElement()) {
     5986            if (Document* contentDocument = toFrameOwnerElement(oldHoverNode.get())->contentDocument())
     5987                contentDocument->updateHoverActiveState(request, 0);
     5988        }
    59845989    }
    59855990
  • trunk/Source/WebCore/page/EventHandler.cpp

    r148211 r148672  
    282282}
    283283
    284 #if ENABLE(GESTURE_EVENTS)
    285284static inline bool shouldGesturesTriggerActive()
    286285{
     
    290289    return false;
    291290}
    292 #endif
    293291
    294292#if !PLATFORM(MAC)
     
    39333931        }
    39343932
    3935 #if ENABLE(GESTURE_EVENTS)
    39363933        if (shouldGesturesTriggerActive())
    39373934            hitType |= HitTestRequest::ReadOnly;
    3938 #endif
    39393935
    39403936        // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
     
    39763972            touchTarget = node;
    39773973        } else if (pointState == PlatformTouchPoint::TouchReleased || pointState == PlatformTouchPoint::TouchCancelled) {
    3978             // We only perform a hittest on release or cancel to unset :active or :hover state.
    3979             if (touchPointTargetKey == m_originatingTouchPointTargetKey) {
    3980                 hitTestResultAtPoint(pagePoint, hitType);
     3974            // No need to perform a hit-test since we only need to unset :hover and :active states.
     3975            if (!shouldGesturesTriggerActive() && allTouchReleased)
     3976                m_frame->document()->updateHoverActiveState(hitType, 0);
     3977            if (touchPointTargetKey == m_originatingTouchPointTargetKey)
    39813978                m_originatingTouchPointTargetKey = 0;
    3982             } else if (m_originatingTouchPointDocument.get() && m_originatingTouchPointDocument->frame()) {
    3983                 LayoutPoint pagePointInOriginatingDocument = documentPointForWindowPoint(m_originatingTouchPointDocument->frame(), point.pos());
    3984                 hitTestResultInFrame(m_originatingTouchPointDocument->frame(), pagePointInOriginatingDocument, hitType);
    3985             }
     3979
    39863980            // The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel
    39873981            // we also remove it from the map.
Note: See TracChangeset for help on using the changeset viewer.