[webkit-changes] [WebKit/WebKit] c1c0e7: perspective calc() values aren't clipped to 0

Antoine Quint noreply at github.com
Mon Dec 12 23:47:22 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c1c0e7fbede03d23c5191147fbd385498a289301
      https://github.com/WebKit/WebKit/commit/c1c0e7fbede03d23c5191147fbd385498a289301
  Author: Antoine Quint <graouts at apple.com>
  Date:   2022-12-12 (Mon, 12 Dec 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/perspective-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/perspective-expected.txt
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp

  Log Message:
  -----------
  perspective calc() values aren't clipped to 0
https://bugs.webkit.org/show_bug.cgi?id=249151

Reviewed by Simon Fraser and Dean Jackson.

The "perspective" property is specified to only allow non-negative values,
see https://www.w3.org/TR/css-transforms-2/#perspective-property. However,
we don't clip values that are computed to less than 0, for instance using a
calc() expression. Instead, we deem them invalid internally and thus consider
as if "none" was provided, which has implications when blending. Indeed, when
interpolating between a valid value and "none", we use discrete interpolation.

We now correctly clip values below 0.

Note that the relevant WPT test still fails, because the test itself is not
valid. It is being addressed in a dedicated WPT PR and will be imported back
into WebKit yielding a PASS result. See https://github.com/web-platform-tests/wpt/pull/37457.

* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/perspective-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/responsive/perspective-expected.txt:
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumePerspective):

Canonical link: https://commits.webkit.org/257779@main




More information about the webkit-changes mailing list