@@ -59915,10 +59915,7 @@ interface <dfn>ImageData</dfn> {
59915
59915
readonly attribute <span data-x="idl-Uint8ClampedArray">Uint8ClampedArray</span> <span data-x="dom-imagedata-data">data</span>;
59916
59916
};
59917
59917
59918
- [<span data-x="dom-Path2D">Constructor</span>,
59919
- <span data-x="dom-Path2D-copy">Constructor</span>(<span>Path2D</span> path),
59920
- <span data-x="dom-Path2D-merge">Constructor</span>(sequence<<span>Path2D</span>> paths, optional <span>CanvasFillRule</span> fillRule = "<span data-x="dom-context-2d-fillRule-nonzero">nonzero</span>"),
59921
- <span data-x="dom-Path2D-withdata">Constructor</span>(DOMString d),
59918
+ [<span data-x="dom-Path2D">Constructor</span>(optional (<span>Path2D</span> or DOMString) path),
59922
59919
Exposed=(Window,Worker)]
59923
59920
interface <dfn>Path2D</dfn> {
59924
59921
void <span data-x="dom-Path2D-addPath">addPath</span>(<span>Path2D</span> path, optional <span>DOMMatrix2DInit</span> transform);
@@ -61784,143 +61781,51 @@ try {
61784
61781
add text to paths.</p>
61785
61782
61786
61783
<dl class="domintro">
61787
-
61788
61784
<dt><var>path</var> = new <code subdfn data-x="dom-Path2D">Path2D</code>()</dt>
61785
+ <dd><p>Creates a new empty <code>Path2D</code> object.</p></dd>
61789
61786
61787
+ <dt><var>path</var> = new <code data-x="dom-Path2D">Path2D</code>(<var>path</var>)</dt>
61790
61788
<dd>
61789
+ <p>When <var>path</var> is a <code>Path2D</code> object, returns a copy.</p>
61791
61790
61792
- <p>Creates a new empty <code>Path2D</code> object.</p>
61793
-
61794
- </dd>
61795
-
61796
- <dt><var>path</var> = new <code subdfn data-x="dom-Path2D-copy">Path2D</code>(<var>path</var>)</dt>
61797
-
61798
- <dd>
61799
-
61800
- <p>Creates a new <code>Path2D</code> object that is a copy of the argument.</p>
61801
-
61802
- </dd>
61803
-
61804
- <dt><var>path</var> = new <code subdfn data-x="dom-Path2D-merge">Path2D</code>(<var>paths</var> [, <var>fillRule</var> ] )</dt>
61805
-
61806
- <dd>
61807
-
61808
- <p>Creates a new <code>Path2D</code> object that describes a path that outlines the given <var>paths</var>, using the given fill rule.</p>
61809
-
61810
- </dd>
61811
-
61812
- <dt><var>path</var> = new <code subdfn data-x="dom-Path2D-withdata">Path2D</code>(<var>d</var>)</dt>
61813
-
61814
- <dd>
61815
-
61816
- <p>Creates a new path with the path described by the argument, interpreted as SVG path data. <ref spec=SVG></p>
61817
-
61791
+ <p>When <var>path</var> is a string, creates the path described by the argument, interpreted as
61792
+ SVG path data. <ref spec=SVG>
61818
61793
</dd>
61819
61794
61820
61795
<dt><var>path</var> . <code subdfn data-x="dom-Path2D-addPath">addPath</code>(<var>path</var> [, <var>transform</var> ] )</dt>
61821
-
61822
- <dd>
61823
-
61824
- <p>Adds to the path the path given by the argument.</p>
61825
-
61826
- </dd>
61827
-
61796
+ <dd><p>Adds to the path the path given by the argument.</p></dd>
61828
61797
</dl>
61829
61798
61830
61799
<div w-nodev>
61831
61800
61832
- <p>The <dfn><code data-x="dom-Path2D">Path2D()</code></dfn> constructor, when invoked, must return a
61833
- newly created <code>Path2D</code> object.</p>
61834
-
61835
- <hr>
61836
-
61837
- <p>The <dfn><code data-x="dom-Path2D-copy">Path2D(<var>path</var>)</code></dfn>
61838
- constructor, when invoked, must return a newly created <code>Path2D</code> object, to which the
61839
- subpaths of the argument are added. (In other words, it returns a copy of the argument.)</p>
61840
-
61841
- <hr>
61842
-
61843
- <p>The <dfn><code data-x="dom-Path2D-merge">Path2D(<var>paths</var>,
61844
- <var>fillRule</var>)</code></dfn> constructor, when invoked, must run these steps:</p>
61801
+ <p>The <dfn><code data-x="dom-Path2D">Path2D(<var>path</var>)</code></dfn> constructor, when
61802
+ invoked, must run these steps:</p>
61845
61803
61846
61804
<ol>
61805
+ <li><p>Let <var>output</var> be a new <code>Path2D</code> object.</p></li>
61847
61806
61848
- <li>
61807
+ <li><p>If <var>path</var> is not given, then return <var>output</var>.</p></li>
61849
61808
61850
- <p>Run the appropriate step from the following list, based on the constructor's second
61851
- argument:</p>
61852
-
61853
- <dl class="switch">
61854
-
61855
- <dt>If it is "nonzero"</dt>
61856
-
61857
- <dd>
61858
-
61859
- <p>Let <var>merged path</var> be a <span data-x="concept-path">path</span> that
61860
- consists of a set of non-overlapping subpaths that exactly outline the points from which, in
61861
- any of the <span data-x="concept-path">paths</span> provided in the constructor's first
61862
- argument, the number of times a half-infinite straight line drawn from that point crosses a
61863
- subpath going in one direction is not equal to the number of times it crosses a subpath going
61864
- in the other direction.</p>
61865
-
61866
- </dd>
61867
-
61868
- <dt>If it is "evenodd"</dt>
61869
-
61870
- <dd>
61871
-
61872
- <p>Let <var>merged path</var> be a <span data-x="concept-path">path</span> that
61873
- consists of a set of non-overlapping subpaths that exactly outline the points from which, in
61874
- any of the <span data-x="concept-path">paths</span> provided in the constructor's first
61875
- argument, the number of times a half-infinite straight line drawn from that point crosses that
61876
- path is odd.</p>
61877
-
61878
- </dd>
61879
-
61880
- </dl>
61881
-
61882
- <p>The subpaths in <var>merged path</var> must be oriented such that for any point,
61883
- the number of times a half-infinite straight line drawn from that point crosses a subpath is
61884
- even if and only if the number of times a half-infinite straight line drawn from that same point
61885
- crosses a subpath going in one direction is equal to the number of times it crosses a subpath
61886
- going in the other direction.</p>
61887
-
61888
- </li>
61889
-
61890
- <li><p>Add all the subpaths in <var>merged path</var> to the <code>Path2D</code>
61891
- object.</p></li>
61892
-
61893
- <li><p>Set the <code>Path2D</code> object's <span>need new subpath</span> flag.</p></li>
61894
-
61895
- </ol>
61896
-
61897
- <hr>
61898
-
61899
- <p>The <dfn><code data-x="dom-Path2D-withdata">Path2D(<var>d</var>)</code></dfn>
61900
- constructor, when invoked, must run these steps:</p>
61901
-
61902
- <ol>
61809
+ <li><p>If <var>path</var> is a <code>Path2D</code> object, then add all subpaths of
61810
+ <var>path</var> to <var>output</var> and return <var>output</var>. (In other words, it returns a
61811
+ copy of the argument.)</p></li>
61903
61812
61904
61813
<li>
61905
-
61906
- <p>Parse and interpret the <var>d</var> argument according to the SVG specification's
61907
- rules for path data, thus obtaining an SVG path. <ref spec=SVG></p>
61814
+ <p>Let <var>svgPath</var> be the result of parsing and interpreting <var>path</var> according to
61815
+ the SVG specification's rules for path data. <ref spec=SVG></p>
61908
61816
61909
61817
<p class="note">The resulting path could be empty. SVG defines error handling rules for parsing
61910
61818
and applying path data.</p>
61911
-
61912
61819
</li>
61913
61820
61914
- <li><p>Let (<var>x</var>, <var>y</var>) be the last point in the SVG
61915
- path.</p></li>
61821
+ <li><p>Let (<var>x</var>, <var>y</var>) be the last point in <var>svgPath</var>.</p></li>
61916
61822
61917
- <li><p>Create a new <code>Path2D</code> object and add all the subpaths in the SVG path, if any,
61918
- to that <code>Path2D</code> object. </p>
61823
+ <li><p>Add all the subpaths, if any, from <var>svgPath</var> to <var>output</var>.</p></li>
61919
61824
61920
- <li><p>Create a new subpath in the <code>Path2D</code> object with (<var>x</var>, <var>y</var>) as the only point in the subpath.</p></li>
61921
-
61922
- <li><p>Return the <code>Path2D</code> object as the constructed object.</p></li>
61825
+ <li><p>Create a new subpath in <var>output</var> with (<var>x</var>, <var>y</var>) as the only
61826
+ point in the subpath.</p></li>
61923
61827
61828
+ <li><p>Return <var>output</var>.</p></li>
61924
61829
</ol>
61925
61830
61926
61831
<hr>
0 commit comments