Skip to content

Replace child text content change steps #800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions dom.bs
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ urlPrefix: https://tc39.github.io/ecma262/#; spec: ECMASCRIPT
type: dfn
text: Realm; url: realm
text: surrounding agent; url: surrounding-agent
urlPrefix: https://w3c.github.io/hr-time/#; spec: HR-TIME
urlPrefix: https://w3c.github.io/hr-time/#; spec: HR-TIME-2
type:typedef; urlPrefix: dom-; text: DOMHighResTimeStamp
type:dfn; text: time origin; url: dfn-time-origin
type:dfn; text: clock resolution
@@ -967,7 +967,7 @@ correct defaults.</p>

<p class=warning>User agents should set a minimum resolution of <var>event</var>'s
{{Event/timeStamp}} attribute to 5 microseconds following the existing <a>clock resolution</a>
recommendation. [[!HR-TIME]]
recommendation. [[!HR-TIME-2]]

<li><p><a for=map>For each</a> <var>member</var> → <var>value</var> in <var>dictionary</var>, if
<var>event</var> has an attribute whose <a spec=webidl>identifier</a> is <var>member</var>, then
@@ -2421,6 +2421,11 @@ algorithm below.
adjust this further based on the requirements of the script element. There might be other ways
to define that though as Olli suggests, so leaving that out for now. -->

<p><a lt="other applicable specifications">Specifications</a> may define
<dfn export id=concept-node-children-changed-ext>children changed steps</dfn> for all or some
<a for=/>nodes</a>. The algorithm is passed no argument and is called from <a for=/>insert</a>,
<a for=/>remove</a>, and <a for=/>replace data</a>.

<p>To <dfn export id=concept-node-insert>insert</dfn> a <var>node</var> into a <var>parent</var>
before a <var>child</var>, with an optional <i>suppress observers flag</i>, run these steps:

@@ -2476,9 +2481,6 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
<li><p>If <var>parent</var> is a <a for=Element>shadow host</a> and <var>node</var> is a
<a>slotable</a>, then <a>assign a slot</a> for <var>node</var>.

<li>If <var>node</var> is a {{Text}} node, run the <a>child text content change steps</a> for
<var>parent</var>.

<li><p>If <var>parent</var>'s <a for=tree>root</a> is a <a for=/>shadow root</a>, and
<var>parent</var> is a <a>slot</a> whose <a for=slot>assigned nodes</a> is the empty list,
then run <a>signal a slot change</a> for <var>parent</var>.
@@ -2515,6 +2517,8 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run

<li><p>If <i>suppress observers flag</i> is unset, then <a>queue a tree mutation record</a> for
<var>parent</var> with <var>nodes</var>, « », <var>previousSibling</var>, and <var>child</var>.

<li><p>Run the <a>children changed steps</a> for <var>parent</var>.
</ol>


@@ -2779,8 +2783,7 @@ with an optional <i>suppress observers flag</i>, run these steps:
<var>parent</var> with « », « <var>node</var> », <var>oldPreviousSibling</var>, and
<var>oldNextSibling</var>.

<li><p>If <var>node</var> is a {{Text}} node, then run the <a>child text content change steps</a>
for <var>parent</var>.
<li><p>Run the <a>children changed steps</a> for <var>parent</var>.
</ol>


@@ -4243,10 +4246,6 @@ steps for each <a>descendant</a> <a>exclusive <code>Text</code> node</a> <var>no
(excluding itself), in <a>tree order</a>.
</ol>

<p class="note">{{Node/normalize()}} does not need to run any
<a>child text content change steps</a>, since although it messes with {{Text}} nodes extensively, it
does so specifically in a way that preserves the <a>child text content</a>.

<hr>

<dl class=domintro>
@@ -7252,8 +7251,8 @@ To <dfn export id=concept-cd-replace>replace data</dfn> of node <var>node</var>
<a for=range>end offset</a> by <var>data</var>'s <a for="JavaScript string">length</a> and decrease
it by <var>count</var>.

<li>If <var>node</var> is a {{Text}} node and its <a>parent</a> is not null, run the
<a>child text content change steps</a> for <var>node</var>'s <a>parent</a>.
<li>If <var>node</var>'s <a>parent</a> is non-null, then run the <a>children changed steps</a> for
<var>node</var>'s <a>parent</a>.
</ol>
<!-- delete happens after insert for better cursor positioning with editing
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13153 -->
@@ -7390,10 +7389,6 @@ if any, and its <a>contiguous exclusive <code>Text</code> nodes</a>, and <var>no
<var>node</var> is the <a for=string>concatenation</a> of the <a for=CharacterData>data</a> of all
the {{Text}} <a for=/>node</a> <a>children</a> of <var>node</var>, in <a>tree order</a>.

<p>This and <a lt="other applicable specifications">other specifications</a> may define
<dfn export id=concept-node-text-change-ext>child text content change steps</dfn> for
<a for=/>nodes</a>.

<p>The <dfn export id=concept-descendant-text-content>descendant text content</dfn> of a
<a for=/>node</a> <var>node</var> is the <a for=string>concatenation</a> of the
<a for=CharacterData>data</a> of all the {{Text}} <a for=/>node</a> <a>descendants</a> of