Changeset 179826 in webkit


Ignore:
Timestamp:
Feb 9, 2015 6:05:49 AM (9 years ago)
Author:
svillar@igalia.com
Message:

ASSERTION FAILED: resolvedInitialPosition <= resolvedFinalPosition in WebCore::GridSpan::GridSpan
https://bugs.webkit.org/show_bug.cgi?id=141328

Reviewed by Darin Adler.

.:

Added as manual test because it involves a huge grid allocation
which is very slow on Debug bots, the only ones capable to trigger
the assertion.

  • ManualTests/css-grid-layout-item-with-huge-span-crash.html: Added.

Source/WebCore:

Whenever
GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition()
was trying to place an item with span, it was completely ignoring
the resolvedInitialPosition returned by
GridResolvedPosition::resolveGridPositionAgainstOppositePosition()
and only using the finalResolvedPosition. This works with an
unlimited grid which can indefinitely grow. But if the item spans
over the grid track limits, then it might happen that the final
resolved position is placed before the initial resolved position,
something that is forbidden.

The solution is to directly use the GridSpan returned by
GridResolvedPosition::resolveGridPositionAgainstOppositePosition(), if the item
does not surpass the track limits then the returned initialResolvedPosition
is identical to the provided one, otherwise it's properly corrected to respect
track boundaries.

  • rendering/style/GridResolvedPosition.cpp:

(WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r179687 r179826  
     12015-02-09  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        ASSERTION FAILED: resolvedInitialPosition <= resolvedFinalPosition in WebCore::GridSpan::GridSpan
     4        https://bugs.webkit.org/show_bug.cgi?id=141328
     5
     6        Reviewed by Darin Adler.
     7
     8        Added as manual test because it involves a huge grid allocation
     9        which is very slow on Debug bots, the only ones capable to trigger
     10        the assertion.
     11
     12        * ManualTests/css-grid-layout-item-with-huge-span-crash.html: Added.
     13
    1142015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r179824 r179826  
     12015-02-06  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        ASSERTION FAILED: resolvedInitialPosition <= resolvedFinalPosition in WebCore::GridSpan::GridSpan
     4        https://bugs.webkit.org/show_bug.cgi?id=141328
     5
     6        Reviewed by Darin Adler.
     7
     8        Whenever
     9        GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition()
     10        was trying to place an item with span, it was completely ignoring
     11        the resolvedInitialPosition returned by
     12        GridResolvedPosition::resolveGridPositionAgainstOppositePosition()
     13        and only using the finalResolvedPosition. This works with an
     14        unlimited grid which can indefinitely grow. But if the item spans
     15        over the grid track limits, then it might happen that the final
     16        resolved position is placed before the initial resolved position,
     17        something that is forbidden.
     18
     19        The solution is to directly use the GridSpan returned by
     20        GridResolvedPosition::resolveGridPositionAgainstOppositePosition(), if the item
     21        does not surpass the track limits then the returned initialResolvedPosition
     22        is identical to the provided one, otherwise it's properly corrected to respect
     23        track boundaries.
     24
     25        * rendering/style/GridResolvedPosition.cpp:
     26        (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
     27
    1282015-01-22  Sergio Villar Senin  <svillar@igalia.com>
    229
  • trunk/Source/WebCore/rendering/style/GridResolvedPosition.cpp

    r177858 r179826  
    7979
    8080    if (initialPosition.isSpan())
    81         resolvedFinalPosition = resolveGridPositionAgainstOppositePosition(gridContainerStyle, resolvedInitialPosition, initialPosition, finalPositionSide)->resolvedFinalPosition;
     81        return *resolveGridPositionAgainstOppositePosition(gridContainerStyle, resolvedInitialPosition, initialPosition, finalPositionSide);
    8282    else if (finalPosition.isSpan())
    83         resolvedFinalPosition = resolveGridPositionAgainstOppositePosition(gridContainerStyle, resolvedInitialPosition, finalPosition, finalPositionSide)->resolvedFinalPosition;
     83        return *resolveGridPositionAgainstOppositePosition(gridContainerStyle, resolvedInitialPosition, finalPosition, finalPositionSide);
    8484
    8585    return GridSpan(resolvedInitialPosition, resolvedFinalPosition);
Note: See TracChangeset for help on using the changeset viewer.