Skip to content

Commit

Permalink
Define getSVGDocument() in terms of content document
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
annevk committed Nov 25, 2019
1 parent 7b4964a commit 88cbe99
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -39550,19 +39550,13 @@ interface <dfn>HTMLAreaElement</dfn> : <span>HTMLElement</span> {

<hr>


<dl class="domintro">

<dt><var>doc</var> = <var>iframe</var> . <code subdfn data-x="dom-media-getSVGDocument">getSVGDocument</code>()</dt>
<dt><var>doc</var> = <var>embed</var> . <code data-x="dom-media-getSVGDocument">getSVGDocument</code>()</dt>
<dt><var>doc</var> = <var>object</var> . <code data-x="dom-media-getSVGDocument">getSVGDocument</code>()</dt>

<dd>

<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>

</dd>

<dd><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.</p></dd>
</dl>

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

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

<li><p>If the element's <span>nested browsing context</span> is null, then return null.</p></li>

<li><p>If the <span>origin</span> of the <span>active document</span> of the <span>nested
browsing context</span> is not <span>same origin-domain</span> with the element's <span>node
document</span>'s <span>origin</span>, then return null.</p></li>

<li><p>If the <span>nested browsing context</span>'s <span>active document</span> was created by
the <span data-x="navigate-xml">page load processing model for XML files</span> section because
the <span data-x="Content-Type sniffing">computed type of the resource</span> in the
<span>navigate</span> algorithm was <code>image/svg+xml</code>, then return that
<code>Document</code> object.</p></li>

<li><p>Otherwise, return null.</p></li>
<li><p>If <var>document</var> is non-null and was created by the <span data-x="navigate-xml">page
load processing model for XML files</span> section because the <span data-x="Content-Type
sniffing">computed type of the resource</span> in the <span>navigate</span> algorithm was
<code>image/svg+xml</code>, then return <var>document</var>.</p></li>
<!-- Ideally this would check a property of the document. -->

<li><p>Return null.</p></li>
</ol>

</div>




<h4><dfn>Dimension attributes</dfn></h4>

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

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

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

<li><p>Return <var>document</var>.</p></li>
</ol>
Expand Down

0 comments on commit 88cbe99

Please sign in to comment.