Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Backout changeset a91d26af2523, because enums are case-sensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Sep 22, 2012
1 parent 7408e9c commit c5d4631
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 44 deletions.
27 changes: 11 additions & 16 deletions domparser
Expand Up @@ -19,7 +19,7 @@
<body class=draft>
<div class=head id=head>
<h1>DOM Parsing and Serialization</h1>
<h2 class="no-num no-toc" id=living-specification-&mdash;-last-update-25-august-2012>Living Specification &mdash; Last Update 25 August 2012</h2>
<h2 class="no-num no-toc" id=living-specification-&mdash;-last-update-22-september-2012>Living Specification &mdash; Last Update 22 September 2012</h2>
<dl>
<dt>This Version:
<dd><a href=http://html5.org/specs/dom-parsing.html>http://html5.org/specs/dom-parsing.html</a>
Expand Down Expand Up @@ -518,17 +518,10 @@ method must

<h2 id=extensions-to-the-element-interface><span class=secno>6 </span>Extensions to the <a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element><code class=external data-anolis-spec=dom>Element</code></a> interface</h2>

<pre class=idl>enum insertAdjacentHTMLPosition {
"beforebegin",
"afterbegin",
"beforeend",
"afterend"
};

partial interface <a class=external data-anolis-spec=dom href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element>Element</a> {
<pre class=idl>partial interface <a class=external data-anolis-spec=dom href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element>Element</a> {
attribute DOMString <a href=#dom-element-innerhtml title=dom-Element-innerHTML>innerHTML</a>;
attribute DOMString <a href=#dom-element-outerhtml title=dom-Element-outerHTML>outerHTML</a>;
void <a href=#dom-element-insertadjacenthtml title=dom-Element-insertAdjacentHTML>insertAdjacentHTML</a>(insertAdjacentHTMLPosition <var title="">position</var>, DOMString <var title="">text</var>);
void <a href=#dom-element-insertadjacenthtml title=dom-Element-insertAdjacentHTML>insertAdjacentHTML</a>(DOMString <var title="">position</var>, DOMString <var title="">text</var>);
};</pre>


Expand Down Expand Up @@ -700,12 +693,10 @@ string).
<dd>After the element itself.
</dl>

<p>Throws a TypeError exception if the <var title="">position</var> argument
has an invalid value.

<p>In <a class=external data-anolis-spec=dom href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#xml-document title="XML document">XML documents</a>,
throws a <a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#syntaxerror><code class=external data-anolis-spec=dom>SyntaxError</code></a>
exception if the given string is not well-formed.
<p>Throws a <a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#syntaxerror><code class=external data-anolis-spec=dom>SyntaxError</code></a>
exception if the arguments have invalid values (e.g., in the case of an
<a class=external data-anolis-spec=dom href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#xml-document>XML document</a>, if the given string is
not well-formed).

<p>Throws a <a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#nomodificationallowederror><code class=external data-anolis-spec=dom>NoModificationAllowedError</code></a>
exception if the given position isn't possible (e.g. inserting elements
Expand Down Expand Up @@ -746,6 +737,10 @@ method must run these steps:
the string "beforeend"
<dd>
<p>Let <var title="">context</var> be the <a href=#context-object>context object</a>.

<dt>Otherwise
<dd>
<p>Throw a <a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#syntaxerror><code class=external data-anolis-spec=dom>SyntaxError</code></a> exception.
</dl>

<li>
Expand Down
25 changes: 10 additions & 15 deletions source.html
Expand Up @@ -497,17 +497,10 @@ <h2>The <code>XMLSerializer</code> interface</h2>

<h2>Extensions to the <code data-anolis-spec=dom>Element</code> interface</h2>

<pre class=idl>enum insertAdjacentHTMLPosition {
"beforebegin",
"afterbegin",
"beforeend",
"afterend"
};

partial interface <span data-anolis-spec=dom>Element</span> {
<pre class=idl>partial interface <span data-anolis-spec=dom>Element</span> {
attribute DOMString <span title=dom-Element-innerHTML>innerHTML</span>;
attribute DOMString <span title=dom-Element-outerHTML>outerHTML</span>;
void <span title=dom-Element-insertAdjacentHTML>insertAdjacentHTML</span>(insertAdjacentHTMLPosition <var title>position</var>, DOMString <var title>text</var>);
void <span title=dom-Element-insertAdjacentHTML>insertAdjacentHTML</span>(DOMString <var title>position</var>, DOMString <var title>text</var>);
};</pre>


Expand Down Expand Up @@ -679,12 +672,10 @@ <h3><code title=dom-Element-insertAdjacentHTML>insertAdjacentHTML()</code></h3>
<dd>After the element itself.
</dl>

<p>Throws a TypeError exception if the <var title>position</var> argument
has an invalid value.

<p>In <span data-anolis-spec=dom title="XML document">XML documents</span>,
throws a <code data-anolis-spec=dom>SyntaxError</code>
exception if the given string is not well-formed.
<p>Throws a <code data-anolis-spec=dom>SyntaxError</code>
exception if the arguments have invalid values (e.g., in the case of an
<span data-anolis-spec=dom>XML document</span>, if the given string is
not well-formed).

<p>Throws a <code data-anolis-spec=dom>NoModificationAllowedError</code>
exception if the given position isn't possible (e.g. inserting elements
Expand Down Expand Up @@ -725,6 +716,10 @@ <h3><code title=dom-Element-insertAdjacentHTML>insertAdjacentHTML()</code></h3>
the string "beforeend"
<dd>
<p>Let <var title>context</var> be the <span>context object</span>.

<dt>Otherwise
<dd>
<p>Throw a <code data-anolis-spec=dom>SyntaxError</code> exception.
</dl>

<li>
Expand Down
5 changes: 4 additions & 1 deletion tests/insert_adjacent_html.html
Expand Up @@ -49,7 +49,10 @@
testPositions(content); // without next sibling
testPositions(content); // test again when there's next sibling

testThrowingPosition(content);
test(function() {
assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("bar", "foo")});
assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforebegİn", "foo")});
});

var parent = document.createElement("div");
var child = document.createElement("div");
Expand Down
12 changes: 1 addition & 11 deletions tests/insert_adjacent_html.js
@@ -1,14 +1,3 @@
function testThrowingPosition(element) {
test(function() {
assert_throws(new TypeError(),
function() { element.insertAdjacentHTML("bar", "foo") }
);
assert_throws(new TypeError(),
function() { element.insertAdjacentHTML("beforebegİn", "foo") }
);
});
}

function testThrowingNoParent(element, desc) {
test(function() {
assert_throws("NO_MODIFICATION_ALLOWED_ERR",
Expand Down Expand Up @@ -41,3 +30,4 @@ function testThrowingNoParent(element, desc) {
);
}, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (elements)");
}

5 changes: 4 additions & 1 deletion tests/insert_adjacent_html.xhtml
Expand Up @@ -48,7 +48,10 @@ var content = document.getElementById("content");
testPositions(content); // without next sibling
testPositions(content); // test again when there's next sibling

testThrowingPosition(content);
test(function() {
assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("bar", "foo")});
assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforebegİn", "foo")});
});

var parent = document.createElement("div");
var child = document.createElement("div");
Expand Down

0 comments on commit c5d4631

Please sign in to comment.