Skip to content

Commit

Permalink
Rename replace() to replaceWith()
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Jan 14, 2015
1 parent 50c63c3 commit b7563aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions Overview.src.html
Expand Up @@ -1986,7 +1986,7 @@ <h4>Interface <code>ChildNode</code></h4>
interface <dfn>ChildNode</dfn> {
[Unscopeable] void <span title=dom-ChildNode-before>before</span>((<span>Node</span> or DOMString)... <var title>nodes</var>);
[Unscopeable] void <span title=dom-ChildNode-after>after</span>((<span>Node</span> or DOMString)... <var title>nodes</var>);
[Unscopeable] void <span title=dom-ChildNode-replace>replace</span>((<span>Node</span> or DOMString)... <var title>nodes</var>);
[Unscopeable] void <span title=dom-ChildNode-replaceWith>replaceWith</span>((<span>Node</span> or DOMString)... <var title>nodes</var>);
[Unscopeable] void <span title=dom-ChildNode-remove>remove</span>();
};
<span>DocumentType</span> implements <span>ChildNode</span>;
Expand Down Expand Up @@ -2014,7 +2014,7 @@ <h4>Interface <code>ChildNode</code></h4>
<code title>HierarchyRequestError</code> if the constraints of the
<span title=concept-node-tree>node tree</span> are violated.

<dt><code><var title>node</var> . <span title=dom-ChildNode-after>replace</span>(<var title>nodes</var>)</code>
<dt><code><var title>node</var> . <span title=dom-ChildNode-replaceWith>replaceWith</span>(<var title>nodes</var>)</code>
<dd>
<p>Replaces <var title>node</var> with <var title>nodes</var>, while
replacing strings in <var title>nodes</var> with equivalent
Expand Down Expand Up @@ -2062,7 +2062,7 @@ <h4>Interface <code>ChildNode</code></h4>
</ol>

<p>The
<dfn title=dom-ChildNode-replace><code>replace(<var>nodes</var>)</code></dfn>
<dfn title=dom-ChildNode-replaceWith><code>replaceWith(<var>nodes</var>)</code></dfn>
method must run these steps:

<ol>
Expand Down Expand Up @@ -9140,6 +9140,7 @@ <h2 class=no-num>Acknowledgments</h2>
Erik Arvidsson,
Gavin Nicol,
Geoffrey Sneddon,
Glen Huang,
Glenn Maynard,
Harald Alvestrand,
Henri Sivonen,
Expand All @@ -9149,6 +9150,7 @@ <h2 class=no-num>Acknowledgments</h2>
Jake Archibald<!-- technically B.J. Archibald -->,
Jake Verbaten,
James Graham,
James Greene,
James Robinson,
Jens Lindström,
João Eiras,
Expand Down
10 changes: 6 additions & 4 deletions dom-core.html
Expand Up @@ -9,7 +9,7 @@

<hgroup>
<h1 class="allcaps">DOM</h1>
<h2>Living Standard — Last Updated 17 December 2014</h2>
<h2>Living Standard — Last Updated 14 January 2015</h2>
</hgroup>

<dl>
Expand Down Expand Up @@ -2066,7 +2066,7 @@ <h4 id="interface-childnode"><span class="secno">4.2.5 </span>Interface <code><a
interface <dfn id="childnode">ChildNode</dfn> {
[Unscopeable] void <a title="dom-ChildNode-before" href="#dom-childnode-before">before</a>((<a href="#node">Node</a> or DOMString)... <var title="">nodes</var>);
[Unscopeable] void <a title="dom-ChildNode-after" href="#dom-childnode-after">after</a>((<a href="#node">Node</a> or DOMString)... <var title="">nodes</var>);
[Unscopeable] void <a title="dom-ChildNode-replace" href="#dom-childnode-replace">replace</a>((<a href="#node">Node</a> or DOMString)... <var title="">nodes</var>);
[Unscopeable] void <a title="dom-ChildNode-replaceWith" href="#dom-childnode-replacewith">replaceWith</a>((<a href="#node">Node</a> or DOMString)... <var title="">nodes</var>);
[Unscopeable] void <a title="dom-ChildNode-remove" href="#dom-childnode-remove">remove</a>();
};
<a href="#documenttype">DocumentType</a> implements <a href="#childnode">ChildNode</a>;
Expand Down Expand Up @@ -2094,7 +2094,7 @@ <h4 id="interface-childnode"><span class="secno">4.2.5 </span>Interface <code><a
<code title="">HierarchyRequestError</code> if the constraints of the
<a title="concept-node-tree" href="#concept-node-tree">node tree</a> are violated.

<dt><code><var title="">node</var> . <a title="dom-ChildNode-after" href="#dom-childnode-after">replace</a>(<var title="">nodes</var>)</code>
<dt><code><var title="">node</var> . <a title="dom-ChildNode-replaceWith" href="#dom-childnode-replacewith">replaceWith</a>(<var title="">nodes</var>)</code>
<dd>
<p>Replaces <var title="">node</var> with <var title="">nodes</var>, while
replacing strings in <var title="">nodes</var> with equivalent
Expand Down Expand Up @@ -2142,7 +2142,7 @@ <h4 id="interface-childnode"><span class="secno">4.2.5 </span>Interface <code><a
</ol>

<p>The
<dfn title="dom-ChildNode-replace" id="dom-childnode-replace"><code>replace(<var>nodes</var>)</code></dfn>
<dfn title="dom-ChildNode-replaceWith" id="dom-childnode-replacewith"><code>replaceWith(<var>nodes</var>)</code></dfn>
method must run these steps:

<ol>
Expand Down Expand Up @@ -9257,6 +9257,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
Erik Arvidsson,
Gavin Nicol,
Geoffrey Sneddon,
Glen Huang,
Glenn Maynard,
Harald Alvestrand,
Henri Sivonen,
Expand All @@ -9266,6 +9267,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
Jake Archibald<!-- technically B.J. Archibald -->,
Jake Verbaten,
James Graham,
James Greene,
James Robinson,
Jens Lindström,
João Eiras,
Expand Down

2 comments on commit b7563aa

@ArkadiuszMichalski
Copy link
Contributor

Choose a reason for hiding this comment

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

I realy wondering why autor of this mail had problem with replace(), but not with before() and after()?
A.before(B) << how did they deducated what must be done here? A set before B or B before A (without reading the spec?)

Personally I don't like this change, all this new methods was short and clear enought, but now you put one longer and boom...camelCases. The only plus is that some other lib use this new name, but in practice I still prefer shorter name.

@annevk
Copy link
Member Author

@annevk annevk commented on b7563aa Jun 12, 2015

Choose a reason for hiding this comment

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

In general I recommend filing issues rather than commenting on commits. The reason we changed the name here is because these names were inspired by existing libraries, that do use after()/before(), but not replace().

Please sign in to comment.