Changeset 168108 in webkit


Ignore:
Timestamp:
May 1, 2014 10:48:38 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Grid Layout] Clamping the number of repetitions in repeat()
https://bugs.webkit.org/show_bug.cgi?id=131023

Patch by Javier Fernandez <jfernandez@igalia.com> on 2014-05-01
Reviewed by Brent Fulgham.

Source/WebCore:
The ED suggests now to be able to clamp the number of repetitions when
using the repeat() function, taking precautions about excessive memory
usage.

The implemented max repetitions is 10K.

Test: fast/css-grid-layout/grid-element-repeat-max-repetitions.html

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseGridTrackRepeatFunction):

LayoutTests:
Test to ensure the number of repetitions used in the repeat() function
is clamped to 10K.

  • fast/css-grid-layout/grid-element-repeat-max-repetitions-expected.txt: Added.
  • fast/css-grid-layout/grid-element-repeat-max-repetitions.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r168107 r168108  
     12014-05-01  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        [CSS Grid Layout] Clamping the number of repetitions in repeat()
     4        https://bugs.webkit.org/show_bug.cgi?id=131023
     5
     6        Reviewed by Brent Fulgham.
     7
     8        Test to ensure the number of repetitions used in the repeat() function
     9        is clamped to 10K.
     10
     11        * fast/css-grid-layout/grid-element-repeat-max-repetitions-expected.txt: Added.
     12        * fast/css-grid-layout/grid-element-repeat-max-repetitions.html: Added.
     13
    1142014-05-01  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r168099 r168108  
     12014-05-01  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        [CSS Grid Layout] Clamping the number of repetitions in repeat()
     4        https://bugs.webkit.org/show_bug.cgi?id=131023
     5
     6        Reviewed by Brent Fulgham.
     7
     8        The ED suggests now to be able to clamp the number of repetitions when
     9        using the repeat() function, taking precautions about excessive memory
     10        usage.
     11
     12        The implemented max repetitions is 10K.
     13
     14        Test: fast/css-grid-layout/grid-element-repeat-max-repetitions.html
     15
     16        * css/CSSParser.cpp:
     17        (WebCore::CSSParser::parseGridTrackRepeatFunction):
     18
    1192014-04-30  Jer Noble  <jer.noble@apple.com>
    220
  • trunk/Source/WebCore/css/CSSParser.cpp

    r167877 r168108  
    151151static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
    152152static const double MAX_SCALE = 1000000;
     153static const unsigned MAX_GRID_TRACK_REPETITIONS = 10000;
    153154
    154155template <unsigned N>
     
    50385039    ASSERT_WITH_SECURITY_IMPLICATION(arguments->valueAt(0)->fValue > 0);
    50395040    size_t repetitions = arguments->valueAt(0)->fValue;
     5041    // Clamp repetitions at MAX_GRID_TRACK_REPETITIONS.
     5042    // http://www.w3.org/TR/css-grid-1/#repeat-notation
     5043    if (repetitions > MAX_GRID_TRACK_REPETITIONS)
     5044        repetitions = MAX_GRID_TRACK_REPETITIONS;
    50405045    RefPtr<CSSValueList> repeatedValues = CSSValueList::createSpaceSeparated();
    50415046    arguments->next(); // Skip the repetition count.
Note: See TracChangeset for help on using the changeset viewer.