Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion master/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ <h3 id="types">Basic Data Types and Interfaces chapter (owner: BogdanBrinza)</h3
<li><a>SVGUnitTypes</a> is no longer NoInterfaceObject. <a href="https://github.com/w3c/svgwg/issues/291">Github #291</a>.</li>
<li>Clarified that <a>SVGElement</a>.<a href="types.html#__svg__SVGElement__className">className</a>
overrides <a>Element</a>.className. Not normative, <a href="https://github.com/w3c/svgwg/issues/298">Github #298</a>.</li>
<li>Specify <a>DOMPointInit</a> as argument type for isPointInFill() and isPointInStroke() instead oF <a>DOMPoint</a>.</li>
<li>Specify <a>DOMPointInit</a> as argument type for isPointInFill() and isPointInStroke() instead of <a>DOMPoint</a>.</li>
<li>Specify algorithm used for isPointInFill() and isPointInStroke().</li>
<li>Moved dataset, tabIndex, focus(), and blur() to a shared <a>HTMLOrSVGElement</a> mixin defined in the HTML specification.</li>
<li>Made <a>SVGElement</a> include the <a>DocumentAndElementEventHandlers</a> interface from HTML.</li>
</ul>
Expand Down
3 changes: 3 additions & 0 deletions master/definitions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,9 @@
<interface name='Window' href='https://html.spec.whatwg.org/multipage/window-object.html#window'/>
<interface name='WindowEventHandlers' href='https://html.spec.whatwg.org/multipage/webappapis.html#windoweventhandlers'/>
<interface name='Animation' href='https://www.w3.org/TR/web-animations-1/#the-animation-interface' />
<interface name='isPointInPath' href='https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-ispointinpath' />
<interface name='isPointInStroke' href='https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-ispointinstroke' />
<interface name='CanvasDrawPath' href='https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawpath' />

<!-- ... terms .......................................................... -->
<term name='event type' href='https://dom.spec.whatwg.org/#ref-for-dom-event-type'/>
Expand Down
39 changes: 32 additions & 7 deletions master/types.html
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,38 @@ <h3 id="InterfaceSVGGeometryElement">Interface SVGGeometryElement</h3>
<a>DOMPoint</a> <a href="types.html#__svg__SVGGeometryElement__getPointAtLength">getPointAtLength</a>(float distance);
};</pre>

<p>The <b id="__svg__SVGGeometryElement__isPointInFill">isPointInFill</b> and
<b id="__svg__SVGGeometryElement__isPointInStroke">isPointInStroke</b> methods
determine whether a given point is within the fill or stroke shape of an element.
Normal hit testing rules apply; the value of the <a>'pointer-events'</a>
property on the element determines whether a point is considered to be
within the fill or stroke. The <var>point</var> argument is interpreted
as a point in the local coordiante system of the element.</p>
<p>The <b id="__svg__SVGGeometryElement__isPointInFill">isPointInFill</b> method,
when invoked, must return true if the point given by <var>point</var> passed to the method,
in the coordinate space of an element, is inside the intended path as determined by the winding
rule indicated by the <a>'fill-rule'</a> property of an element; and must return false otherwise.
Open subpaths must be implicitly closed when computing the area inside the path, without affecting
the actual subpaths. Points on the path itself must be considered to be inside the path.
The returned value is independent of any visual CSS property but <a>'fill-rule'</a>
If either of the <var>x</var> or <var>y</var> properties on <var>point</var> are infinite or NaN,
then the method must return false.</p>

<p class="note"><a>isPointInFill</a> takes the winding
rule indicated by the <a>'fill-rule'</a> property of an element even if the element is a child
of a <a>'clipPath'</a> element.</p>

<p class="note"><a>isPointInFill</a> is aligned
with the <a>isPointInPath</a> method on the <a>CanvasDrawPath</a> mixin as much as the SVG context
allows it to be.</p>

<p>The <a>isPointInStroke</a> method,
when invoked, must return true if the point given by <var>point</var> passed to the method,
in the coordinate space of an element, is in or on the outline path of an applied stroke on
an element; and must return false otherwise.
The outline path must take the stroke properties <a>'stroke-width'</a>,
<a>'stroke-linecap'</a>, <a>'stroke-linejoin'</a>, <a>'stroke-miterlimit'</a>, <a>'stroke-dasharray'</a>
and <a>'stroke-dashoffset'</a> of an element into account.
The returned value is independent of any visual CSS property but the listed stroke properties.
If either of the <var>x</var> or <var>y</var> properties on <var>point</var> are infinite or NaN,
then the method must return false.</p>

<p class="note"><a>isPointInStroke</a> is aligned
with the <a>isPointInPath</a> method on the <a>CanvasDrawPath</a> mixin as much as the SVGcontext
allows it to be.</p>

<p>The <b id="__svg__SVGGeometryElement__pathLength">pathLength</b> IDL attribute
<a>reflects</a> the <a>'pathLength'</a> content attribute.</p>
Expand Down