Changeset 160979 in webkit


Ignore:
Timestamp:
Dec 22, 2013 10:15:41 AM (10 years ago)
Author:
mihnea@adobe.com
Message:

[CSSRegions] Crash when trying to select content from invalid region
https://bugs.webkit.org/show_bug.cgi?id=126113

Reviewed by Antti Koivisto.

Source/WebCore:

After fix for https://bugs.webkit.org/show_bug.cgi?id=120769, positionForPoint for a region attempts to use the associated named flow to perform its task.
However, this should happen only when the region is valid. If the region is invalid, part of a dependency cycle, positionForPoint should behave as usual
for a block instead of a region, otherwise it may run into an infinite loop due to cyclic dependencies and a crash will occur.

This patch ensures that positionForPoint region specifie behaviour is followed only if the region is valid - not part of a dependency cycle.

Test: fast/regions/selection/invalid-region-selection-crash.html

  • rendering/RenderRegion.cpp:

(WebCore::RenderRegion::positionForPoint):

LayoutTests:

  • fast/regions/selection/invalid-region-selection-crash-expected.txt: Added.
  • fast/regions/selection/invalid-region-selection-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160978 r160979  
     12013-12-22  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Crash when trying to select content from invalid region
     4        https://bugs.webkit.org/show_bug.cgi?id=126113
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/regions/selection/invalid-region-selection-crash-expected.txt: Added.
     9        * fast/regions/selection/invalid-region-selection-crash.html: Added.
     10
    1112013-12-22  Mihnea Ovidenie  <mihnea@adobe.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r160973 r160979  
     12013-12-22  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSSRegions] Crash when trying to select content from invalid region
     4        https://bugs.webkit.org/show_bug.cgi?id=126113
     5
     6        Reviewed by Antti Koivisto.
     7
     8        After fix for https://bugs.webkit.org/show_bug.cgi?id=120769, positionForPoint for a region attempts to use the associated named flow to perform its task.
     9        However, this should happen only when the region is valid. If the region is invalid, part of a dependency cycle, positionForPoint should behave as usual
     10        for a block instead of a region, otherwise it may run into an infinite loop due to cyclic dependencies and a crash will occur.
     11
     12        This patch ensures that positionForPoint region specifie behaviour is followed only if the region is valid - not part of a dependency cycle.
     13
     14        Test: fast/regions/selection/invalid-region-selection-crash.html
     15
     16        * rendering/RenderRegion.cpp:
     17        (WebCore::RenderRegion::positionForPoint):
     18
    1192013-12-21  Dirk Schulze  <krit@webkit.org>
    220
  • trunk/Source/WebCore/rendering/RenderRegion.cpp

    r159745 r160979  
    113113VisiblePosition RenderRegion::positionForPoint(const LayoutPoint& point)
    114114{
    115     if (!m_flowThread->firstChild()) // checking for empty region blocks.
     115    ASSERT(m_flowThread);
     116    if (!isValid() || !m_flowThread->firstChild()) // checking for empty region blocks.
    116117        return RenderBlock::positionForPoint(point);
    117118
Note: See TracChangeset for help on using the changeset viewer.