<!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>[201823] 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/201823">201823</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-08 12:19:22 -0700 (Wed, 08 Jun 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/201667">r201667</a>): ASSERTION FAILED: !m_anchorNode || !editingIgnoresContent(*m_anchorNode)
https://bugs.webkit.org/show_bug.cgi?id=158373
Source/WebCore:
<rdar://problem/26690795>
Reviewed by Brent Fulgham.
The bug was caused by VisibleSelection::toNormalizedRange calling parentAnchoredEquivalent on an orphaned Position.
Fixed it by checking that condition and exiting early since we can't create a Range with a detached node anyway.
Also renamed isNonOrphanedCaretOrRange to isNoneOrOrphaned after negating the semantics for clarity.
Test: editing/selection/selection-in-iframe-removed-crash.html
* editing/EditorCommand.cpp:
(WebCore::valueFormatBlock):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::doApply):
* editing/RemoveFormatCommand.cpp:
(WebCore::RemoveFormatCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
* editing/SetSelectionCommand.cpp:
(WebCore::SetSelectionCommand::doApply):
(WebCore::SetSelectionCommand::doUnapply):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::doApply):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::firstRange): Also added a check for isNoneOrOrphaned since this function can hit the same
assertion when the selection end points are orphaned.
(WebCore::VisibleSelection::toNormalizedRange): Fixed the bug.
* editing/VisibleSelection.h:
(WebCore::VisibleSelection::isNoneOrOrphaned): Renamed from isNonOrphanedCaretOrRange and negated the semantics.
LayoutTests:
Reviewed by Brent Fulgham.
Fixed a test so that the assertion failure happens within the test instead of affecting the subsequent test.
* editing/selection/selection-in-iframe-removed-crash-expected.txt:
* editing/selection/selection-in-iframe-removed-crash.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestseditingselectionselectioniniframeremovedcrashexpectedtxt">trunk/LayoutTests/editing/selection/selection-in-iframe-removed-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingselectionselectioniniframeremovedcrashhtml">trunk/LayoutTests/editing/selection/selection-in-iframe-removed-crash.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorCommandcpp">trunk/Source/WebCore/editing/EditorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertLineBreakCommandcpp">trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertListCommandcpp">trunk/Source/WebCore/editing/InsertListCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp">trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertTextCommandcpp">trunk/Source/WebCore/editing/InsertTextCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingRemoveFormatCommandcpp">trunk/Source/WebCore/editing/RemoveFormatCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingSetSelectionCommandcpp">trunk/Source/WebCore/editing/SetSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTypingCommandcpp">trunk/Source/WebCore/editing/TypingCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleSelectioncpp">trunk/Source/WebCore/editing/VisibleSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleSelectionh">trunk/Source/WebCore/editing/VisibleSelection.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/LayoutTests/ChangeLog        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-06-07 Ryosuke Niwa <rniwa@webkit.org>
+
+ REGRESSION (r201667): ASSERTION FAILED: !m_anchorNode || !editingIgnoresContent(*m_anchorNode)
+ https://bugs.webkit.org/show_bug.cgi?id=158373
+
+ Reviewed by Brent Fulgham.
+
+ Fixed a test so that the assertion failure happens within the test instead of affecting the subsequent test.
+
+ * editing/selection/selection-in-iframe-removed-crash-expected.txt:
+ * editing/selection/selection-in-iframe-removed-crash.html:
+
</ins><span class="cx"> 2016-06-08 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> Marking css3/filters/backdrop/dynamic-backdrop-filter-change.html as flaky on Mac
</span></span></pre></div>
<a id="trunkLayoutTestseditingselectionselectioniniframeremovedcrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/selection/selection-in-iframe-removed-crash-expected.txt (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/selection/selection-in-iframe-removed-crash-expected.txt        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/LayoutTests/editing/selection/selection-in-iframe-removed-crash-expected.txt        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -1 +1 @@
</span><del>-Test passes if it does not crash.
</del><ins>+Test passes if it does not crash.
</ins></span></pre></div>
<a id="trunkLayoutTestseditingselectionselectioniniframeremovedcrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/selection/selection-in-iframe-removed-crash.html (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/selection/selection-in-iframe-removed-crash.html        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/LayoutTests/editing/selection/selection-in-iframe-removed-crash.html        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -2,8 +2,10 @@
</span><span class="cx"> <html>
</span><span class="cx"> Test passes if it does not crash.
</span><span class="cx"> <script>
</span><del>-if (window.testRunner)
</del><ins>+if (window.testRunner) {
</ins><span class="cx"> testRunner.dumpAsText();
</span><ins>+ testRunner.waitUntilDone();
+}
</ins><span class="cx">
</span><span class="cx"> var docElement = document.documentElement;
</span><span class="cx"> function crash() {
</span><span class="lines">@@ -21,6 +23,8 @@
</span><span class="cx"> range1 = document.createRange();
</span><span class="cx"> range1.selectNodeContents(iframe1.contentDocument);
</span><span class="cx"> window.getSelection().addRange(range1);
</span><ins>+ if (window.testRunner)
+ testRunner.notifyDone();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> document.addEventListener("DOMContentLoaded", crash, false);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/ChangeLog        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-06-07 Ryosuke Niwa <rniwa@webkit.org>
+
+ REGRESSION (r201667): ASSERTION FAILED: !m_anchorNode || !editingIgnoresContent(*m_anchorNode)
+ https://bugs.webkit.org/show_bug.cgi?id=158373
+ <rdar://problem/26690795>
+
+ Reviewed by Brent Fulgham.
+
+ The bug was caused by VisibleSelection::toNormalizedRange calling parentAnchoredEquivalent on an orphaned Position.
+ Fixed it by checking that condition and exiting early since we can't create a Range with a detached node anyway.
+
+ Also renamed isNonOrphanedCaretOrRange to isNoneOrOrphaned after negating the semantics for clarity.
+
+ Test: editing/selection/selection-in-iframe-removed-crash.html
+
+ * editing/EditorCommand.cpp:
+ (WebCore::valueFormatBlock):
+ * editing/FrameSelection.cpp:
+ (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
+ * editing/InsertLineBreakCommand.cpp:
+ (WebCore::InsertLineBreakCommand::doApply):
+ * editing/InsertListCommand.cpp:
+ (WebCore::InsertListCommand::doApply):
+ * editing/InsertParagraphSeparatorCommand.cpp:
+ (WebCore::InsertParagraphSeparatorCommand::doApply):
+ * editing/InsertTextCommand.cpp:
+ (WebCore::InsertTextCommand::doApply):
+ * editing/RemoveFormatCommand.cpp:
+ (WebCore::RemoveFormatCommand::doApply):
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::doApply):
+ * editing/SetSelectionCommand.cpp:
+ (WebCore::SetSelectionCommand::doApply):
+ (WebCore::SetSelectionCommand::doUnapply):
+ * editing/TypingCommand.cpp:
+ (WebCore::TypingCommand::doApply):
+ * editing/VisibleSelection.cpp:
+ (WebCore::VisibleSelection::firstRange): Also added a check for isNoneOrOrphaned since this function can hit the same
+ assertion when the selection end points are orphaned.
+ (WebCore::VisibleSelection::toNormalizedRange): Fixed the bug.
+ * editing/VisibleSelection.h:
+ (WebCore::VisibleSelection::isNoneOrOrphaned): Renamed from isNonOrphanedCaretOrRange and negated the semantics.
+
</ins><span class="cx"> 2016-06-08 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Multiple selectors break keyframes animation
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -1484,7 +1484,7 @@
</span><span class="cx"> static String valueFormatBlock(Frame& frame, Event*)
</span><span class="cx"> {
</span><span class="cx"> const VisibleSelection& selection = frame.selection().selection();
</span><del>- if (!selection.isNonOrphanedCaretOrRange() || !selection.isContentEditable())
</del><ins>+ if (selection.isNoneOrOrphaned() || !selection.isContentEditable())
</ins><span class="cx"> return emptyString();
</span><span class="cx"> Element* formatBlockElement = FormatBlockCommand::elementForFormatBlockCommand(selection.firstRange().get());
</span><span class="cx"> if (!formatBlockElement)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -290,7 +290,7 @@
</span><span class="cx"> // It's possible that during the above set selection, this FrameSelection has been modified by
</span><span class="cx"> // selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since
</span><span class="cx"> // the frame is about to be destroyed. If this is the case, clear our selection.
</span><del>- if (newSelectionFrame->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange())
</del><ins>+ if (newSelectionFrame->hasOneRef() && m_selection.isNoneOrOrphaned())
</ins><span class="cx"> clear();
</span><span class="cx"> return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertLineBreakCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> {
</span><span class="cx"> deleteSelection();
</span><span class="cx"> VisibleSelection selection = endingSelection();
</span><del>- if (!selection.isNonOrphanedCaretOrRange())
</del><ins>+ if (selection.isNoneOrOrphaned())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> VisiblePosition caret(selection.visibleStart());
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertListCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertListCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertListCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/InsertListCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -112,12 +112,9 @@
</span><span class="cx">
</span><span class="cx"> void InsertListCommand::doApply()
</span><span class="cx"> {
</span><del>- if (!endingSelection().isNonOrphanedCaretOrRange())
</del><ins>+ if (endingSelection().isNoneOrOrphaned() || !endingSelection().isContentRichlyEditable())
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- if (!endingSelection().rootEditableElement())
- return;
-
</del><span class="cx"> VisiblePosition visibleEnd = endingSelection().visibleEnd();
</span><span class="cx"> VisiblePosition visibleStart = endingSelection().visibleStart();
</span><span class="cx"> // When a selection ends at the start of a paragraph, we rarely paint
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">
</span><span class="cx"> void InsertParagraphSeparatorCommand::doApply()
</span><span class="cx"> {
</span><del>- if (!endingSelection().isNonOrphanedCaretOrRange())
</del><ins>+ if (endingSelection().isNoneOrOrphaned())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> Position insertionPosition = endingSelection().start();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertTextCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertTextCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertTextCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/InsertTextCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_text.find('\n') == notFound);
</span><span class="cx">
</span><del>- if (!endingSelection().isNonOrphanedCaretOrRange())
</del><ins>+ if (endingSelection().isNoneOrOrphaned())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // Delete the current selection.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingRemoveFormatCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/RemoveFormatCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/RemoveFormatCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/RemoveFormatCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">
</span><span class="cx"> void RemoveFormatCommand::doApply()
</span><span class="cx"> {
</span><del>- if (!endingSelection().isNonOrphanedCaretOrRange())
</del><ins>+ if (endingSelection().isNoneOrOrphaned())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // Get the default style for this editable root, it's the style that we'll give the
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -914,12 +914,9 @@
</span><span class="cx"> VisibleSelection selection = endingSelection();
</span><span class="cx"> ASSERT(selection.isCaretOrRange());
</span><span class="cx"> ASSERT(selection.start().deprecatedNode());
</span><del>- if (!selection.isNonOrphanedCaretOrRange() || !selection.start().deprecatedNode())
</del><ins>+ if (selection.isNoneOrOrphaned() || !selection.start().deprecatedNode() || !selection.isContentEditable())
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- if (!selection.rootEditableElement())
- return;
-
</del><span class="cx"> // In plain text only regions, we create style-less fragments, so the inserted content will automatically
</span><span class="cx"> // match the style of the surrounding area and so we can avoid unnecessary work below for m_matchStyle.
</span><span class="cx"> if (!selection.isContentRichlyEditable())
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingSetSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/SetSelectionCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/SetSelectionCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/SetSelectionCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> {
</span><span class="cx"> FrameSelection& selection = frame().selection();
</span><span class="cx">
</span><del>- if (selection.shouldChangeSelection(m_selectionToSet) && m_selectionToSet.isNonOrphanedCaretOrRange()) {
</del><ins>+ if (selection.shouldChangeSelection(m_selectionToSet) && !m_selectionToSet.isNoneOrOrphaned()) {
</ins><span class="cx"> selection.setSelection(m_selectionToSet, m_options);
</span><span class="cx"> setEndingSelection(m_selectionToSet);
</span><span class="cx"> }
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> {
</span><span class="cx"> FrameSelection& selection = frame().selection();
</span><span class="cx">
</span><del>- if (selection.shouldChangeSelection(startingSelection()) && startingSelection().isNonOrphanedCaretOrRange())
</del><ins>+ if (selection.shouldChangeSelection(startingSelection()) && !startingSelection().isNoneOrOrphaned())
</ins><span class="cx"> selection.setSelection(startingSelection(), m_options);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTypingCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TypingCommand.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TypingCommand.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/TypingCommand.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -261,9 +261,9 @@
</span><span class="cx">
</span><span class="cx"> void TypingCommand::doApply()
</span><span class="cx"> {
</span><del>- if (!endingSelection().isNonOrphanedCaretOrRange())
</del><ins>+ if (endingSelection().isNoneOrOrphaned())
</ins><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (m_commandType == DeleteKey)
</span><span class="cx"> if (m_commands.isEmpty())
</span><span class="cx"> m_openedByBackwardDelete = true;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleSelection.cpp (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleSelection.cpp        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/VisibleSelection.cpp        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -125,18 +125,18 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<Range> VisibleSelection::firstRange() const
</span><span class="cx"> {
</span><del>- if (isNone())
</del><ins>+ if (isNoneOrOrphaned())
</ins><span class="cx"> return nullptr;
</span><span class="cx"> Position start = m_start.parentAnchoredEquivalent();
</span><span class="cx"> Position end = m_end.parentAnchoredEquivalent();
</span><del>- if (start.isNull() || end.isNull())
</del><ins>+ if (start.isNull() || start.isOrphan() || end.isNull() || end.isOrphan())
</ins><span class="cx"> return nullptr;
</span><span class="cx"> return Range::create(start.anchorNode()->document(), start, end);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<Range> VisibleSelection::toNormalizedRange() const
</span><span class="cx"> {
</span><del>- if (isNone())
</del><ins>+ if (isNoneOrOrphaned())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // Make sure we have an updated layout since this function is called
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> m_start.anchorNode()->document().updateLayout();
</span><span class="cx">
</span><span class="cx"> // Check again, because updating layout can clear the selection.
</span><del>- if (isNone())
</del><ins>+ if (isNoneOrOrphaned())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> Position s, e;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleSelectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleSelection.h (201822 => 201823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleSelection.h        2016-06-08 19:18:48 UTC (rev 201822)
+++ trunk/Source/WebCore/editing/VisibleSelection.h        2016-06-08 19:19:22 UTC (rev 201823)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> bool isRange() const { return selectionType() == RangeSelection; }
</span><span class="cx"> bool isCaretOrRange() const { return selectionType() != NoSelection; }
</span><span class="cx"> bool isNonOrphanedRange() const { return isRange() && !start().isOrphan() && !end().isOrphan(); }
</span><del>- bool isNonOrphanedCaretOrRange() const { return isCaretOrRange() && !start().isOrphan() && !end().isOrphan(); }
</del><ins>+ bool isNoneOrOrphaned() const { return isNone() || start().isOrphan() || end().isOrphan(); }
</ins><span class="cx">
</span><span class="cx"> bool isBaseFirst() const { return m_baseIsFirst; }
</span><span class="cx"> bool isDirectional() const { return m_isDirectional; }
</span></span></pre>
</div>
</div>
</body>
</html>