Skip to content

Commit dc6cece

Browse files
committed
Link to external algorithms
1 parent 07518e5 commit dc6cece

File tree

1 file changed

+41
-36
lines changed

1 file changed

+41
-36
lines changed

source

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4085,6 +4085,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
40854085
<ul class="brief">
40864086
<li><dfn data-x-href="https://drafts.fxtf.org/filter-effects/#typedef-filter-value-list">&lt;filter-value-list&gt;</dfn></li>
40874087
<li><dfn data-x-href="https://drafts.fxtf.org/filter-effects/#filter-primitive-attributes">filter primitive attribute</dfn></li>
4088+
<li><dfn data-x-href="https://drafts.fxtf.org/filter-effects/#FilterProperty">filter
4089+
property</dfn></li>
40884090
</ul>
40894091
</dd>
40904092

@@ -60970,7 +60972,7 @@ typedef record&lt;DOMString, any> <dfn>CanvasFilterInput</dfn>;
6097060972

6097160973
[Exposed=(Window,Worker,PaintWorkletGlobalScope)]
6097260974
interface <dfn interface>CanvasFilter</dfn> {
60973-
<span data-x="dom-CanvasFilter">constructor</span>((<code>CanvasFilterInput</code> or sequence&lt;<code>CanvasFilterInput</code>>) filters);
60975+
<span data-x="dom-CanvasFilter">constructor</span>(optional (<code>CanvasFilterInput</code> or sequence&lt;<code>CanvasFilterInput</code>>) filters);
6097460976
};
6097560977

6097660978
interface mixin <dfn interface>CanvasRect</dfn> {
@@ -66041,12 +66043,11 @@ console.log(pixels.data[2]);
6604166043
data-x="dom-context-2d-filter">filter</code></dfn> attribute.</p>
6604266044

6604366045
<p>Such objects have an associated <dfn data-x="concept-canvas-current-filter">current
66044-
filter</dfn>, which is either "<code data-x="">none</code>", a
66045-
<span>&lt;filter-value-list&gt;</span>, or a <code>CanvasFilter</code>. Initially the <span
66046-
data-x="concept-canvas-current-filter">current filter</span> is set to "<code
66046+
filter</dfn>, which is either a string or a <code>CanvasFilter</code>. Initially the <span
66047+
data-x="concept-canvas-current-filter">current filter</span> is set to the string "<code
6604766048
data-x="">none</code>". Whenever the value of the <span
6604866049
data-x="concept-canvas-current-filter">current filter</span> is the string "<code
66049-
data-x="">none</code>", filters will be disabled for the context.</p>
66050+
data-x="">none</code>" filters will be disabled for the context.</p>
6605066051

6605166052
<p>A <span>&lt;filter-value-list&gt;</span> consists of a sequence of one or more filter
6605266053
functions or references to SVG filters. The input to the filter is used as the input to the first
@@ -66074,14 +66075,15 @@ console.log(pixels.data[2]);
6607466075
data-x="concept-canvas-current-filter">current filter</span> to "<code data-x="">none</code>"
6607566076
and return.</p></li>
6607666077

66077-
<li><p>Let <var>parsedValue</var> be the result of parsing the given values as a
66078-
<span>&lt;filter-value-list&gt;</span>. If any property-independent style sheet syntax like
66079-
'inherit' or 'initial' is present, then this parsing must return failure.</p></li>
66078+
<li><p>Let <var>parsedValue</var> be the result of <span data-x="parse something according to
66079+
a CSS grammar">parsing</span> the given values as a <span>&lt;filter-value-list&gt;</span>. If
66080+
any property-independent style sheet syntax like 'inherit' or 'initial' is present, then this
66081+
parsing must return failure.</p></li>
6608066082

6608166083
<li><p>If <var>parsedValue</var> is failure, then return.</p></li>
6608266084

6608366085
<li><p>Set <span>this</span>'s <span data-x="concept-canvas-current-filter">current
66084-
filter</span> to <var>parsedValue</var>.</p></li>
66086+
filter</span> to the given value.</p></li>
6608566087
</ol>
6608666088
</li>
6608766089

@@ -66122,15 +66124,18 @@ console.log(pixels.data[2]);
6612266124
following steps:</p>
6612366125

6612466126
<ol>
66125-
<li><p>If <var>attrName</var> is of type "<code data-x="">false | true</code>", then return
66126-
<code data-x="idl-boolean">boolean</code>.</p></li>
66127+
<li><p>Let <var>type</var> be the type listed for <var>attrName</var> in Filters. <ref
66128+
spec=FILTERS></p></li>
6612766129

66128-
<li><p>If <var>attrName</var> is of type "<code data-x="">list of &lt;number&gt;s</code>", then
66129-
return <code data-x="">sequence&lt;long long&gt;</code>.</p></li>
66130+
<li><p><var>type</var> is "<code data-x="">false | true</code>", then return <code
66131+
data-x="idl-boolean">boolean</code>.</p></li>
6613066132

66131-
<li><p>If <var>attrName</var> is of type <code
66132-
data-x="">"&lt;number-optional-number&gt;</code>", "<code data-x="">&lt;number&gt;</code>", or
66133-
"<code data-x="">&lt;integer&gt;</code>", then return <code data-x="">long long</code>.</p></li>
66133+
<li><p><var>type</var> is "<code data-x="">list of &lt;number&gt;s</code>", then return <code
66134+
data-x="">sequence&lt;long long&gt;</code>.</p></li>
66135+
66136+
<li><p><var>type</var> is <code data-x="">"&lt;number-optional-number&gt;</code>", "<code
66137+
data-x="">&lt;number&gt;</code>", or "<code data-x="">&lt;integer&gt;</code>", then return
66138+
<code data-x="">long long</code>.</p></li>
6613466139

6613566140
<li><p>Return <code data-x="idl-DOMString">DOMString</code>.</p></li>
6613666141
</ol>
@@ -66205,8 +66210,8 @@ console.log(pixels.data[2]);
6620566210

6620666211
<li><p><var>key</var> is a <span>filter primitive attribute</span></p></li>
6620766212

66208-
<li><p><var>key</var> is "<code data-x="">class</code>", "<code data-x="">style</code>",
66209-
"<code data-x="">in</code>", or "<code data-x="">filter</code>"</p></li>
66213+
<li><p><var>key</var> is "<code data-x="">in</code>", or "<code
66214+
data-x="">filter</code>"</p></li>
6621066215
</ul>
6621166216

6621266217
<p>then <span>continue</span>.</p>
@@ -66307,40 +66312,40 @@ console.log(pixels.data[2]);
6630766312
graphs are a planned expansion of this feature.</p>
6630866313

6630966314
<p>Coordinates used in the value of the <span data-x="concept-canvas-current-filter">current
66310-
filter</span> attribute are interpreted such that one pixel is equivalent to one SVG user space
66311-
unit and to one canvas coordinate space unit. Filter coordinates are not affected by the <span
66315+
filter</span> are interpreted such that one pixel is equivalent to one SVG user space unit and to
66316+
one canvas coordinate space unit. Filter coordinates are not affected by the <span
6631266317
data-x="dom-context-2d-transformation">current transformation matrix</span>. The current
6631366318
transformation matrix affects only the input to the filter. Filters are applied in the
6631466319
<span>output bitmap</span>'s coordinate space.</p>
6631566320

66316-
<p>When the value of the <span data-x="concept-canvas-current-filter">current filter</span>
66317-
attribute is a <span>&lt;filter-value-list&gt;</span> which defines lengths using percentages or
66318-
using <span>'em'</span> or <span>'ex'</span> units, these must be interpreted relative to the
66319-
<span>computed value</span> of the <span>'font-size'</span> property of the <span>font style
66320-
source object</span> at the time that the attribute is set. If the <span
66321+
<p>When the value of the <span data-x="concept-canvas-current-filter">current filter</span> is a
66322+
string parsable as a <span>&lt;filter-value-list&gt;</span> which defines lengths using
66323+
percentages or using <span>'em'</span> or <span>'ex'</span> units, these must be interpreted
66324+
relative to the <span>computed value</span> of the <span>'font-size'</span> property of the
66325+
<span>font style source object</span> at the time that the attribute is set. If the <span
6632166326
data-x="computed value">computed values</span> are undefined for a particular case (e.g. because
6632266327
the <span>font style source object</span> is not an element or is not <span>being
6632366328
rendered</span>), then the relative keywords must be interpreted relative to the default value of
6632466329
the <code data-x="dom-context-2d-font">font</code> attribute. The 'larger' and 'smaller' keywords
6632566330
are not supported.</p>
6632666331

66327-
<p>If the value of the <span data-x="concept-canvas-current-filter">current filter</span>
66328-
attribute is a <span>&lt;filter-value-list&gt;</span> with a reference to an SVG filter in the
66329-
same document, and this SVG filter changes, then the changed filter is used for the next draw
66332+
<p>If the value of the <span data-x="concept-canvas-current-filter">current filter</span> is a
66333+
string parseable as a <span>&lt;filter-value-list&gt;</span> with a reference to an SVG filter in
66334+
the same document, and this SVG filter changes, then the changed filter is used for the next draw
6633066335
operation.</p>
6633166336

66332-
<p>If the value of the <span data-x="concept-canvas-current-filter">current filter</span>
66333-
attribute is a <span>&lt;filter-value-list&gt;</span> with a reference to an SVG filter in an
66334-
external resource document and that document is not loaded when a drawing operation is invoked,
66335-
then the drawing operation must proceed with no filtering.</p>
66337+
<p>If the value of the <span data-x="concept-canvas-current-filter">current filter</span> is a
66338+
string parseable as a <span>&lt;filter-value-list&gt;</span> with a reference to an SVG filter in
66339+
an external resource document and that document is not loaded when a drawing operation is
66340+
invoked, then the drawing operation must proceed with no filtering.</p>
6633666341

6633766342
</div>
6633866343

6633966344
<h6>Working with externally-defined SVG filters</h6>
6634066345

6634166346
<!-- NON-NORMATIVE SECTION -->
6634266347

66343-
<p>Since drawing is performed using filter value "<code data-x="">none</code>"" until an
66348+
<p>Since drawing is performed using filter value "<code data-x="">none</code>" until an
6634466349
externally-defined filter has finished loading, authors might wish to determine whether such a
6634566350
filter has finished loading before proceeding with a drawing operation. One way to accomplish
6634666351
this is to load the externally-defined filter elsewhere within the same page in some element that
@@ -66365,12 +66370,12 @@ console.log(pixels.data[2]);
6636566370
other than "<code data-x="">none</code>" and all the externally-defined filters it references,
6636666371
if any, are in documents that are currently loaded, then use image <var>A</var> as the input to
6636766372
the <span data-x="concept-canvas-current-filter">current filter</span>, creating image
66368-
<var>B</var>. If the <span data-x="concept-canvas-current-filter">current filter</span> is a
66369-
<span>&lt;filter-value-list&gt;</span>, then draw using the <span
66373+
<var>B</var>. If the <span data-x="concept-canvas-current-filter">current filter</span> is a
66374+
string parseable as a <span>&lt;filter-value-list&gt;</span>, then draw using the <span
6637066375
data-x="concept-canvas-current-filter">current filter</span> in the same manner as SVG. If the
6637166376
<span data-x="concept-canvas-current-filter">current filter</span> is a
6637266377
<code>CanvasFilter</code>, draw using the equivalent SVG for the XML structure stored in the
66373-
<span data-x="concept-canvas-current-filter">current filter</span>'s associated <span
66378+
<span data-x="concept-canvas-current-filter">current filter</span>'s by mapping each <span>filter property</span> of the <span
6637466379
data-x="concept-concept-canvasfilter-xml-filter-list">XML filter list</span>.</p>
6637566380

6637666381
<p>Otherwise, let <var>B</var> be an alias for <var>A</var>.</p>

0 commit comments

Comments
 (0)