Changeset 273068 in webkit


Ignore:
Timestamp:
Feb 18, 2021 12:38:17 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

Treat <ratio> that ends with forward slash as invalid
https://bugs.webkit.org/show_bug.cgi?id=221978

Patch by Rob Buis <rbuis@igalia.com> on 2021-02-18
Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-sizing/aspect-ratio/parsing/aspect-ratio-invalid-expected.txt:
  • web-platform-tests/css/css-sizing/aspect-ratio/parsing/aspect-ratio-invalid.html:

Source/WebCore:

Treat <ratio> that ends with forward slash as invalid:
https://drafts.csswg.org/css-values-4/#ratio-value

Test: imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/parsing/aspect-ratio-invalid.html

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeAspectRatio):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r273065 r273068  
     12021-02-18  Rob Buis  <rbuis@igalia.com>
     2
     3        Treat <ratio> that ends with forward slash as invalid
     4        https://bugs.webkit.org/show_bug.cgi?id=221978
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        * web-platform-tests/css/css-sizing/aspect-ratio/parsing/aspect-ratio-invalid-expected.txt:
     9        * web-platform-tests/css/css-sizing/aspect-ratio/parsing/aspect-ratio-invalid.html:
     10
    1112021-02-17  Tyler Wilcock  <twilco.o@protonmail.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/parsing/aspect-ratio-invalid-expected.txt

    r272315 r273068  
    88PASS e.style['aspect-ratio'] = "invalid 1.5" should not set the property value
    99PASS e.style['aspect-ratio'] = "auto 1 / 1 auto" should not set the property value
     10PASS e.style['aspect-ratio'] = "16 /" should not set the property value
     11PASS e.style['aspect-ratio'] = "auto 16 /" should not set the property value
     12PASS e.style['aspect-ratio'] = "16 / auto" should not set the property value
    1013
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/parsing/aspect-ratio-invalid.html

    r272315 r273068  
    1717test_invalid_value("aspect-ratio", "invalid 1.5");
    1818test_invalid_value("aspect-ratio", "auto 1 / 1 auto");
     19test_invalid_value("aspect-ratio", "16 /");
     20test_invalid_value("aspect-ratio", "auto 16 /");
     21test_invalid_value("aspect-ratio", "16 / auto");
    1922</script>
  • trunk/Source/WebCore/ChangeLog

    r273067 r273068  
     12021-02-18  Rob Buis  <rbuis@igalia.com>
     2
     3        Treat <ratio> that ends with forward slash as invalid
     4        https://bugs.webkit.org/show_bug.cgi?id=221978
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        Treat <ratio> that ends with forward slash as invalid:
     9        https://drafts.csswg.org/css-values-4/#ratio-value
     10
     11        Test: imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/parsing/aspect-ratio-invalid.html
     12
     13        * css/parser/CSSPropertyParser.cpp:
     14        (WebCore::consumeAspectRatio):
     15
    1162021-02-18  Antoine Quint  <graouts@webkit.org>
    217
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r272870 r273068  
    39263926
    39273927    auto rightValue = consumeNumber(range, ValueRangeNonNegative);
    3928     if (rightValue && !slashSeen)
     3928    if ((rightValue && !slashSeen) || (!rightValue && slashSeen))
    39293929        return nullptr;
    39303930    if (!slashSeen && !rightValue) // A missing right-hand is treated as 1.
Note: See TracChangeset for help on using the changeset viewer.