Commit 7467bb95 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Update comments and test mix-blend-mode on pattern

The working group recently resolved that mix-blend-mode should not
apply to never-rendered elements such as pattern, see:
https://github.com/w3c/fxtf-drafts/issues/309. This patch updates the
comment in LayoutObject::IsBlendingAllowed and adds a web platform test
(all browsers should pass this already). This removes the TODO added in
https://chromium-review.googlesource.com/c/chromium/src/+/1169624.

Change-Id: Ie74fd48075ae377636cb3efe93dd2fa6896fc534
Reviewed-on: https://chromium-review.googlesource.com/c/1303954Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603379}
parent 0a3af5bc
<!DOCTYPE html>
<div>Expected: a solid green square.</div>
<svg style="width: 200px; height: 200px; background: green;"></svg>
<!DOCTYPE html>
<title>'mix-blend-mode' for &lt;svg:pattern&gt;</title>
<link rel="help" href="https://www.w3.org/TR/SVG2/render.html#PaintersModel">
<link rel="help" href="https://github.com/w3c/fxtf-drafts/issues/309">
<link rel="match" href="filter-effects-on-pattern-ref.html">
<div>Expected: a solid green square.</div>
<svg style="width: 200px; height: 200px; background: green;">
<defs>
<pattern id="pattern" x="0" y="0" width=".25" height=".25" style="mix-blend-mode: difference;">
<rect x="0" y="0" width="25" height="25" fill="green"/>
</pattern>
</defs>
<rect fill="url(#pattern)" width="200" height="200"/>
</svg>
...@@ -749,8 +749,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -749,8 +749,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
bool IsBlendingAllowed() const { bool IsBlendingAllowed() const {
return !IsSVG() || IsSVGShape() || IsSVGImage() || IsSVGText() || return !IsSVG() || IsSVGShape() || IsSVGImage() || IsSVGText() ||
IsSVGInline() || IsSVGRoot() || IsSVGForeignObject() || IsSVGInline() || IsSVGRoot() || IsSVGForeignObject() ||
// TODO(pdr): According to the current spec, blending should apply to // Blending does not apply to non-renderable elements such as
// hidden containers (e.g. pattern). // patterns (see: https://github.com/w3c/fxtf-drafts/issues/309).
(IsSVGContainer() && !IsSVGHiddenContainer()); (IsSVGContainer() && !IsSVGHiddenContainer());
} }
virtual bool HasNonIsolatedBlendingDescendants() const { virtual bool HasNonIsolatedBlendingDescendants() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment