Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b90b184ba424183bfefa7869c29788d7ab391c9b
      
https://github.com/WebKit/WebKit/commit/b90b184ba424183bfefa7869c29788d7ab391c9b
  Author: Taher Ali <[email protected]>
  Date:   2026-08-31 (Mon, 31 Aug 2026)

  Changed paths:
    A 
LayoutTests/svg/css-link-params/link-parameters-background-image-expected.html
    A LayoutTests/svg/css-link-params/link-parameters-background-image.html
    A LayoutTests/svg/css-link-params/link-parameters-basic-expected.html
    A LayoutTests/svg/css-link-params/link-parameters-basic.html
    A 
LayoutTests/svg/css-link-params/link-parameters-duplicate-name-expected.html
    A LayoutTests/svg/css-link-params/link-parameters-duplicate-name.html
    A LayoutTests/svg/css-link-params/link-parameters-dynamic-expected.html
    A LayoutTests/svg/css-link-params/link-parameters-dynamic.html
    A LayoutTests/svg/css-link-params/link-parameters-fallback-expected.html
    A LayoutTests/svg/css-link-params/link-parameters-fallback.html
    A LayoutTests/svg/css-link-params/link-parameters-geometry-expected.html
    A LayoutTests/svg/css-link-params/link-parameters-geometry.html
    A LayoutTests/svg/css-link-params/link-parameters-none-expected.html
    A LayoutTests/svg/css-link-params/link-parameters-none.html
    A 
LayoutTests/svg/css-link-params/link-parameters-per-container-expected.html
    A LayoutTests/svg/css-link-params/link-parameters-per-container.html
    A LayoutTests/svg/css-link-params/resources/geometry.svg
    A LayoutTests/svg/css-link-params/resources/solid.svg
    M Source/WebCore/loader/cache/CachedImage.cpp
    M Source/WebCore/loader/cache/CachedImage.h
    M Source/WebCore/style/StyleDifference.cpp
    M Source/WebCore/style/StyleEnvironmentVariables.cpp
    M Source/WebCore/style/StyleEnvironmentVariables.h
    M Source/WebCore/style/StyleSubstitutionResolver.cpp
    M Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp
    M Source/WebCore/style/values/images/kinds/StyleCursorImage.cpp
    M Source/WebCore/svg/graphics/SVGImage.cpp
    M Source/WebCore/svg/graphics/SVGImage.h
    M Source/WebCore/svg/graphics/SVGImageCache.cpp
    M Source/WebCore/svg/graphics/SVGImageCache.h
    M Source/WebCore/svg/graphics/SVGImageForContainer.cpp
    M Source/WebCore/svg/graphics/SVGImageForContainer.h

  Log Message:
  -----------
  [css-link-params] Render SVG resources with link parameters
https://bugs.webkit.org/show_bug.cgi?id=322128
rdar://185355738

Reviewed by Antti Koivisto.

319240@main parses, computes and serializes the link-parameters property but 
does
not use the computed value, so it has no rendering effect. This PR makes it 
render
the parameters.

The most trivial form renders:
<style> img { link-parameters: param(--bg, green); } </style>
<img src="icon.svg"> <!-- icon.svg: fill="env(--bg, #111)" -->

There's a pre-existing architecture limitation: one resource
document (SVGImage) holds one container's parameters at a time, so
drawing restyles that document. We can reduce this cost by caching a
display list per container (webkit.org/b/322833) as a follow-up.

Tests: svg/css-link-params/link-parameters-background-image.html
       svg/css-link-params/link-parameters-basic.html
       svg/css-link-params/link-parameters-duplicate-name.html
       svg/css-link-params/link-parameters-dynamic.html
       svg/css-link-params/link-parameters-fallback.html
       svg/css-link-params/link-parameters-geometry.html
       svg/css-link-params/link-parameters-none.html
       svg/css-link-params/link-parameters-per-container.html

* 
LayoutTests/svg/css-link-params/link-parameters-background-image-expected.html: 
Added.
* LayoutTests/svg/css-link-params/link-parameters-background-image.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-basic-expected.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-basic.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-duplicate-name-expected.html: 
Added.
* LayoutTests/svg/css-link-params/link-parameters-duplicate-name.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-dynamic-expected.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-dynamic.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-fallback-expected.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-fallback.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-geometry-expected.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-geometry.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-none-expected.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-none.html: Added.
* LayoutTests/svg/css-link-params/link-parameters-per-container-expected.html: 
Added.
* LayoutTests/svg/css-link-params/link-parameters-per-container.html: Added.
* LayoutTests/svg/css-link-params/resources/geometry.svg: Added.
* LayoutTests/svg/css-link-params/resources/solid.svg: Added.
* Source/WebCore/loader/cache/CachedImage.cpp:
(WebCore::CachedImage::switchClientsToRevalidatedResource):
(WebCore::CachedImage::setContainerContextForClient):
(WebCore::CachedImage::createImage):
* Source/WebCore/loader/cache/CachedImage.h:
* Source/WebCore/style/StyleDifference.cpp:
* Source/WebCore/style/StyleEnvironmentVariables.cpp:
(WebCore::Style::EnvironmentVariables::uaDefinedValues const):
(WebCore::Style::EnvironmentVariables::valueForName const):
(WebCore::Style::EnvironmentVariables::setLinkParameters):
(WebCore::Style::EnvironmentVariables::values const): Deleted.
* Source/WebCore/style/StyleEnvironmentVariables.h:
* Source/WebCore/style/StyleSubstitutionResolver.cpp:
(WebCore::Style::SubstitutionResolver::propertyValueForVariableName):
* Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp:
(WebCore::Style::CachedImage::setContainerContextForRenderer):
* Source/WebCore/style/values/images/kinds/StyleCursorImage.cpp:
(WebCore::Style::CursorImage::setContainerContextForRenderer):
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::SVGImage):
(WebCore::SVGImage::drawForContainer):
(WebCore::SVGImage::applyLinkParameters):
(WebCore::SVGImage::drawPatternForContainer):
* Source/WebCore/svg/graphics/SVGImage.h:
* Source/WebCore/svg/graphics/SVGImageCache.cpp:
(WebCore::SVGImageCache::setContainerContextForClient):
* Source/WebCore/svg/graphics/SVGImageCache.h:
* Source/WebCore/svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::SVGImageForContainer):
(WebCore::SVGImageForContainer::draw):
(WebCore::SVGImageForContainer::drawPattern):
* Source/WebCore/svg/graphics/SVGImageForContainer.h:

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



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

Reply via email to