Changeset 128222 in webkit


Ignore:
Timestamp:
Sep 11, 2012 1:36:16 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Crash on a long press gesture when touch adjustment is enabled.
https://bugs.webkit.org/show_bug.cgi?id=96313

Patch by Kevin Ellis <kevers@chromium.org> on 2012-09-11
Reviewed by Antonio Gomes.

Source/WebCore:

Fix to ensure that a long-press on a shadow-DOM element does not
trigger a crash in TouchAdjustment::providesContextMenuItems.
Prior to the patch, a null-pointer exception was trigger because
of a null renderer in the check.

Test: touchadjustment/context-menu-shadow-node.html

  • page/TouchAdjustment.cpp:

(WebCore::TouchAdjustment::providesContextMenuItems):

LayoutTests:

Add test to ensure that a long-press on a shadow DOM element does
not trigger a crash when determining if an element provides a context
menu.

  • touchadjustment/context-menu-shadow-node-expected.txt: Added.
  • touchadjustment/context-menu-shadow-node.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128221 r128222  
     12012-09-11  Kevin Ellis  <kevers@chromium.org>
     2
     3        Crash on a long press gesture when touch adjustment is enabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=96313
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Add test to ensure that a long-press on a shadow DOM element does
     9        not trigger a crash when determining if an element provides a context
     10        menu.
     11
     12        * touchadjustment/context-menu-shadow-node-expected.txt: Added.
     13        * touchadjustment/context-menu-shadow-node.html: Added.
     14
    1152012-09-11  Zan Dobersek  <zandobersek@gmail.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r128221 r128222  
     12012-09-11  Kevin Ellis  <kevers@chromium.org>
     2
     3        Crash on a long press gesture when touch adjustment is enabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=96313
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Fix to ensure that a long-press on a shadow-DOM element does not
     9        trigger a crash in TouchAdjustment::providesContextMenuItems.
     10        Prior to the patch, a null-pointer exception was trigger because
     11        of a null renderer in the check.
     12
     13        Test: touchadjustment/context-menu-shadow-node.html
     14
     15        * page/TouchAdjustment.cpp:
     16        (WebCore::TouchAdjustment::providesContextMenuItems):
     17
    1182012-09-11  Zan Dobersek  <zandobersek@gmail.com>
    219
  • trunk/Source/WebCore/page/TouchAdjustment.cpp

    r126284 r128222  
    9797    // This function tries to match the nodes that receive special context-menu items in
    9898    // ContextMenuController::populate(), and should be kept uptodate with those.
     99    ASSERT(node->renderer() || node->isShadowRoot());
     100    if (!node->renderer())
     101        return false;
    99102    if (node->isContentEditable())
    100103        return true;
     
    127130static inline void appendBasicSubtargetsForNode(Node* node, SubtargetGeometryList& subtargets)
    128131{
    129     // Since the node is a result of a hit test, we are already ensured it has a renderer.
     132    // Node guaranteed to have renderer due to check in node filter.
    130133    ASSERT(node->renderer());
    131134
Note: See TracChangeset for help on using the changeset viewer.