<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[281930] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/281930">281930</a></dd>
<dt>Author</dt> <dd>ntim@apple.com</dd>
<dt>Date</dt> <dd>2021-09-02 09:39:48 -0700 (Thu, 02 Sep 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add more inert checks for selection-related functionality
https://bugs.webkit.org/show_bug.cgi?id=229728

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/inert/inert-node-is-unselectable.tentative-expected.txt:

Source/WebCore:

Test: LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unselectable.tentative.html

* dom/Position.cpp:
(WebCore::Position::nodeIsInertOrUserSelectNone):
(WebCore::Position::isCandidate const):
(WebCore::Position::nodeIsUserSelectNone): Deleted.
(WebCore::Position::nodeIsUserSelectAll):
* dom/Position.h:
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate const):
* page/EventHandler.cpp:
(WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::collectSelectionGeometriesInternal):

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::selectionPositionInformation):

LayoutTests:

* TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsinertinertnodeisunselectabletentativeexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unselectable.tentative-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCoredomPositioncpp">trunk/Source/WebCore/dom/Position.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPositionh">trunk/Source/WebCore/dom/Position.h</a></li>
<li><a href="#trunkSourceWebCoredomPositionIteratorcpp">trunk/Source/WebCore/dom/PositionIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjectcpp">trunk/Source/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/LayoutTests/ChangeLog 2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2021-09-02  Tim Nguyen  <ntim@apple.com>
+
+        Add more inert checks for selection-related functionality
+        https://bugs.webkit.org/show_bug.cgi?id=229728
+
+        Reviewed by Antti Koivisto.
+
+        * TestExpectations:
+
</ins><span class="cx"> 2021-09-02  Ayumi Kojima  <ayumi_kojima@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [ iOS ] SHOULD NEVER BE REACHED ./Modules/mediastream/MediaStreamTrack.cpp(294) : WebCore::DoubleRange WebCore::capabilityDoubleRange(const WebCore::CapabilityValueOrRange &).
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/LayoutTests/TestExpectations  2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -2399,9 +2399,6 @@
</span><span class="cx"> webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-containing-block.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-stacking.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><del>-# inert subtrees
-webkit.org/b/110952 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-not-highlighted.html [ ImageOnlyFailure ]
-
</del><span class="cx"> # Assertion failure in MessagePort::contextDestroyed, usually attributed to later tests
</span><span class="cx"> webkit.org/b/94458 http/tests/security/MessagePort/event-listener-context.html [ Skip ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2021-09-02  Tim Nguyen  <ntim@apple.com>
+
+        Add more inert checks for selection-related functionality
+        https://bugs.webkit.org/show_bug.cgi?id=229728
+
+        Reviewed by Antti Koivisto.
+
+        * web-platform-tests/inert/inert-node-is-unselectable.tentative-expected.txt:
+
</ins><span class="cx"> 2021-09-02  Antti Koivisto  <antti@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [CSS Cascade Layers] Support layer argument in @import rules
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsinertinertnodeisunselectabletentativeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unselectable.tentative-expected.txt (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unselectable.tentative-expected.txt        2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unselectable.tentative-expected.txt   2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> Here is a text node you can't select.
</span><span class="cx"> I'm selectable.
</span><span class="cx"> 
</span><del>-FAIL Inert nodes cannot be selected. assert_equals: expected "I'm selectable." but got "Here is a text node you can't select.\nI'm selectable."
</del><ins>+PASS Inert nodes cannot be selected.
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebCore/ChangeLog      2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2021-09-02  Tim Nguyen  <ntim@apple.com>
+
+        Add more inert checks for selection-related functionality
+        https://bugs.webkit.org/show_bug.cgi?id=229728
+
+        Reviewed by Antti Koivisto.
+
+        Test: LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unselectable.tentative.html
+
+        * dom/Position.cpp:
+        (WebCore::Position::nodeIsInertOrUserSelectNone):
+        (WebCore::Position::isCandidate const):
+        (WebCore::Position::nodeIsUserSelectNone): Deleted.
+        (WebCore::Position::nodeIsUserSelectAll):
+        * dom/Position.h:
+        * dom/PositionIterator.cpp:
+        (WebCore::PositionIterator::isCandidate const):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::collectSelectionGeometriesInternal):
+
</ins><span class="cx"> 2021-09-02  Antti Koivisto  <antti@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [CSS Cascade Layers] Support layer argument in @import rules
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h  2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebCore/dom/Node.h     2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -529,7 +529,7 @@
</span><span class="cx">     // https://github.com/WICG/inert/blob/master/README.md
</span><span class="cx">     // This can't be in Element because text nodes must be recognized as
</span><span class="cx">     // inert to prevent text selection.
</span><del>-    bool isInert() const;
</del><ins>+    WEBCORE_EXPORT bool isInert() const;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     enum class NodeFlag : uint32_t {
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp    2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebCore/dom/Position.cpp       2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -935,14 +935,20 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Position::nodeIsUserSelectNone(Node* node)
</del><ins>+bool Position::nodeIsInertOrUserSelectNone(Node* node)
</ins><span class="cx"> {
</span><del>-    return node && node->renderer() && node->renderer()->style().userSelect() == UserSelect::None;
</del><ins>+    if (!node)
+        return false;
+    if (node->isInert())
+        return true;
+    return node->renderer() && node->renderer()->style().userSelect() == UserSelect::None;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Position::nodeIsUserSelectAll(const Node* node)
</span><span class="cx"> {
</span><del>-    return node && node->renderer() && node->renderer()->style().userSelect() == UserSelect::All;
</del><ins>+    if (!node || node->isInert())
+        return false;
+    return node->renderer() && node->renderer()->style().userSelect() == UserSelect::All;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Node* Position::rootUserSelectAllForNode(Node* node)
</span><span class="lines">@@ -982,16 +988,16 @@
</span><span class="cx"> 
</span><span class="cx">     if (renderer->isBR()) {
</span><span class="cx">         // FIXME: The condition should be m_anchorType == PositionIsBeforeAnchor, but for now we still need to support legacy positions.
</span><del>-        return !m_offset && m_anchorType != PositionIsAfterAnchor && !nodeIsUserSelectNone(deprecatedNode()->parentNode());
</del><ins>+        return !m_offset && m_anchorType != PositionIsAfterAnchor && !nodeIsInertOrUserSelectNone(deprecatedNode()->parentNode());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (is<RenderText>(*renderer))
</span><del>-        return !nodeIsUserSelectNone(deprecatedNode()) && downcast<RenderText>(*renderer).containsCaretOffset(m_offset);
</del><ins>+        return !nodeIsInertOrUserSelectNone(deprecatedNode()) && downcast<RenderText>(*renderer).containsCaretOffset(m_offset);
</ins><span class="cx"> 
</span><span class="cx">     if (positionBeforeOrAfterNodeIsCandidate(*deprecatedNode())) {
</span><span class="cx">         return ((atFirstEditingPositionForNode() && m_anchorType == PositionIsBeforeAnchor)
</span><span class="cx">             || (atLastEditingPositionForNode() && m_anchorType == PositionIsAfterAnchor))
</span><del>-            && !nodeIsUserSelectNone(deprecatedNode()->parentNode());
</del><ins>+            && !nodeIsInertOrUserSelectNone(deprecatedNode()->parentNode());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (is<HTMLHtmlElement>(*m_anchorNode))
</span><span class="lines">@@ -1001,13 +1007,13 @@
</span><span class="cx">         auto& block = downcast<RenderBlock>(*renderer);
</span><span class="cx">         if (block.logicalHeight() || is<HTMLBodyElement>(*m_anchorNode) || m_anchorNode->isRootEditableElement()) {
</span><span class="cx">             if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(block))
</span><del>-                return atFirstEditingPositionForNode() && !Position::nodeIsUserSelectNone(deprecatedNode());
-            return m_anchorNode->hasEditableStyle() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
</del><ins>+                return atFirstEditingPositionForNode() && !Position::nodeIsInertOrUserSelectNone(deprecatedNode());
+            return m_anchorNode->hasEditableStyle() && !Position::nodeIsInertOrUserSelectNone(deprecatedNode()) && atEditingBoundary();
</ins><span class="cx">         }
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return m_anchorNode->hasEditableStyle() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
</del><ins>+    return m_anchorNode->hasEditableStyle() && !Position::nodeIsInertOrUserSelectNone(deprecatedNode()) && atEditingBoundary();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Position::isRenderedCharacter() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.h (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.h      2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebCore/dom/Position.h 2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx">     static unsigned positionCountBetweenPositions(const Position&, const Position&);
</span><span class="cx"> 
</span><span class="cx">     static bool hasRenderedNonAnonymousDescendantsWithHeight(const RenderElement&);
</span><del>-    static bool nodeIsUserSelectNone(Node*);
</del><ins>+    static bool nodeIsInertOrUserSelectNone(Node*);
</ins><span class="cx">     static bool nodeIsUserSelectAll(const Node*);
</span><span class="cx">     static Node* rootUserSelectAllForNode(Node*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositionIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PositionIterator.cpp (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PositionIterator.cpp    2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebCore/dom/PositionIterator.cpp       2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -162,10 +162,10 @@
</span><span class="cx">         return Position(*this).isCandidate();
</span><span class="cx"> 
</span><span class="cx">     if (is<RenderText>(*renderer))
</span><del>-        return !Position::nodeIsUserSelectNone(m_anchorNode) && downcast<RenderText>(*renderer).containsCaretOffset(m_offsetInAnchor);
</del><ins>+        return !Position::nodeIsInertOrUserSelectNone(m_anchorNode) && downcast<RenderText>(*renderer).containsCaretOffset(m_offsetInAnchor);
</ins><span class="cx"> 
</span><span class="cx">     if (positionBeforeOrAfterNodeIsCandidate(*m_anchorNode))
</span><del>-        return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelectNone(m_anchorNode->parentNode());
</del><ins>+        return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsInertOrUserSelectNone(m_anchorNode->parentNode());
</ins><span class="cx"> 
</span><span class="cx">     if (is<HTMLHtmlElement>(*m_anchorNode))
</span><span class="cx">         return false;
</span><span class="lines">@@ -174,13 +174,13 @@
</span><span class="cx">         auto& block = downcast<RenderBlock>(*renderer);
</span><span class="cx">         if (block.logicalHeight() || is<HTMLBodyElement>(*m_anchorNode) || m_anchorNode->isRootEditableElement()) {
</span><span class="cx">             if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(block))
</span><del>-                return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anchorNode);
-            return m_anchorNode->hasEditableStyle() && !Position::nodeIsUserSelectNone(m_anchorNode) && Position(*this).atEditingBoundary();
</del><ins>+                return atStartOfNode() && !Position::nodeIsInertOrUserSelectNone(m_anchorNode);
+            return m_anchorNode->hasEditableStyle() && !Position::nodeIsInertOrUserSelectNone(m_anchorNode) && Position(*this).atEditingBoundary();
</ins><span class="cx">         }
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return m_anchorNode->hasEditableStyle() && !Position::nodeIsUserSelectNone(m_anchorNode) && Position(*this).atEditingBoundary();
</del><ins>+    return m_anchorNode->hasEditableStyle() && !Position::nodeIsInertOrUserSelectNone(m_anchorNode) && Position(*this).atEditingBoundary();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp       2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebCore/page/EventHandler.cpp  2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -465,7 +465,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool EventHandler::updateSelectionForMouseDownDispatchingSelectStart(Node* targetNode, const VisibleSelection& selection, TextGranularity granularity)
</span><span class="cx"> {
</span><del>-    if (Position::nodeIsUserSelectNone(targetNode))
</del><ins>+    if (Position::nodeIsInertOrUserSelectNone(targetNode))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!dispatchSelectStart(targetNode)) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp  2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp     2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -2175,7 +2175,7 @@
</span><span class="cx">     for (auto& node : intersectingNodesWithDeprecatedZeroOffsetStartQuirk(range)) {
</span><span class="cx">         auto renderer = node.renderer();
</span><span class="cx">         // Only ask leaf render objects for their line box rects.
</span><del>-        if (renderer && !renderer->firstChildSlow() && renderer->style().userSelect() != UserSelect::None) {
</del><ins>+        if (renderer && !renderer->firstChildSlow() && renderer->style().userSelect() != UserSelect::None && !node.isInert()) {
</ins><span class="cx">             bool isStartNode = renderer->node() == range.start.container.ptr();
</span><span class="cx">             bool isEndNode = renderer->node() == range.end.container.ptr();
</span><span class="cx">             if (hasFlippedWritingMode != renderer->style().isFlippedBlocksWritingMode())
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebKit/ChangeLog       2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-09-02  Tim Nguyen  <ntim@apple.com>
+
+        Add more inert checks for selection-related functionality
+        https://bugs.webkit.org/show_bug.cgi?id=229728
+
+        Reviewed by Antti Koivisto.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::selectionPositionInformation):
+
</ins><span class="cx"> 2021-09-01  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Move PCM::Store ownership from WebResourceLoadStatisticsStore to PrivateClickMeasurementManager
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (281929 => 281930)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2021-09-02 16:37:30 UTC (rev 281929)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm    2021-09-02 16:39:48 UTC (rev 281930)
</span><span class="lines">@@ -2884,7 +2884,7 @@
</span><span class="cx">         if (attachment.file())
</span><span class="cx">             info.url = URL::fileURLWithFileSystemPath(downcast<HTMLAttachmentElement>(*hitNode).file()->path());
</span><span class="cx">     } else {
</span><del>-        info.isSelectable = renderer->style().userSelect() != UserSelect::None;
</del><ins>+        info.isSelectable = renderer->style().userSelect() != UserSelect::None && !hitNode->isInert();
</ins><span class="cx">         // We don't want to select blocks that are larger than 97% of the visible area of the document.
</span><span class="cx">         // FIXME: Is this heuristic still needed, now that block selection has been removed?
</span><span class="cx">         if (info.isSelectable && !hitNode->isTextNode())
</span></span></pre>
</div>
</div>

</body>
</html>