Changeset 112197 in webkit


Ignore:
Timestamp:
Mar 26, 2012 7:42:48 PM (12 years ago)
Author:
shinyak@chromium.org
Message:

Triggers assertion if dragging from outside of <meter> in a shadow tree to inside of it.
https://bugs.webkit.org/show_bug.cgi?id=82177

Reviewed by Dimitri Glazkov.

Source/WebCore:

VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries has moved the start position or
the end position to the invalid position, i.e. position after (before) the non-existing node.

This patch fixes the problem, and adds assertion that the selection does not cross shadow boundaries.

Test: fast/dom/shadow/drag-to-meter-in-shadow-crash.html

  • editing/VisibleSelection.cpp:

(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):

LayoutTests:

  • fast/dom/shadow/drag-to-meter-in-shadow-crash-expected.txt: Added.
  • fast/dom/shadow/drag-to-meter-in-shadow-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r112190 r112197  
     12012-03-26  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        Triggers assertion if dragging from outside of <meter> in a shadow tree to inside of it.
     4        https://bugs.webkit.org/show_bug.cgi?id=82177
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * fast/dom/shadow/drag-to-meter-in-shadow-crash-expected.txt: Added.
     9        * fast/dom/shadow/drag-to-meter-in-shadow-crash.html: Added.
     10
    1112012-03-26  Adam Barth  <abarth@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r112196 r112197  
     12012-03-26  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        Triggers assertion if dragging from outside of <meter> in a shadow tree to inside of it.
     4        https://bugs.webkit.org/show_bug.cgi?id=82177
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries has moved the start position or
     9        the end position to the invalid position, i.e. position after (before) the non-existing node.
     10
     11        This patch fixes the problem, and adds assertion that the selection does not cross shadow boundaries.
     12
     13        Test: fast/dom/shadow/drag-to-meter-in-shadow-crash.html
     14
     15        * editing/VisibleSelection.cpp:
     16        (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):
     17
    1182012-03-26  Scott Byer  <scottbyer@chromium.org>
    219
  • trunk/Source/WebCore/editing/VisibleSelection.cpp

    r102252 r112197  
    472472
    473473    if (m_baseIsFirst) {
    474         m_extent = startRootNode ? lastPositionInNode(startRootNode) : positionBeforeNode(endRootNode->shadowAncestorNode());
     474        m_extent = startRootNode ? lastPositionInOrAfterNode(startRootNode) : positionBeforeNode(endRootNode->shadowAncestorNode());
    475475        m_end = m_extent;
    476476    } else {
    477         m_extent = endRootNode ? firstPositionInNode(endRootNode) : positionAfterNode(startRootNode->shadowAncestorNode());
     477        m_extent = endRootNode ? firstPositionInOrBeforeNode(endRootNode) : positionAfterNode(startRootNode->shadowAncestorNode());
    478478        m_start = m_extent;
    479479    }
     480
     481    ASSERT(m_start.anchorNode()->treeScope() == m_end.anchorNode()->treeScope());
    480482}
    481483
Note: See TracChangeset for help on using the changeset viewer.