From 617566c1c6b544101e18529df0e146b6748339f7 Mon Sep 17 00:00:00 2001
From: Domenic Denicola <d@domenic.me>
Date: Wed, 29 Jun 2016 18:25:00 -0400
Subject: [PATCH 01/11] Re-add the inert="" attribute

This reverts the edits made in https://github.com/whatwg/html/commit/5ddfc78b1f82e86cc202d72ccc752a0e15f1e4ad (and https://github.com/whatwg/html/commit/b0ec7168f44ac6281e7867dc2367ffb2b66131d9) which removed the inert attribute. The inert attribute was originally added in https://github.com/whatwg/html/commit/2fb24fcf3f916236e8767e2cb72b23e5c75b77e9 as part of the <dialog> feature. It is currently being re-considered as part of the https://github.com/WICG/inert proposal.
---
 source | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/source b/source
index c127ef318d6..7053a4f81d8 100644
--- a/source
+++ b/source
@@ -72548,7 +72548,25 @@ END:VCARD</pre>
   data-x="top-layer-add">adding</span> the <code>dialog</code> element to its <span>node
   document</span>'s <span>top layer</span>.</p>
 
+ <h4>The <dfn data-x="attr-inert"><code>inert</code></dfn> attribute</h4>
 
+  <p>The <code data-x="attr-inert">inert</code> attribute is a <span>boolean attribute</span> that
+  indicates, by its presence, that the element and all its descendants is to be made
+  <span>inert</span>.</p>
+
+  <p w-nodev>When an element has an <code data-x="attr-inert">inert</code> attribute, the user agent
+  must mark that element and all its descendants as <span>inert</span>.</p>
+
+  <p class="note">By default, there is no visual indication of a subtree being inert. Authors are
+  encouraged to clearly mark what parts of their document are active and which are inert, to avoid
+  user confusion. In particular, it is worth remembering that not all users can see all parts of a
+  page at once; for example, users of screen readers, users on small devices or with magnifiers, and
+  even users just using particularly small windows might not be able to see the active part of a
+  page and may get frustrated if inert sections are not obviously inert. For individual controls,
+  the <code data-x="attr-fe-disabled">disabled</code> attribute is probably more appropriate.</p>
+
+  <p>The <dfn data-x="dom-inert"><code>inert</code></dfn> IDL attribute must <span>reflect</span>
+  the content attribute of the same name.</p>
 
   <h3>Tracking user activation</h3>
 

From fea0edb8d968ba50b7ae9db957b722ebaec1f4e9 Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Wed, 8 Aug 2018 15:44:27 +1000
Subject: [PATCH 02/11] Add advice to use default cursor

---
 source | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/source b/source
index 7053a4f81d8..5d05dad0946 100644
--- a/source
+++ b/source
@@ -72557,13 +72557,20 @@ END:VCARD</pre>
   <p w-nodev>When an element has an <code data-x="attr-inert">inert</code> attribute, the user agent
   must mark that element and all its descendants as <span>inert</span>.</p>
 
-  <p class="note">By default, there is no visual indication of a subtree being inert. Authors are
-  encouraged to clearly mark what parts of their document are active and which are inert, to avoid
-  user confusion. In particular, it is worth remembering that not all users can see all parts of a
-  page at once; for example, users of screen readers, users on small devices or with magnifiers, and
-  even users just using particularly small windows might not be able to see the active part of a
-  page and may get frustrated if inert sections are not obviously inert. For individual controls,
-  the <code data-x="attr-fe-disabled">disabled</code> attribute is probably more appropriate.</p>
+  <p class="note">By default, there is no persistent visual indication of a subtree being inert.
+  Since inert subtrees may not be the target of user interaction events,
+  including text selection,
+  user agents should show the default cursor when an the user indicates an element in an inert subtree
+  using a pointing device.
+  Authors are encouraged to clearly mark what parts of their document are active and which are inert,
+  to avoid user confusion.
+  In particular, it is worth remembering that not all users can see all parts of a page at once;
+  for example, users of screen readers, users on small devices or with magnifiers,
+  and even users just using particularly small windows
+  might not be able to see the active part of a page and may get frustrated
+  if inert sections are not obviously inert.
+  For individual controls, the <code data-x="attr-fe-disabled">disabled</code> attribute
+  is probably more appropriate.</p>
 
   <p>The <dfn data-x="dom-inert"><code>inert</code></dfn> IDL attribute must <span>reflect</span>
   the content attribute of the same name.</p>

From 4faaca339a1b708fa63eb07f6eac62a55a9631ca Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Tue, 8 Jan 2019 11:21:26 +1100
Subject: [PATCH 03/11] Clarify mouse pointer and event behaviour

---
 source | 54 +++++++++++++++++++++++++++++-------------------------
 1 file changed, 29 insertions(+), 25 deletions(-)

diff --git a/source b/source
index 5d05dad0946..04778ca3d40 100644
--- a/source
+++ b/source
@@ -72507,25 +72507,35 @@ END:VCARD</pre>
   <h3>Inert subtrees</h3>
 
   <p class="note">This section <strong>does not</strong> define or create any content attribute
-  named "inert". This section merely defines an abstract <em>concept</em> of
-  <span data-x="inert">inertness</span>.</p>
+  named "inert". This section merely defines an abstract <em>concept</em> of <span
+  data-x="inert">inertness</span>. See <code data-x="attr-inert">inert</code> for an explanation of
+  the attribute of the same name.</p>
 
   <p>A node (in particular elements and text nodes) can be marked as <dfn>inert</dfn>. When a node
-  is <span>inert</span>, then the user agent must act as if the node was absent for the purposes of
-  targeting user interaction events, may ignore the node for the purposes of
-  <span>find-in-page</span>, and may prevent the user from selecting text in that node. User agents
-  should allow the user to override the restrictions on search and text selection, however.</p>
+  is <span>inert</span>, then:</p>
+
+ <ul>
+   <li><p>the user agent must act as if the node's <span>event listener list</span> is empty for the
+   purposes of <span data-x="concept-event-listener-invoke">event invocation</span>,</p></li>
+   <li><p>the user agent may ignore the node for the purposes of <span>find-in-page</span>, and</p></li>
+   <li><p>the user agent may prevent the user from selecting text in that node.</p></li>
+  </ul>
+
+  <p>User agents should allow the user to override the restrictions on search and text selection,
+  however.</p>
 
   <p class="example">For example, consider a page that consists of just a single <span>inert</span>
-  paragraph positioned in the middle of a <code>body</code>. If a user moves their pointing device
-  from the <code>body</code> over to the <span>inert</span> paragraph and clicks on the paragraph,
-  no <code data-x="event-mouseover">mouseover</code> event would be fired, and the <code
-  data-x="event-mousemove">mousemove</code> and <code data-x="event-click">click</code> events would
-  be fired on the <code>body</code> element rather than the paragraph.</p>
+  <code>button</code> positioned in the middle of a <code>body</code>. If a user clicks on the
+  button, the <code data-x="event-click">click</code> event would cause no event listeners on
+  <code>button</code> to be run, and the event would bubble up to the <code>body</code> element
+  regardless of any event listeners on the <code>button</code>.</p>
 
   <p class="note">When a node is inert, it generally cannot be focused. Inert nodes that are <span
   data-x="concept-command">commands</span> will also get disabled.</p>
 
+  <p>User agents should show the default cursor when a user indicates an element in an inert subtree
+  using a pointing device.</p>
+
   <p>While a <span>browsing context container</span> is marked as <span>inert</span>, its
   <span>nested browsing context</span>'s <span>active document</span>, and all nodes in that
   <code>Document</code>, must be marked as <span>inert</span>.</p>
@@ -72548,7 +72558,7 @@ END:VCARD</pre>
   data-x="top-layer-add">adding</span> the <code>dialog</code> element to its <span>node
   document</span>'s <span>top layer</span>.</p>
 
- <h4>The <dfn data-x="attr-inert"><code>inert</code></dfn> attribute</h4>
+  <h4>The <dfn data-x="attr-inert"><code>inert</code></dfn> attribute</h4>
 
   <p>The <code data-x="attr-inert">inert</code> attribute is a <span>boolean attribute</span> that
   indicates, by its presence, that the element and all its descendants is to be made
@@ -72558,19 +72568,13 @@ END:VCARD</pre>
   must mark that element and all its descendants as <span>inert</span>.</p>
 
   <p class="note">By default, there is no persistent visual indication of a subtree being inert.
-  Since inert subtrees may not be the target of user interaction events,
-  including text selection,
-  user agents should show the default cursor when an the user indicates an element in an inert subtree
-  using a pointing device.
-  Authors are encouraged to clearly mark what parts of their document are active and which are inert,
-  to avoid user confusion.
-  In particular, it is worth remembering that not all users can see all parts of a page at once;
-  for example, users of screen readers, users on small devices or with magnifiers,
-  and even users just using particularly small windows
-  might not be able to see the active part of a page and may get frustrated
-  if inert sections are not obviously inert.
-  For individual controls, the <code data-x="attr-fe-disabled">disabled</code> attribute
-  is probably more appropriate.</p>
+  Authors are encouraged to clearly mark what parts of their document are active and which are
+  inert, to avoid user confusion.  In particular, it is worth remembering that not all users can see
+  all parts of a page at once; for example, users of screen readers, users on small devices or with
+  magnifiers, and even users just using particularly small windows might not be able to see the
+  active part of a page and might get frustrated if inert sections are not obviously inert. For
+  individual controls, the <code data-x="attr-fe-disabled">disabled</code> attribute is probably
+  more appropriate.</p>
 
   <p>The <dfn data-x="dom-inert"><code>inert</code></dfn> IDL attribute must <span>reflect</span>
   the content attribute of the same name.</p>

From 0819a4b0155c961d039a4b03ad5cf6f7ae49bd8b Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Tue, 19 Mar 2019 15:23:19 +1100
Subject: [PATCH 04/11] Add touch events and comments on hit testing

---
 source | 55 ++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 48 insertions(+), 7 deletions(-)

diff --git a/source b/source
index 04778ca3d40..68dd89f59f2 100644
--- a/source
+++ b/source
@@ -72514,11 +72514,53 @@ END:VCARD</pre>
   <p>A node (in particular elements and text nodes) can be marked as <dfn>inert</dfn>. When a node
   is <span>inert</span>, then:</p>
 
- <ul>
-   <li><p>the user agent must act as if the node's <span>event listener list</span> is empty for the
-   purposes of <span data-x="concept-event-listener-invoke">event invocation</span>,</p></li>
-   <li><p>the user agent may ignore the node for the purposes of <span>find-in-page</span>, and</p></li>
-   <li><p>the user agent may prevent the user from selecting text in that node.</p></li>
+  <ul>
+   <li>
+    <p>the user agent must not fire any of the following events on the node:</p>
+    <ul>
+     <li><p><code data-x="event-blur">blur</code></p></li>
+     <li><p><code data-x="event-focus">focus</code></p></li>
+     <li><p><code data-x="event-focusin">focusin</code></p></li>
+     <li><p><code data-x="event-focusout">focusout</code></p></li>
+     <li><p><code data-x="event-auxclick">auxclick</code></p></li>
+     <li><p><code data-x="event-click">click</code></p></li>
+     <li><p><code data-x="event-dblclick">dblclick</code></p></li>
+     <li><p><code data-x="event-mousedown">mousedown</code></p></li>
+     <li><p><code data-x="event-mouseenter">mouseenter</code></p></li>
+     <li><p><code data-x="event-mouseleave">mouseleave</code></p></li>
+     <li><p><code data-x="event-mousemove">mousemove</code></p></li>
+     <li><p><code data-x="event-mouseout">mouseout</code></p></li>
+     <li><p><code data-x="event-mouseover">mouseover</code></p></li>
+     <li><p><code data-x="event-mouseup">mouseup</code></p></li>
+     <li><p><code data-x="event-touchstart">touchstart</code></p></li>
+     <li><p><code data-x="event-touchend">touchend</code></p></li>
+     <li><p><code data-x="event-touchmove">touchmove</code></p></li>
+     <li><p><code data-x="event-touchcancel">touchcancel</code></p></li>
+     <li><p><code data-x="event-wheel">wheel</code></p></li>
+     <li><p><code data-x="event-beforeinput">beforeinput</code></p></li>
+     <li><p><code data-x="event-input">input</code></p></li>
+     <li><p><code data-x="event-keydown">keydown</code></p></li>
+     <li><p><code data-x="event-keyup">keyup</code></p></li>
+     <li><p><code data-x="event-compositionstart">compositionstart</code></p></li>
+     <li><p><code data-x="event-compositionupdate">compositionupdate</code></p></li>
+     <li><p><code data-x="event-compositionend">compositionend</code></p></li>
+    </ul>
+   </li>
+
+   <li><p>if one of the above events would otherwise be fired on the element
+   as a result of a user interaction, where the process for determining the
+   event target entails "hit testing", the event must instead be targeted at
+   the non-inert ancestor of the element which would be the topmost "hit
+   testing" result for the point at which the interaction occurred, if the inert
+   element, its inert ancestors, and any unrelated elements were not
+   present;</p></li>
+
+   <li><p>the user agent may ignore the node for the purposes of text search user interfaces
+   (commonly known as "find in page"); and</p></li>
+
+   <li><p>the user agent may prevent the user from selecting text in that node, and may prevent
+   code calling <code data-x="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
+   on the node.</p></li>
   </ul>
 
   <p>User agents should allow the user to override the restrictions on search and text selection,
@@ -72527,8 +72569,7 @@ END:VCARD</pre>
   <p class="example">For example, consider a page that consists of just a single <span>inert</span>
   <code>button</code> positioned in the middle of a <code>body</code>. If a user clicks on the
   button, the <code data-x="event-click">click</code> event would cause no event listeners on
-  <code>button</code> to be run, and the event would bubble up to the <code>body</code> element
-  regardless of any event listeners on the <code>button</code>.</p>
+  <code>button</code> to be run, and the event would instead be targeted at the <code>body</code> element.</p>
 
   <p class="note">When a node is inert, it generally cannot be focused. Inert nodes that are <span
   data-x="concept-command">commands</span> will also get disabled.</p>

From c173dae2267dda1a7dd7d7f8fae8f56115386510 Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Fri, 22 Mar 2019 15:13:47 +1100
Subject: [PATCH 05/11] Clarify event retargeting, and mention inertness in the
 definition of .

---
 source | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/source b/source
index 68dd89f59f2..77380469d51 100644
--- a/source
+++ b/source
@@ -3053,7 +3053,19 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      <li><dfn data-x="event-keydown" data-x-href="https://w3c.github.io/uievents/#event-type-keydown"><code>keydown</code></dfn> event</li>
      <li><dfn data-x="event-keypress" data-x-href="https://w3c.github.io/uievents/#event-type-keypress"><code>keypress</code></dfn> event</li>
      <li><dfn data-x="event-keyup" data-x-href="https://w3c.github.io/uievents/#event-type-keyup"><code>keyup</code></dfn> event</li>
-    </ul>
+
+     <li><dfn data-x="event-focusin" data-x-href="https://w3c.github.io/uievents/#event-type-focusin"><code>focusin</code></dfn> event</li>
+     <li><dfn data-x="event-focusout" data-x-href="https://w3c.github.io/uievents/#event-type-focusout"><code>focusout</code></dfn> event</li>
+
+     <li><dfn data-x="event-beforeinput" data-x-href="https://w3c.github.io/uievents/#event-type-beforeinput"><code>beforeinput</code></dfn> event</li>
+
+     <li><dfn data-x="event-compositionstart" data-x-href="https://w3c.github.io/uievents/#event-type-compositionstart"><code>compositionstart</code></dfn> event</li>
+     <li><dfn data-x="event-compositionupdate" data-x-href="https://w3c.github.io/uievents/#event-type-compositionupdate"><code>compositionupdate</code></dfn> event</li>
+     <li><dfn data-x="event-compositionend" data-x-href="https://w3c.github.io/uievents/#event-type-compositionend"><code>compositionend</code></dfn> event</li>
+
+     <li>The <dfn data-x="event-target" data-x-href="https://w3c.github.io/uievents/#event-target">event target</dfn> concept</li>
+     <li>The <dfn data-x="topmost-event-target" data-x-href="https://w3c.github.io/uievents/#topmost-event-target">topmost event target</dfn> concept</li>
+  </ul>
 
     <p>The following features are defined in <cite>Touch Events</cite>: <ref spec=TOUCH></p>
 

From 5da910e9c8e12244787832be45ada76e809fbad3 Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Fri, 22 Mar 2019 17:01:36 +1100
Subject: [PATCH 06/11] Rephrase and capitalise

---
 source | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/source b/source
index 77380469d51..734d4318f03 100644
--- a/source
+++ b/source
@@ -72518,9 +72518,7 @@ END:VCARD</pre>
 
   <h3>Inert subtrees</h3>
 
-  <p class="note">This section <strong>does not</strong> define or create any content attribute
-  named "inert". This section merely defines an abstract <em>concept</em> of <span
-  data-x="inert">inertness</span>. See <code data-x="attr-inert">inert</code> for an explanation of
+  <p class="note">See also <code data-x="attr-inert">inert</code> for an explanation of
   the attribute of the same name.</p>
 
   <p>A node (in particular elements and text nodes) can be marked as <dfn>inert</dfn>. When a node
@@ -72559,13 +72557,31 @@ END:VCARD</pre>
     </ul>
    </li>
 
-   <li><p>if one of the above events would otherwise be fired on the element
-   as a result of a user interaction, where the process for determining the
-   event target entails "hit testing", the event must instead be targeted at
-   the non-inert ancestor of the element which would be the topmost "hit
-   testing" result for the point at which the interaction occurred, if the inert
-   element, its inert ancestors, and any unrelated elements were not
-   present;</p></li>
+   <li>
+    <p>If one of the following events would be fired as a result of user input, such that the
+    <span>inert</span> element would be the <span data-x="topmost-event-target">topmost event
+    target</span>, an alternative <span data-x="event-target">event target</span> must be found as
+    follows:</p>
+    <ol>
+     <li><p>Let <var>originalElement</var> be the <span data-x="topmost-event-target">topmost event
+     target</span> for the event.</p></li>
+     <li><p>Let <var>candidate</var> be the same element.</p></li>
+     <li><p>Let <var>ineligible</var> be an empty list.</p></li>
+     <li>
+      <p>While <var>candidate</var> is <span>inert</span>, or <var>candidate</var> is not an an
+      ancestor of <var>originalElement</var>:</p>
+      <ol>
+       <li><p>Add <var>candidate</var> to <var>ineligible</var>.</p></li>
+       <li><p>Let <var>candidate</var> be the element which would be the <span
+       data-x="topmost-event-target">topmost event target</span> if all the elements in
+       <var>ineligible</var> were excluded from consideration.</p></li>
+      </ol>
+     </li>
+     <li><p>If <var>candidate</var> is not null, let <var>candidate</var> be the new <span
+     data-x="event-target">event target</span>.</p></li>
+     <li><p>Otherwise, do not fire the event.</p></li>
+    </ol>
+   </li>
 
    <li><p>the user agent may ignore the node for the purposes of text search user interfaces
    (commonly known as "find in page"); and</p></li>

From 2f1b841ea66566fa431a5937698ef540f9a3c41f Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Fri, 12 Apr 2019 14:35:36 +1000
Subject: [PATCH 07/11] Remove list of forbidden events, and clarify behaviour
 for shadow trees and iframes

---
 source | 40 +++-------------------------------------
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/source b/source
index 734d4318f03..676a4d500f3 100644
--- a/source
+++ b/source
@@ -72526,39 +72526,7 @@ END:VCARD</pre>
 
   <ul>
    <li>
-    <p>the user agent must not fire any of the following events on the node:</p>
-    <ul>
-     <li><p><code data-x="event-blur">blur</code></p></li>
-     <li><p><code data-x="event-focus">focus</code></p></li>
-     <li><p><code data-x="event-focusin">focusin</code></p></li>
-     <li><p><code data-x="event-focusout">focusout</code></p></li>
-     <li><p><code data-x="event-auxclick">auxclick</code></p></li>
-     <li><p><code data-x="event-click">click</code></p></li>
-     <li><p><code data-x="event-dblclick">dblclick</code></p></li>
-     <li><p><code data-x="event-mousedown">mousedown</code></p></li>
-     <li><p><code data-x="event-mouseenter">mouseenter</code></p></li>
-     <li><p><code data-x="event-mouseleave">mouseleave</code></p></li>
-     <li><p><code data-x="event-mousemove">mousemove</code></p></li>
-     <li><p><code data-x="event-mouseout">mouseout</code></p></li>
-     <li><p><code data-x="event-mouseover">mouseover</code></p></li>
-     <li><p><code data-x="event-mouseup">mouseup</code></p></li>
-     <li><p><code data-x="event-touchstart">touchstart</code></p></li>
-     <li><p><code data-x="event-touchend">touchend</code></p></li>
-     <li><p><code data-x="event-touchmove">touchmove</code></p></li>
-     <li><p><code data-x="event-touchcancel">touchcancel</code></p></li>
-     <li><p><code data-x="event-wheel">wheel</code></p></li>
-     <li><p><code data-x="event-beforeinput">beforeinput</code></p></li>
-     <li><p><code data-x="event-input">input</code></p></li>
-     <li><p><code data-x="event-keydown">keydown</code></p></li>
-     <li><p><code data-x="event-keyup">keyup</code></p></li>
-     <li><p><code data-x="event-compositionstart">compositionstart</code></p></li>
-     <li><p><code data-x="event-compositionupdate">compositionupdate</code></p></li>
-     <li><p><code data-x="event-compositionend">compositionend</code></p></li>
-    </ul>
-   </li>
-
-   <li>
-    <p>If one of the following events would be fired as a result of user input, such that the
+    <p>If an event would be fired as a result of user input, such that the
     <span>inert</span> element would be the <span data-x="topmost-event-target">topmost event
     target</span>, an alternative <span data-x="event-target">event target</span> must be found as
     follows:</p>
@@ -72583,12 +72551,10 @@ END:VCARD</pre>
     </ol>
    </li>
 
-   <li><p>the user agent may ignore the node for the purposes of text search user interfaces
+   <li><p>The user agent may ignore the node for the purposes of text search user interfaces
    (commonly known as "find in page"); and</p></li>
 
-   <li><p>the user agent may prevent the user from selecting text in that node, and may prevent
-   code calling <code data-x="dom-textarea/input-setSelectionRange">setSelectionRange()</code>
-   on the node.</p></li>
+   <li><p>The user agent may prevent the user from selecting text in that node.</p></li>
   </ul>
 
   <p>User agents should allow the user to override the restrictions on search and text selection,

From a69465a6ef877ada931dc9788fd718a8df897adb Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Fri, 3 May 2019 09:47:28 +1000
Subject: [PATCH 08/11] Address Anne's comments

---
 source | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/source b/source
index 676a4d500f3..007277f1290 100644
--- a/source
+++ b/source
@@ -3054,15 +3054,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      <li><dfn data-x="event-keypress" data-x-href="https://w3c.github.io/uievents/#event-type-keypress"><code>keypress</code></dfn> event</li>
      <li><dfn data-x="event-keyup" data-x-href="https://w3c.github.io/uievents/#event-type-keyup"><code>keyup</code></dfn> event</li>
 
-     <li><dfn data-x="event-focusin" data-x-href="https://w3c.github.io/uievents/#event-type-focusin"><code>focusin</code></dfn> event</li>
-     <li><dfn data-x="event-focusout" data-x-href="https://w3c.github.io/uievents/#event-type-focusout"><code>focusout</code></dfn> event</li>
-
-     <li><dfn data-x="event-beforeinput" data-x-href="https://w3c.github.io/uievents/#event-type-beforeinput"><code>beforeinput</code></dfn> event</li>
-
-     <li><dfn data-x="event-compositionstart" data-x-href="https://w3c.github.io/uievents/#event-type-compositionstart"><code>compositionstart</code></dfn> event</li>
-     <li><dfn data-x="event-compositionupdate" data-x-href="https://w3c.github.io/uievents/#event-type-compositionupdate"><code>compositionupdate</code></dfn> event</li>
-     <li><dfn data-x="event-compositionend" data-x-href="https://w3c.github.io/uievents/#event-type-compositionend"><code>compositionend</code></dfn> event</li>
-
      <li>The <dfn data-x="event-target" data-x-href="https://w3c.github.io/uievents/#event-target">event target</dfn> concept</li>
      <li>The <dfn data-x="topmost-event-target" data-x-href="https://w3c.github.io/uievents/#topmost-event-target">topmost event target</dfn> concept</li>
   </ul>
@@ -55137,6 +55128,8 @@ MIT Room 32-G524
    apply">does not apply</span> to this element, throw an
    <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
 
+   <li><p>If this element is <code>inert</code>, return.</p></li>
+
    <li><p><span>Set the selection range</span> with <var>start</var>, <var>end</var>, and
    <var>direction</var>.</p></li>
   </ol>
@@ -72540,9 +72533,10 @@ END:VCARD</pre>
       ancestor of <var>originalElement</var>:</p>
       <ol>
        <li><p>Add <var>candidate</var> to <var>ineligible</var>.</p></li>
-       <li><p>Let <var>candidate</var> be the element which would be the <span
+       <li><p>Set <var>candidate</var> to the element which would be the <span
        data-x="topmost-event-target">topmost event target</span> if all the elements in
-       <var>ineligible</var> were excluded from consideration.</p></li>
+       <var>ineligible</var> were excluded from consideration, or null if no such element
+       exists.</p></li>
       </ol>
      </li>
      <li><p>If <var>candidate</var> is not null, let <var>candidate</var> be the new <span
@@ -72557,13 +72551,14 @@ END:VCARD</pre>
    <li><p>The user agent may prevent the user from selecting text in that node.</p></li>
   </ul>
 
-  <p>User agents should allow the user to override the restrictions on search and text selection,
+  <p>User agents may allow the user to override the restrictions on search and text selection,
   however.</p>
 
-  <p class="example">For example, consider a page that consists of just a single <span>inert</span>
+  <p class="example">Consider a page that consists of just a single <span>inert</span>
   <code>button</code> positioned in the middle of a <code>body</code>. If a user clicks on the
   button, the <code data-x="event-click">click</code> event would cause no event listeners on
-  <code>button</code> to be run, and the event would instead be targeted at the <code>body</code> element.</p>
+  <code>button</code> to be run, and the event would instead be targeted at the <code>body</code>
+  element.</p>
 
   <p class="note">When a node is inert, it generally cannot be focused. Inert nodes that are <span
   data-x="concept-command">commands</span> will also get disabled.</p>
@@ -72571,6 +72566,8 @@ END:VCARD</pre>
   <p>User agents should show the default cursor when a user indicates an element in an inert subtree
   using a pointing device.</p>
 
+  <p>By default, an element is not <span>inert</span>.</p>
+
   <p>While a <span>browsing context container</span> is marked as <span>inert</span>, its
   <span>nested browsing context</span>'s <span>active document</span>, and all nodes in that
   <code>Document</code>, must be marked as <span>inert</span>.</p>

From 24ae880b31ed1bc9445717f697927cdc64611896 Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Wed, 12 Jun 2019 14:13:50 +1000
Subject: [PATCH 09/11] s/when/while/

---
 source | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/source b/source
index 007277f1290..59afe7ee451 100644
--- a/source
+++ b/source
@@ -1,4 +1,4 @@
-<!-- -*- mode: Text; fill-column: 100 -*- vim: set textwidth=100 :
+<!-- -*- mode: Text; fill-column: 100 -*- vim: set textwidth=100 :	
  !   EDITOR NOTES
  !
  !   Adding a new element involves editing the following sections:
@@ -72593,11 +72593,11 @@ END:VCARD</pre>
   <h4>The <dfn data-x="attr-inert"><code>inert</code></dfn> attribute</h4>
 
   <p>The <code data-x="attr-inert">inert</code> attribute is a <span>boolean attribute</span> that
-  indicates, by its presence, that the element and all its descendants is to be made
-  <span>inert</span>.</p>
+  indicates, by its presence, that the element and all its shadow-including descendants is to be
+  made <span>inert</span>.</p>
 
-  <p w-nodev>When an element has an <code data-x="attr-inert">inert</code> attribute, the user agent
-  must mark that element and all its descendants as <span>inert</span>.</p>
+  <p w-nodev>While an element has an <code data-x="attr-inert">inert</code> attribute, the user
+  agent must mark that element and all its shadow-including descendants as <span>inert</span>.</p>
 
   <p class="note">By default, there is no persistent visual indication of a subtree being inert.
   Authors are encouraged to clearly mark what parts of their document are active and which are

From 825167f8b6a2844e866a214c41662779aed5f5dd Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Wed, 25 Sep 2019 14:14:58 +1000
Subject: [PATCH 10/11] Inert acts on the flat tree, not shadow-including
 descendants.

---
 source | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/source b/source
index 59afe7ee451..e399a8dbebb 100644
--- a/source
+++ b/source
@@ -3695,7 +3695,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
     <p>The following terms are defined in the <cite>CSS Scoping</cite>: <ref spec=CSSSCOPING></p>
 
     <ul class="brief">
-     <li><dfn data-x-href="https://drafts.csswg.org/css-scoping/#flat-tree">flat tree</dfn></li>
+     <li><dfn id="flat-tree" data-x-href="https://drafts.csswg.org/css-scoping/#flat-tree">flat tree</dfn></li>
     </ul>
 
     <p>The following terms and features are defined in <cite>CSS Color Adjustment</cite>: <ref
@@ -72530,7 +72530,7 @@ END:VCARD</pre>
      <li><p>Let <var>ineligible</var> be an empty list.</p></li>
      <li>
       <p>While <var>candidate</var> is <span>inert</span>, or <var>candidate</var> is not an an
-      ancestor of <var>originalElement</var>:</p>
+      ancestor of <var>originalElement</var> in the <span>flat tree</span>:</p>
       <ol>
        <li><p>Add <var>candidate</var> to <var>ineligible</var>.</p></li>
        <li><p>Set <var>candidate</var> to the element which would be the <span
@@ -72597,7 +72597,8 @@ END:VCARD</pre>
   made <span>inert</span>.</p>
 
   <p w-nodev>While an element has an <code data-x="attr-inert">inert</code> attribute, the user
-  agent must mark that element and all its shadow-including descendants as <span>inert</span>.</p>
+  agent must mark that element and all its <span>flat tree</span> descendants as
+  <span>inert</span>.</p>
 
   <p class="note">By default, there is no persistent visual indication of a subtree being inert.
   Authors are encouraged to clearly mark what parts of their document are active and which are

From 221575608a98ac290fea2452439f7a0fa3001381 Mon Sep 17 00:00:00 2001
From: Alice Boxhall <aboxhall@chromium.org>
Date: Tue, 16 Feb 2021 21:00:20 +1100
Subject: [PATCH 11/11] Fix up merge issues

---
 source | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source b/source
index e399a8dbebb..42db70e37d2 100644
--- a/source
+++ b/source
@@ -1,4 +1,4 @@
-<!-- -*- mode: Text; fill-column: 100 -*- vim: set textwidth=100 :	
+<!-- -*- mode: Text; fill-column: 100 -*- vim: set textwidth=100 :
  !   EDITOR NOTES
  !
  !   Adding a new element involves editing the following sections:
@@ -3695,7 +3695,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
     <p>The following terms are defined in the <cite>CSS Scoping</cite>: <ref spec=CSSSCOPING></p>
 
     <ul class="brief">
-     <li><dfn id="flat-tree" data-x-href="https://drafts.csswg.org/css-scoping/#flat-tree">flat tree</dfn></li>
+     <li><dfn data-x-href="https://drafts.csswg.org/css-scoping/#flat-tree">flat tree</dfn></li>
     </ul>
 
     <p>The following terms and features are defined in <cite>CSS Color Adjustment</cite>: <ref