Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d1773079b63ba93655cb0eb892b549241c9b87be
      
https://github.com/WebKit/WebKit/commit/d1773079b63ba93655cb0eb892b549241c9b87be
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-13 (Sun, 13 Sep 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/geometry/DOMPoint-matrixTransform-translation-w-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/geometry/DOMPoint-matrixTransform-translation-w.html
    M Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp

  Log Message:
  -----------
  TransformationMatrix::map4ComponentPoint() ignores w in the 
identity/translation fast path
https://bugs.webkit.org/show_bug.cgi?id=324067
rdar://187297446

Reviewed by Simon Fraser.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

map4ComponentPoint() has a fast path for identity/translation matrices that
adds the translation directly to x, y, and z. This effectively assumes w == 1
and disagrees with the general v4MulPointByMatrix() path, which computes
x + w*tx, y + w*ty, z + w*tz for a translation matrix. As a result,
DOMMatrixReadOnly.transformPoint() and DOMPointReadOnly.matrixTransform()
produced incorrect coordinates whenever a translation (or identity+translation)
matrix was applied to a point whose w component was not 1.

Scale the translation by w in the fast path so it matches the general path.

Test: 
imported/w3c/web-platform-tests/css/geometry/DOMPoint-matrixTransform-translation-w.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/geometry/DOMPoint-matrixTransform-translation-w-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/geometry/DOMPoint-matrixTransform-translation-w.html:
 Added.
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::map4ComponentPoint const):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to