Skip to content

Commit

Permalink
Align with origin changes in HTML
Browse files Browse the repository at this point in the history
Fixes #195.
  • Loading branch information
annevk committed Apr 5, 2016
1 parent b9b9fe1 commit 20b3f3e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 57 deletions.
55 changes: 10 additions & 45 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ urlPrefix: https://html.spec.whatwg.org/multipage/
text: concept-document-bc
text: concept-document-window
text: unit of related similar-origin browsing contexts
text: origin
text: effective script origin
text: origin alias; url: #concept-origin-alias
text: Unicode serialization of an origin; url: #unicode-serialisation-of-an-origin
text: origin; url: concept-origin
urlPrefix: infrastructure.html
text: in parallel
url: https://w3c.github.io/DOM-Parsing/#widl-Range-createContextualFragment-DocumentFragment-DOMString-fragment
Expand Down Expand Up @@ -4288,9 +4285,7 @@ Unless stated otherwise, a <a>document</a>'s <a for=Document>base URL</a> is
<a for=Document>type</a> is "<code>xml</code>", and its
<a for=Document>mode</a> is "<code>no-quirks</code>".

Unless stated otherwise, a <a>document</a>'s <a>origin</a> is a globally unique identifier
and its <a>effective script origin</a> is an <a lt="origin alias">alias</a> of that
<a>origin</a>. [[!HTML]]
Unless stated otherwise, a <a>document</a>'s <a>origin</a> is a new <a>opaque origin</a>. [[!HTML]]

A <a>document</a> is said to be an <dfn export>XML document</dfn> if its
<a for=Document>type</a> is "<code>xml</code>", and an <dfn export>HTML document</dfn>
Expand Down Expand Up @@ -4352,17 +4347,9 @@ null if <var>event</var>'s <code for=Event>type</code> attribute value is "<code
<a for=Document>content type</a>.
</dl>

The <dfn constructor for=Document><code>Document()</code></dfn> constructor
must return a new <a>document</a> whose
<a>origin</a> is an
<a lt="origin alias">alias</a> to the
<a>origin</a> of the global object's associated
<a>document</a>, and
<a>effective script origin</a> is an
<a lt="origin alias">alias</a> to the
<a>effective script origin</a> of the
global object's associated <a>document</a>.
[[!HTML]]
<p>The <dfn constructor for=Document><code>Document()</code></dfn> constructor, when invoked, must
return a new <a>document</a> whose <a>origin</a> is the <a>origin</a> of the global object's
associated <a>document</a>. [[!HTML]]

<p class="note no-backref">Unlike
{{createDocument()}}
Expand All @@ -4378,7 +4365,7 @@ The <dfn attribute for=Document><code>URL</code></dfn> attribute's getter and
<a for=Document>URL</a>, <a lt="URL serializer" spec=url>serialized</a>.

The <dfn attribute for=Document><code>origin</code></dfn> attribute's getter must return the
<a lt="Unicode serialization of an origin">Unicode serialization</a> of <a>context object</a>'s
<a lt="Unicode serialisation of an origin">Unicode serialization</a> of <a>context object</a>'s
<a>origin</a>.

The <dfn attribute for=Document><code>compatMode</code></dfn> attribute's getter must
Expand Down Expand Up @@ -5001,19 +4988,8 @@ method must run these steps:
<a>append</a>
<var>element</var> to <var>document</var>.

<li><var>document</var>'s
<a>origin</a> is an
<a lt="origin alias">alias</a> to the
<a>origin</a> of the
<a>context object</a>'s associated
<a>document</a>, and
<var>document</var>'s
<a>effective script origin</a> is an
<a lt="origin alias">alias</a> to the
<a>effective script origin</a> of the
<a>context object</a>'s associated
<a>document</a>.
[[!HTML]]
<li><var>document</var>'s <a>origin</a> is the <a>origin</a> of the <a>context object</a>'s
associated <a>document</a>. [[!HTML]]

<li>Return <var>document</var>.
</ol>
Expand Down Expand Up @@ -5052,19 +5028,8 @@ method, when invoked, must run these steps:
<li><a>Append</a> a new <{body}> element in the <a>HTML namespace</a>, to the <{html}>
element created earlier.

<li><var>doc</var>'s
<a>origin</a> is an
<a lt="origin alias">alias</a> to the
<a>origin</a> of the
<a>context object</a>'s associated
<a>document</a>, and
<var>doc</var>'s
<a>effective script origin</a> is an
<a lt="origin alias">alias</a> to the
<a>effective script origin</a> of the
<a>context object</a>'s associated
<a>document</a>.
[[!HTML]]
<li><var>doc</var>'s <a>origin</a> is the <a>origin</a> of the <a>context object</a>'s associated
<a>document</a>. [[!HTML]]

<li>Return <var>doc</var>.
</ol>
Expand Down
Loading

4 comments on commit 20b3f3e

@ArkadiuszMichalski
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@annevk
"The Document() constructor, when invoked, must return a new document whose origin is the origin of the global object’s associated document."
What is global object here? In DOM we don't have such definition so you mean this from HTML https://html.spec.whatwg.org/multipage/webappapis.html#global-object? If yes maybe use refference?

@annevk
Copy link
Member Author

@annevk annevk commented on 20b3f3e Apr 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that language needs to be made more formal. Could you file an issue? It's not really related to this change.

@ArkadiuszMichalski
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@annevk
Copy link
Member Author

@annevk annevk commented on 20b3f3e Apr 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Please sign in to comment.