Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c329236d6f8eb05d72d0aa0d262fbac2b4cb602d
      
https://github.com/WebKit/WebKit/commit/c329236d6f8eb05d72d0aa0d262fbac2b4cb602d
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-06-12 (Fri, 12 Jun 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedInteger-expected.txt
    M Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
    M Source/WebCore/svg/SVGFEConvolveMatrixElement.h

  Log Message:
  -----------
  SVGFEConvolveMatrixElement should reject invalid order attribute values
https://bugs.webkit.org/show_bug.cgi?id=304107
rdar://166438611

Reviewed by Taher Ali.

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

When the order attribute is set to an invalid value (e.g., negative numbers
or zero), the orderX and orderY SVG DOM getters return the initial value of 3
per WPT, rather than the invalid parsed value. But the filter must still fail
to render — otherwise an invalid order combined with a matching kernelMatrix
length would paint as if valid (e.g. order="-3" with a 9-element kernelMatrix
would otherwise succeed as order="3").

To satisfy both requirements, track the invalid state via a new
m_hasInvalidOrderAttribute flag, set when parsing produces a value < 1 and
cleared on a valid update. The DOM getters still report 3, while
createFilterEffect checks the flag and returns an empty IntSize so filter
creation fails.

Note: when a CSS filter reference fails, HTML elements still paint without
the filter (only SVG elements are suppressed via hasFailedFilterForSVG).
That discrepancy is pre-existing and out of scope for this patch.

* Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::attributeChanged):
(WebCore::SVGFEConvolveMatrixElement::createFilterEffect const):
* Source/WebCore/svg/SVGFEConvolveMatrixElement.h:
* 
LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedInteger-expected.txt:
 Progression

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



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

Reply via email to