Changeset 203684 in webkit


Ignore:
Timestamp:
Jul 25, 2016 9:03:31 AM (8 years ago)
Author:
Wenson Hsieh
Message:

The web process hangs when computing elements-based snap points for a container with large max scroll offset
https://bugs.webkit.org/show_bug.cgi?id=152605
<rdar://problem/25353661>

Reviewed by Simon Fraser.

Source/WebCore:

Fixes a bug in the computation of axis snap points. The ScrollSnapPoints object, which tracks
snap points along a particular axis, has two flags, hasRepeat and usesElements. For elements-
based snapping, both flags would be turned on, since StyleBuilderConverter::convertScrollSnapPoints
short-circuits for elements-based snapping and does not default usesRepeat to false. To address this,
we make ScrollSnapPoints not repeat(100%) by default.

Test: css3/scroll-snap/scroll-snap-elements-container-larger-than-children.html

  • css/StyleBuilderConverter.h:

(WebCore::StyleBuilderConverter::convertScrollSnapPoints): Deleted.

  • rendering/style/StyleScrollSnapPoints.cpp:

(WebCore::ScrollSnapPoints::ScrollSnapPoints):

LayoutTests:

Adds a scroll snap offset computation test case that would have previously
caused the web process to hang before this patch.

  • css3/scroll-snap/scroll-snap-elements-container-larger-than-children-expected.txt: Added.
  • css3/scroll-snap/scroll-snap-elements-container-larger-than-children.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r203680 r203684  
     12016-07-24  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        The web process hangs when computing elements-based snap points for a container with large max scroll offset
     4        https://bugs.webkit.org/show_bug.cgi?id=152605
     5        <rdar://problem/25353661>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Adds a scroll snap offset computation test case that would have previously
     10        caused the web process to hang before this patch.
     11
     12        * css3/scroll-snap/scroll-snap-elements-container-larger-than-children-expected.txt: Added.
     13        * css3/scroll-snap/scroll-snap-elements-container-larger-than-children.html: Added.
     14
    1152016-07-25  Sergio Villar Senin  <svillar@igalia.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r203683 r203684  
     12016-07-24  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        The web process hangs when computing elements-based snap points for a container with large max scroll offset
     4        https://bugs.webkit.org/show_bug.cgi?id=152605
     5        <rdar://problem/25353661>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Fixes a bug in the computation of axis snap points. The ScrollSnapPoints object, which tracks
     10        snap points along a particular axis, has two flags, hasRepeat and usesElements. For elements-
     11        based snapping, both flags would be turned on, since StyleBuilderConverter::convertScrollSnapPoints
     12        short-circuits for elements-based snapping and does not default usesRepeat to false. To address this,
     13        we make ScrollSnapPoints not repeat(100%) by default.
     14
     15        Test: css3/scroll-snap/scroll-snap-elements-container-larger-than-children.html
     16
     17        * css/StyleBuilderConverter.h:
     18        (WebCore::StyleBuilderConverter::convertScrollSnapPoints): Deleted.
     19        * rendering/style/StyleScrollSnapPoints.cpp:
     20        (WebCore::ScrollSnapPoints::ScrollSnapPoints):
     21
    1222016-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
    223
  • trunk/Source/WebCore/css/StyleBuilderConverter.h

    r202371 r203684  
    791791    }
    792792
    793     points->hasRepeat = false;
    794793    for (auto& currentValue : downcast<CSSValueList>(value)) {
    795794        auto& itemValue = downcast<CSSPrimitiveValue>(currentValue.get());
  • trunk/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp

    r181189 r203684  
    3232
    3333ScrollSnapPoints::ScrollSnapPoints()
    34     : repeatOffset(100, Percent)
    35     , hasRepeat(true)
     34    : repeatOffset(0, Fixed)
     35    , hasRepeat(false)
    3636    , usesElements(false)
    3737{
Note: See TracChangeset for help on using the changeset viewer.