<!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>[213355] trunk/Source</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/213355">213355</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-03-02 22:35:25 -0800 (Thu, 02 Mar 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Rename htmlediting.h/cpp to Editing.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=169103
Patch by Sam Weinig <sam@webkit.org> on 2017-03-02
Reviewed by Alex Christensen.
Source/WebCore:
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
* accessibility/AccessibilityNodeObject.cpp:
* accessibility/AccessibilityObject.cpp:
* accessibility/AccessibilityRenderObject.cpp:
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* dom/Document.cpp:
* dom/Element.cpp:
* dom/Node.h:
* dom/Position.cpp:
* dom/PositionIterator.cpp:
* dom/Range.cpp:
* editing/AlternativeTextController.cpp:
* editing/AppendNodeCommand.cpp:
* editing/ApplyBlockElementCommand.cpp:
* editing/ApplyStyleCommand.cpp:
* editing/BreakBlockquoteCommand.cpp:
* editing/CompositeEditCommand.cpp:
* editing/CreateLinkCommand.cpp:
(WebCore::CreateLinkCommand::CreateLinkCommand):
* editing/DeleteFromTextNodeCommand.cpp:
* editing/DeleteSelectionCommand.cpp:
* editing/EditCommand.cpp:
* editing/Editing.cpp: Copied from Source/WebCore/editing/htmlediting.cpp.
* editing/Editing.h: Copied from Source/WebCore/editing/htmlediting.h.
* editing/EditingAllInOne.cpp:
* editing/EditingStyle.cpp:
* editing/Editor.cpp:
* editing/EditorCommand.cpp:
* editing/FormatBlockCommand.cpp:
* editing/FrameSelection.cpp:
* editing/HTMLInterchange.cpp:
* editing/IndentOutdentCommand.cpp:
* editing/InsertLineBreakCommand.cpp:
* editing/InsertListCommand.cpp:
* editing/InsertNodeBeforeCommand.cpp:
* editing/InsertParagraphSeparatorCommand.cpp:
* editing/InsertTextCommand.cpp:
* editing/ModifySelectionListLevel.cpp:
* editing/RemoveNodeCommand.cpp:
* editing/ReplaceNodeWithSpanCommand.cpp:
* editing/ReplaceSelectionCommand.cpp:
* editing/SpellChecker.cpp:
* editing/TextIterator.cpp:
* editing/TypingCommand.cpp:
* editing/VisiblePosition.cpp:
* editing/VisibleSelection.cpp:
* editing/VisibleUnits.cpp:
* editing/cocoa/DataDetection.mm:
* editing/cocoa/EditorCocoa.mm:
* editing/htmlediting.cpp: Removed.
* editing/htmlediting.h: Removed.
* editing/ios/EditorIOS.mm:
* editing/mac/DictionaryLookup.mm:
* editing/mac/EditorMac.mm:
* editing/markup.cpp:
* html/HTMLTextFormControlElement.cpp:
* inspector/InspectorDOMAgent.cpp:
* page/DOMSelection.cpp:
* page/DragController.cpp:
* page/EventHandler.cpp:
* page/FocusController.cpp:
* page/Frame.cpp:
* platform/ios/PasteboardIOS.mm:
* platform/mac/PasteboardMac.mm:
* rendering/RenderBox.cpp:
* rendering/RenderObject.cpp:
Source/WebKit/ios:
* WebCoreSupport/WebFrameIOS.mm:
* WebCoreSupport/WebVisiblePosition.mm:
Source/WebKit/mac:
* DOM/DOMUIKitExtensions.mm:
* WebView/WebFrame.mm:
* WebView/WebView.mm:
Source/WebKit/win:
* AccessibleTextImpl.cpp:
Source/WebKit2:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleHyperlinkcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTextcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleWrapperAtkcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperBasemm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</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="#trunkSourceWebCoredomPositionIteratorcpp">trunk/Source/WebCore/dom/PositionIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingAlternativeTextControllercpp">trunk/Source/WebCore/editing/AlternativeTextController.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingAppendNodeCommandcpp">trunk/Source/WebCore/editing/AppendNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyBlockElementCommandcpp">trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingBreakBlockquoteCommandcpp">trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCreateLinkCommandcpp">trunk/Source/WebCore/editing/CreateLinkCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteFromTextNodeCommandcpp">trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteSelectionCommandcpp">trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditCommandcpp">trunk/Source/WebCore/editing/EditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingAllInOnecpp">trunk/Source/WebCore/editing/EditingAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStylecpp">trunk/Source/WebCore/editing/EditingStyle.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorCommandcpp">trunk/Source/WebCore/editing/EditorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFormatBlockCommandcpp">trunk/Source/WebCore/editing/FormatBlockCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingHTMLInterchangecpp">trunk/Source/WebCore/editing/HTMLInterchange.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingIndentOutdentCommandcpp">trunk/Source/WebCore/editing/IndentOutdentCommand.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="#trunkSourceWebCoreeditingInsertNodeBeforeCommandcpp">trunk/Source/WebCore/editing/InsertNodeBeforeCommand.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="#trunkSourceWebCoreeditingModifySelectionListLevelcpp">trunk/Source/WebCore/editing/ModifySelectionListLevel.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingRemoveNodeCommandcpp">trunk/Source/WebCore/editing/RemoveNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceNodeWithSpanCommandcpp">trunk/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingSpellCheckercpp">trunk/Source/WebCore/editing/SpellChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTypingCommandcpp">trunk/Source/WebCore/editing/TypingCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisiblePositioncpp">trunk/Source/WebCore/editing/VisiblePosition.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleSelectioncpp">trunk/Source/WebCore/editing/VisibleSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleUnitscpp">trunk/Source/WebCore/editing/VisibleUnits.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaDataDetectionmm">trunk/Source/WebCore/editing/cocoa/DataDetection.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaEditorCocoamm">trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingiosEditorIOSmm">trunk/Source/WebCore/editing/ios/EditorIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingmacDictionaryLookupmm">trunk/Source/WebCore/editing/mac/DictionaryLookup.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingmacEditorMacmm">trunk/Source/WebCore/editing/mac/EditorMac.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingmarkupcpp">trunk/Source/WebCore/editing/markup.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextFormControlElementcpp">trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMSelectioncpp">trunk/Source/WebCore/page/DOMSelection.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFocusControllercpp">trunk/Source/WebCore/page/FocusController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFramecpp">trunk/Source/WebCore/page/Frame.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPasteboardIOSmm">trunk/Source/WebCore/platform/ios/PasteboardIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPasteboardMacmm">trunk/Source/WebCore/platform/mac/PasteboardMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjectcpp">trunk/Source/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#trunkSourceWebKitiosChangeLog">trunk/Source/WebKit/ios/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitiosWebCoreSupportWebFrameIOSmm">trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm</a></li>
<li><a href="#trunkSourceWebKitiosWebCoreSupportWebVisiblePositionmm">trunk/Source/WebKit/ios/WebCoreSupport/WebVisiblePosition.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMUIKitExtensionsmm">trunk/Source/WebKit/mac/DOM/DOMUIKitExtensions.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebFramemm">trunk/Source/WebKit/mac/WebView/WebFrame.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitwinAccessibleTextImplcpp">trunk/Source/WebKit/win/AccessibleTextImpl.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreeditingEditingcpp">trunk/Source/WebCore/editing/Editing.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingh">trunk/Source/WebCore/editing/Editing.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreeditinghtmleditingcpp">trunk/Source/WebCore/editing/htmlediting.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditinghtmleditingh">trunk/Source/WebCore/editing/htmlediting.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/CMakeLists.txt        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -1557,6 +1557,7 @@
</span><span class="cx"> editing/DictationAlternative.cpp
</span><span class="cx"> editing/DictationCommand.cpp
</span><span class="cx"> editing/EditCommand.cpp
</span><ins>+ editing/Editing.cpp
</ins><span class="cx"> editing/EditingStyle.cpp
</span><span class="cx"> editing/Editor.cpp
</span><span class="cx"> editing/EditorCommand.cpp
</span><span class="lines">@@ -1600,7 +1601,6 @@
</span><span class="cx"> editing/VisibleSelection.cpp
</span><span class="cx"> editing/VisibleUnits.cpp
</span><span class="cx"> editing/WrapContentsInDummySpanCommand.cpp
</span><del>- editing/htmlediting.cpp
</del><span class="cx"> editing/markup.cpp
</span><span class="cx">
</span><span class="cx"> fileapi/AsyncFileStream.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/ChangeLog        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -1,3 +1,83 @@
</span><ins>+2017-03-02 Sam Weinig <sam@webkit.org>
+
+ Rename htmlediting.h/cpp to Editing.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=169103
+
+ Reviewed by Alex Christensen.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * accessibility/AXObjectCache.cpp:
+ * accessibility/AccessibilityNodeObject.cpp:
+ * accessibility/AccessibilityObject.cpp:
+ * accessibility/AccessibilityRenderObject.cpp:
+ * accessibility/atk/WebKitAccessibleHyperlink.cpp:
+ * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
+ * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+ * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+ * dom/Document.cpp:
+ * dom/Element.cpp:
+ * dom/Node.h:
+ * dom/Position.cpp:
+ * dom/PositionIterator.cpp:
+ * dom/Range.cpp:
+ * editing/AlternativeTextController.cpp:
+ * editing/AppendNodeCommand.cpp:
+ * editing/ApplyBlockElementCommand.cpp:
+ * editing/ApplyStyleCommand.cpp:
+ * editing/BreakBlockquoteCommand.cpp:
+ * editing/CompositeEditCommand.cpp:
+ * editing/CreateLinkCommand.cpp:
+ (WebCore::CreateLinkCommand::CreateLinkCommand):
+ * editing/DeleteFromTextNodeCommand.cpp:
+ * editing/DeleteSelectionCommand.cpp:
+ * editing/EditCommand.cpp:
+ * editing/Editing.cpp: Copied from Source/WebCore/editing/htmlediting.cpp.
+ * editing/Editing.h: Copied from Source/WebCore/editing/htmlediting.h.
+ * editing/EditingAllInOne.cpp:
+ * editing/EditingStyle.cpp:
+ * editing/Editor.cpp:
+ * editing/EditorCommand.cpp:
+ * editing/FormatBlockCommand.cpp:
+ * editing/FrameSelection.cpp:
+ * editing/HTMLInterchange.cpp:
+ * editing/IndentOutdentCommand.cpp:
+ * editing/InsertLineBreakCommand.cpp:
+ * editing/InsertListCommand.cpp:
+ * editing/InsertNodeBeforeCommand.cpp:
+ * editing/InsertParagraphSeparatorCommand.cpp:
+ * editing/InsertTextCommand.cpp:
+ * editing/ModifySelectionListLevel.cpp:
+ * editing/RemoveNodeCommand.cpp:
+ * editing/ReplaceNodeWithSpanCommand.cpp:
+ * editing/ReplaceSelectionCommand.cpp:
+ * editing/SpellChecker.cpp:
+ * editing/TextIterator.cpp:
+ * editing/TypingCommand.cpp:
+ * editing/VisiblePosition.cpp:
+ * editing/VisibleSelection.cpp:
+ * editing/VisibleUnits.cpp:
+ * editing/cocoa/DataDetection.mm:
+ * editing/cocoa/EditorCocoa.mm:
+ * editing/htmlediting.cpp: Removed.
+ * editing/htmlediting.h: Removed.
+ * editing/ios/EditorIOS.mm:
+ * editing/mac/DictionaryLookup.mm:
+ * editing/mac/EditorMac.mm:
+ * editing/markup.cpp:
+ * html/HTMLTextFormControlElement.cpp:
+ * inspector/InspectorDOMAgent.cpp:
+ * page/DOMSelection.cpp:
+ * page/DragController.cpp:
+ * page/EventHandler.cpp:
+ * page/FocusController.cpp:
+ * page/Frame.cpp:
+ * platform/ios/PasteboardIOS.mm:
+ * platform/mac/PasteboardMac.mm:
+ * rendering/RenderBox.cpp:
+ * rendering/RenderObject.cpp:
+
</ins><span class="cx"> 2017-03-02 Matt Baker <mattbaker@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Should be able to push nodes in an iframe subtree to the frontend
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -3385,8 +3385,8 @@
</span><span class="cx">                 93309DE4099E64920056E581 /* EditCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309D95099E64910056E581 /* EditCommand.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93309DE5099E64920056E581 /* HTMLInterchange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309D96099E64910056E581 /* HTMLInterchange.cpp */; };
</span><span class="cx">                 93309DE6099E64920056E581 /* HTMLInterchange.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309D97099E64910056E581 /* HTMLInterchange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                93309DE7099E64920056E581 /* htmlediting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309D98099E64910056E581 /* htmlediting.cpp */; };
-                93309DE8099E64920056E581 /* htmlediting.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309D99099E64910056E581 /* htmlediting.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                93309DE7099E64920056E581 /* Editing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309D98099E64910056E581 /* Editing.cpp */; };
+                93309DE8099E64920056E581 /* Editing.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309D99099E64910056E581 /* Editing.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 93309DE9099E64920056E581 /* InsertIntoTextNodeCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309D9A099E64910056E581 /* InsertIntoTextNodeCommand.cpp */; };
</span><span class="cx">                 93309DEA099E64920056E581 /* InsertIntoTextNodeCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309D9B099E64910056E581 /* InsertIntoTextNodeCommand.h */; };
</span><span class="cx">                 93309DEB099E64920056E581 /* InsertLineBreakCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309D9C099E64910056E581 /* InsertLineBreakCommand.cpp */; };
</span><span class="lines">@@ -11167,8 +11167,8 @@
</span><span class="cx">                 93309D95099E64910056E581 /* EditCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditCommand.h; sourceTree = "<group>"; };
</span><span class="cx">                 93309D96099E64910056E581 /* HTMLInterchange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLInterchange.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 93309D97099E64910056E581 /* HTMLInterchange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLInterchange.h; sourceTree = "<group>"; };
</span><del>-                93309D98099E64910056E581 /* htmlediting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = htmlediting.cpp; sourceTree = "<group>"; };
-                93309D99099E64910056E581 /* htmlediting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = htmlediting.h; sourceTree = "<group>"; };
</del><ins>+                93309D98099E64910056E581 /* Editing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Editing.cpp; sourceTree = "<group>"; };
+                93309D99099E64910056E581 /* Editing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Editing.h; sourceTree = "<group>"; };
</ins><span class="cx">                 93309D9A099E64910056E581 /* InsertIntoTextNodeCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InsertIntoTextNodeCommand.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 93309D9B099E64910056E581 /* InsertIntoTextNodeCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InsertIntoTextNodeCommand.h; sourceTree = "<group>"; };
</span><span class="cx">                 93309D9C099E64910056E581 /* InsertLineBreakCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InsertLineBreakCommand.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -19067,8 +19067,8 @@
</span><span class="cx">                                 D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */,
</span><span class="cx">                                 93309DBE099E64910056E581 /* FrameSelection.cpp */,
</span><span class="cx">                                 93309DBF099E64910056E581 /* FrameSelection.h */,
</span><del>-                                93309D98099E64910056E581 /* htmlediting.cpp */,
-                                93309D99099E64910056E581 /* htmlediting.h */,
</del><ins>+                                93309D98099E64910056E581 /* Editing.cpp */,
+                                93309D99099E64910056E581 /* Editing.h */,
</ins><span class="cx">                                 93309D96099E64910056E581 /* HTMLInterchange.cpp */,
</span><span class="cx">                                 93309D97099E64910056E581 /* HTMLInterchange.h */,
</span><span class="cx">                                 DB23C2C90A508D29002489EB /* IndentOutdentCommand.cpp */,
</span><span class="lines">@@ -26382,7 +26382,7 @@
</span><span class="cx">                                 A8EA79F70A1916DF00A8EF5F /* HTMLDListElement.h in Headers */,
</span><span class="cx">                                 93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */,
</span><span class="cx">                                 977B3867122883E900B81FF8 /* HTMLDocumentParser.h in Headers */,
</span><del>-                                93309DE8099E64920056E581 /* htmlediting.h in Headers */,
</del><ins>+                                93309DE8099E64920056E581 /* Editing.h in Headers */,
</ins><span class="cx">                                 93F198E608245E59001E9ABC /* HTMLElement.h in Headers */,
</span><span class="cx">                                 A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */,
</span><span class="cx">                                 977B37241228721700B81FF8 /* HTMLElementStack.h in Headers */,
</span><span class="lines">@@ -30234,7 +30234,7 @@
</span><span class="cx">                                 A8EA79F50A1916DF00A8EF5F /* HTMLDListElement.cpp in Sources */,
</span><span class="cx">                                 93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */,
</span><span class="cx">                                 977B3866122883E900B81FF8 /* HTMLDocumentParser.cpp in Sources */,
</span><del>-                                93309DE7099E64920056E581 /* htmlediting.cpp in Sources */,
</del><ins>+                                93309DE7099E64920056E581 /* Editing.cpp in Sources */,
</ins><span class="cx">                                 93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */,
</span><span class="cx">                                 A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */,
</span><span class="cx">                                 977B37231228721700B81FF8 /* HTMLElementStack.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> #include "AccessibilityTree.h"
</span><span class="cx"> #include "AccessibilityTreeItem.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "FocusController.h"
</span><span class="lines">@@ -93,7 +94,6 @@
</span><span class="cx"> #include "ScrollView.h"
</span><span class="cx"> #include "TextBoundaries.h"
</span><span class="cx"> #include "TextIterator.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/DataLog.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "AccessibilityListBox.h"
</span><span class="cx"> #include "AccessibilitySpinButton.h"
</span><span class="cx"> #include "AccessibilityTable.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "FloatRect.h"
</span><span class="lines">@@ -70,7 +71,6 @@
</span><span class="cx"> #include "UserGestureIndicator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><span class="cx"> #include "Widget.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include "AccessibilityScrollView.h"
</span><span class="cx"> #include "AccessibilityTable.h"
</span><span class="cx"> #include "DOMTokenList.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "EventHandler.h"
</span><span class="lines">@@ -70,7 +71,6 @@
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "UserGestureIndicator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "AccessibilitySpinButton.h"
</span><span class="cx"> #include "AccessibilityTable.h"
</span><span class="cx"> #include "CachedImage.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="lines">@@ -98,7 +99,6 @@
</span><span class="cx"> #include "TextControlInnerElements.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleHyperlinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx">
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "AccessibilityObject.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> #include "Position.h"
</span><span class="cx"> #include "Range.h"
</span><span class="lines">@@ -33,7 +34,6 @@
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "WebKitAccessibleUtil.h"
</span><span class="cx"> #include "WebKitAccessibleWrapperAtk.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><span class="cx"> #include <atk/atk.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">
</span><span class="cx"> #include "AccessibilityObject.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "FontCascade.h"
</span><span class="cx"> #include "FrameView.h"
</span><span class="cx"> #include "HTMLParserIdioms.h"
</span><span class="lines">@@ -50,7 +51,6 @@
</span><span class="cx"> #include "VisibleUnits.h"
</span><span class="cx"> #include "WebKitAccessibleUtil.h"
</span><span class="cx"> #include "WebKitAccessibleWrapperAtk.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/glib/GUniquePtr.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleWrapperAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include "AccessibilityListBoxOption.h"
</span><span class="cx"> #include "AccessibilityTable.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameView.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="lines">@@ -65,7 +66,6 @@
</span><span class="cx"> #include "WebKitAccessibleInterfaceText.h"
</span><span class="cx"> #include "WebKitAccessibleInterfaceValue.h"
</span><span class="cx"> #include "WebKitAccessibleUtil.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <glib/gprintf.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperBasemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #import "AccessibilityTableRow.h"
</span><span class="cx"> #import "ColorMac.h"
</span><span class="cx"> #import "ContextMenuController.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "Font.h"
</span><span class="cx"> #import "FontCascade.h"
</span><span class="cx"> #import "Frame.h"
</span><span class="lines">@@ -62,7 +63,6 @@
</span><span class="cx"> #import "WebCoreFrameView.h"
</span><span class="cx"> #import "WebCoreObjCExtras.h"
</span><span class="cx"> #import "WebCoreSystemInterface.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace HTMLNames;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #import "ChromeClient.h"
</span><span class="cx"> #import "ColorMac.h"
</span><span class="cx"> #import "ContextMenuController.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "Editor.h"
</span><span class="cx"> #import "Font.h"
</span><span class="cx"> #import "FontCascade.h"
</span><span class="lines">@@ -74,7 +75,6 @@
</span><span class="cx"> #import "WebCoreFrameView.h"
</span><span class="cx"> #import "WebCoreObjCExtras.h"
</span><span class="cx"> #import "WebCoreSystemInterface.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx"> #import <wtf/ObjcRuntimeExtras.h>
</span><span class="cx"> #if ENABLE(TREE_DEBUGGING) || ENABLE(METER_ELEMENT)
</span><span class="cx"> #import <wtf/text/StringBuilder.h>
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/dom/Document.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> #include "DocumentMarkerController.h"
</span><span class="cx"> #include "DocumentSharedObjectPool.h"
</span><span class="cx"> #include "DocumentType.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "EventHandler.h"
</span><span class="lines">@@ -193,7 +194,6 @@
</span><span class="cx"> #include "XPathExpression.h"
</span><span class="cx"> #include "XPathNSResolver.h"
</span><span class="cx"> #include "XPathResult.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <ctime>
</span><span class="cx"> #include <inspector/ScriptCallStack.h>
</span><span class="cx"> #include <wtf/CurrentTime.h>
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/dom/Element.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include "DOMTokenList.h"
</span><span class="cx"> #include "DocumentAnimation.h"
</span><span class="cx"> #include "DocumentSharedObjectPool.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "ElementRareData.h"
</span><span class="cx"> #include "EventDispatcher.h"
</span><span class="lines">@@ -102,7 +103,6 @@
</span><span class="cx"> #include "XLinkNames.h"
</span><span class="cx"> #include "XMLNSNames.h"
</span><span class="cx"> #include "XMLNames.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx"> #include <wtf/CurrentTime.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/dom/Node.h        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx"> {
</span><span class="cx"> return computeEditability(treatment, ShouldUpdateStyle::DoNotUpdate) != Editability::ReadOnly;
</span><span class="cx"> }
</span><del>- // FIXME: Replace every use of this function by helpers in htmlediting.h
</del><ins>+ // FIXME: Replace every use of this function by helpers in Editing.h
</ins><span class="cx"> bool hasRichlyEditableStyle() const
</span><span class="cx"> {
</span><span class="cx"> return computeEditability(UserSelectAllIsAlwaysNonEditable, ShouldUpdateStyle::DoNotUpdate) == Editability::CanEditRichly;
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/dom/Position.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "Position.h"
</span><span class="cx">
</span><span class="cx"> #include "CSSComputedStyleDeclaration.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "HTMLBRElement.h"
</span><span class="cx"> #include "HTMLBodyElement.h"
</span><span class="cx"> #include "HTMLHtmlElement.h"
</span><span class="lines">@@ -50,7 +51,6 @@
</span><span class="cx"> #include "TextStream.h"
</span><span class="cx"> #include "VisiblePosition.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositionIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PositionIterator.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PositionIterator.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/dom/PositionIterator.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PositionIterator.h"
</span><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "HTMLBodyElement.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "HTMLHtmlElement.h"
</span><span class="lines">@@ -32,7 +33,6 @@
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "RenderBlockFlow.h"
</span><span class="cx"> #include "RenderText.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/dom/Range.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "ClientRectList.h"
</span><span class="cx"> #include "Comment.h"
</span><span class="cx"> #include "DocumentFragment.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Event.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="lines">@@ -47,7 +48,6 @@
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisiblePosition.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <wtf/RefCountedLeakCounter.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAlternativeTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AlternativeTextController.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AlternativeTextController.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/AlternativeTextController.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "DocumentMarkerController.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "Event.h"
</span><span class="lines">@@ -43,7 +44,6 @@
</span><span class="cx"> #include "TextEvent.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAppendNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AppendNodeCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AppendNodeCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/AppendNodeCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -28,9 +28,9 @@
</span><span class="cx">
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "RenderElement.h"
</span><span class="cx"> #include "Text.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyBlockElementCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ApplyBlockElementCommand.h"
</span><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "HTMLBRElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "RenderElement.h"
</span><span class="lines">@@ -33,7 +34,6 @@
</span><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "CSSParser.h"
</span><span class="cx"> #include "CSSValuePool.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="lines">@@ -48,7 +49,6 @@
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "TextNodeTraversal.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingBreakBlockquoteCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -26,12 +26,12 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "BreakBlockquoteCommand.h"
</span><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "HTMLBRElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><span class="cx"> #include "RenderListItem.h"
</span><span class="cx"> #include "Text.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "DocumentFragment.h"
</span><span class="cx"> #include "DocumentMarkerController.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "EditorInsertAction.h"
</span><span class="cx"> #include "ElementTraversal.h"
</span><span class="lines">@@ -73,7 +74,6 @@
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><span class="cx"> #include "WrapContentsInDummySpanCommand.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCreateLinkCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CreateLinkCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CreateLinkCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/CreateLinkCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -25,17 +25,17 @@
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "CreateLinkCommand.h"
</span><del>-#include "htmlediting.h"
-#include "Text.h"
</del><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "HTMLAnchorElement.h"
</span><ins>+#include "Text.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> CreateLinkCommand::CreateLinkCommand(Document& document, const String& url)
</span><span class="cx"> : CompositeEditCommand(document)
</span><ins>+ , m_url(url)
</ins><span class="cx"> {
</span><del>- m_url = url;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CreateLinkCommand::doApply()
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteFromTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -26,9 +26,9 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DeleteFromTextNodeCommand.h"
</span><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Text.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "DocumentMarkerController.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "ElementIterator.h"
</span><span class="lines">@@ -43,7 +44,6 @@
</span><span class="cx"> #include "RenderedDocumentMarker.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/EditCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "CompositeEditCommand.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="lines">@@ -35,7 +36,6 @@
</span><span class="cx"> #include "HTMLInputElement.h"
</span><span class="cx"> #include "HTMLTextAreaElement.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingcppfromrev213354trunkSourceWebCoreeditinghtmleditingcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/editing/Editing.cpp (from rev 213354, trunk/Source/WebCore/editing/htmlediting.cpp) (0 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editing.cpp         (rev 0)
+++ trunk/Source/WebCore/editing/Editing.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -0,0 +1,1287 @@
</span><ins>+/*
+ * Copyright (C) 2004-2007, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Editing.h"
+
+#include "AXObjectCache.h"
+#include "Document.h"
+#include "Editor.h"
+#include "Frame.h"
+#include "HTMLBodyElement.h"
+#include "HTMLDListElement.h"
+#include "HTMLDivElement.h"
+#include "HTMLElementFactory.h"
+#include "HTMLInterchange.h"
+#include "HTMLLIElement.h"
+#include "HTMLNames.h"
+#include "HTMLOListElement.h"
+#include "HTMLParagraphElement.h"
+#include "HTMLSpanElement.h"
+#include "HTMLTableElement.h"
+#include "HTMLTextFormControlElement.h"
+#include "HTMLUListElement.h"
+#include "NodeTraversal.h"
+#include "PositionIterator.h"
+#include "RenderBlock.h"
+#include "RenderElement.h"
+#include "RenderTableCell.h"
+#include "ShadowRoot.h"
+#include "Text.h"
+#include "TextIterator.h"
+#include "VisibleUnits.h"
+#include <wtf/Assertions.h>
+#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringBuilder.h>
+#include <wtf/unicode/CharacterNames.h>
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+static bool isVisiblyAdjacent(const Position&, const Position&);
+
+bool canHaveChildrenForEditing(const Node& node)
+{
+ return !is<Text>(node) && node.canContainRangeEndPoint();
+}
+
+// Atomic means that the node has no children, or has children which are ignored for the purposes of editing.
+bool isAtomicNode(const Node* node)
+{
+ return node && (!node->hasChildNodes() || editingIgnoresContent(*node));
+}
+
+// Compare two positions, taking into account the possibility that one or both
+// could be inside a shadow tree. Only works for non-null values.
+int comparePositions(const Position& a, const Position& b)
+{
+ TreeScope* commonScope = commonTreeScope(a.containerNode(), b.containerNode());
+
+ if (!commonScope)
+ return 0;
+
+ Node* nodeA = commonScope->ancestorNodeInThisScope(a.containerNode());
+ ASSERT(nodeA);
+ bool hasDescendentA = nodeA != a.containerNode();
+ int offsetA = hasDescendentA ? 0 : a.computeOffsetInContainerNode();
+
+ Node* nodeB = commonScope->ancestorNodeInThisScope(b.containerNode());
+ ASSERT(nodeB);
+ bool hasDescendentB = nodeB != b.containerNode();
+ int offsetB = hasDescendentB ? 0 : b.computeOffsetInContainerNode();
+
+ int bias = 0;
+ if (nodeA == nodeB) {
+ if (hasDescendentA)
+ bias = -1;
+ else if (hasDescendentB)
+ bias = 1;
+ }
+
+ auto comparisonResult = Range::compareBoundaryPoints(nodeA, offsetA, nodeB, offsetB);
+ if (comparisonResult.hasException())
+ return bias;
+ auto result = comparisonResult.releaseReturnValue();
+ return result ? result : bias;
+}
+
+int comparePositions(const VisiblePosition& a, const VisiblePosition& b)
+{
+ return comparePositions(a.deepEquivalent(), b.deepEquivalent());
+}
+
+ContainerNode* highestEditableRoot(const Position& position, EditableType editableType)
+{
+ ContainerNode* highestEditableRoot = editableRootForPosition(position, editableType);
+ if (!highestEditableRoot)
+ return nullptr;
+
+ for (ContainerNode* node = highestEditableRoot; !is<HTMLBodyElement>(*node); ) {
+ node = node->parentNode();
+ if (!node)
+ break;
+ // FIXME: Can this ever be a Document or DocumentFragment? If not, this should return Element* instead.
+ if (hasEditableStyle(*node, editableType))
+ highestEditableRoot = node;
+ }
+
+ return highestEditableRoot;
+}
+
+Element* lowestEditableAncestor(Node* node)
+{
+ for (; node; node = node->parentNode()) {
+ if (node->hasEditableStyle())
+ return node->rootEditableElement();
+ if (is<HTMLBodyElement>(*node))
+ break;
+ }
+ return nullptr;
+}
+
+static bool isEditableToAccessibility(const Node& node)
+{
+ ASSERT(AXObjectCache::accessibilityEnabled());
+ ASSERT(node.document().existingAXObjectCache());
+
+ if (auto* cache = node.document().existingAXObjectCache())
+ return cache->rootAXEditableElement(&node);
+
+ return false;
+}
+
+static bool computeEditability(const Node& node, EditableType editableType, Node::ShouldUpdateStyle shouldUpdateStyle)
+{
+ if (node.computeEditability(Node::UserSelectAllIsAlwaysNonEditable, shouldUpdateStyle) != Node::Editability::ReadOnly)
+ return true;
+
+ switch (editableType) {
+ case ContentIsEditable:
+ return false;
+ case HasEditableAXRole:
+ return isEditableToAccessibility(node);
+ }
+ ASSERT_NOT_REACHED();
+ return false;
+}
+
+bool hasEditableStyle(const Node& node, EditableType editableType)
+{
+ return computeEditability(node, editableType, Node::ShouldUpdateStyle::DoNotUpdate);
+}
+
+bool isEditableNode(const Node& node)
+{
+ return computeEditability(node, ContentIsEditable, Node::ShouldUpdateStyle::Update);
+}
+
+bool isEditablePosition(const Position& position, EditableType editableType)
+{
+ Node* node = position.containerNode();
+ return node && computeEditability(*node, editableType, Node::ShouldUpdateStyle::Update);
+}
+
+bool isAtUnsplittableElement(const Position& position)
+{
+ Node* node = position.containerNode();
+ return node == editableRootForPosition(position) || node == enclosingNodeOfType(position, isTableCell);
+}
+
+bool isRichlyEditablePosition(const Position& position)
+{
+ auto* node = position.containerNode();
+ return node && node->hasRichlyEditableStyle();
+}
+
+Element* editableRootForPosition(const Position& position, EditableType editableType)
+{
+ Node* node = position.containerNode();
+ if (!node)
+ return nullptr;
+
+ switch (editableType) {
+ case HasEditableAXRole:
+ if (auto* cache = node->document().existingAXObjectCache())
+ return const_cast<Element*>(cache->rootAXEditableElement(node));
+ FALLTHROUGH;
+ case ContentIsEditable:
+ return node->rootEditableElement();
+ }
+ return nullptr;
+}
+
+// Finds the enclosing element until which the tree can be split.
+// When a user hits ENTER, he/she won't expect this element to be split into two.
+// You may pass it as the second argument of splitTreeToNode.
+Element* unsplittableElementForPosition(const Position& position)
+{
+ // Since enclosingNodeOfType won't search beyond the highest root editable node,
+ // this code works even if the closest table cell was outside of the root editable node.
+ if (auto* enclosingCell = downcast<Element>(enclosingNodeOfType(position, &isTableCell)))
+ return enclosingCell;
+ return editableRootForPosition(position);
+}
+
+Position nextCandidate(const Position& position)
+{
+ for (PositionIterator nextPosition = position; !nextPosition.atEnd(); ) {
+ nextPosition.increment();
+ if (nextPosition.isCandidate())
+ return nextPosition;
+ }
+ return { };
+}
+
+Position nextVisuallyDistinctCandidate(const Position& position)
+{
+ // FIXME: Use PositionIterator instead.
+ Position nextPosition = position;
+ Position downstreamStart = nextPosition.downstream();
+ while (!nextPosition.atEndOfTree()) {
+ nextPosition = nextPosition.next(Character);
+ if (nextPosition.isCandidate() && nextPosition.downstream() != downstreamStart)
+ return nextPosition;
+ if (auto* node = nextPosition.containerNode()) {
+ if (!node->renderer())
+ nextPosition = lastPositionInOrAfterNode(node);
+ }
+ }
+ return { };
+}
+
+Position previousCandidate(const Position& position)
+{
+ PositionIterator previousPosition = position;
+ while (!previousPosition.atStart()) {
+ previousPosition.decrement();
+ if (previousPosition.isCandidate())
+ return previousPosition;
+ }
+ return { };
+}
+
+Position previousVisuallyDistinctCandidate(const Position& position)
+{
+ // FIXME: Use PositionIterator instead.
+ Position previousPosition = position;
+ Position downstreamStart = previousPosition.downstream();
+ while (!previousPosition.atStartOfTree()) {
+ previousPosition = previousPosition.previous(Character);
+ if (previousPosition.isCandidate() && previousPosition.downstream() != downstreamStart)
+ return previousPosition;
+ if (auto* node = previousPosition.containerNode()) {
+ if (!node->renderer())
+ previousPosition = firstPositionInOrBeforeNode(node);
+ }
+ }
+ return { };
+}
+
+Position firstEditablePositionAfterPositionInRoot(const Position& position, ContainerNode* highestRoot)
+{
+ if (!highestRoot)
+ return { };
+
+ // position falls before highestRoot.
+ if (comparePositions(position, firstPositionInNode(highestRoot)) == -1 && highestRoot->hasEditableStyle())
+ return firstPositionInNode(highestRoot);
+
+ Position candidate = position;
+
+ if (&position.deprecatedNode()->treeScope() != &highestRoot->treeScope()) {
+ auto* shadowAncestor = highestRoot->treeScope().ancestorNodeInThisScope(position.deprecatedNode());
+ if (!shadowAncestor)
+ return { };
+
+ candidate = positionAfterNode(shadowAncestor);
+ }
+
+ while (candidate.deprecatedNode() && !isEditablePosition(candidate) && candidate.deprecatedNode()->isDescendantOf(*highestRoot))
+ candidate = isAtomicNode(candidate.deprecatedNode()) ? positionInParentAfterNode(candidate.deprecatedNode()) : nextVisuallyDistinctCandidate(candidate);
+
+ if (candidate.deprecatedNode() && candidate.deprecatedNode() != highestRoot && !candidate.deprecatedNode()->isDescendantOf(*highestRoot))
+ return { };
+
+ return candidate;
+}
+
+Position lastEditablePositionBeforePositionInRoot(const Position& position, ContainerNode* highestRoot)
+{
+ if (!highestRoot)
+ return { };
+
+ // When position falls after highestRoot, the result is easy to compute.
+ if (comparePositions(position, lastPositionInNode(highestRoot)) == 1)
+ return lastPositionInNode(highestRoot);
+
+ Position candidate = position;
+
+ if (&position.deprecatedNode()->treeScope() != &highestRoot->treeScope()) {
+ auto* shadowAncestor = highestRoot->treeScope().ancestorNodeInThisScope(position.deprecatedNode());
+ if (!shadowAncestor)
+ return { };
+
+ candidate = firstPositionInOrBeforeNode(shadowAncestor);
+ }
+
+ while (candidate.deprecatedNode() && !isEditablePosition(candidate) && candidate.deprecatedNode()->isDescendantOf(*highestRoot))
+ candidate = isAtomicNode(candidate.deprecatedNode()) ? positionInParentBeforeNode(candidate.deprecatedNode()) : previousVisuallyDistinctCandidate(candidate);
+
+ if (candidate.deprecatedNode() && candidate.deprecatedNode() != highestRoot && !candidate.deprecatedNode()->isDescendantOf(*highestRoot))
+ return { };
+
+ return candidate;
+}
+
+// FIXME: The function name, comment, and code say three different things here!
+// Whether or not content before and after this node will collapse onto the same line as it.
+bool isBlock(const Node* node)
+{
+ return node && node->renderer() && !node->renderer()->isInline() && !node->renderer()->isRubyText();
+}
+
+bool isInline(const Node* node)
+{
+ return node && node->renderer() && node->renderer()->isInline();
+}
+
+// FIXME: Deploy this in all of the places where enclosingBlockFlow/enclosingBlockFlowOrTableElement are used.
+// FIXME: Pass a position to this function. The enclosing block of [table, x] for example, should be the
+// block that contains the table and not the table, and this function should be the only one responsible for
+// knowing about these kinds of special cases.
+Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
+{
+ Node* enclosingNode = enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule);
+ return is<Element>(enclosingNode) ? downcast<Element>(enclosingNode) : nullptr;
+}
+
+TextDirection directionOfEnclosingBlock(const Position& position)
+{
+ auto block = enclosingBlock(position.containerNode());
+ if (!block)
+ return LTR;
+ auto renderer = block->renderer();
+ if (!renderer)
+ return LTR;
+ return renderer->style().direction();
+}
+
+// This method is used to create positions in the DOM. It returns the maximum valid offset
+// in a node. It returns 1 for some elements even though they do not have children, which
+// creates technically invalid DOM Positions. Be sure to call parentAnchoredEquivalent
+// on a Position before using it to create a DOM Range, or an exception will be thrown.
+int lastOffsetForEditing(const Node& node)
+{
+ if (node.offsetInCharacters())
+ return node.maxCharacterOffset();
+
+ if (node.hasChildNodes())
+ return node.countChildNodes();
+
+ // NOTE: This should preempt the countChildNodes() for, e.g., select nodes.
+ // FIXME: What does the comment above mean?
+ if (editingIgnoresContent(node))
+ return 1;
+
+ return 0;
+}
+
+bool isAmbiguousBoundaryCharacter(UChar character)
+{
+ // These are characters that can behave as word boundaries, but can appear within words.
+ // If they are just typed, i.e. if they are immediately followed by a caret, we want to delay text checking until the next character has been typed.
+ // FIXME: this is required until <rdar://problem/6853027> is fixed and text checking can do this for us.
+ return character == '\'' || character == '@' || character == rightSingleQuotationMark || character == hebrewPunctuationGershayim;
+}
+
+String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfParagraph, bool endIsEndOfParagraph)
+{
+ StringBuilder rebalancedString;
+
+ bool previousCharacterWasSpace = false;
+ unsigned length = string.length();
+ for (unsigned i = 0; i < length; ++i) {
+ auto character = string[i];
+ if (!deprecatedIsEditingWhitespace(character)) {
+ previousCharacterWasSpace = false;
+ continue;
+ }
+ LChar selectedWhitespaceCharacter;
+ if (previousCharacterWasSpace || (!i && startIsStartOfParagraph) || (i == length - 1 && endIsEndOfParagraph)) {
+ selectedWhitespaceCharacter = noBreakSpace;
+ previousCharacterWasSpace = false;
+ } else {
+ selectedWhitespaceCharacter = ' ';
+ previousCharacterWasSpace = true;
+ }
+ if (character == selectedWhitespaceCharacter)
+ continue;
+ rebalancedString.reserveCapacity(length);
+ rebalancedString.append(string, rebalancedString.length(), i - rebalancedString.length());
+ rebalancedString.append(selectedWhitespaceCharacter);
+ }
+
+ if (rebalancedString.isEmpty())
+ return string;
+
+ rebalancedString.reserveCapacity(length);
+ rebalancedString.append(string, rebalancedString.length(), length - rebalancedString.length());
+ return rebalancedString.toString();
+}
+
+bool isTableStructureNode(const Node* node)
+{
+ auto* renderer = node->renderer();
+ return renderer && (renderer->isTableCell() || renderer->isTableRow() || renderer->isTableSection() || renderer->isRenderTableCol());
+}
+
+const String& nonBreakingSpaceString()
+{
+ static NeverDestroyed<String> nonBreakingSpaceString(&noBreakSpace, 1);
+ return nonBreakingSpaceString;
+}
+
+static bool isSpecialHTMLElement(const Node* node)
+{
+ if (!is<HTMLElement>(node))
+ return false;
+
+ if (downcast<HTMLElement>(*node).isLink())
+ return true;
+
+ auto* renderer = downcast<HTMLElement>(*node).renderer();
+ if (!renderer)
+ return false;
+
+ if (renderer->style().display() == TABLE || renderer->style().display() == INLINE_TABLE)
+ return true;
+
+ if (renderer->style().isFloating())
+ return true;
+
+ if (renderer->style().position() != StaticPosition)
+ return true;
+
+ return false;
+}
+
+static HTMLElement* firstInSpecialElement(const Position& position)
+{
+ auto* rootEditableElement = position.containerNode()->rootEditableElement();
+ for (Node* node = position.deprecatedNode(); node && node->rootEditableElement() == rootEditableElement; node = node->parentNode()) {
+ if (!isSpecialHTMLElement(node))
+ continue;
+ VisiblePosition vPos(position, DOWNSTREAM);
+ VisiblePosition firstInElement(firstPositionInOrBeforeNode(node), DOWNSTREAM);
+ if ((isRenderedTable(node) && vPos == firstInElement.next()) || vPos == firstInElement)
+ return &downcast<HTMLElement>(*node);
+ }
+ return nullptr;
+}
+
+static HTMLElement* lastInSpecialElement(const Position& position)
+{
+ auto* rootEditableElement = position.containerNode()->rootEditableElement();
+ for (Node* node = position.deprecatedNode(); node && node->rootEditableElement() == rootEditableElement; node = node->parentNode()) {
+ if (!isSpecialHTMLElement(node))
+ continue;
+ VisiblePosition vPos(position, DOWNSTREAM);
+ VisiblePosition lastInElement(lastPositionInOrAfterNode(node), DOWNSTREAM);
+ if ((isRenderedTable(node) && vPos == lastInElement.previous()) || vPos == lastInElement)
+ return &downcast<HTMLElement>(*node);
+ }
+ return nullptr;
+}
+
+Position positionBeforeContainingSpecialElement(const Position& position, HTMLElement** containingSpecialElement)
+{
+ auto* element = firstInSpecialElement(position);
+ if (!element)
+ return position;
+ Position result = positionInParentBeforeNode(element);
+ if (result.isNull() || result.deprecatedNode()->rootEditableElement() != position.deprecatedNode()->rootEditableElement())
+ return position;
+ if (containingSpecialElement)
+ *containingSpecialElement = element;
+ return result;
+}
+
+Position positionAfterContainingSpecialElement(const Position& position, HTMLElement** containingSpecialElement)
+{
+ auto* element = lastInSpecialElement(position);
+ if (!element)
+ return position;
+ Position result = positionInParentAfterNode(element);
+ if (result.isNull() || result.deprecatedNode()->rootEditableElement() != position.deprecatedNode()->rootEditableElement())
+ return position;
+ if (containingSpecialElement)
+ *containingSpecialElement = element;
+ return result;
+}
+
+Element* isFirstPositionAfterTable(const VisiblePosition& position)
+{
+ Position upstream(position.deepEquivalent().upstream());
+ auto* node = upstream.deprecatedNode();
+ if (!node)
+ return nullptr;
+ auto* renderer = node->renderer();
+ if (!renderer || !renderer->isTable() || !upstream.atLastEditingPositionForNode())
+ return nullptr;
+ return &downcast<Element>(*node);
+}
+
+Element* isLastPositionBeforeTable(const VisiblePosition& position)
+{
+ Position downstream(position.deepEquivalent().downstream());
+ auto* node = downstream.deprecatedNode();
+ if (!node)
+ return nullptr;
+ auto* renderer = node->renderer();
+ if (!renderer || !renderer->isTable() || !downstream.atFirstEditingPositionForNode())
+ return nullptr;
+ return &downcast<Element>(*node);
+}
+
+// Returns the visible position at the beginning of a node
+VisiblePosition visiblePositionBeforeNode(Node& node)
+{
+ if (node.hasChildNodes())
+ return VisiblePosition(firstPositionInOrBeforeNode(&node), DOWNSTREAM);
+ ASSERT(node.parentNode());
+ ASSERT(!node.parentNode()->isShadowRoot());
+ return positionInParentBeforeNode(&node);
+}
+
+// Returns the visible position at the ending of a node
+VisiblePosition visiblePositionAfterNode(Node& node)
+{
+ if (node.hasChildNodes())
+ return VisiblePosition(lastPositionInOrAfterNode(&node), DOWNSTREAM);
+ ASSERT(node.parentNode());
+ ASSERT(!node.parentNode()->isShadowRoot());
+ return positionInParentAfterNode(&node);
+}
+
+bool isListHTMLElement(Node* node)
+{
+ return node && (is<HTMLUListElement>(*node) || is<HTMLOListElement>(*node) || is<HTMLDListElement>(*node));
+}
+
+bool isListItem(const Node* node)
+{
+ return node && (isListHTMLElement(node->parentNode()) || (node->renderer() && node->renderer()->isListItem()));
+}
+
+Element* enclosingElementWithTag(const Position& position, const QualifiedName& tagName)
+{
+ auto* root = highestEditableRoot(position);
+ for (Node* node = position.deprecatedNode(); node; node = node->parentNode()) {
+ if (root && !node->hasEditableStyle())
+ continue;
+ if (!is<Element>(*node))
+ continue;
+ if (downcast<Element>(*node).hasTagName(tagName))
+ return &downcast<Element>(*node);
+ if (node == root)
+ return nullptr;
+ }
+ return nullptr;
+}
+
+Node* enclosingNodeOfType(const Position& position, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule rule)
+{
+ // FIXME: support CanSkipCrossEditingBoundary
+ ASSERT(rule == CanCrossEditingBoundary || rule == CannotCrossEditingBoundary);
+ auto* root = rule == CannotCrossEditingBoundary ? highestEditableRoot(position) : nullptr;
+ for (Node* n = position.deprecatedNode(); n; n = n->parentNode()) {
+ // Don't return a non-editable node if the input position was editable, since
+ // the callers from editing will no doubt want to perform editing inside the returned node.
+ if (root && !n->hasEditableStyle())
+ continue;
+ if (nodeIsOfType(n))
+ return n;
+ if (n == root)
+ return nullptr;
+ }
+ return nullptr;
+}
+
+Node* highestEnclosingNodeOfType(const Position& position, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule rule, Node* stayWithin)
+{
+ Node* highest = nullptr;
+ auto* root = rule == CannotCrossEditingBoundary ? highestEditableRoot(position) : nullptr;
+ for (Node* n = position.containerNode(); n && n != stayWithin; n = n->parentNode()) {
+ if (root && !n->hasEditableStyle())
+ continue;
+ if (nodeIsOfType(n))
+ highest = n;
+ if (n == root)
+ break;
+ }
+ return highest;
+}
+
+static bool hasARenderedDescendant(Node* node, Node* excludedNode)
+{
+ for (Node* n = node->firstChild(); n;) {
+ if (n == excludedNode) {
+ n = NodeTraversal::nextSkippingChildren(*n, node);
+ continue;
+ }
+ if (n->renderer())
+ return true;
+ n = NodeTraversal::next(*n, node);
+ }
+ return false;
+}
+
+Node* highestNodeToRemoveInPruning(Node* node)
+{
+ Node* previousNode = nullptr;
+ auto* rootEditableElement = node ? node->rootEditableElement() : nullptr;
+ for (; node; node = node->parentNode()) {
+ if (auto* renderer = node->renderer()) {
+ if (!renderer->canHaveChildren() || hasARenderedDescendant(node, previousNode) || rootEditableElement == node)
+ return previousNode;
+ }
+ previousNode = node;
+ }
+ return nullptr;
+}
+
+Element* enclosingTableCell(const Position& position)
+{
+ return downcast<Element>(enclosingNodeOfType(position, isTableCell));
+}
+
+Element* enclosingAnchorElement(const Position& p)
+{
+ for (Node* node = p.deprecatedNode(); node; node = node->parentNode()) {
+ if (is<Element>(*node) && node->isLink())
+ return downcast<Element>(node);
+ }
+ return nullptr;
+}
+
+HTMLElement* enclosingList(Node* node)
+{
+ if (!node)
+ return nullptr;
+
+ auto* root = highestEditableRoot(firstPositionInOrBeforeNode(node));
+
+ for (ContainerNode* ancestor = node->parentNode(); ancestor; ancestor = ancestor->parentNode()) {
+ if (is<HTMLUListElement>(*ancestor) || is<HTMLOListElement>(*ancestor))
+ return downcast<HTMLElement>(ancestor);
+ if (ancestor == root)
+ return nullptr;
+ }
+
+ return nullptr;
+}
+
+Node* enclosingListChild(Node *node)
+{
+ if (!node)
+ return nullptr;
+
+ // Check for a list item element, or for a node whose parent is a list element. Such a node
+ // will appear visually as a list item (but without a list marker)
+ auto* root = highestEditableRoot(firstPositionInOrBeforeNode(node));
+
+ // FIXME: This function is inappropriately named since it starts with node instead of node->parentNode()
+ for (Node* n = node; n && n->parentNode(); n = n->parentNode()) {
+ if (is<HTMLLIElement>(*n) || (isListHTMLElement(n->parentNode()) && n != root))
+ return n;
+ if (n == root || isTableCell(n))
+ return nullptr;
+ }
+
+ return nullptr;
+}
+
+static HTMLElement* embeddedSublist(Node* listItem)
+{
+ // Check the DOM so that we'll find collapsed sublists without renderers.
+ for (Node* n = listItem->firstChild(); n; n = n->nextSibling()) {
+ if (isListHTMLElement(n))
+ return downcast<HTMLElement>(n);
+ }
+ return nullptr;
+}
+
+static Node* appendedSublist(Node* listItem)
+{
+ // Check the DOM so that we'll find collapsed sublists without renderers.
+ for (Node* n = listItem->nextSibling(); n; n = n->nextSibling()) {
+ if (isListHTMLElement(n))
+ return downcast<HTMLElement>(n);
+ if (isListItem(listItem))
+ return nullptr;
+ }
+
+ return nullptr;
+}
+
+// FIXME: This function should not need to call isStartOfParagraph/isEndOfParagraph.
+Node* enclosingEmptyListItem(const VisiblePosition& position)
+{
+ // Check that position is on a line by itself inside a list item
+ auto* listChildNode = enclosingListChild(position.deepEquivalent().deprecatedNode());
+ if (!listChildNode || !isStartOfParagraph(position) || !isEndOfParagraph(position))
+ return nullptr;
+
+ VisiblePosition firstInListChild(firstPositionInOrBeforeNode(listChildNode));
+ VisiblePosition lastInListChild(lastPositionInOrAfterNode(listChildNode));
+
+ if (firstInListChild != position || lastInListChild != position)
+ return nullptr;
+
+ if (embeddedSublist(listChildNode) || appendedSublist(listChildNode))
+ return nullptr;
+
+ return listChildNode;
+}
+
+HTMLElement* outermostEnclosingList(Node* node, Node* rootList)
+{
+ auto* list = enclosingList(node);
+ if (!list)
+ return nullptr;
+
+ while (auto* nextList = enclosingList(list)) {
+ if (nextList == rootList)
+ break;
+ list = nextList;
+ }
+
+ return list;
+}
+
+bool canMergeLists(Element* firstList, Element* secondList)
+{
+ if (!is<HTMLElement>(firstList) || !is<HTMLElement>(secondList))
+ return false;
+
+ auto& first = downcast<HTMLElement>(*firstList);
+ auto& second = downcast<HTMLElement>(*secondList);
+
+ return first.localName() == second.localName() // make sure the list types match (ol vs. ul)
+ && first.hasEditableStyle() && second.hasEditableStyle() // both lists are editable
+ && first.rootEditableElement() == second.rootEditableElement() // don't cross editing boundaries
+ // Make sure there is no visible content between this li and the previous list.
+ && isVisiblyAdjacent(positionInParentAfterNode(&first), positionInParentBeforeNode(&second));
+}
+
+static Node* previousNodeConsideringAtomicNodes(const Node* node)
+{
+ if (node->previousSibling()) {
+ Node* n = node->previousSibling();
+ while (!isAtomicNode(n) && n->lastChild())
+ n = n->lastChild();
+ return n;
+ }
+ if (node->parentNode())
+ return node->parentNode();
+ return nullptr;
+}
+
+static Node* nextNodeConsideringAtomicNodes(const Node* node)
+{
+ if (!isAtomicNode(node) && node->firstChild())
+ return node->firstChild();
+ if (node->nextSibling())
+ return node->nextSibling();
+ const Node* n = node;
+ while (n && !n->nextSibling())
+ n = n->parentNode();
+ if (n)
+ return n->nextSibling();
+ return nullptr;
+}
+
+Node* previousLeafNode(const Node* node)
+{
+ while ((node = previousNodeConsideringAtomicNodes(node))) {
+ if (isAtomicNode(node))
+ return const_cast<Node*>(node);
+ }
+ return nullptr;
+}
+
+Node* nextLeafNode(const Node* node)
+{
+ while ((node = nextNodeConsideringAtomicNodes(node))) {
+ if (isAtomicNode(node))
+ return const_cast<Node*>(node);
+ }
+ return nullptr;
+}
+
+// FIXME: Do not require renderer, so that this can be used within fragments.
+bool isRenderedTable(const Node* node)
+{
+ if (!is<Element>(node))
+ return false;
+ auto* renderer = downcast<Element>(*node).renderer();
+ return renderer && renderer->isTable();
+}
+
+bool isTableCell(const Node* node)
+{
+ auto* renderer = node->renderer();
+ if (!renderer)
+ return node->hasTagName(tdTag) || node->hasTagName(thTag);
+ return renderer->isTableCell();
+}
+
+bool isEmptyTableCell(const Node* node)
+{
+ // Returns true IFF the passed in node is one of:
+ // .) a table cell with no children,
+ // .) a table cell with a single BR child, and which has no other child renderers, including :before and :after renderers
+ // .) the BR child of such a table cell
+
+ // Find rendered node
+ while (node && !node->renderer())
+ node = node->parentNode();
+ if (!node)
+ return false;
+
+ // Make sure the rendered node is a table cell or <br>.
+ // If it's a <br>, then the parent node has to be a table cell.
+ auto* renderer = node->renderer();
+ if (renderer->isBR()) {
+ renderer = renderer->parent();
+ if (!renderer)
+ return false;
+ }
+ if (!is<RenderTableCell>(*renderer))
+ return false;
+
+ // Check that the table cell contains no child renderers except for perhaps a single <br>.
+ auto* childRenderer = downcast<RenderTableCell>(*renderer).firstChild();
+ if (!childRenderer)
+ return true;
+ if (!childRenderer->isBR())
+ return false;
+ return !childRenderer->nextSibling();
+}
+
+Ref<HTMLElement> createDefaultParagraphElement(Document& document)
+{
+ switch (document.frame()->editor().defaultParagraphSeparator()) {
+ case EditorParagraphSeparatorIsDiv:
+ return HTMLDivElement::create(document);
+ case EditorParagraphSeparatorIsP:
+ break;
+ }
+ return HTMLParagraphElement::create(document);
+}
+
+Ref<HTMLElement> createHTMLElement(Document& document, const QualifiedName& name)
+{
+ return HTMLElementFactory::createElement(name, document);
+}
+
+Ref<HTMLElement> createHTMLElement(Document& document, const AtomicString& tagName)
+{
+ return createHTMLElement(document, QualifiedName(nullAtom, tagName, xhtmlNamespaceURI));
+}
+
+bool isTabSpanNode(const Node* node)
+{
+ return is<HTMLSpanElement>(node) && downcast<HTMLSpanElement>(*node).attributeWithoutSynchronization(classAttr) == AppleTabSpanClass;
+}
+
+bool isTabSpanTextNode(const Node* node)
+{
+ return is<Text>(node) && isTabSpanNode(node->parentNode());
+}
+
+HTMLSpanElement* tabSpanNode(const Node* node)
+{
+ return isTabSpanTextNode(node) ? downcast<HTMLSpanElement>(node->parentNode()) : nullptr;
+}
+
+static Ref<Element> createTabSpanElement(Document& document, Text& tabTextNode)
+{
+ auto spanElement = HTMLSpanElement::create(document);
+
+ spanElement->setAttributeWithoutSynchronization(classAttr, AppleTabSpanClass);
+ spanElement->setAttribute(styleAttr, "white-space:pre");
+
+ spanElement->appendChild(tabTextNode);
+
+ return WTFMove(spanElement);
+}
+
+Ref<Element> createTabSpanElement(Document& document, const String& tabText)
+{
+ return createTabSpanElement(document, document.createTextNode(tabText));
+}
+
+Ref<Element> createTabSpanElement(Document& document)
+{
+ return createTabSpanElement(document, document.createEditingTextNode(ASCIILiteral("\t")));
+}
+
+bool isNodeRendered(const Node& node)
+{
+ auto* renderer = node.renderer();
+ return renderer && renderer->style().visibility() == VISIBLE;
+}
+
+unsigned numEnclosingMailBlockquotes(const Position& position)
+{
+ unsigned count = 0;
+ for (Node* node = position.deprecatedNode(); node; node = node->parentNode()) {
+ if (isMailBlockquote(node))
+ ++count;
+ }
+ return count;
+}
+
+void updatePositionForNodeRemoval(Position& position, Node& node)
+{
+ if (position.isNull())
+ return;
+ switch (position.anchorType()) {
+ case Position::PositionIsBeforeChildren:
+ if (node.containsIncludingShadowDOM(position.containerNode()))
+ position = positionInParentBeforeNode(&node);
+ break;
+ case Position::PositionIsAfterChildren:
+ if (node.containsIncludingShadowDOM(position.containerNode()))
+ position = positionInParentBeforeNode(&node);
+ break;
+ case Position::PositionIsOffsetInAnchor:
+ if (position.containerNode() == node.parentNode() && static_cast<unsigned>(position.offsetInContainerNode()) > node.computeNodeIndex())
+ position.moveToOffset(position.offsetInContainerNode() - 1);
+ else if (node.containsIncludingShadowDOM(position.containerNode()))
+ position = positionInParentBeforeNode(&node);
+ break;
+ case Position::PositionIsAfterAnchor:
+ if (node.containsIncludingShadowDOM(position.anchorNode()))
+ position = positionInParentAfterNode(&node);
+ break;
+ case Position::PositionIsBeforeAnchor:
+ if (node.containsIncludingShadowDOM(position.anchorNode()))
+ position = positionInParentBeforeNode(&node);
+ break;
+ }
+}
+
+bool isMailBlockquote(const Node* node)
+{
+ ASSERT(node);
+ if (!node->hasTagName(blockquoteTag))
+ return false;
+ return downcast<HTMLElement>(*node).attributeWithoutSynchronization(typeAttr) == "cite";
+}
+
+int caretMinOffset(const Node& node)
+{
+ auto* renderer = node.renderer();
+ ASSERT(!node.isCharacterDataNode() || !renderer || renderer->isText());
+ return renderer ? renderer->caretMinOffset() : 0;
+}
+
+// If a node can contain candidates for VisiblePositions, return the offset of the last candidate, otherwise
+// return the number of children for container nodes and the length for unrendered text nodes.
+int caretMaxOffset(const Node& node)
+{
+ // For rendered text nodes, return the last position that a caret could occupy.
+ if (is<Text>(node)) {
+ if (auto* renderer = downcast<Text>(node).renderer())
+ return renderer->caretMaxOffset();
+ }
+ return lastOffsetForEditing(node);
+}
+
+bool lineBreakExistsAtVisiblePosition(const VisiblePosition& position)
+{
+ return lineBreakExistsAtPosition(position.deepEquivalent().downstream());
+}
+
+bool lineBreakExistsAtPosition(const Position& position)
+{
+ if (position.isNull())
+ return false;
+
+ if (position.anchorNode()->hasTagName(brTag) && position.atFirstEditingPositionForNode())
+ return true;
+
+ if (!position.anchorNode()->renderer())
+ return false;
+
+ if (!is<Text>(*position.anchorNode()) || !position.anchorNode()->renderer()->style().preserveNewline())
+ return false;
+
+ Text& textNode = downcast<Text>(*position.anchorNode());
+ unsigned offset = position.offsetInContainerNode();
+ return offset < textNode.length() && textNode.data()[offset] == '\n';
+}
+
+// Modifies selections that have an end point at the edge of a table
+// that contains the other endpoint so that they don't confuse
+// code that iterates over selected paragraphs.
+VisibleSelection selectionForParagraphIteration(const VisibleSelection& original)
+{
+ VisibleSelection newSelection(original);
+ VisiblePosition startOfSelection(newSelection.visibleStart());
+ VisiblePosition endOfSelection(newSelection.visibleEnd());
+
+ // If the end of the selection to modify is just after a table, and
+ // if the start of the selection is inside that table, then the last paragraph
+ // that we'll want modify is the last one inside the table, not the table itself
+ // (a table is itself a paragraph).
+ if (auto* table = isFirstPositionAfterTable(endOfSelection)) {
+ if (startOfSelection.deepEquivalent().deprecatedNode()->isDescendantOf(*table))
+ newSelection = VisibleSelection(startOfSelection, endOfSelection.previous(CannotCrossEditingBoundary));
+ }
+
+ // If the start of the selection to modify is just before a table,
+ // and if the end of the selection is inside that table, then the first paragraph
+ // we'll want to modify is the first one inside the table, not the paragraph
+ // containing the table itself.
+ if (auto* table = isLastPositionBeforeTable(startOfSelection)) {
+ if (endOfSelection.deepEquivalent().deprecatedNode()->isDescendantOf(*table))
+ newSelection = VisibleSelection(startOfSelection.next(CannotCrossEditingBoundary), endOfSelection);
+ }
+
+ return newSelection;
+}
+
+// FIXME: indexForVisiblePosition and visiblePositionForIndex use TextIterators to convert between
+// VisiblePositions and indices. But TextIterator iteration using TextIteratorEmitsCharactersBetweenAllVisiblePositions
+// does not exactly match VisiblePosition iteration, so using them to preserve a selection during an editing
+// opertion is unreliable. TextIterator's TextIteratorEmitsCharactersBetweenAllVisiblePositions mode needs to be fixed,
+// or these functions need to be changed to iterate using actual VisiblePositions.
+// FIXME: Deploy these functions everywhere that TextIterators are used to convert between VisiblePositions and indices.
+int indexForVisiblePosition(const VisiblePosition& visiblePosition, RefPtr<ContainerNode>& scope)
+{
+ if (visiblePosition.isNull())
+ return 0;
+
+ auto position = visiblePosition.deepEquivalent();
+ auto& document = *position.document();
+
+ auto* editableRoot = highestEditableRoot(position, AXObjectCache::accessibilityEnabled() ? HasEditableAXRole : ContentIsEditable);
+ if (editableRoot && !document.inDesignMode())
+ scope = editableRoot;
+ else {
+ if (position.containerNode()->isInShadowTree())
+ scope = position.containerNode()->containingShadowRoot();
+ else
+ scope = &document;
+ }
+
+ auto range = Range::create(document, firstPositionInNode(scope.get()), position.parentAnchoredEquivalent());
+ return TextIterator::rangeLength(range.ptr(), true);
+}
+
+// FIXME: Merge this function with the one above.
+int indexForVisiblePosition(Node& node, const VisiblePosition& visiblePosition, bool forSelectionPreservation)
+{
+ auto range = Range::create(node.document(), firstPositionInNode(&node), visiblePosition.deepEquivalent().parentAnchoredEquivalent());
+ return TextIterator::rangeLength(range.ptr(), forSelectionPreservation);
+}
+
+VisiblePosition visiblePositionForIndex(int index, ContainerNode* scope)
+{
+ auto range = TextIterator::rangeFromLocationAndLength(scope, index, 0, true);
+ // Check for an invalid index. Certain editing operations invalidate indices because
+ // of problems with TextIteratorEmitsCharactersBetweenAllVisiblePositions.
+ if (!range)
+ return { };
+ return { range->startPosition() };
+}
+
+VisiblePosition visiblePositionForIndexUsingCharacterIterator(Node& node, int index)
+{
+ if (index <= 0)
+ return { firstPositionInOrBeforeNode(&node), DOWNSTREAM };
+
+ RefPtr<Range> range = Range::create(node.document());
+ range->selectNodeContents(node);
+ CharacterIterator it(*range);
+ it.advance(index - 1);
+ return { it.atEnd() ? range->endPosition() : it.range()->endPosition(), UPSTREAM };
+}
+
+// Determines whether two positions are visibly next to each other (first then second)
+// while ignoring whitespaces and unrendered nodes
+static bool isVisiblyAdjacent(const Position& first, const Position& second)
+{
+ return VisiblePosition(first) == VisiblePosition(second.upstream());
+}
+
+// Determines whether a node is inside a range or visibly starts and ends at the boundaries of the range.
+// Call this function to determine whether a node is visibly fit inside selectedRange
+bool isNodeVisiblyContainedWithin(Node& node, const Range& range)
+{
+ // If the node is inside the range, then it surely is contained within.
+ auto comparisonResult = range.compareNode(node);
+ if (!comparisonResult.hasException() && comparisonResult.releaseReturnValue() == Range::NODE_INSIDE)
+ return true;
+
+ bool startIsVisuallySame = visiblePositionBeforeNode(node) == range.startPosition();
+ if (startIsVisuallySame && comparePositions(positionInParentAfterNode(&node), range.endPosition()) < 0)
+ return true;
+
+ bool endIsVisuallySame = visiblePositionAfterNode(node) == range.endPosition();
+ if (endIsVisuallySame && comparePositions(range.startPosition(), positionInParentBeforeNode(&node)) < 0)
+ return true;
+
+ return startIsVisuallySame && endIsVisuallySame;
+}
+
+bool isRenderedAsNonInlineTableImageOrHR(const Node* node)
+{
+ if (!node)
+ return false;
+ RenderObject* renderer = node->renderer();
+ return renderer && ((renderer->isTable() && !renderer->isInline()) || (renderer->isImage() && !renderer->isInline()) || renderer->isHR());
+}
+
+bool areIdenticalElements(const Node& first, const Node& second)
+{
+ if (!is<Element>(first) || !is<Element>(second))
+ return false;
+ auto& firstElement = downcast<Element>(first);
+ auto& secondElement = downcast<Element>(second);
+ return firstElement.hasTagName(secondElement.tagQName()) && firstElement.hasEquivalentAttributes(&secondElement);
+}
+
+bool isNonTableCellHTMLBlockElement(const Node* node)
+{
+ return node->hasTagName(listingTag)
+ || node->hasTagName(olTag)
+ || node->hasTagName(preTag)
+ || is<HTMLTableElement>(*node)
+ || node->hasTagName(ulTag)
+ || node->hasTagName(xmpTag)
+ || node->hasTagName(h1Tag)
+ || node->hasTagName(h2Tag)
+ || node->hasTagName(h3Tag)
+ || node->hasTagName(h4Tag)
+ || node->hasTagName(h5Tag);
+}
+
+Position adjustedSelectionStartForStyleComputation(const VisibleSelection& selection)
+{
+ // This function is used by range style computations to avoid bugs like:
+ // <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
+ // It is important to skip certain irrelevant content at the start of the selection, so we do not wind up
+ // with a spurious "mixed" style.
+
+ auto visiblePosition = selection.visibleStart();
+ if (visiblePosition.isNull())
+ return { };
+
+ // if the selection is a caret, just return the position, since the style
+ // behind us is relevant
+ if (selection.isCaret())
+ return visiblePosition.deepEquivalent();
+
+ // if the selection starts just before a paragraph break, skip over it
+ if (isEndOfParagraph(visiblePosition))
+ return visiblePosition.next().deepEquivalent().downstream();
+
+ // otherwise, make sure to be at the start of the first selected node,
+ // instead of possibly at the end of the last node before the selection
+ return visiblePosition.deepEquivalent().downstream();
+}
+
+// FIXME: Should this be deprecated like deprecatedEnclosingBlockFlowElement is?
+bool isBlockFlowElement(const Node& node)
+{
+ if (!node.isElementNode())
+ return false;
+ auto* renderer = downcast<Element>(node).renderer();
+ return renderer && renderer->isRenderBlockFlow();
+}
+
+Element* deprecatedEnclosingBlockFlowElement(Node* node)
+{
+ if (!node)
+ return nullptr;
+ if (isBlockFlowElement(*node))
+ return downcast<Element>(node);
+ while ((node = node->parentNode())) {
+ if (isBlockFlowElement(*node) || is<HTMLBodyElement>(*node))
+ return downcast<Element>(node);
+ }
+ return nullptr;
+}
+
+static inline bool caretRendersInsideNode(Node& node)
+{
+ return !isRenderedTable(&node) && !editingIgnoresContent(node);
+}
+
+RenderBlock* rendererForCaretPainting(Node* node)
+{
+ if (!node)
+ return nullptr;
+
+ auto* renderer = node->renderer();
+ if (!renderer)
+ return nullptr;
+
+ // If caretNode is a block and caret is inside it, then caret should be painted by that block.
+ bool paintedByBlock = is<RenderBlockFlow>(*renderer) && caretRendersInsideNode(*node);
+ return paintedByBlock ? downcast<RenderBlock>(renderer) : renderer->containingBlock();
+}
+
+LayoutRect localCaretRectInRendererForCaretPainting(const VisiblePosition& caretPosition, RenderBlock*& caretPainter)
+{
+ if (caretPosition.isNull())
+ return LayoutRect();
+
+ ASSERT(caretPosition.deepEquivalent().deprecatedNode()->renderer());
+
+ // First compute a rect local to the renderer at the selection start.
+ RenderObject* renderer;
+ LayoutRect localRect = caretPosition.localCaretRect(renderer);
+
+ return localCaretRectInRendererForRect(localRect, caretPosition.deepEquivalent().deprecatedNode(), renderer, caretPainter);
+}
+
+LayoutRect localCaretRectInRendererForRect(LayoutRect& localRect, Node* node, RenderObject* renderer, RenderBlock*& caretPainter)
+{
+ // Get the renderer that will be responsible for painting the caret
+ // (which is either the renderer we just found, or one of its containers).
+ caretPainter = rendererForCaretPainting(node);
+
+ // Compute an offset between the renderer and the caretPainter.
+ while (renderer != caretPainter) {
+ RenderElement* containerObject = renderer->container();
+ if (!containerObject)
+ return LayoutRect();
+ localRect.move(renderer->offsetFromContainer(*containerObject, localRect.location()));
+ renderer = containerObject;
+ }
+
+ return localRect;
+}
+
+IntRect absoluteBoundsForLocalCaretRect(RenderBlock* rendererForCaretPainting, const LayoutRect& rect, bool* insideFixed)
+{
+ if (insideFixed)
+ *insideFixed = false;
+
+ if (!rendererForCaretPainting || rect.isEmpty())
+ return IntRect();
+
+ LayoutRect localRect(rect);
+ rendererForCaretPainting->flipForWritingMode(localRect);
+ return rendererForCaretPainting->localToAbsoluteQuad(FloatRect(localRect), UseTransforms, insideFixed).enclosingBoundingBox();
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingEditinghfromrev213354trunkSourceWebCoreeditinghtmleditingh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/editing/Editing.h (from rev 213354, trunk/Source/WebCore/editing/htmlediting.h) (0 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editing.h         (rev 0)
+++ trunk/Source/WebCore/editing/Editing.h        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -0,0 +1,243 @@
</span><ins>+/*
+ * Copyright (C) 2004, 2006, 2008, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "Position.h"
+#include <wtf/Forward.h>
+#include <wtf/unicode/CharacterNames.h>
+
+namespace WebCore {
+
+class Document;
+class HTMLElement;
+class HTMLSpanElement;
+class HTMLTextFormControlElement;
+class RenderBlock;
+class VisiblePosition;
+class VisibleSelection;
+
+// -------------------------------------------------------------------------
+// Node
+// -------------------------------------------------------------------------
+
+ContainerNode* highestEditableRoot(const Position&, EditableType = ContentIsEditable);
+
+Node* highestEnclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary, Node* stayWithin = nullptr);
+Node* highestNodeToRemoveInPruning(Node*);
+Element* lowestEditableAncestor(Node*);
+
+Element* deprecatedEnclosingBlockFlowElement(Node*); // Use enclosingBlock instead.
+Element* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
+Element* enclosingTableCell(const Position&);
+Node* enclosingEmptyListItem(const VisiblePosition&);
+Element* enclosingAnchorElement(const Position&);
+Element* enclosingElementWithTag(const Position&, const QualifiedName&);
+Node* enclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
+HTMLSpanElement* tabSpanNode(const Node*);
+Element* isLastPositionBeforeTable(const VisiblePosition&); // FIXME: Strange to name this isXXX, but return an element.
+Element* isFirstPositionAfterTable(const VisiblePosition&); // FIXME: Strange to name this isXXX, but return an element.
+
+// These two deliver leaf nodes as if the whole DOM tree were a linear chain of its leaf nodes.
+Node* nextLeafNode(const Node*);
+Node* previousLeafNode(const Node*);
+
+WEBCORE_EXPORT int lastOffsetForEditing(const Node&);
+int caretMinOffset(const Node&);
+int caretMaxOffset(const Node&);
+
+bool hasEditableStyle(const Node&, EditableType);
+bool isEditableNode(const Node&);
+
+// FIXME: editingIgnoresContent, canHaveChildrenForEditing, and isAtomicNode should be named to clarify how they differ.
+
+// Returns true for nodes that either have no content, or have content that is ignored (skipped over) while editing.
+// There are no VisiblePositions inside these nodes.
+bool editingIgnoresContent(const Node&);
+
+bool canHaveChildrenForEditing(const Node&);
+bool isAtomicNode(const Node*);
+
+bool isBlock(const Node*);
+bool isBlockFlowElement(const Node&);
+bool isInline(const Node*);
+bool isTabSpanNode(const Node*);
+bool isTabSpanTextNode(const Node*);
+bool isMailBlockquote(const Node*);
+bool isRenderedTable(const Node*);
+bool isTableCell(const Node*);
+bool isEmptyTableCell(const Node*);
+bool isTableStructureNode(const Node*);
+bool isListHTMLElement(Node*);
+bool isListItem(const Node*);
+bool isNodeRendered(const Node&);
+bool isRenderedAsNonInlineTableImageOrHR(const Node*);
+bool isNonTableCellHTMLBlockElement(const Node*);
+
+bool isNodeVisiblyContainedWithin(Node&, const Range&);
+
+bool areIdenticalElements(const Node&, const Node&);
+
+bool positionBeforeOrAfterNodeIsCandidate(Node&);
+
+// -------------------------------------------------------------------------
+// Position
+// -------------------------------------------------------------------------
+
+Position nextCandidate(const Position&);
+Position previousCandidate(const Position&);
+
+Position nextVisuallyDistinctCandidate(const Position&);
+Position previousVisuallyDistinctCandidate(const Position&);
+
+Position positionBeforeContainingSpecialElement(const Position&, HTMLElement** containingSpecialElement = nullptr);
+Position positionAfterContainingSpecialElement(const Position&, HTMLElement** containingSpecialElement = nullptr);
+
+Position firstPositionInOrBeforeNode(Node*);
+Position lastPositionInOrAfterNode(Node*);
+
+Position firstEditablePositionAfterPositionInRoot(const Position&, ContainerNode* root);
+Position lastEditablePositionBeforePositionInRoot(const Position&, ContainerNode* root);
+
+int comparePositions(const Position&, const Position&);
+
+WEBCORE_EXPORT bool isEditablePosition(const Position&, EditableType = ContentIsEditable);
+bool isRichlyEditablePosition(const Position&);
+bool lineBreakExistsAtPosition(const Position&);
+bool isAtUnsplittableElement(const Position&);
+
+unsigned numEnclosingMailBlockquotes(const Position&);
+void updatePositionForNodeRemoval(Position&, Node&);
+
+WEBCORE_EXPORT TextDirection directionOfEnclosingBlock(const Position&);
+
+// -------------------------------------------------------------------------
+// VisiblePosition
+// -------------------------------------------------------------------------
+
+VisiblePosition visiblePositionBeforeNode(Node&);
+VisiblePosition visiblePositionAfterNode(Node&);
+
+bool lineBreakExistsAtVisiblePosition(const VisiblePosition&);
+
+int comparePositions(const VisiblePosition&, const VisiblePosition&);
+
+WEBCORE_EXPORT int indexForVisiblePosition(const VisiblePosition&, RefPtr<ContainerNode>& scope);
+int indexForVisiblePosition(Node&, const VisiblePosition&, bool forSelectionPreservation);
+WEBCORE_EXPORT VisiblePosition visiblePositionForIndex(int index, ContainerNode* scope);
+VisiblePosition visiblePositionForIndexUsingCharacterIterator(Node&, int index); // FIXME: Why do we need this version?
+
+// -------------------------------------------------------------------------
+// HTMLElement
+// -------------------------------------------------------------------------
+
+WEBCORE_EXPORT Ref<HTMLElement> createDefaultParagraphElement(Document&);
+Ref<HTMLElement> createHTMLElement(Document&, const QualifiedName&);
+Ref<HTMLElement> createHTMLElement(Document&, const AtomicString&);
+
+WEBCORE_EXPORT HTMLElement* enclosingList(Node*);
+HTMLElement* outermostEnclosingList(Node*, Node* rootList = nullptr);
+Node* enclosingListChild(Node*);
+
+// -------------------------------------------------------------------------
+// Element
+// -------------------------------------------------------------------------
+
+Ref<Element> createTabSpanElement(Document&);
+Ref<Element> createTabSpanElement(Document&, const String& tabText);
+Ref<Element> createBlockPlaceholderElement(Document&);
+
+Element* editableRootForPosition(const Position&, EditableType = ContentIsEditable);
+Element* unsplittableElementForPosition(const Position&);
+
+bool canMergeLists(Element* firstList, Element* secondList);
+
+// -------------------------------------------------------------------------
+// VisibleSelection
+// -------------------------------------------------------------------------
+
+VisibleSelection selectionForParagraphIteration(const VisibleSelection&);
+Position adjustedSelectionStartForStyleComputation(const VisibleSelection&);
+
+// -------------------------------------------------------------------------
+
+// FIXME: This is only one of many definitions of whitespace. Possibly never the right one to use.
+bool deprecatedIsEditingWhitespace(UChar);
+
+// FIXME: Can't answer this question correctly without being passed the white-space mode.
+bool deprecatedIsCollapsibleWhitespace(UChar);
+
+bool isAmbiguousBoundaryCharacter(UChar);
+
+String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagraph, bool endIsEndOfParagraph);
+const String& nonBreakingSpaceString();
+
+// Miscellaneous functions for caret rendering.
+
+RenderBlock* rendererForCaretPainting(Node*);
+LayoutRect localCaretRectInRendererForCaretPainting(const VisiblePosition&, RenderBlock*&);
+LayoutRect localCaretRectInRendererForRect(LayoutRect&, Node*, RenderObject*, RenderBlock*&);
+IntRect absoluteBoundsForLocalCaretRect(RenderBlock* rendererForCaretPainting, const LayoutRect&, bool* insideFixed = nullptr);
+
+// -------------------------------------------------------------------------
+
+inline bool deprecatedIsEditingWhitespace(UChar c)
+{
+ return c == noBreakSpace || c == ' ' || c == '\n' || c == '\t';
+}
+
+// FIXME: Can't really answer this question correctly without knowing the white-space mode.
+inline bool deprecatedIsCollapsibleWhitespace(UChar c)
+{
+ return c == ' ' || c == '\n';
+}
+
+bool isAmbiguousBoundaryCharacter(UChar);
+
+inline bool editingIgnoresContent(const Node& node)
+{
+ return !node.canContainRangeEndPoint();
+}
+
+inline bool positionBeforeOrAfterNodeIsCandidate(Node& node)
+{
+ return isRenderedTable(&node) || editingIgnoresContent(node);
+}
+
+inline Position firstPositionInOrBeforeNode(Node* node)
+{
+ if (!node)
+ return { };
+ return editingIgnoresContent(*node) ? positionBeforeNode(node) : firstPositionInNode(node);
+}
+
+inline Position lastPositionInOrAfterNode(Node* node)
+{
+ if (!node)
+ return { };
+ return editingIgnoresContent(*node) ? positionAfterNode(node) : lastPositionInNode(node);
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingAllInOne.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingAllInOne.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/EditingAllInOne.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include <DictationAlternative.cpp>
</span><span class="cx"> #include <DictationCommand.cpp>
</span><span class="cx"> #include <EditCommand.cpp>
</span><ins>+#include <Editing.cpp>
</ins><span class="cx"> #include <EditingStyle.cpp>
</span><span class="cx"> #include <Editor.cpp>
</span><span class="cx"> #include <EditorCommand.cpp>
</span><span class="lines">@@ -83,5 +84,4 @@
</span><span class="cx"> #include <VisibleSelection.cpp>
</span><span class="cx"> #include <VisibleUnits.cpp>
</span><span class="cx"> #include <WrapContentsInDummySpanCommand.cpp>
</span><del>-#include <htmlediting.cpp>
</del><span class="cx"> #include <markup.cpp>
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include "CSSStyleRule.h"
</span><span class="cx"> #include "CSSValueList.h"
</span><span class="cx"> #include "CSSValuePool.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "HTMLFontElement.h"
</span><span class="lines">@@ -50,7 +51,6 @@
</span><span class="cx"> #include "StyleRule.h"
</span><span class="cx"> #include "StyledElement.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/Editor.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include "DictationCommand.h"
</span><span class="cx"> #include "DocumentFragment.h"
</span><span class="cx"> #include "DocumentMarkerController.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "EventHandler.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="lines">@@ -95,7 +96,6 @@
</span><span class="cx"> #include "TypingCommand.h"
</span><span class="cx"> #include "UserTypingGestureIndicator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "Chrome.h"
</span><span class="cx"> #include "CreateLinkCommand.h"
</span><span class="cx"> #include "DocumentFragment.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "Event.h"
</span><span class="cx"> #include "EventHandler.h"
</span><span class="lines">@@ -58,7 +59,6 @@
</span><span class="cx"> #include "UnlinkCommand.h"
</span><span class="cx"> #include "UserGestureIndicator.h"
</span><span class="cx"> #include "UserTypingGestureIndicator.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx"> #include <wtf/text/AtomicString.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFormatBlockCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FormatBlockCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FormatBlockCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/FormatBlockCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,12 +27,12 @@
</span><span class="cx"> #include "FormatBlockCommand.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "Range.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "CharacterData.h"
</span><span class="cx"> #include "DeleteSelectionCommand.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "Element.h"
</span><span class="lines">@@ -63,7 +64,6 @@
</span><span class="cx"> #include "StyleProperties.h"
</span><span class="cx"> #include "TypingCommand.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingHTMLInterchangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/HTMLInterchange.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/HTMLInterchange.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/HTMLInterchange.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -26,11 +26,11 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "HTMLInterchange.h"
</span><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "RenderElement.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "TextIterator.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingIndentOutdentCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/IndentOutdentCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/IndentOutdentCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/IndentOutdentCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "IndentOutdentCommand.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "ElementTraversal.h"
</span><span class="cx"> #include "HTMLBRElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="lines">@@ -38,7 +39,6 @@
</span><span class="cx"> #include "SplitElementCommand.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertLineBreakCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "InsertLineBreakCommand.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameSelection.h"
</span><span class="cx"> #include "HTMLBRElement.h"
</span><span class="lines">@@ -37,7 +38,6 @@
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertListCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertListCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertListCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/InsertListCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "InsertListCommand.h"
</span><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "ElementTraversal.h"
</span><span class="cx"> #include "HTMLBRElement.h"
</span><span class="cx"> #include "HTMLLIElement.h"
</span><span class="lines">@@ -33,7 +34,6 @@
</span><span class="cx"> #include "HTMLUListElement.h"
</span><span class="cx"> #include "Range.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertNodeBeforeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,9 +27,9 @@
</span><span class="cx"> #include "InsertNodeBeforeCommand.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "RenderElement.h"
</span><span class="cx"> #include "Text.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "InsertParagraphSeparatorCommand.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "EditingStyle.h"
</span><span class="cx"> #include "HTMLBRElement.h"
</span><span class="cx"> #include "HTMLFormElement.h"
</span><span class="lines">@@ -36,7 +37,6 @@
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertTextCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertTextCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertTextCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/InsertTextCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "InsertTextCommand.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><span class="lines">@@ -33,7 +34,6 @@
</span><span class="cx"> #include "HTMLInterchange.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingModifySelectionListLevelcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ModifySelectionListLevel.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ModifySelectionListLevel.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/ModifySelectionListLevel.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,12 +27,12 @@
</span><span class="cx"> #include "ModifySelectionListLevel.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameSelection.h"
</span><span class="cx"> #include "HTMLOListElement.h"
</span><span class="cx"> #include "HTMLUListElement.h"
</span><span class="cx"> #include "RenderObject.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingRemoveNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/RemoveNodeCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/RemoveNodeCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/RemoveNodeCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -26,8 +26,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "RemoveNodeCommand.h"
</span><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "RenderElement.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/Assertions.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceNodeWithSpanCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ReplaceNodeWithSpanCommand.h"
</span><span class="cx">
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "HTMLSpanElement.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "DataTransfer.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "DocumentFragment.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="lines">@@ -58,7 +59,6 @@
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingSpellCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/SpellChecker.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/SpellChecker.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/SpellChecker.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "DocumentMarkerController.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "Page.h"
</span><span class="lines">@@ -36,7 +37,6 @@
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "TextCheckerClient.h"
</span><span class="cx"> #include "TextCheckingHelper.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "FontCascade.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "HTMLBodyElement.h"
</span><span class="lines">@@ -58,7 +59,6 @@
</span><span class="cx"> #include "TextControlInnerElements.h"
</span><span class="cx"> #include "VisiblePosition.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTypingCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TypingCommand.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TypingCommand.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/TypingCommand.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "DataTransfer.h"
</span><span class="cx"> #include "DeleteSelectionCommand.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="lines">@@ -46,7 +47,6 @@
</span><span class="cx"> #include "StaticRange.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisiblePositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisiblePosition.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisiblePosition.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/VisiblePosition.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include "VisiblePosition.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "FloatQuad.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "HTMLHtmlElement.h"
</span><span class="lines">@@ -40,7 +41,6 @@
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "TextStream.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleSelection.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleSelection.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/VisibleSelection.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,11 +27,11 @@
</span><span class="cx"> #include "VisibleSelection.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "HTMLInputElement.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <wtf/Assertions.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleUnitscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleUnits.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "VisibleUnits.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "HTMLBRElement.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="lines">@@ -41,7 +42,6 @@
</span><span class="cx"> #include "VisibleSelection.h"
</span><span class="cx"> #include <unicode/ubrk.h>
</span><span class="cx"> #include <wtf/text/TextBreakIterator.h>
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaDataDetectionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #import "CSSStyleDeclaration.h"
</span><span class="cx"> #import "DataDetectorsSPI.h"
</span><span class="cx"> #import "DataDetectorsUISPI.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "ElementAncestorIterator.h"
</span><span class="cx"> #import "ElementTraversal.h"
</span><span class="cx"> #import "FrameView.h"
</span><span class="lines">@@ -47,7 +48,6 @@
</span><span class="cx"> #import "TextIterator.h"
</span><span class="cx"> #import "VisiblePosition.h"
</span><span class="cx"> #import "VisibleUnits.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx"> #import <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> #import "DataDetectorsCoreSoftLink.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaEditorCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import "ColorMac.h"
</span><span class="cx"> #import "DocumentFragment.h"
</span><span class="cx"> #import "DocumentLoader.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "EditingStyle.h"
</span><span class="cx"> #import "EditorClient.h"
</span><span class="cx"> #import "Frame.h"
</span><span class="lines">@@ -47,7 +48,6 @@
</span><span class="cx"> #import "RenderStyle.h"
</span><span class="cx"> #import "SoftLinking.h"
</span><span class="cx"> #import "Text.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx"> #import <wtf/BlockObjCExceptions.h>
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditinghtmleditingcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/htmlediting.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/htmlediting.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/htmlediting.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -1,1287 +0,0 @@
</span><del>-/*
- * Copyright (C) 2004-2007, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "htmlediting.h"
-
-#include "AXObjectCache.h"
-#include "Document.h"
-#include "Editor.h"
-#include "Frame.h"
-#include "HTMLBodyElement.h"
-#include "HTMLDListElement.h"
-#include "HTMLDivElement.h"
-#include "HTMLElementFactory.h"
-#include "HTMLInterchange.h"
-#include "HTMLLIElement.h"
-#include "HTMLNames.h"
-#include "HTMLOListElement.h"
-#include "HTMLParagraphElement.h"
-#include "HTMLSpanElement.h"
-#include "HTMLTableElement.h"
-#include "HTMLTextFormControlElement.h"
-#include "HTMLUListElement.h"
-#include "NodeTraversal.h"
-#include "PositionIterator.h"
-#include "RenderBlock.h"
-#include "RenderElement.h"
-#include "RenderTableCell.h"
-#include "ShadowRoot.h"
-#include "Text.h"
-#include "TextIterator.h"
-#include "VisibleUnits.h"
-#include <wtf/Assertions.h>
-#include <wtf/StdLibExtras.h>
-#include <wtf/text/StringBuilder.h>
-#include <wtf/unicode/CharacterNames.h>
-
-namespace WebCore {
-
-using namespace HTMLNames;
-
-static bool isVisiblyAdjacent(const Position&, const Position&);
-
-bool canHaveChildrenForEditing(const Node& node)
-{
- return !is<Text>(node) && node.canContainRangeEndPoint();
-}
-
-// Atomic means that the node has no children, or has children which are ignored for the purposes of editing.
-bool isAtomicNode(const Node* node)
-{
- return node && (!node->hasChildNodes() || editingIgnoresContent(*node));
-}
-
-// Compare two positions, taking into account the possibility that one or both
-// could be inside a shadow tree. Only works for non-null values.
-int comparePositions(const Position& a, const Position& b)
-{
- TreeScope* commonScope = commonTreeScope(a.containerNode(), b.containerNode());
-
- if (!commonScope)
- return 0;
-
- Node* nodeA = commonScope->ancestorNodeInThisScope(a.containerNode());
- ASSERT(nodeA);
- bool hasDescendentA = nodeA != a.containerNode();
- int offsetA = hasDescendentA ? 0 : a.computeOffsetInContainerNode();
-
- Node* nodeB = commonScope->ancestorNodeInThisScope(b.containerNode());
- ASSERT(nodeB);
- bool hasDescendentB = nodeB != b.containerNode();
- int offsetB = hasDescendentB ? 0 : b.computeOffsetInContainerNode();
-
- int bias = 0;
- if (nodeA == nodeB) {
- if (hasDescendentA)
- bias = -1;
- else if (hasDescendentB)
- bias = 1;
- }
-
- auto comparisonResult = Range::compareBoundaryPoints(nodeA, offsetA, nodeB, offsetB);
- if (comparisonResult.hasException())
- return bias;
- auto result = comparisonResult.releaseReturnValue();
- return result ? result : bias;
-}
-
-int comparePositions(const VisiblePosition& a, const VisiblePosition& b)
-{
- return comparePositions(a.deepEquivalent(), b.deepEquivalent());
-}
-
-ContainerNode* highestEditableRoot(const Position& position, EditableType editableType)
-{
- ContainerNode* highestEditableRoot = editableRootForPosition(position, editableType);
- if (!highestEditableRoot)
- return nullptr;
-
- for (ContainerNode* node = highestEditableRoot; !is<HTMLBodyElement>(*node); ) {
- node = node->parentNode();
- if (!node)
- break;
- // FIXME: Can this ever be a Document or DocumentFragment? If not, this should return Element* instead.
- if (hasEditableStyle(*node, editableType))
- highestEditableRoot = node;
- }
-
- return highestEditableRoot;
-}
-
-Element* lowestEditableAncestor(Node* node)
-{
- for (; node; node = node->parentNode()) {
- if (node->hasEditableStyle())
- return node->rootEditableElement();
- if (is<HTMLBodyElement>(*node))
- break;
- }
- return nullptr;
-}
-
-static bool isEditableToAccessibility(const Node& node)
-{
- ASSERT(AXObjectCache::accessibilityEnabled());
- ASSERT(node.document().existingAXObjectCache());
-
- if (auto* cache = node.document().existingAXObjectCache())
- return cache->rootAXEditableElement(&node);
-
- return false;
-}
-
-static bool computeEditability(const Node& node, EditableType editableType, Node::ShouldUpdateStyle shouldUpdateStyle)
-{
- if (node.computeEditability(Node::UserSelectAllIsAlwaysNonEditable, shouldUpdateStyle) != Node::Editability::ReadOnly)
- return true;
-
- switch (editableType) {
- case ContentIsEditable:
- return false;
- case HasEditableAXRole:
- return isEditableToAccessibility(node);
- }
- ASSERT_NOT_REACHED();
- return false;
-}
-
-bool hasEditableStyle(const Node& node, EditableType editableType)
-{
- return computeEditability(node, editableType, Node::ShouldUpdateStyle::DoNotUpdate);
-}
-
-bool isEditableNode(const Node& node)
-{
- return computeEditability(node, ContentIsEditable, Node::ShouldUpdateStyle::Update);
-}
-
-bool isEditablePosition(const Position& position, EditableType editableType)
-{
- Node* node = position.containerNode();
- return node && computeEditability(*node, editableType, Node::ShouldUpdateStyle::Update);
-}
-
-bool isAtUnsplittableElement(const Position& position)
-{
- Node* node = position.containerNode();
- return node == editableRootForPosition(position) || node == enclosingNodeOfType(position, isTableCell);
-}
-
-bool isRichlyEditablePosition(const Position& position)
-{
- auto* node = position.containerNode();
- return node && node->hasRichlyEditableStyle();
-}
-
-Element* editableRootForPosition(const Position& position, EditableType editableType)
-{
- Node* node = position.containerNode();
- if (!node)
- return nullptr;
-
- switch (editableType) {
- case HasEditableAXRole:
- if (auto* cache = node->document().existingAXObjectCache())
- return const_cast<Element*>(cache->rootAXEditableElement(node));
- FALLTHROUGH;
- case ContentIsEditable:
- return node->rootEditableElement();
- }
- return nullptr;
-}
-
-// Finds the enclosing element until which the tree can be split.
-// When a user hits ENTER, he/she won't expect this element to be split into two.
-// You may pass it as the second argument of splitTreeToNode.
-Element* unsplittableElementForPosition(const Position& position)
-{
- // Since enclosingNodeOfType won't search beyond the highest root editable node,
- // this code works even if the closest table cell was outside of the root editable node.
- if (auto* enclosingCell = downcast<Element>(enclosingNodeOfType(position, &isTableCell)))
- return enclosingCell;
- return editableRootForPosition(position);
-}
-
-Position nextCandidate(const Position& position)
-{
- for (PositionIterator nextPosition = position; !nextPosition.atEnd(); ) {
- nextPosition.increment();
- if (nextPosition.isCandidate())
- return nextPosition;
- }
- return { };
-}
-
-Position nextVisuallyDistinctCandidate(const Position& position)
-{
- // FIXME: Use PositionIterator instead.
- Position nextPosition = position;
- Position downstreamStart = nextPosition.downstream();
- while (!nextPosition.atEndOfTree()) {
- nextPosition = nextPosition.next(Character);
- if (nextPosition.isCandidate() && nextPosition.downstream() != downstreamStart)
- return nextPosition;
- if (auto* node = nextPosition.containerNode()) {
- if (!node->renderer())
- nextPosition = lastPositionInOrAfterNode(node);
- }
- }
- return { };
-}
-
-Position previousCandidate(const Position& position)
-{
- PositionIterator previousPosition = position;
- while (!previousPosition.atStart()) {
- previousPosition.decrement();
- if (previousPosition.isCandidate())
- return previousPosition;
- }
- return { };
-}
-
-Position previousVisuallyDistinctCandidate(const Position& position)
-{
- // FIXME: Use PositionIterator instead.
- Position previousPosition = position;
- Position downstreamStart = previousPosition.downstream();
- while (!previousPosition.atStartOfTree()) {
- previousPosition = previousPosition.previous(Character);
- if (previousPosition.isCandidate() && previousPosition.downstream() != downstreamStart)
- return previousPosition;
- if (auto* node = previousPosition.containerNode()) {
- if (!node->renderer())
- previousPosition = firstPositionInOrBeforeNode(node);
- }
- }
- return { };
-}
-
-Position firstEditablePositionAfterPositionInRoot(const Position& position, ContainerNode* highestRoot)
-{
- if (!highestRoot)
- return { };
-
- // position falls before highestRoot.
- if (comparePositions(position, firstPositionInNode(highestRoot)) == -1 && highestRoot->hasEditableStyle())
- return firstPositionInNode(highestRoot);
-
- Position candidate = position;
-
- if (&position.deprecatedNode()->treeScope() != &highestRoot->treeScope()) {
- auto* shadowAncestor = highestRoot->treeScope().ancestorNodeInThisScope(position.deprecatedNode());
- if (!shadowAncestor)
- return { };
-
- candidate = positionAfterNode(shadowAncestor);
- }
-
- while (candidate.deprecatedNode() && !isEditablePosition(candidate) && candidate.deprecatedNode()->isDescendantOf(*highestRoot))
- candidate = isAtomicNode(candidate.deprecatedNode()) ? positionInParentAfterNode(candidate.deprecatedNode()) : nextVisuallyDistinctCandidate(candidate);
-
- if (candidate.deprecatedNode() && candidate.deprecatedNode() != highestRoot && !candidate.deprecatedNode()->isDescendantOf(*highestRoot))
- return { };
-
- return candidate;
-}
-
-Position lastEditablePositionBeforePositionInRoot(const Position& position, ContainerNode* highestRoot)
-{
- if (!highestRoot)
- return { };
-
- // When position falls after highestRoot, the result is easy to compute.
- if (comparePositions(position, lastPositionInNode(highestRoot)) == 1)
- return lastPositionInNode(highestRoot);
-
- Position candidate = position;
-
- if (&position.deprecatedNode()->treeScope() != &highestRoot->treeScope()) {
- auto* shadowAncestor = highestRoot->treeScope().ancestorNodeInThisScope(position.deprecatedNode());
- if (!shadowAncestor)
- return { };
-
- candidate = firstPositionInOrBeforeNode(shadowAncestor);
- }
-
- while (candidate.deprecatedNode() && !isEditablePosition(candidate) && candidate.deprecatedNode()->isDescendantOf(*highestRoot))
- candidate = isAtomicNode(candidate.deprecatedNode()) ? positionInParentBeforeNode(candidate.deprecatedNode()) : previousVisuallyDistinctCandidate(candidate);
-
- if (candidate.deprecatedNode() && candidate.deprecatedNode() != highestRoot && !candidate.deprecatedNode()->isDescendantOf(*highestRoot))
- return { };
-
- return candidate;
-}
-
-// FIXME: The function name, comment, and code say three different things here!
-// Whether or not content before and after this node will collapse onto the same line as it.
-bool isBlock(const Node* node)
-{
- return node && node->renderer() && !node->renderer()->isInline() && !node->renderer()->isRubyText();
-}
-
-bool isInline(const Node* node)
-{
- return node && node->renderer() && node->renderer()->isInline();
-}
-
-// FIXME: Deploy this in all of the places where enclosingBlockFlow/enclosingBlockFlowOrTableElement are used.
-// FIXME: Pass a position to this function. The enclosing block of [table, x] for example, should be the
-// block that contains the table and not the table, and this function should be the only one responsible for
-// knowing about these kinds of special cases.
-Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
-{
- Node* enclosingNode = enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule);
- return is<Element>(enclosingNode) ? downcast<Element>(enclosingNode) : nullptr;
-}
-
-TextDirection directionOfEnclosingBlock(const Position& position)
-{
- auto block = enclosingBlock(position.containerNode());
- if (!block)
- return LTR;
- auto renderer = block->renderer();
- if (!renderer)
- return LTR;
- return renderer->style().direction();
-}
-
-// This method is used to create positions in the DOM. It returns the maximum valid offset
-// in a node. It returns 1 for some elements even though they do not have children, which
-// creates technically invalid DOM Positions. Be sure to call parentAnchoredEquivalent
-// on a Position before using it to create a DOM Range, or an exception will be thrown.
-int lastOffsetForEditing(const Node& node)
-{
- if (node.offsetInCharacters())
- return node.maxCharacterOffset();
-
- if (node.hasChildNodes())
- return node.countChildNodes();
-
- // NOTE: This should preempt the countChildNodes() for, e.g., select nodes.
- // FIXME: What does the comment above mean?
- if (editingIgnoresContent(node))
- return 1;
-
- return 0;
-}
-
-bool isAmbiguousBoundaryCharacter(UChar character)
-{
- // These are characters that can behave as word boundaries, but can appear within words.
- // If they are just typed, i.e. if they are immediately followed by a caret, we want to delay text checking until the next character has been typed.
- // FIXME: this is required until <rdar://problem/6853027> is fixed and text checking can do this for us.
- return character == '\'' || character == '@' || character == rightSingleQuotationMark || character == hebrewPunctuationGershayim;
-}
-
-String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfParagraph, bool endIsEndOfParagraph)
-{
- StringBuilder rebalancedString;
-
- bool previousCharacterWasSpace = false;
- unsigned length = string.length();
- for (unsigned i = 0; i < length; ++i) {
- auto character = string[i];
- if (!deprecatedIsEditingWhitespace(character)) {
- previousCharacterWasSpace = false;
- continue;
- }
- LChar selectedWhitespaceCharacter;
- if (previousCharacterWasSpace || (!i && startIsStartOfParagraph) || (i == length - 1 && endIsEndOfParagraph)) {
- selectedWhitespaceCharacter = noBreakSpace;
- previousCharacterWasSpace = false;
- } else {
- selectedWhitespaceCharacter = ' ';
- previousCharacterWasSpace = true;
- }
- if (character == selectedWhitespaceCharacter)
- continue;
- rebalancedString.reserveCapacity(length);
- rebalancedString.append(string, rebalancedString.length(), i - rebalancedString.length());
- rebalancedString.append(selectedWhitespaceCharacter);
- }
-
- if (rebalancedString.isEmpty())
- return string;
-
- rebalancedString.reserveCapacity(length);
- rebalancedString.append(string, rebalancedString.length(), length - rebalancedString.length());
- return rebalancedString.toString();
-}
-
-bool isTableStructureNode(const Node* node)
-{
- auto* renderer = node->renderer();
- return renderer && (renderer->isTableCell() || renderer->isTableRow() || renderer->isTableSection() || renderer->isRenderTableCol());
-}
-
-const String& nonBreakingSpaceString()
-{
- static NeverDestroyed<String> nonBreakingSpaceString(&noBreakSpace, 1);
- return nonBreakingSpaceString;
-}
-
-static bool isSpecialHTMLElement(const Node* node)
-{
- if (!is<HTMLElement>(node))
- return false;
-
- if (downcast<HTMLElement>(*node).isLink())
- return true;
-
- auto* renderer = downcast<HTMLElement>(*node).renderer();
- if (!renderer)
- return false;
-
- if (renderer->style().display() == TABLE || renderer->style().display() == INLINE_TABLE)
- return true;
-
- if (renderer->style().isFloating())
- return true;
-
- if (renderer->style().position() != StaticPosition)
- return true;
-
- return false;
-}
-
-static HTMLElement* firstInSpecialElement(const Position& position)
-{
- auto* rootEditableElement = position.containerNode()->rootEditableElement();
- for (Node* node = position.deprecatedNode(); node && node->rootEditableElement() == rootEditableElement; node = node->parentNode()) {
- if (!isSpecialHTMLElement(node))
- continue;
- VisiblePosition vPos(position, DOWNSTREAM);
- VisiblePosition firstInElement(firstPositionInOrBeforeNode(node), DOWNSTREAM);
- if ((isRenderedTable(node) && vPos == firstInElement.next()) || vPos == firstInElement)
- return &downcast<HTMLElement>(*node);
- }
- return nullptr;
-}
-
-static HTMLElement* lastInSpecialElement(const Position& position)
-{
- auto* rootEditableElement = position.containerNode()->rootEditableElement();
- for (Node* node = position.deprecatedNode(); node && node->rootEditableElement() == rootEditableElement; node = node->parentNode()) {
- if (!isSpecialHTMLElement(node))
- continue;
- VisiblePosition vPos(position, DOWNSTREAM);
- VisiblePosition lastInElement(lastPositionInOrAfterNode(node), DOWNSTREAM);
- if ((isRenderedTable(node) && vPos == lastInElement.previous()) || vPos == lastInElement)
- return &downcast<HTMLElement>(*node);
- }
- return nullptr;
-}
-
-Position positionBeforeContainingSpecialElement(const Position& position, HTMLElement** containingSpecialElement)
-{
- auto* element = firstInSpecialElement(position);
- if (!element)
- return position;
- Position result = positionInParentBeforeNode(element);
- if (result.isNull() || result.deprecatedNode()->rootEditableElement() != position.deprecatedNode()->rootEditableElement())
- return position;
- if (containingSpecialElement)
- *containingSpecialElement = element;
- return result;
-}
-
-Position positionAfterContainingSpecialElement(const Position& position, HTMLElement** containingSpecialElement)
-{
- auto* element = lastInSpecialElement(position);
- if (!element)
- return position;
- Position result = positionInParentAfterNode(element);
- if (result.isNull() || result.deprecatedNode()->rootEditableElement() != position.deprecatedNode()->rootEditableElement())
- return position;
- if (containingSpecialElement)
- *containingSpecialElement = element;
- return result;
-}
-
-Element* isFirstPositionAfterTable(const VisiblePosition& position)
-{
- Position upstream(position.deepEquivalent().upstream());
- auto* node = upstream.deprecatedNode();
- if (!node)
- return nullptr;
- auto* renderer = node->renderer();
- if (!renderer || !renderer->isTable() || !upstream.atLastEditingPositionForNode())
- return nullptr;
- return &downcast<Element>(*node);
-}
-
-Element* isLastPositionBeforeTable(const VisiblePosition& position)
-{
- Position downstream(position.deepEquivalent().downstream());
- auto* node = downstream.deprecatedNode();
- if (!node)
- return nullptr;
- auto* renderer = node->renderer();
- if (!renderer || !renderer->isTable() || !downstream.atFirstEditingPositionForNode())
- return nullptr;
- return &downcast<Element>(*node);
-}
-
-// Returns the visible position at the beginning of a node
-VisiblePosition visiblePositionBeforeNode(Node& node)
-{
- if (node.hasChildNodes())
- return VisiblePosition(firstPositionInOrBeforeNode(&node), DOWNSTREAM);
- ASSERT(node.parentNode());
- ASSERT(!node.parentNode()->isShadowRoot());
- return positionInParentBeforeNode(&node);
-}
-
-// Returns the visible position at the ending of a node
-VisiblePosition visiblePositionAfterNode(Node& node)
-{
- if (node.hasChildNodes())
- return VisiblePosition(lastPositionInOrAfterNode(&node), DOWNSTREAM);
- ASSERT(node.parentNode());
- ASSERT(!node.parentNode()->isShadowRoot());
- return positionInParentAfterNode(&node);
-}
-
-bool isListHTMLElement(Node* node)
-{
- return node && (is<HTMLUListElement>(*node) || is<HTMLOListElement>(*node) || is<HTMLDListElement>(*node));
-}
-
-bool isListItem(const Node* node)
-{
- return node && (isListHTMLElement(node->parentNode()) || (node->renderer() && node->renderer()->isListItem()));
-}
-
-Element* enclosingElementWithTag(const Position& position, const QualifiedName& tagName)
-{
- auto* root = highestEditableRoot(position);
- for (Node* node = position.deprecatedNode(); node; node = node->parentNode()) {
- if (root && !node->hasEditableStyle())
- continue;
- if (!is<Element>(*node))
- continue;
- if (downcast<Element>(*node).hasTagName(tagName))
- return &downcast<Element>(*node);
- if (node == root)
- return nullptr;
- }
- return nullptr;
-}
-
-Node* enclosingNodeOfType(const Position& position, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule rule)
-{
- // FIXME: support CanSkipCrossEditingBoundary
- ASSERT(rule == CanCrossEditingBoundary || rule == CannotCrossEditingBoundary);
- auto* root = rule == CannotCrossEditingBoundary ? highestEditableRoot(position) : nullptr;
- for (Node* n = position.deprecatedNode(); n; n = n->parentNode()) {
- // Don't return a non-editable node if the input position was editable, since
- // the callers from editing will no doubt want to perform editing inside the returned node.
- if (root && !n->hasEditableStyle())
- continue;
- if (nodeIsOfType(n))
- return n;
- if (n == root)
- return nullptr;
- }
- return nullptr;
-}
-
-Node* highestEnclosingNodeOfType(const Position& position, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule rule, Node* stayWithin)
-{
- Node* highest = nullptr;
- auto* root = rule == CannotCrossEditingBoundary ? highestEditableRoot(position) : nullptr;
- for (Node* n = position.containerNode(); n && n != stayWithin; n = n->parentNode()) {
- if (root && !n->hasEditableStyle())
- continue;
- if (nodeIsOfType(n))
- highest = n;
- if (n == root)
- break;
- }
- return highest;
-}
-
-static bool hasARenderedDescendant(Node* node, Node* excludedNode)
-{
- for (Node* n = node->firstChild(); n;) {
- if (n == excludedNode) {
- n = NodeTraversal::nextSkippingChildren(*n, node);
- continue;
- }
- if (n->renderer())
- return true;
- n = NodeTraversal::next(*n, node);
- }
- return false;
-}
-
-Node* highestNodeToRemoveInPruning(Node* node)
-{
- Node* previousNode = nullptr;
- auto* rootEditableElement = node ? node->rootEditableElement() : nullptr;
- for (; node; node = node->parentNode()) {
- if (auto* renderer = node->renderer()) {
- if (!renderer->canHaveChildren() || hasARenderedDescendant(node, previousNode) || rootEditableElement == node)
- return previousNode;
- }
- previousNode = node;
- }
- return nullptr;
-}
-
-Element* enclosingTableCell(const Position& position)
-{
- return downcast<Element>(enclosingNodeOfType(position, isTableCell));
-}
-
-Element* enclosingAnchorElement(const Position& p)
-{
- for (Node* node = p.deprecatedNode(); node; node = node->parentNode()) {
- if (is<Element>(*node) && node->isLink())
- return downcast<Element>(node);
- }
- return nullptr;
-}
-
-HTMLElement* enclosingList(Node* node)
-{
- if (!node)
- return nullptr;
-
- auto* root = highestEditableRoot(firstPositionInOrBeforeNode(node));
-
- for (ContainerNode* ancestor = node->parentNode(); ancestor; ancestor = ancestor->parentNode()) {
- if (is<HTMLUListElement>(*ancestor) || is<HTMLOListElement>(*ancestor))
- return downcast<HTMLElement>(ancestor);
- if (ancestor == root)
- return nullptr;
- }
-
- return nullptr;
-}
-
-Node* enclosingListChild(Node *node)
-{
- if (!node)
- return nullptr;
-
- // Check for a list item element, or for a node whose parent is a list element. Such a node
- // will appear visually as a list item (but without a list marker)
- auto* root = highestEditableRoot(firstPositionInOrBeforeNode(node));
-
- // FIXME: This function is inappropriately named since it starts with node instead of node->parentNode()
- for (Node* n = node; n && n->parentNode(); n = n->parentNode()) {
- if (is<HTMLLIElement>(*n) || (isListHTMLElement(n->parentNode()) && n != root))
- return n;
- if (n == root || isTableCell(n))
- return nullptr;
- }
-
- return nullptr;
-}
-
-static HTMLElement* embeddedSublist(Node* listItem)
-{
- // Check the DOM so that we'll find collapsed sublists without renderers.
- for (Node* n = listItem->firstChild(); n; n = n->nextSibling()) {
- if (isListHTMLElement(n))
- return downcast<HTMLElement>(n);
- }
- return nullptr;
-}
-
-static Node* appendedSublist(Node* listItem)
-{
- // Check the DOM so that we'll find collapsed sublists without renderers.
- for (Node* n = listItem->nextSibling(); n; n = n->nextSibling()) {
- if (isListHTMLElement(n))
- return downcast<HTMLElement>(n);
- if (isListItem(listItem))
- return nullptr;
- }
-
- return nullptr;
-}
-
-// FIXME: This function should not need to call isStartOfParagraph/isEndOfParagraph.
-Node* enclosingEmptyListItem(const VisiblePosition& position)
-{
- // Check that position is on a line by itself inside a list item
- auto* listChildNode = enclosingListChild(position.deepEquivalent().deprecatedNode());
- if (!listChildNode || !isStartOfParagraph(position) || !isEndOfParagraph(position))
- return nullptr;
-
- VisiblePosition firstInListChild(firstPositionInOrBeforeNode(listChildNode));
- VisiblePosition lastInListChild(lastPositionInOrAfterNode(listChildNode));
-
- if (firstInListChild != position || lastInListChild != position)
- return nullptr;
-
- if (embeddedSublist(listChildNode) || appendedSublist(listChildNode))
- return nullptr;
-
- return listChildNode;
-}
-
-HTMLElement* outermostEnclosingList(Node* node, Node* rootList)
-{
- auto* list = enclosingList(node);
- if (!list)
- return nullptr;
-
- while (auto* nextList = enclosingList(list)) {
- if (nextList == rootList)
- break;
- list = nextList;
- }
-
- return list;
-}
-
-bool canMergeLists(Element* firstList, Element* secondList)
-{
- if (!is<HTMLElement>(firstList) || !is<HTMLElement>(secondList))
- return false;
-
- auto& first = downcast<HTMLElement>(*firstList);
- auto& second = downcast<HTMLElement>(*secondList);
-
- return first.localName() == second.localName() // make sure the list types match (ol vs. ul)
- && first.hasEditableStyle() && second.hasEditableStyle() // both lists are editable
- && first.rootEditableElement() == second.rootEditableElement() // don't cross editing boundaries
- // Make sure there is no visible content between this li and the previous list.
- && isVisiblyAdjacent(positionInParentAfterNode(&first), positionInParentBeforeNode(&second));
-}
-
-static Node* previousNodeConsideringAtomicNodes(const Node* node)
-{
- if (node->previousSibling()) {
- Node* n = node->previousSibling();
- while (!isAtomicNode(n) && n->lastChild())
- n = n->lastChild();
- return n;
- }
- if (node->parentNode())
- return node->parentNode();
- return nullptr;
-}
-
-static Node* nextNodeConsideringAtomicNodes(const Node* node)
-{
- if (!isAtomicNode(node) && node->firstChild())
- return node->firstChild();
- if (node->nextSibling())
- return node->nextSibling();
- const Node* n = node;
- while (n && !n->nextSibling())
- n = n->parentNode();
- if (n)
- return n->nextSibling();
- return nullptr;
-}
-
-Node* previousLeafNode(const Node* node)
-{
- while ((node = previousNodeConsideringAtomicNodes(node))) {
- if (isAtomicNode(node))
- return const_cast<Node*>(node);
- }
- return nullptr;
-}
-
-Node* nextLeafNode(const Node* node)
-{
- while ((node = nextNodeConsideringAtomicNodes(node))) {
- if (isAtomicNode(node))
- return const_cast<Node*>(node);
- }
- return nullptr;
-}
-
-// FIXME: Do not require renderer, so that this can be used within fragments.
-bool isRenderedTable(const Node* node)
-{
- if (!is<Element>(node))
- return false;
- auto* renderer = downcast<Element>(*node).renderer();
- return renderer && renderer->isTable();
-}
-
-bool isTableCell(const Node* node)
-{
- auto* renderer = node->renderer();
- if (!renderer)
- return node->hasTagName(tdTag) || node->hasTagName(thTag);
- return renderer->isTableCell();
-}
-
-bool isEmptyTableCell(const Node* node)
-{
- // Returns true IFF the passed in node is one of:
- // .) a table cell with no children,
- // .) a table cell with a single BR child, and which has no other child renderers, including :before and :after renderers
- // .) the BR child of such a table cell
-
- // Find rendered node
- while (node && !node->renderer())
- node = node->parentNode();
- if (!node)
- return false;
-
- // Make sure the rendered node is a table cell or <br>.
- // If it's a <br>, then the parent node has to be a table cell.
- auto* renderer = node->renderer();
- if (renderer->isBR()) {
- renderer = renderer->parent();
- if (!renderer)
- return false;
- }
- if (!is<RenderTableCell>(*renderer))
- return false;
-
- // Check that the table cell contains no child renderers except for perhaps a single <br>.
- auto* childRenderer = downcast<RenderTableCell>(*renderer).firstChild();
- if (!childRenderer)
- return true;
- if (!childRenderer->isBR())
- return false;
- return !childRenderer->nextSibling();
-}
-
-Ref<HTMLElement> createDefaultParagraphElement(Document& document)
-{
- switch (document.frame()->editor().defaultParagraphSeparator()) {
- case EditorParagraphSeparatorIsDiv:
- return HTMLDivElement::create(document);
- case EditorParagraphSeparatorIsP:
- break;
- }
- return HTMLParagraphElement::create(document);
-}
-
-Ref<HTMLElement> createHTMLElement(Document& document, const QualifiedName& name)
-{
- return HTMLElementFactory::createElement(name, document);
-}
-
-Ref<HTMLElement> createHTMLElement(Document& document, const AtomicString& tagName)
-{
- return createHTMLElement(document, QualifiedName(nullAtom, tagName, xhtmlNamespaceURI));
-}
-
-bool isTabSpanNode(const Node* node)
-{
- return is<HTMLSpanElement>(node) && downcast<HTMLSpanElement>(*node).attributeWithoutSynchronization(classAttr) == AppleTabSpanClass;
-}
-
-bool isTabSpanTextNode(const Node* node)
-{
- return is<Text>(node) && isTabSpanNode(node->parentNode());
-}
-
-HTMLSpanElement* tabSpanNode(const Node* node)
-{
- return isTabSpanTextNode(node) ? downcast<HTMLSpanElement>(node->parentNode()) : nullptr;
-}
-
-static Ref<Element> createTabSpanElement(Document& document, Text& tabTextNode)
-{
- auto spanElement = HTMLSpanElement::create(document);
-
- spanElement->setAttributeWithoutSynchronization(classAttr, AppleTabSpanClass);
- spanElement->setAttribute(styleAttr, "white-space:pre");
-
- spanElement->appendChild(tabTextNode);
-
- return WTFMove(spanElement);
-}
-
-Ref<Element> createTabSpanElement(Document& document, const String& tabText)
-{
- return createTabSpanElement(document, document.createTextNode(tabText));
-}
-
-Ref<Element> createTabSpanElement(Document& document)
-{
- return createTabSpanElement(document, document.createEditingTextNode(ASCIILiteral("\t")));
-}
-
-bool isNodeRendered(const Node& node)
-{
- auto* renderer = node.renderer();
- return renderer && renderer->style().visibility() == VISIBLE;
-}
-
-unsigned numEnclosingMailBlockquotes(const Position& position)
-{
- unsigned count = 0;
- for (Node* node = position.deprecatedNode(); node; node = node->parentNode()) {
- if (isMailBlockquote(node))
- ++count;
- }
- return count;
-}
-
-void updatePositionForNodeRemoval(Position& position, Node& node)
-{
- if (position.isNull())
- return;
- switch (position.anchorType()) {
- case Position::PositionIsBeforeChildren:
- if (node.containsIncludingShadowDOM(position.containerNode()))
- position = positionInParentBeforeNode(&node);
- break;
- case Position::PositionIsAfterChildren:
- if (node.containsIncludingShadowDOM(position.containerNode()))
- position = positionInParentBeforeNode(&node);
- break;
- case Position::PositionIsOffsetInAnchor:
- if (position.containerNode() == node.parentNode() && static_cast<unsigned>(position.offsetInContainerNode()) > node.computeNodeIndex())
- position.moveToOffset(position.offsetInContainerNode() - 1);
- else if (node.containsIncludingShadowDOM(position.containerNode()))
- position = positionInParentBeforeNode(&node);
- break;
- case Position::PositionIsAfterAnchor:
- if (node.containsIncludingShadowDOM(position.anchorNode()))
- position = positionInParentAfterNode(&node);
- break;
- case Position::PositionIsBeforeAnchor:
- if (node.containsIncludingShadowDOM(position.anchorNode()))
- position = positionInParentBeforeNode(&node);
- break;
- }
-}
-
-bool isMailBlockquote(const Node* node)
-{
- ASSERT(node);
- if (!node->hasTagName(blockquoteTag))
- return false;
- return downcast<HTMLElement>(*node).attributeWithoutSynchronization(typeAttr) == "cite";
-}
-
-int caretMinOffset(const Node& node)
-{
- auto* renderer = node.renderer();
- ASSERT(!node.isCharacterDataNode() || !renderer || renderer->isText());
- return renderer ? renderer->caretMinOffset() : 0;
-}
-
-// If a node can contain candidates for VisiblePositions, return the offset of the last candidate, otherwise
-// return the number of children for container nodes and the length for unrendered text nodes.
-int caretMaxOffset(const Node& node)
-{
- // For rendered text nodes, return the last position that a caret could occupy.
- if (is<Text>(node)) {
- if (auto* renderer = downcast<Text>(node).renderer())
- return renderer->caretMaxOffset();
- }
- return lastOffsetForEditing(node);
-}
-
-bool lineBreakExistsAtVisiblePosition(const VisiblePosition& position)
-{
- return lineBreakExistsAtPosition(position.deepEquivalent().downstream());
-}
-
-bool lineBreakExistsAtPosition(const Position& position)
-{
- if (position.isNull())
- return false;
-
- if (position.anchorNode()->hasTagName(brTag) && position.atFirstEditingPositionForNode())
- return true;
-
- if (!position.anchorNode()->renderer())
- return false;
-
- if (!is<Text>(*position.anchorNode()) || !position.anchorNode()->renderer()->style().preserveNewline())
- return false;
-
- Text& textNode = downcast<Text>(*position.anchorNode());
- unsigned offset = position.offsetInContainerNode();
- return offset < textNode.length() && textNode.data()[offset] == '\n';
-}
-
-// Modifies selections that have an end point at the edge of a table
-// that contains the other endpoint so that they don't confuse
-// code that iterates over selected paragraphs.
-VisibleSelection selectionForParagraphIteration(const VisibleSelection& original)
-{
- VisibleSelection newSelection(original);
- VisiblePosition startOfSelection(newSelection.visibleStart());
- VisiblePosition endOfSelection(newSelection.visibleEnd());
-
- // If the end of the selection to modify is just after a table, and
- // if the start of the selection is inside that table, then the last paragraph
- // that we'll want modify is the last one inside the table, not the table itself
- // (a table is itself a paragraph).
- if (auto* table = isFirstPositionAfterTable(endOfSelection)) {
- if (startOfSelection.deepEquivalent().deprecatedNode()->isDescendantOf(*table))
- newSelection = VisibleSelection(startOfSelection, endOfSelection.previous(CannotCrossEditingBoundary));
- }
-
- // If the start of the selection to modify is just before a table,
- // and if the end of the selection is inside that table, then the first paragraph
- // we'll want to modify is the first one inside the table, not the paragraph
- // containing the table itself.
- if (auto* table = isLastPositionBeforeTable(startOfSelection)) {
- if (endOfSelection.deepEquivalent().deprecatedNode()->isDescendantOf(*table))
- newSelection = VisibleSelection(startOfSelection.next(CannotCrossEditingBoundary), endOfSelection);
- }
-
- return newSelection;
-}
-
-// FIXME: indexForVisiblePosition and visiblePositionForIndex use TextIterators to convert between
-// VisiblePositions and indices. But TextIterator iteration using TextIteratorEmitsCharactersBetweenAllVisiblePositions
-// does not exactly match VisiblePosition iteration, so using them to preserve a selection during an editing
-// opertion is unreliable. TextIterator's TextIteratorEmitsCharactersBetweenAllVisiblePositions mode needs to be fixed,
-// or these functions need to be changed to iterate using actual VisiblePositions.
-// FIXME: Deploy these functions everywhere that TextIterators are used to convert between VisiblePositions and indices.
-int indexForVisiblePosition(const VisiblePosition& visiblePosition, RefPtr<ContainerNode>& scope)
-{
- if (visiblePosition.isNull())
- return 0;
-
- auto position = visiblePosition.deepEquivalent();
- auto& document = *position.document();
-
- auto* editableRoot = highestEditableRoot(position, AXObjectCache::accessibilityEnabled() ? HasEditableAXRole : ContentIsEditable);
- if (editableRoot && !document.inDesignMode())
- scope = editableRoot;
- else {
- if (position.containerNode()->isInShadowTree())
- scope = position.containerNode()->containingShadowRoot();
- else
- scope = &document;
- }
-
- auto range = Range::create(document, firstPositionInNode(scope.get()), position.parentAnchoredEquivalent());
- return TextIterator::rangeLength(range.ptr(), true);
-}
-
-// FIXME: Merge this function with the one above.
-int indexForVisiblePosition(Node& node, const VisiblePosition& visiblePosition, bool forSelectionPreservation)
-{
- auto range = Range::create(node.document(), firstPositionInNode(&node), visiblePosition.deepEquivalent().parentAnchoredEquivalent());
- return TextIterator::rangeLength(range.ptr(), forSelectionPreservation);
-}
-
-VisiblePosition visiblePositionForIndex(int index, ContainerNode* scope)
-{
- auto range = TextIterator::rangeFromLocationAndLength(scope, index, 0, true);
- // Check for an invalid index. Certain editing operations invalidate indices because
- // of problems with TextIteratorEmitsCharactersBetweenAllVisiblePositions.
- if (!range)
- return { };
- return { range->startPosition() };
-}
-
-VisiblePosition visiblePositionForIndexUsingCharacterIterator(Node& node, int index)
-{
- if (index <= 0)
- return { firstPositionInOrBeforeNode(&node), DOWNSTREAM };
-
- RefPtr<Range> range = Range::create(node.document());
- range->selectNodeContents(node);
- CharacterIterator it(*range);
- it.advance(index - 1);
- return { it.atEnd() ? range->endPosition() : it.range()->endPosition(), UPSTREAM };
-}
-
-// Determines whether two positions are visibly next to each other (first then second)
-// while ignoring whitespaces and unrendered nodes
-static bool isVisiblyAdjacent(const Position& first, const Position& second)
-{
- return VisiblePosition(first) == VisiblePosition(second.upstream());
-}
-
-// Determines whether a node is inside a range or visibly starts and ends at the boundaries of the range.
-// Call this function to determine whether a node is visibly fit inside selectedRange
-bool isNodeVisiblyContainedWithin(Node& node, const Range& range)
-{
- // If the node is inside the range, then it surely is contained within.
- auto comparisonResult = range.compareNode(node);
- if (!comparisonResult.hasException() && comparisonResult.releaseReturnValue() == Range::NODE_INSIDE)
- return true;
-
- bool startIsVisuallySame = visiblePositionBeforeNode(node) == range.startPosition();
- if (startIsVisuallySame && comparePositions(positionInParentAfterNode(&node), range.endPosition()) < 0)
- return true;
-
- bool endIsVisuallySame = visiblePositionAfterNode(node) == range.endPosition();
- if (endIsVisuallySame && comparePositions(range.startPosition(), positionInParentBeforeNode(&node)) < 0)
- return true;
-
- return startIsVisuallySame && endIsVisuallySame;
-}
-
-bool isRenderedAsNonInlineTableImageOrHR(const Node* node)
-{
- if (!node)
- return false;
- RenderObject* renderer = node->renderer();
- return renderer && ((renderer->isTable() && !renderer->isInline()) || (renderer->isImage() && !renderer->isInline()) || renderer->isHR());
-}
-
-bool areIdenticalElements(const Node& first, const Node& second)
-{
- if (!is<Element>(first) || !is<Element>(second))
- return false;
- auto& firstElement = downcast<Element>(first);
- auto& secondElement = downcast<Element>(second);
- return firstElement.hasTagName(secondElement.tagQName()) && firstElement.hasEquivalentAttributes(&secondElement);
-}
-
-bool isNonTableCellHTMLBlockElement(const Node* node)
-{
- return node->hasTagName(listingTag)
- || node->hasTagName(olTag)
- || node->hasTagName(preTag)
- || is<HTMLTableElement>(*node)
- || node->hasTagName(ulTag)
- || node->hasTagName(xmpTag)
- || node->hasTagName(h1Tag)
- || node->hasTagName(h2Tag)
- || node->hasTagName(h3Tag)
- || node->hasTagName(h4Tag)
- || node->hasTagName(h5Tag);
-}
-
-Position adjustedSelectionStartForStyleComputation(const VisibleSelection& selection)
-{
- // This function is used by range style computations to avoid bugs like:
- // <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
- // It is important to skip certain irrelevant content at the start of the selection, so we do not wind up
- // with a spurious "mixed" style.
-
- auto visiblePosition = selection.visibleStart();
- if (visiblePosition.isNull())
- return { };
-
- // if the selection is a caret, just return the position, since the style
- // behind us is relevant
- if (selection.isCaret())
- return visiblePosition.deepEquivalent();
-
- // if the selection starts just before a paragraph break, skip over it
- if (isEndOfParagraph(visiblePosition))
- return visiblePosition.next().deepEquivalent().downstream();
-
- // otherwise, make sure to be at the start of the first selected node,
- // instead of possibly at the end of the last node before the selection
- return visiblePosition.deepEquivalent().downstream();
-}
-
-// FIXME: Should this be deprecated like deprecatedEnclosingBlockFlowElement is?
-bool isBlockFlowElement(const Node& node)
-{
- if (!node.isElementNode())
- return false;
- auto* renderer = downcast<Element>(node).renderer();
- return renderer && renderer->isRenderBlockFlow();
-}
-
-Element* deprecatedEnclosingBlockFlowElement(Node* node)
-{
- if (!node)
- return nullptr;
- if (isBlockFlowElement(*node))
- return downcast<Element>(node);
- while ((node = node->parentNode())) {
- if (isBlockFlowElement(*node) || is<HTMLBodyElement>(*node))
- return downcast<Element>(node);
- }
- return nullptr;
-}
-
-static inline bool caretRendersInsideNode(Node& node)
-{
- return !isRenderedTable(&node) && !editingIgnoresContent(node);
-}
-
-RenderBlock* rendererForCaretPainting(Node* node)
-{
- if (!node)
- return nullptr;
-
- auto* renderer = node->renderer();
- if (!renderer)
- return nullptr;
-
- // If caretNode is a block and caret is inside it, then caret should be painted by that block.
- bool paintedByBlock = is<RenderBlockFlow>(*renderer) && caretRendersInsideNode(*node);
- return paintedByBlock ? downcast<RenderBlock>(renderer) : renderer->containingBlock();
-}
-
-LayoutRect localCaretRectInRendererForCaretPainting(const VisiblePosition& caretPosition, RenderBlock*& caretPainter)
-{
- if (caretPosition.isNull())
- return LayoutRect();
-
- ASSERT(caretPosition.deepEquivalent().deprecatedNode()->renderer());
-
- // First compute a rect local to the renderer at the selection start.
- RenderObject* renderer;
- LayoutRect localRect = caretPosition.localCaretRect(renderer);
-
- return localCaretRectInRendererForRect(localRect, caretPosition.deepEquivalent().deprecatedNode(), renderer, caretPainter);
-}
-
-LayoutRect localCaretRectInRendererForRect(LayoutRect& localRect, Node* node, RenderObject* renderer, RenderBlock*& caretPainter)
-{
- // Get the renderer that will be responsible for painting the caret
- // (which is either the renderer we just found, or one of its containers).
- caretPainter = rendererForCaretPainting(node);
-
- // Compute an offset between the renderer and the caretPainter.
- while (renderer != caretPainter) {
- RenderElement* containerObject = renderer->container();
- if (!containerObject)
- return LayoutRect();
- localRect.move(renderer->offsetFromContainer(*containerObject, localRect.location()));
- renderer = containerObject;
- }
-
- return localRect;
-}
-
-IntRect absoluteBoundsForLocalCaretRect(RenderBlock* rendererForCaretPainting, const LayoutRect& rect, bool* insideFixed)
-{
- if (insideFixed)
- *insideFixed = false;
-
- if (!rendererForCaretPainting || rect.isEmpty())
- return IntRect();
-
- LayoutRect localRect(rect);
- rendererForCaretPainting->flipForWritingMode(localRect);
- return rendererForCaretPainting->localToAbsoluteQuad(FloatRect(localRect), UseTransforms, insideFixed).enclosingBoundingBox();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreeditinghtmleditingh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/htmlediting.h (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/htmlediting.h        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/htmlediting.h        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -1,243 +0,0 @@
</span><del>-/*
- * Copyright (C) 2004, 2006, 2008, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "Position.h"
-#include <wtf/Forward.h>
-#include <wtf/unicode/CharacterNames.h>
-
-namespace WebCore {
-
-class Document;
-class HTMLElement;
-class HTMLSpanElement;
-class HTMLTextFormControlElement;
-class RenderBlock;
-class VisiblePosition;
-class VisibleSelection;
-
-// -------------------------------------------------------------------------
-// Node
-// -------------------------------------------------------------------------
-
-ContainerNode* highestEditableRoot(const Position&, EditableType = ContentIsEditable);
-
-Node* highestEnclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary, Node* stayWithin = nullptr);
-Node* highestNodeToRemoveInPruning(Node*);
-Element* lowestEditableAncestor(Node*);
-
-Element* deprecatedEnclosingBlockFlowElement(Node*); // Use enclosingBlock instead.
-Element* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
-Element* enclosingTableCell(const Position&);
-Node* enclosingEmptyListItem(const VisiblePosition&);
-Element* enclosingAnchorElement(const Position&);
-Element* enclosingElementWithTag(const Position&, const QualifiedName&);
-Node* enclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
-HTMLSpanElement* tabSpanNode(const Node*);
-Element* isLastPositionBeforeTable(const VisiblePosition&); // FIXME: Strange to name this isXXX, but return an element.
-Element* isFirstPositionAfterTable(const VisiblePosition&); // FIXME: Strange to name this isXXX, but return an element.
-
-// These two deliver leaf nodes as if the whole DOM tree were a linear chain of its leaf nodes.
-Node* nextLeafNode(const Node*);
-Node* previousLeafNode(const Node*);
-
-WEBCORE_EXPORT int lastOffsetForEditing(const Node&);
-int caretMinOffset(const Node&);
-int caretMaxOffset(const Node&);
-
-bool hasEditableStyle(const Node&, EditableType);
-bool isEditableNode(const Node&);
-
-// FIXME: editingIgnoresContent, canHaveChildrenForEditing, and isAtomicNode should be named to clarify how they differ.
-
-// Returns true for nodes that either have no content, or have content that is ignored (skipped over) while editing.
-// There are no VisiblePositions inside these nodes.
-bool editingIgnoresContent(const Node&);
-
-bool canHaveChildrenForEditing(const Node&);
-bool isAtomicNode(const Node*);
-
-bool isBlock(const Node*);
-bool isBlockFlowElement(const Node&);
-bool isInline(const Node*);
-bool isTabSpanNode(const Node*);
-bool isTabSpanTextNode(const Node*);
-bool isMailBlockquote(const Node*);
-bool isRenderedTable(const Node*);
-bool isTableCell(const Node*);
-bool isEmptyTableCell(const Node*);
-bool isTableStructureNode(const Node*);
-bool isListHTMLElement(Node*);
-bool isListItem(const Node*);
-bool isNodeRendered(const Node&);
-bool isRenderedAsNonInlineTableImageOrHR(const Node*);
-bool isNonTableCellHTMLBlockElement(const Node*);
-
-bool isNodeVisiblyContainedWithin(Node&, const Range&);
-
-bool areIdenticalElements(const Node&, const Node&);
-
-bool positionBeforeOrAfterNodeIsCandidate(Node&);
-
-// -------------------------------------------------------------------------
-// Position
-// -------------------------------------------------------------------------
-
-Position nextCandidate(const Position&);
-Position previousCandidate(const Position&);
-
-Position nextVisuallyDistinctCandidate(const Position&);
-Position previousVisuallyDistinctCandidate(const Position&);
-
-Position positionBeforeContainingSpecialElement(const Position&, HTMLElement** containingSpecialElement = nullptr);
-Position positionAfterContainingSpecialElement(const Position&, HTMLElement** containingSpecialElement = nullptr);
-
-Position firstPositionInOrBeforeNode(Node*);
-Position lastPositionInOrAfterNode(Node*);
-
-Position firstEditablePositionAfterPositionInRoot(const Position&, ContainerNode* root);
-Position lastEditablePositionBeforePositionInRoot(const Position&, ContainerNode* root);
-
-int comparePositions(const Position&, const Position&);
-
-WEBCORE_EXPORT bool isEditablePosition(const Position&, EditableType = ContentIsEditable);
-bool isRichlyEditablePosition(const Position&);
-bool lineBreakExistsAtPosition(const Position&);
-bool isAtUnsplittableElement(const Position&);
-
-unsigned numEnclosingMailBlockquotes(const Position&);
-void updatePositionForNodeRemoval(Position&, Node&);
-
-WEBCORE_EXPORT TextDirection directionOfEnclosingBlock(const Position&);
-
-// -------------------------------------------------------------------------
-// VisiblePosition
-// -------------------------------------------------------------------------
-
-VisiblePosition visiblePositionBeforeNode(Node&);
-VisiblePosition visiblePositionAfterNode(Node&);
-
-bool lineBreakExistsAtVisiblePosition(const VisiblePosition&);
-
-int comparePositions(const VisiblePosition&, const VisiblePosition&);
-
-WEBCORE_EXPORT int indexForVisiblePosition(const VisiblePosition&, RefPtr<ContainerNode>& scope);
-int indexForVisiblePosition(Node&, const VisiblePosition&, bool forSelectionPreservation);
-WEBCORE_EXPORT VisiblePosition visiblePositionForIndex(int index, ContainerNode* scope);
-VisiblePosition visiblePositionForIndexUsingCharacterIterator(Node&, int index); // FIXME: Why do we need this version?
-
-// -------------------------------------------------------------------------
-// HTMLElement
-// -------------------------------------------------------------------------
-
-WEBCORE_EXPORT Ref<HTMLElement> createDefaultParagraphElement(Document&);
-Ref<HTMLElement> createHTMLElement(Document&, const QualifiedName&);
-Ref<HTMLElement> createHTMLElement(Document&, const AtomicString&);
-
-WEBCORE_EXPORT HTMLElement* enclosingList(Node*);
-HTMLElement* outermostEnclosingList(Node*, Node* rootList = nullptr);
-Node* enclosingListChild(Node*);
-
-// -------------------------------------------------------------------------
-// Element
-// -------------------------------------------------------------------------
-
-Ref<Element> createTabSpanElement(Document&);
-Ref<Element> createTabSpanElement(Document&, const String& tabText);
-Ref<Element> createBlockPlaceholderElement(Document&);
-
-Element* editableRootForPosition(const Position&, EditableType = ContentIsEditable);
-Element* unsplittableElementForPosition(const Position&);
-
-bool canMergeLists(Element* firstList, Element* secondList);
-
-// -------------------------------------------------------------------------
-// VisibleSelection
-// -------------------------------------------------------------------------
-
-VisibleSelection selectionForParagraphIteration(const VisibleSelection&);
-Position adjustedSelectionStartForStyleComputation(const VisibleSelection&);
-
-// -------------------------------------------------------------------------
-
-// FIXME: This is only one of many definitions of whitespace. Possibly never the right one to use.
-bool deprecatedIsEditingWhitespace(UChar);
-
-// FIXME: Can't answer this question correctly without being passed the white-space mode.
-bool deprecatedIsCollapsibleWhitespace(UChar);
-
-bool isAmbiguousBoundaryCharacter(UChar);
-
-String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagraph, bool endIsEndOfParagraph);
-const String& nonBreakingSpaceString();
-
-// Miscellaneous functions for caret rendering.
-
-RenderBlock* rendererForCaretPainting(Node*);
-LayoutRect localCaretRectInRendererForCaretPainting(const VisiblePosition&, RenderBlock*&);
-LayoutRect localCaretRectInRendererForRect(LayoutRect&, Node*, RenderObject*, RenderBlock*&);
-IntRect absoluteBoundsForLocalCaretRect(RenderBlock* rendererForCaretPainting, const LayoutRect&, bool* insideFixed = nullptr);
-
-// -------------------------------------------------------------------------
-
-inline bool deprecatedIsEditingWhitespace(UChar c)
-{
- return c == noBreakSpace || c == ' ' || c == '\n' || c == '\t';
-}
-
-// FIXME: Can't really answer this question correctly without knowing the white-space mode.
-inline bool deprecatedIsCollapsibleWhitespace(UChar c)
-{
- return c == ' ' || c == '\n';
-}
-
-bool isAmbiguousBoundaryCharacter(UChar);
-
-inline bool editingIgnoresContent(const Node& node)
-{
- return !node.canContainRangeEndPoint();
-}
-
-inline bool positionBeforeOrAfterNodeIsCandidate(Node& node)
-{
- return isRenderedTable(&node) || editingIgnoresContent(node);
-}
-
-inline Position firstPositionInOrBeforeNode(Node* node)
-{
- if (!node)
- return { };
- return editingIgnoresContent(*node) ? positionBeforeNode(node) : firstPositionInNode(node);
-}
-
-inline Position lastPositionInOrAfterNode(Node* node)
-{
- if (!node)
- return { };
- return editingIgnoresContent(*node) ? positionAfterNode(node) : lastPositionInNode(node);
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreeditingiosEditorIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ios/EditorIOS.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/EditorIOS.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/ios/EditorIOS.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import "DocumentFragment.h"
</span><span class="cx"> #import "DocumentLoader.h"
</span><span class="cx"> #import "DocumentMarkerController.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "EditorClient.h"
</span><span class="cx"> #import "FontCascade.h"
</span><span class="cx"> #import "Frame.h"
</span><span class="lines">@@ -59,10 +60,9 @@
</span><span class="cx"> #import "Text.h"
</span><span class="cx"> #import "TypingCommand.h"
</span><span class="cx"> #import "WAKAppKitStubs.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx"> #import "markup.h"
</span><span class="cx"> #import <MobileCoreServices/MobileCoreServices.h>
</span><del>-#include <wtf/text/StringBuilder.h>
</del><ins>+#import <wtf/text/StringBuilder.h>
</ins><span class="cx">
</span><span class="cx"> SOFT_LINK_FRAMEWORK(AppSupport)
</span><span class="cx"> SOFT_LINK(AppSupport, CPSharedResourcesDirectory, CFStringRef, (void), ())
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacDictionaryLookupmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/DictionaryLookup.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/DictionaryLookup.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/mac/DictionaryLookup.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">
</span><span class="cx"> #import "Document.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "FocusController.h"
</span><span class="cx"> #import "Frame.h"
</span><span class="cx"> #import "FrameSelection.h"
</span><span class="lines">@@ -44,7 +45,6 @@
</span><span class="cx"> #import "VisibleSelection.h"
</span><span class="cx"> #import "VisibleUnits.h"
</span><span class="cx"> #import "WebCoreSystemInterface.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx"> #import <PDFKit/PDFKit.h>
</span><span class="cx"> #import <wtf/BlockObjCExceptions.h>
</span><span class="cx"> #import <wtf/RefPtr.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacEditorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/EditorMac.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import "DataTransfer.h"
</span><span class="cx"> #import "DocumentFragment.h"
</span><span class="cx"> #import "DocumentLoader.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "Editor.h"
</span><span class="cx"> #import "EditorClient.h"
</span><span class="cx"> #import "File.h"
</span><span class="lines">@@ -64,7 +65,6 @@
</span><span class="cx"> #import "TypingCommand.h"
</span><span class="cx"> #import "UUID.h"
</span><span class="cx"> #import "WebNSAttributedStringExtras.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx"> #import "markup.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmarkupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/markup.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/markup.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/editing/markup.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "ChildListMutationScope.h"
</span><span class="cx"> #include "DocumentFragment.h"
</span><span class="cx"> #include "DocumentType.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "ElementIterator.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="lines">@@ -62,7 +63,6 @@
</span><span class="cx"> #include "TypedElementDescendantIterator.h"
</span><span class="cx"> #include "VisibleSelection.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "CSSPrimitiveValueMappings.h"
</span><span class="cx"> #include "ChromeClient.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Event.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="lines">@@ -48,7 +49,6 @@
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "TextControlInnerElements.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> #include "DOMWindow.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "DocumentType.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "Event.h"
</span><span class="cx"> #include "EventListener.h"
</span><span class="lines">@@ -91,7 +92,6 @@
</span><span class="cx"> #include "TextNodeTraversal.h"
</span><span class="cx"> #include "Timer.h"
</span><span class="cx"> #include "XPathResult.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx"> #include <inspector/IdentifiersFactory.h>
</span><span class="cx"> #include <inspector/InjectedScript.h>
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMSelection.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMSelection.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/page/DOMSelection.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -32,12 +32,12 @@
</span><span class="cx"> #include "DOMSelection.h"
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameSelection.h"
</span><span class="cx"> #include "Range.h"
</span><span class="cx"> #include "TextIterator.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/page/DragController.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include "DragData.h"
</span><span class="cx"> #include "DragImage.h"
</span><span class="cx"> #include "DragState.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "EventHandler.h"
</span><span class="lines">@@ -77,7 +78,6 @@
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "TextEvent.h"
</span><span class="cx"> #include "VisiblePosition.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DATA_INTERACTION)
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "CursorList.h"
</span><span class="cx"> #include "DragController.h"
</span><span class="cx"> #include "DragState.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="lines">@@ -93,7 +94,6 @@
</span><span class="cx"> #include "WheelEvent.h"
</span><span class="cx"> #include "WheelEventDeltaFilter.h"
</span><span class="cx"> #include "WindowsKeyboardCodes.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <wtf/Assertions.h>
</span><span class="cx"> #include <wtf/CurrentTime.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/page/FocusController.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "Chrome.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "Element.h"
</span><span class="lines">@@ -58,7 +59,6 @@
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "SpatialNavigation.h"
</span><span class="cx"> #include "Widget.h"
</span><del>-#include "htmlediting.h" // For firstPositionInOrBeforeNode
</del><span class="cx"> #include <limits>
</span><span class="cx"> #include <wtf/CurrentTime.h>
</span><span class="cx"> #include <wtf/Ref.h>
</span></span></pre></div>
<a id="trunkSourceWebCorepageFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Frame.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/page/Frame.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include "ChromeClient.h"
</span><span class="cx"> #include "DOMWindow.h"
</span><span class="cx"> #include "DocumentType.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "Editor.h"
</span><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "Event.h"
</span><span class="lines">@@ -103,7 +104,6 @@
</span><span class="cx"> #include "XLinkNames.h"
</span><span class="cx"> #include "XMLNSNames.h"
</span><span class="cx"> #include "XMLNames.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include "markup.h"
</span><span class="cx"> #include "npruntime_impl.h"
</span><span class="cx"> #include "runtime_root.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPasteboardIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PasteboardIOS.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PasteboardIOS.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/platform/ios/PasteboardIOS.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #import "Document.h"
</span><span class="cx"> #import "DocumentFragment.h"
</span><span class="cx"> #import "DocumentLoader.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "Editor.h"
</span><span class="cx"> #import "EditorClient.h"
</span><span class="cx"> #import "Frame.h"
</span><span class="lines">@@ -46,7 +47,6 @@
</span><span class="cx"> #import "Text.h"
</span><span class="cx"> #import "URL.h"
</span><span class="cx"> #import "WebNSAttributedStringExtras.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx"> #import "markup.h"
</span><span class="cx"> #import <MobileCoreServices/MobileCoreServices.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPasteboardMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -31,15 +31,14 @@
</span><span class="cx"> #import "DocumentFragment.h"
</span><span class="cx"> #import "DocumentLoader.h"
</span><span class="cx"> #import "DragData.h"
</span><ins>+#import "Editing.h"
</ins><span class="cx"> #import "Editor.h"
</span><span class="cx"> #import "EditorClient.h"
</span><span class="cx"> #import "Frame.h"
</span><ins>+#import "FrameLoaderClient.h"
</ins><span class="cx"> #import "FrameView.h"
</span><del>-#import "FrameLoaderClient.h"
</del><span class="cx"> #import "HitTestResult.h"
</span><del>-#import "htmlediting.h"
</del><span class="cx"> #import "Image.h"
</span><del>-#import "URL.h"
</del><span class="cx"> #import "LegacyWebArchive.h"
</span><span class="cx"> #import "LoaderNSURLExtras.h"
</span><span class="cx"> #import "MIMETypeRegistry.h"
</span><span class="lines">@@ -47,11 +46,12 @@
</span><span class="cx"> #import "PlatformStrategies.h"
</span><span class="cx"> #import "RenderImage.h"
</span><span class="cx"> #import "Text.h"
</span><ins>+#import "URL.h"
</ins><span class="cx"> #import "WebCoreNSStringExtras.h"
</span><span class="cx"> #import "WebNSAttributedStringExtras.h"
</span><span class="cx"> #import "markup.h"
</span><ins>+#import <wtf/RetainPtr.h>
</ins><span class="cx"> #import <wtf/StdLibExtras.h>
</span><del>-#import <wtf/RetainPtr.h>
</del><span class="cx"> #import <wtf/text/StringBuilder.h>
</span><span class="cx"> #import <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include "CSSFontSelector.h"
</span><span class="cx"> #include "ControlStates.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "EventHandler.h"
</span><span class="cx"> #include "FloatQuad.h"
</span><span class="cx"> #include "FloatRoundedRect.h"
</span><span class="lines">@@ -67,7 +68,6 @@
</span><span class="cx"> #include "ScrollbarTheme.h"
</span><span class="cx"> #include "StyleScrollSnapPoints.h"
</span><span class="cx"> #include "TransformState.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <algorithm>
</span><span class="cx"> #include <math.h>
</span><span class="cx"> #include <wtf/StackStats.h>
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "CSSAnimationController.h"
</span><ins>+#include "Editing.h"
</ins><span class="cx"> #include "FloatQuad.h"
</span><span class="cx"> #include "FlowThreadController.h"
</span><span class="cx"> #include "FrameSelection.h"
</span><span class="lines">@@ -69,7 +70,6 @@
</span><span class="cx"> #include "SVGRenderSupport.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "TransformState.h"
</span><del>-#include "htmlediting.h"
</del><span class="cx"> #include <algorithm>
</span><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <wtf/RefCountedLeakCounter.h>
</span></span></pre></div>
<a id="trunkSourceWebKitiosChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/ChangeLog (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/ChangeLog        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/ios/ChangeLog        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-03-02 Sam Weinig <sam@webkit.org>
+
+ Rename htmlediting.h/cpp to Editing.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=169103
+
+ Reviewed by Alex Christensen.
+
+ * WebCoreSupport/WebFrameIOS.mm:
+ * WebCoreSupport/WebVisiblePosition.mm:
+
</ins><span class="cx"> 2017-02-23 Aakash Jain <aakash_jain@apple.com>
</span><span class="cx">
</span><span class="cx"> Move instance member from WebFixedPositionContent to implementation file
</span></span></pre></div>
<a id="trunkSourceWebKitiosWebCoreSupportWebFrameIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -27,9 +27,10 @@
</span><span class="cx">
</span><span class="cx"> #import "WebFrameIOS.h"
</span><span class="cx">
</span><ins>+#import <WebCore/DocumentMarkerController.h>
+#import <WebCore/Editing.h>
</ins><span class="cx"> #import <WebCore/Editor.h>
</span><span class="cx"> #import <WebCore/Element.h>
</span><del>-#import <WebCore/DocumentMarkerController.h>
</del><span class="cx"> #import <WebCore/EventHandler.h>
</span><span class="cx"> #import <WebCore/FloatRect.h>
</span><span class="cx"> #import <WebCore/Frame.h>
</span><span class="lines">@@ -37,7 +38,6 @@
</span><span class="cx"> #import <WebCore/FrameSnapshotting.h>
</span><span class="cx"> #import <WebCore/FrameView.h>
</span><span class="cx"> #import <WebCore/HitTestResult.h>
</span><del>-#import <WebCore/htmlediting.h>
</del><span class="cx"> #import <WebCore/Position.h>
</span><span class="cx"> #import <WebCore/Range.h>
</span><span class="cx"> #import <WebCore/RenderObject.h>
</span></span></pre></div>
<a id="trunkSourceWebKitiosWebCoreSupportWebVisiblePositionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/WebCoreSupport/WebVisiblePosition.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/WebCoreSupport/WebVisiblePosition.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebVisiblePosition.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #import "WebVisiblePositionInternal.h"
</span><span class="cx">
</span><span class="cx"> #import <WebCore/DocumentMarkerController.h>
</span><ins>+#import <WebCore/Editing.h>
</ins><span class="cx"> #import <WebCore/FrameSelection.h>
</span><span class="cx"> #import <WebCore/HTMLTextFormControlElement.h>
</span><span class="cx"> #import <WebCore/Node.h>
</span><span class="lines">@@ -37,12 +38,11 @@
</span><span class="cx"> #import <WebCore/RenderTextControl.h>
</span><span class="cx"> #import <WebCore/RenderedDocumentMarker.h>
</span><span class="cx"> #import <WebCore/TextBoundaries.h>
</span><ins>+#import <WebCore/TextFlags.h>
</ins><span class="cx"> #import <WebCore/TextGranularity.h>
</span><del>-#import <WebCore/TextFlags.h>
</del><span class="cx"> #import <WebCore/TextIterator.h>
</span><span class="cx"> #import <WebCore/VisiblePosition.h>
</span><span class="cx"> #import <WebCore/VisibleUnits.h>
</span><del>-#import <WebCore/htmlediting.h>
</del><span class="cx">
</span><span class="cx">
</span><span class="cx"> #import "DOMNodeInternal.h"
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/mac/ChangeLog        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-03-02 Sam Weinig <sam@webkit.org>
+
+ Rename htmlediting.h/cpp to Editing.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=169103
+
+ Reviewed by Alex Christensen.
+
+ * DOM/DOMUIKitExtensions.mm:
+ * WebView/WebFrame.mm:
+ * WebView/WebView.mm:
+
</ins><span class="cx"> 2017-03-02 Megan Gardner <megan_gardner@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix 32-bit
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMUIKitExtensionsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMUIKitExtensions.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMUIKitExtensions.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/mac/DOM/DOMUIKitExtensions.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx">
</span><span class="cx"> #import "DOMUIKitExtensions.h"
</span><span class="cx">
</span><del>-#import <WebCore/CachedImage.h>
</del><span class="cx"> #import "DOM.h"
</span><span class="cx"> #import "DOMCore.h"
</span><span class="cx"> #import "DOMExtensions.h"
</span><span class="lines">@@ -41,11 +40,12 @@
</span><span class="cx"> #import "DOMInternal.h"
</span><span class="cx"> #import "DOMNodeInternal.h"
</span><span class="cx"> #import "DOMRangeInternal.h"
</span><ins>+#import <WebCore/CachedImage.h>
+#import <WebCore/Editing.h>
</ins><span class="cx"> #import <WebCore/FloatPoint.h>
</span><span class="cx"> #import <WebCore/FontCascade.h>
</span><span class="cx"> #import <WebCore/FrameSelection.h>
</span><span class="cx"> #import <WebCore/HTMLAreaElement.h>
</span><del>-#import <WebCore/htmlediting.h>
</del><span class="cx"> #import <WebCore/HTMLImageElement.h>
</span><span class="cx"> #import <WebCore/HTMLInputElement.h>
</span><span class="cx"> #import <WebCore/HTMLSelectElement.h>
</span><span class="lines">@@ -57,10 +57,10 @@
</span><span class="cx"> #import <WebCore/RenderBlock.h>
</span><span class="cx"> #import <WebCore/RenderBlockFlow.h>
</span><span class="cx"> #import <WebCore/RenderBox.h>
</span><del>-#import <WebCore/RoundedRect.h>
</del><span class="cx"> #import <WebCore/RenderObject.h>
</span><span class="cx"> #import <WebCore/RenderStyleConstants.h>
</span><span class="cx"> #import <WebCore/RenderText.h>
</span><ins>+#import <WebCore/RoundedRect.h>
</ins><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx"> #import <WebCore/VisiblePosition.h>
</span><span class="cx"> #import <WebCore/VisibleUnits.h>
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebFrame.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx"> #import <WebCore/DocumentFragment.h>
</span><span class="cx"> #import <WebCore/DocumentLoader.h>
</span><span class="cx"> #import <WebCore/DocumentMarkerController.h>
</span><ins>+#import <WebCore/Editing.h>
</ins><span class="cx"> #import <WebCore/Editor.h>
</span><span class="cx"> #import <WebCore/EventHandler.h>
</span><span class="cx"> #import <WebCore/EventNames.h>
</span><span class="lines">@@ -97,7 +98,6 @@
</span><span class="cx"> #import <WebCore/TextIterator.h>
</span><span class="cx"> #import <WebCore/ThreadCheck.h>
</span><span class="cx"> #import <WebCore/VisibleUnits.h>
</span><del>-#import <WebCore/htmlediting.h>
</del><span class="cx"> #import <WebCore/markup.h>
</span><span class="cx"> #import <WebKitSystemInterface.h>
</span><span class="cx"> #import <bindings/ScriptValue.h>
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -133,6 +133,7 @@
</span><span class="cx"> #import <WebCore/DocumentLoader.h>
</span><span class="cx"> #import <WebCore/DragController.h>
</span><span class="cx"> #import <WebCore/DragData.h>
</span><ins>+#import <WebCore/Editing.h>
</ins><span class="cx"> #import <WebCore/Editor.h>
</span><span class="cx"> #import <WebCore/EventHandler.h>
</span><span class="cx"> #import <WebCore/FocusController.h>
</span><span class="lines">@@ -202,7 +203,6 @@
</span><span class="cx"> #import <WebCore/WebCoreObjCExtras.h>
</span><span class="cx"> #import <WebCore/WebCoreView.h>
</span><span class="cx"> #import <WebCore/Widget.h>
</span><del>-#import <WebCore/htmlediting.h>
</del><span class="cx"> #import <WebKitLegacy/DOM.h>
</span><span class="cx"> #import <WebKitLegacy/DOMExtensions.h>
</span><span class="cx"> #import <WebKitLegacy/DOMPrivate.h>
</span></span></pre></div>
<a id="trunkSourceWebKitwinAccessibleTextImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/AccessibleTextImpl.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/AccessibleTextImpl.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/win/AccessibleTextImpl.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "WebView.h"
</span><span class="cx">
</span><span class="cx"> #include <WebCore/Document.h>
</span><ins>+#include <WebCore/Editing.h>
</ins><span class="cx"> #include <WebCore/Editor.h>
</span><span class="cx"> #include <WebCore/Frame.h>
</span><span class="cx"> #include <WebCore/FrameSelection.h>
</span><span class="lines">@@ -38,7 +39,6 @@
</span><span class="cx"> #include <WebCore/RenderTextControl.h>
</span><span class="cx"> #include <WebCore/VisibleSelection.h>
</span><span class="cx"> #include <WebCore/VisibleUnits.h>
</span><del>-#include <WebCore/htmlediting.h>
</del><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit/win/ChangeLog        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2017-03-02 Sam Weinig <sam@webkit.org>
+
+ Rename htmlediting.h/cpp to Editing.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=169103
+
+ Reviewed by Alex Christensen.
+
+ * AccessibleTextImpl.cpp:
+
</ins><span class="cx"> 2017-03-01 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Actually fix Windows build.
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit2/ChangeLog        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-03-02 Sam Weinig <sam@webkit.org>
+
+ Rename htmlediting.h/cpp to Editing.h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=169103
+
+ Reviewed by Alex Christensen.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+
</ins><span class="cx"> 2017-03-02 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> [Mac] Set the NSURLSessionTask priority to match the request's priority
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -127,6 +127,7 @@
</span><span class="cx"> #include <WebCore/DocumentMarkerController.h>
</span><span class="cx"> #include <WebCore/DragController.h>
</span><span class="cx"> #include <WebCore/DragData.h>
</span><ins>+#include <WebCore/Editing.h>
</ins><span class="cx"> #include <WebCore/ElementIterator.h>
</span><span class="cx"> #include <WebCore/EventHandler.h>
</span><span class="cx"> #include <WebCore/EventNames.h>
</span><span class="lines">@@ -181,7 +182,6 @@
</span><span class="cx"> #include <WebCore/VisiblePosition.h>
</span><span class="cx"> #include <WebCore/VisibleUnits.h>
</span><span class="cx"> #include <WebCore/WebGLStateTracker.h>
</span><del>-#include <WebCore/htmlediting.h>
</del><span class="cx"> #include <WebCore/markup.h>
</span><span class="cx"> #include <bindings/ScriptValue.h>
</span><span class="cx"> #include <profiler/ProfilerDatabase.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> #import <WebCore/DataDetection.h>
</span><span class="cx"> #import <WebCore/DiagnosticLoggingClient.h>
</span><span class="cx"> #import <WebCore/DiagnosticLoggingKeys.h>
</span><ins>+#import <WebCore/Editing.h>
</ins><span class="cx"> #import <WebCore/Element.h>
</span><span class="cx"> #import <WebCore/ElementAncestorIterator.h>
</span><span class="cx"> #import <WebCore/EventHandler.h>
</span><span class="lines">@@ -104,7 +105,6 @@
</span><span class="cx"> #import <WebCore/VisibleUnits.h>
</span><span class="cx"> #import <WebCore/WKContentObservation.h>
</span><span class="cx"> #import <WebCore/WebEvent.h>
</span><del>-#import <WebCore/htmlediting.h>
</del><span class="cx"> #import <wtf/MathExtras.h>
</span><span class="cx"> #import <wtf/MemoryPressureHandler.h>
</span><span class="cx"> #import <wtf/SetForScope.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (213354 => 213355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2017-03-03 06:10:27 UTC (rev 213354)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2017-03-03 06:35:25 UTC (rev 213355)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> #import <WebCore/BackForwardController.h>
</span><span class="cx"> #import <WebCore/DataDetection.h>
</span><span class="cx"> #import <WebCore/DictionaryLookup.h>
</span><ins>+#import <WebCore/Editing.h>
</ins><span class="cx"> #import <WebCore/Editor.h>
</span><span class="cx"> #import <WebCore/EventHandler.h>
</span><span class="cx"> #import <WebCore/FocusController.h>
</span><span class="lines">@@ -87,7 +88,6 @@
</span><span class="cx"> #import <WebCore/TextIterator.h>
</span><span class="cx"> #import <WebCore/VisibleUnits.h>
</span><span class="cx"> #import <WebCore/WindowsKeyboardCodes.h>
</span><del>-#import <WebCore/htmlediting.h>
</del><span class="cx"> #import <WebKitSystemInterface.h>
</span><span class="cx"> #import <wtf/SetForScope.h>
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>