Changeset 169273 in webkit


Ignore:
Timestamp:
May 23, 2014 12:01:27 PM (10 years ago)
Author:
mihnea@adobe.com
Message:

REGRESSION(r169105): fast/regions/cssom/region-range-for-box-crash.html is more crashy than before
https://bugs.webkit.org/show_bug.cgi?id=133124

Reviewed by David Hyatt.

Source/WebCore:
When adjusting the end points of a subtree selection in the case of a document
with named flows, we have to make sure that we pass the computed end
points to the visible selection algorithm only if the end points are
part of the same subtree, otherwise assume a selection clear behavior.

The test fast/regions/cssom/region-range-for-box-crash.html is used to
test this behavior.

  • rendering/SelectionSubtreeRoot.cpp:

(WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
(WebCore::SelectionSubtreeRoot::selectionStartEndPositions): Moved to header file.

  • rendering/SelectionSubtreeRoot.h:

(WebCore::SelectionSubtreeRoot::selectionStartEndPositions):

LayoutTests:
Unskip the test file that used to crash.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r169270 r169273  
     12014-05-23  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        REGRESSION(r169105): fast/regions/cssom/region-range-for-box-crash.html is more crashy than before
     4        https://bugs.webkit.org/show_bug.cgi?id=133124
     5
     6        Reviewed by David Hyatt.
     7
     8        Unskip the test file that used to crash.
     9
     10        * TestExpectations:
     11
    1122014-05-23  Mark Hahnenberg  <mhahnenberg@apple.com>
    213
  • trunk/LayoutTests/TestExpectations

    r169117 r169273  
    123123webkit.org/b/132791 svg/as-object/sizing/svg-in-object-placeholder-height-auto.html [ Skip ]
    124124
    125 webkit.org/b/133124 fast/regions/cssom/region-range-for-box-crash.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r169264 r169273  
     12014-05-23  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        REGRESSION(r169105): fast/regions/cssom/region-range-for-box-crash.html is more crashy than before
     4        https://bugs.webkit.org/show_bug.cgi?id=133124
     5
     6        Reviewed by David Hyatt.
     7
     8        When adjusting the end points of a subtree selection in the case of a document
     9        with named flows, we have to make sure that we pass the computed end
     10        points to the visible selection algorithm only if the end points are
     11        part of the same subtree, otherwise assume a selection clear behavior.
     12
     13        The test fast/regions/cssom/region-range-for-box-crash.html is used to
     14        test this behavior.
     15
     16        * rendering/SelectionSubtreeRoot.cpp:
     17        (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
     18        (WebCore::SelectionSubtreeRoot::selectionStartEndPositions): Moved to header file.
     19        * rendering/SelectionSubtreeRoot.h:
     20        (WebCore::SelectionSubtreeRoot::selectionStartEndPositions):
     21
    1222014-05-23  Jeremy Jones  <jeremyj@apple.com>
    223
  • trunk/Source/WebCore/rendering/SelectionSubtreeRoot.cpp

    r169105 r169273  
    4646}
    4747
    48 void SelectionSubtreeRoot::selectionStartEndPositions(int& startPos, int& endPos) const
    49 {
    50     startPos = m_selectionStartPos;
    51     endPos = m_selectionEndPos;
    52 }
    53 
    5448void SelectionSubtreeRoot::adjustForVisibleSelection(Document& document)
    5549{
     
    7872    m_selectionEndPos = -1;
    7973
    80     if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() != selection.visibleEnd()) {
     74    if (startPos.isNotNull()
     75        && endPos.isNotNull()
     76        && selection.visibleStart() != selection.visibleEnd()
     77        && startPos.deprecatedNode()->renderer()->flowThreadContainingBlock() == endPos.deprecatedNode()->renderer()->flowThreadContainingBlock()) {
    8178        m_selectionStart = startPos.deprecatedNode()->renderer();
    8279        m_selectionStartPos = startPos.deprecatedEditingOffset();
  • trunk/Source/WebCore/rendering/SelectionSubtreeRoot.h

    r169105 r169273  
    4646    RenderObject* selectionEnd() const { return m_selectionEnd; }
    4747    int selectionEndPos() const { return m_selectionEndPos; }
    48     void selectionStartEndPositions(int& startPos, int& endPos) const;
     48    void selectionStartEndPositions(int& startPos, int& endPos) const
     49    {
     50        startPos = m_selectionStartPos;
     51        endPos = m_selectionEndPos;
     52    }
     53
    4954    bool selectionClear() const
    5055    {
Note: See TracChangeset for help on using the changeset viewer.