Skip to content

Commit 88cbe99

Browse files
committed
Define getSVGDocument() in terms of content document
Additionally, make content document (also used by contentDocument) perform the same origin-domain comparison on the two documents involved. Tests: web-platform-tests/wpt#20432. Fixes #5094.
1 parent 7b4964a commit 88cbe99

File tree

1 file changed

+12
-25
lines changed

1 file changed

+12
-25
lines changed

source

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39550,19 +39550,13 @@ interface <dfn>HTMLAreaElement</dfn> : <span>HTMLElement</span> {
3955039550

3955139551
<hr>
3955239552

39553-
3955439553
<dl class="domintro">
39555-
3955639554
<dt><var>doc</var> = <var>iframe</var> . <code subdfn data-x="dom-media-getSVGDocument">getSVGDocument</code>()</dt>
3955739555
<dt><var>doc</var> = <var>embed</var> . <code data-x="dom-media-getSVGDocument">getSVGDocument</code>()</dt>
3955839556
<dt><var>doc</var> = <var>object</var> . <code data-x="dom-media-getSVGDocument">getSVGDocument</code>()</dt>
3955939557

39560-
<dd>
39561-
39562-
<p>Returns the <code>Document</code> object, in the case of <code>iframe</code>, <code>embed</code>, or <code>object</code> elements being used to embed SVG images.</p>
39563-
39564-
</dd>
39565-
39558+
<dd><p>Returns the <code>Document</code> object, in the case of <code>iframe</code>,
39559+
<code>embed</code>, or <code>object</code> elements being used to embed SVG.</p></dd>
3956639560
</dl>
3956739561

3956839562
<div w-nodev>
@@ -39571,28 +39565,21 @@ interface <dfn>HTMLAreaElement</dfn> : <span>HTMLElement</span> {
3957139565
the following steps:</p>
3957239566

3957339567
<ol>
39568+
<li><p>Let <var>document</var> be this element's <span>content document</span>.</p></li>
3957439569

39575-
<li><p>If the element's <span>nested browsing context</span> is null, then return null.</p></li>
39576-
39577-
<li><p>If the <span>origin</span> of the <span>active document</span> of the <span>nested
39578-
browsing context</span> is not <span>same origin-domain</span> with the element's <span>node
39579-
document</span>'s <span>origin</span>, then return null.</p></li>
39580-
39581-
<li><p>If the <span>nested browsing context</span>'s <span>active document</span> was created by
39582-
the <span data-x="navigate-xml">page load processing model for XML files</span> section because
39583-
the <span data-x="Content-Type sniffing">computed type of the resource</span> in the
39584-
<span>navigate</span> algorithm was <code>image/svg+xml</code>, then return that
39585-
<code>Document</code> object.</p></li>
39586-
39587-
<li><p>Otherwise, return null.</p></li>
39570+
<li><p>If <var>document</var> is non-null and was created by the <span data-x="navigate-xml">page
39571+
load processing model for XML files</span> section because the <span data-x="Content-Type
39572+
sniffing">computed type of the resource</span> in the <span>navigate</span> algorithm was
39573+
<code>image/svg+xml</code>, then return <var>document</var>.</p></li>
39574+
<!-- Ideally this would check a property of the document. -->
3958839575

39576+
<li><p>Return null.</p></li>
3958939577
</ol>
3959039578

3959139579
</div>
3959239580

3959339581

3959439582

39595-
3959639583
<h4><dfn>Dimension attributes</dfn></h4>
3959739584

3959839585
<p><span w-nodev><strong>Author requirements</strong>:</span> The <dfn><code
@@ -78766,9 +78753,9 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
7876678753

7876778754
<li><p>Let <var>document</var> be <var>context</var>'s <span>active document</span>.</p></li>
7876878755

78769-
<li><p>If <var>document</var>'s <span>origin</span> and the <span
78770-
data-x="concept-settings-object-origin">origin</span> specified by the <span>current settings
78771-
object</span> are not <span>same origin-domain</span>, then return null.</p></li>
78756+
<li><p>If <var>document</var>'s <span>origin</span> and <var>container</var>'s <span>node
78757+
document</span>'s <span>origin</span> are not <span>same origin-domain</span>, then return
78758+
null.</p></li>
7877278759

7877378760
<li><p>Return <var>document</var>.</p></li>
7877478761
</ol>

0 commit comments

Comments
 (0)