<!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>[199054] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199054">199054</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-04-05 03:29:31 -0700 (Tue, 05 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use RenderTreeUpdater for text node mutations
https://bugs.webkit.org/show_bug.cgi?id=156107
Reviewed by Andreas Kling.
Source/WebCore:
Use the new mechanism for updating render tree after text node content changes.
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/Text.cpp:
(WebCore::Text::createWithLengthLimit):
(WebCore::Text::updateRendererAfterContentChange):
Update using RenderTreeUpdater.
(WebCore::Text::formatForDebugger):
* dom/Text.h:
(WebCore::Text::Text):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::elementImplicitVisibility):
(WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.
(WebCore::Style::textRendererIsNeeded): Deleted.
(WebCore::Style::createTextRendererIfNeeded): Deleted.
(WebCore::Style::attachTextRenderer): Deleted.
(WebCore::Style::detachTextRenderer): Deleted.
(WebCore::Style::updateTextRendererAfterContentChange): Deleted.
(WebCore::Style::resolveTextNode): Deleted.
Kill the old code paths.
* style/StyleTreeResolver.h:
LayoutTests:
Mostly just revert non-rendered whitespace related changes from the earlier patches.
* editing/style/remove-underline-from-stylesheet-expected.txt:
* editing/style/typing-style-003-expected.txt:
* platform/ios-simulator/editing/style/typing-style-003-expected.txt: Removed.
* platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt:
* platform/mac/editing/inserting/editable-html-element-expected.txt:
* platform/mac/editing/inserting/editing-empty-divs-expected.txt:
* platform/mac/editing/inserting/insert-at-end-02-expected.txt:
* platform/mac/editing/pasteboard/4989774-expected.txt:
* platform/mac/editing/selection/4983858-expected.txt:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestseditingmacspellingautocorrectioncontractionexpectedtxt">trunk/LayoutTests/editing/mac/spelling/autocorrection-contraction-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingmacspellingautocorrectionremovingunderlineafterpasteexpectedtxt">trunk/LayoutTests/editing/mac/spelling/autocorrection-removing-underline-after-paste-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingmacspellingautocorrectionremovingunderlineexpectedtxt">trunk/LayoutTests/editing/mac/spelling/autocorrection-removing-underline-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingmacspellingautocorrectionsimpleexpectedtxt">trunk/LayoutTests/editing/mac/spelling/autocorrection-simple-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingstyleremoveunderlinefromstylesheetexpectedtxt">trunk/LayoutTests/editing/style/remove-underline-from-stylesheet-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingstyletypingstyle003expectedtxt">trunk/LayoutTests/editing/style/typing-style-003-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadremovebadobjectinbeforeloadlistenerexpectedtxt">trunk/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdombeforeloadremoveflashinbeforeloadlistenerexpectedtxt">trunk/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaceditinginsertingeditablehtmlelementexpectedtxt">trunk/LayoutTests/platform/mac/editing/inserting/editable-html-element-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaceditinginsertingeditingemptydivsexpectedtxt">trunk/LayoutTests/platform/mac/editing/inserting/editing-empty-divs-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaceditinginsertinginsertatend02expectedtxt">trunk/LayoutTests/platform/mac/editing/inserting/insert-at-end-02-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaceditingpasteboard4989774expectedtxt">trunk/LayoutTests/platform/mac/editing/pasteboard/4989774-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaceditingselection4983858expectedtxt">trunk/LayoutTests/platform/mac/editing/selection/4983858-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2editingmacspellingautocorrectioncontractionexpectedtxt">trunk/LayoutTests/platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt</a></li>
<li><a href="#trunkLayoutTestspluginsfocusexpectedtxt">trunk/LayoutTests/plugins/focus-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatacpp">trunk/Source/WebCore/dom/CharacterData.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTextcpp">trunk/Source/WebCore/dom/Text.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTexth">trunk/Source/WebCore/dom/Text.h</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdatercpp">trunk/Source/WebCore/style/RenderTreeUpdater.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleTreeResolvercpp">trunk/Source/WebCore/style/StyleTreeResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleTreeResolverh">trunk/Source/WebCore/style/StyleTreeResolver.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleUpdatecpp">trunk/Source/WebCore/style/StyleUpdate.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleUpdateh">trunk/Source/WebCore/style/StyleUpdate.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformiossimulatoreditingstyletypingstyle003expectedtxt">trunk/LayoutTests/platform/ios-simulator/editing/style/typing-style-003-expected.txt</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/ChangeLog        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-04-05 Antti Koivisto <antti@apple.com>
+
+ Use RenderTreeUpdater for text node mutations
+ https://bugs.webkit.org/show_bug.cgi?id=156107
+
+ Reviewed by Andreas Kling.
+
+ Mostly just revert non-rendered whitespace related changes from the earlier patches.
+
+ * editing/style/remove-underline-from-stylesheet-expected.txt:
+ * editing/style/typing-style-003-expected.txt:
+ * platform/ios-simulator/editing/style/typing-style-003-expected.txt: Removed.
+ * platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt:
+ * platform/mac/editing/inserting/editable-html-element-expected.txt:
+ * platform/mac/editing/inserting/editing-empty-divs-expected.txt:
+ * platform/mac/editing/inserting/insert-at-end-02-expected.txt:
+ * platform/mac/editing/pasteboard/4989774-expected.txt:
+ * platform/mac/editing/selection/4983858-expected.txt:
+
</ins><span class="cx"> 2016-04-04 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> CSS Triangles Rendering Regression affecting CSS Ribbons.
</span></span></pre></div>
<a id="trunkLayoutTestseditingmacspellingautocorrectioncontractionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/mac/spelling/autocorrection-contraction-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/mac/spelling/autocorrection-contraction-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/editing/mac/spelling/autocorrection-contraction-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -279,4 +279,4 @@
</span><span class="cx"> RenderText {#text} at (0,0) size 160x28
</span><span class="cx"> text run at (0,0) width 154: "would' wouldn't"
</span><span class="cx"> text run at (153,0) width 7: " "
</span><del>-caret: position 16 of child 0 {#text} of child 6 {DIV} of child 3 {DIV} of body
</del><ins>+caret: position 16 of child 0 {#text} of child 5 {DIV} of child 3 {DIV} of body
</ins></span></pre></div>
<a id="trunkLayoutTestseditingmacspellingautocorrectionremovingunderlineafterpasteexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/mac/spelling/autocorrection-removing-underline-after-paste-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/mac/spelling/autocorrection-removing-underline-after-paste-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/editing/mac/spelling/autocorrection-removing-underline-after-paste-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -82,4 +82,4 @@
</span><span class="cx"> text run at (0,28) width 34: "baz"
</span><span class="cx"> RenderBlock {DIV} at (14,70) size 756x28
</span><span class="cx"> RenderBR {BR} at (0,0) size 0x28
</span><del>-caret: position 0 of child 0 {BR} of child 5 {DIV} of child 5 {DIV} of body
</del><ins>+caret: position 0 of child 0 {BR} of child 4 {DIV} of child 5 {DIV} of body
</ins></span></pre></div>
<a id="trunkLayoutTestseditingmacspellingautocorrectionremovingunderlineexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/mac/spelling/autocorrection-removing-underline-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/mac/spelling/autocorrection-removing-underline-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/editing/mac/spelling/autocorrection-removing-underline-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -78,4 +78,4 @@
</span><span class="cx"> RenderInline {SPAN} at (0,0) size 1x28
</span><span class="cx"> RenderBlock {DIV} at (14,42) size 756x28
</span><span class="cx"> RenderBR {BR} at (0,0) size 0x28
</span><del>-caret: position 0 of child 0 {BR} of child 3 {DIV} of child 5 {DIV} of body
</del><ins>+caret: position 0 of child 0 {BR} of child 2 {DIV} of child 5 {DIV} of body
</ins></span></pre></div>
<a id="trunkLayoutTestseditingmacspellingautocorrectionsimpleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/mac/spelling/autocorrection-simple-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/mac/spelling/autocorrection-simple-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/editing/mac/spelling/autocorrection-simple-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -137,4 +137,4 @@
</span><span class="cx"> RenderBlock {DIV} at (14,42) size 756x28
</span><span class="cx"> RenderText {#text} at (0,0) size 138x28
</span><span class="cx"> text run at (0,0) width 138: "the notational,"
</span><del>-caret: position 15 of child 0 {#text} of child 3 {DIV} of child 7 {DIV} of body
</del><ins>+caret: position 15 of child 0 {#text} of child 2 {DIV} of child 7 {DIV} of body
</ins></span></pre></div>
<a id="trunkLayoutTestseditingstyleremoveunderlinefromstylesheetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/style/remove-underline-from-stylesheet-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/style/remove-underline-from-stylesheet-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/editing/style/remove-underline-from-stylesheet-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -76,7 +76,5 @@
</span><span class="cx"> | "xxxxxx "
</span><span class="cx"> | "<#selection-anchor>xxxxxx<#selection-focus>"
</span><span class="cx"> | " xxxxxx"
</span><del>-| "
-"
</del><span class="cx"> | <span>
</span><span class="cx"> | id="test"
</span></span></pre></div>
<a id="trunkLayoutTestseditingstyletypingstyle003expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/style/typing-style-003-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/style/typing-style-003-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/editing/style/typing-style-003-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -52,10 +52,10 @@
</span><span class="cx"> EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
</span><span class="cx"> xxxxxxxxxxxxxxx
</span><span class="cx"> execTypeCharacterCommand: x <span id="test"></span>
</span><del>-execTypeCharacterCommand: xx <span id="test"></span>
-execTypeCharacterCommand: xxx <span id="test"></span>
-execBoldCommand: xxx <span id="test"></span>
-execTypeCharacterCommand: xxx<b>x</b> <span id="test"></span>
</del><ins>+execTypeCharacterCommand: xx<span id="test"></span>
+execTypeCharacterCommand: xxx<span id="test"></span>
+execBoldCommand: xxx<span id="test"></span>
+execTypeCharacterCommand: xxx<b>x</b><span id="test"></span>
</ins><span class="cx"> execTypeCharacterCommand: xxx<b>xx</b><span id="test"></span>
</span><span class="cx"> execTypeCharacterCommand: xxx<b>xxx</b><span id="test"></span>
</span><span class="cx"> execItalicCommand: xxx<b>xxx</b><span id="test"></span>
</span></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadremovebadobjectinbeforeloadlistenerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><span class="cx"> This page tests that you can correctly remove an object element with an invalid data URL in its beforeload listener without causing a crash.
</span><span class="cx">
</span><span class="cx"> PASS
</span><del>-
</del></span></pre></div>
<a id="trunkLayoutTestsfastdombeforeloadremoveflashinbeforeloadlistenerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><span class="cx"> This page tests that you can correctly remove a flash object in a beforeload listener without causing a crash.
</span><span class="cx">
</span><span class="cx"> PASS
</span><del>-
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatoreditingstyletypingstyle003expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-simulator/editing/style/typing-style-003-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/editing/style/typing-style-003-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/platform/ios-simulator/editing/style/typing-style-003-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -1,72 +0,0 @@
</span><del>-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > DIV > BODY > HTML > #document to 1 of #text > B > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > B > DIV > BODY > HTML > #document to 1 of #text > B > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > DIV > BODY > HTML > #document to 1 of #text > B > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > B > DIV > BODY > HTML > #document to 2 of #text > B > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > B > DIV > BODY > HTML > #document to 2 of #text > B > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > B > DIV > BODY > HTML > #document to 3 of #text > B > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > I > B > DIV > BODY > HTML > #document to 1 of #text > I > B > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > I > B > DIV > BODY > HTML > #document to 1 of #text > I > B > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > I > B > DIV > BODY > HTML > #document to 1 of #text > I > B > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > I > B > DIV > BODY > HTML > #document to 2 of #text > I > B > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > I > B > DIV > BODY > HTML > #document to 2 of #text > I > B > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > I > B > DIV > BODY > HTML > #document to 3 of #text > I > B > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > I > DIV > BODY > HTML > #document to 1 of #text > I > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > I > DIV > BODY > HTML > #document to 1 of #text > I > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > I > DIV > BODY > HTML > #document to 1 of #text > I > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > I > DIV > BODY > HTML > #document to 2 of #text > I > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > I > DIV > BODY > HTML > #document to 2 of #text > I > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > I > DIV > BODY > HTML > #document to 3 of #text > I > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-xxxxxxxxxxxxxxx
-execTypeCharacterCommand: x <span id="test"></span>
-execTypeCharacterCommand: xx<span id="test"></span>
-execTypeCharacterCommand: xxx<span id="test"></span>
-execBoldCommand: xxx<span id="test"></span>
-execTypeCharacterCommand: xxx<b>x</b><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xx</b><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx</b><span id="test"></span>
-execItalicCommand: xxx<b>xxx</b><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx<i>x</i></b><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx<i>xx</i></b><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx<i>xxx</i></b><span id="test"></span>
-execBoldCommand: xxx<b>xxx<i>xxx</i></b><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx</b><i><b>xxx</b>x</i><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx</b><i><b>xxx</b>xx</i><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx</b><i><b>xxx</b>xxx</i><span id="test"></span>
-execItalicCommand: xxx<b>xxx</b><i><b>xxx</b>xxx</i><span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx</b><i><b>xxx</b>xxx</i>x<span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx</b><i><b>xxx</b>xxx</i>xx<span id="test"></span>
-execTypeCharacterCommand: xxx<b>xxx</b><i><b>xxx</b>xxx</i>xxx<span id="test"></span>
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmaceditinginsertingeditablehtmlelementexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/editing/inserting/editable-html-element-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/editing/inserting/editable-html-element-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/platform/mac/editing/inserting/editable-html-element-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> text run at (0,18) width 767: "inserting a paragraph separator doesn't split the body (inserting a paragraph separator usually splits/clones the enclosing"
</span><span class="cx"> text run at (766,18) width 5: " "
</span><span class="cx"> text run at (0,36) width 132: "block flow element)."
</span><ins>+ RenderText {#text} at (0,0) size 0x0
</ins><span class="cx"> RenderBlock {DIV} at (0,54) size 784x18
</span><span class="cx"> RenderBR {BR} at (0,0) size 0x18
</span><span class="cx"> caret: position 0 of child 0 {BR} of child 2 {DIV} of body
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaceditinginsertingeditingemptydivsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/editing/inserting/editing-empty-divs-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/editing/inserting/editing-empty-divs-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/platform/mac/editing/inserting/editing-empty-divs-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx"> RenderBlock {DIV} at (0,230) size 708x22 [border: (1px dotted #0000FF)]
</span><span class="cx"> RenderText {#text} at (1,1) size 8x18
</span><span class="cx"> text run at (1,1) width 8: "c"
</span><ins>+ RenderText {#text} at (0,0) size 0x0
</ins><span class="cx"> RenderBlock {P} at (0,268) size 784x18
</span><span class="cx"> RenderText {#text} at (0,0) size 240x18
</span><span class="cx"> text run at (0,0) width 240: "This div contains a self-closing p tag."
</span><span class="lines">@@ -80,5 +81,6 @@
</span><span class="cx"> RenderBlock (anonymous) at (1,1) size 706x18
</span><span class="cx"> RenderText {#text} at (0,0) size 8x18
</span><span class="cx"> text run at (0,0) width 8: "c"
</span><ins>+ RenderText {#text} at (0,0) size 0x0
</ins><span class="cx"> RenderBlock {P} at (1,35) size 706x0
</span><span class="cx"> caret: position 1 of child 0 {#text} of child 21 {DIV} of body
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaceditinginsertinginsertatend02expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/editing/inserting/insert-at-end-02-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/editing/inserting/insert-at-end-02-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/platform/mac/editing/inserting/insert-at-end-02-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -29,4 +29,5 @@
</span><span class="cx"> RenderBlock (anonymous) at (2,46) size 780x18
</span><span class="cx"> RenderText {#text} at (0,0) size 8x18
</span><span class="cx"> text run at (0,0) width 8: "x"
</span><ins>+ RenderText {#text} at (0,0) size 0x0
</ins><span class="cx"> caret: position 1 of child 5 {#text} of child 5 {DIV} of body
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaceditingpasteboard4989774expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/editing/pasteboard/4989774-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/editing/pasteboard/4989774-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/platform/mac/editing/pasteboard/4989774-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -12,4 +12,6 @@
</span><span class="cx"> text run at (634,103) width 102: "You should see"
</span><span class="cx"> text run at (735,103) width 5: " "
</span><span class="cx"> text run at (0,121) width 364: "several pictures above all in the same line/paragraph."
</span><ins>+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
</ins><span class="cx"> caret: position 164 of child 4 {#text} of body
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaceditingselection4983858expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/editing/selection/4983858-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/editing/selection/4983858-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/platform/mac/editing/selection/4983858-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -10,6 +10,7 @@
</span><span class="cx"> text run at (716,0) width 65: "paragraph"
</span><span class="cx"> text run at (780,0) width 4: " "
</span><span class="cx"> text run at (0,18) width 165: "below should be selected:"
</span><ins>+ RenderText {#text} at (0,0) size 0x0
</ins><span class="cx"> RenderBlock {DIV} at (0,36) size 784x18
</span><span class="cx"> RenderText {#text} at (0,0) size 22x18
</span><span class="cx"> text run at (0,0) width 22: "foo"
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2editingmacspellingautocorrectioncontractionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -259,4 +259,4 @@
</span><span class="cx"> RenderText {#text} at (0,0) size 172x28
</span><span class="cx"> text run at (0,0) width 166: "wouldn' wouldn't"
</span><span class="cx"> text run at (165,0) width 7: " "
</span><del>-caret: position 17 of child 0 {#text} of child 6 {DIV} of child 3 {DIV} of body
</del><ins>+caret: position 17 of child 0 {#text} of child 5 {DIV} of child 3 {DIV} of body
</ins></span></pre></div>
<a id="trunkLayoutTestspluginsfocusexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/plugins/focus-expected.txt (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/focus-expected.txt        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/LayoutTests/plugins/focus-expected.txt        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -24,4 +24,3 @@
</span><span class="cx"> This tests focusing Embeds and Objects. See LayoutTests/java for Applet elements.
</span><span class="cx">
</span><span class="cx"> Fallback contents. Fallback contents. Fallback contents.
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/ChangeLog        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-04-05 Antti Koivisto <antti@apple.com>
+
+ Use RenderTreeUpdater for text node mutations
+ https://bugs.webkit.org/show_bug.cgi?id=156107
+
+ Reviewed by Andreas Kling.
+
+ Use the new mechanism for updating render tree after text node content changes.
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::parserAppendData):
+ (WebCore::CharacterData::setDataAndUpdate):
+ * dom/Text.cpp:
+ (WebCore::Text::createWithLengthLimit):
+ (WebCore::Text::updateRendererAfterContentChange):
+
+ Update using RenderTreeUpdater.
+
+ (WebCore::Text::formatForDebugger):
+ * dom/Text.h:
+ (WebCore::Text::Text):
+ * style/StyleTreeResolver.cpp:
+ (WebCore::Style::TreeResolver::styleForElement):
+ (WebCore::Style::resetStyleForNonRenderedDescendants):
+ (WebCore::Style::TreeResolver::resolveElement):
+ (WebCore::Style::elementImplicitVisibility):
+ (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.
+ (WebCore::Style::textRendererIsNeeded): Deleted.
+ (WebCore::Style::createTextRendererIfNeeded): Deleted.
+ (WebCore::Style::attachTextRenderer): Deleted.
+ (WebCore::Style::detachTextRenderer): Deleted.
+ (WebCore::Style::updateTextRendererAfterContentChange): Deleted.
+ (WebCore::Style::resolveTextNode): Deleted.
+
+ Kill the old code paths.
+
+ * style/StyleTreeResolver.h:
+
</ins><span class="cx"> 2016-04-05 Hunseop Jeong <hs85.jeong@samsung.com>
</span><span class="cx">
</span><span class="cx"> [Curl][Soup] Fix the build after r199039
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.cpp (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.cpp        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/dom/CharacterData.cpp        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "ProcessingInstruction.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><del>-#include "StyleTreeResolver.h"
</del><span class="cx"> #include "TextBreakIterator.h"
</span><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx">
</span><span class="lines">@@ -89,8 +88,8 @@
</span><span class="cx"> m_data.append(string.characters16() + offset, characterLengthLimit);
</span><span class="cx">
</span><span class="cx"> ASSERT(!renderer() || is<Text>(*this));
</span><del>- if (is<Text>(*this))
- Style::updateTextRendererAfterContentChange(downcast<Text>(*this), oldLength, 0);
</del><ins>+ if (is<Text>(*this) && parentNode())
+ downcast<Text>(*this).updateRendererAfterContentChange(oldLength, 0);
</ins><span class="cx">
</span><span class="cx"> document().incDOMTreeVersion();
</span><span class="cx"> // We don't call dispatchModifiedEvent here because we don't want the
</span><span class="lines">@@ -188,8 +187,8 @@
</span><span class="cx"> m_data = newData;
</span><span class="cx">
</span><span class="cx"> ASSERT(!renderer() || is<Text>(*this));
</span><del>- if (is<Text>(*this))
- Style::updateTextRendererAfterContentChange(downcast<Text>(*this), offsetOfReplacedData, oldLength);
</del><ins>+ if (is<Text>(*this) && parentNode())
+ downcast<Text>(*this).updateRendererAfterContentChange(offsetOfReplacedData, oldLength);
</ins><span class="cx">
</span><span class="cx"> if (is<ProcessingInstruction>(*this))
</span><span class="cx"> downcast<ProcessingInstruction>(*this).checkStyleSheet();
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.cpp (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.cpp        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/dom/Text.cpp        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -26,12 +26,14 @@
</span><span class="cx"> #include "RenderCombineText.h"
</span><span class="cx"> #include "RenderSVGInlineText.h"
</span><span class="cx"> #include "RenderText.h"
</span><ins>+#include "RenderTreeUpdater.h"
</ins><span class="cx"> #include "SVGElement.h"
</span><span class="cx"> #include "SVGNames.h"
</span><span class="cx"> #include "ScopedEventQueue.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleUpdate.h"
</ins><span class="cx"> #include "TextNodeTraversal.h"
</span><span class="cx"> #include <wtf/CheckedArithmetic.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="lines">@@ -217,6 +219,23 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Text::updateRendererAfterContentChange(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData)
+{
+ ASSERT(parentNode());
+ if (styleChangeType() == ReconstructRenderTree)
+ return;
+
+ auto textUpdate = std::make_unique<Style::Update>(document());
+ textUpdate->addText(*this);
+
+ RenderTreeUpdater renderTreeUpdater(document());
+ renderTreeUpdater.commit(WTFMove(textUpdate));
+
+ if (auto* renderer = this->renderer())
+ renderer->setTextWithOffset(data(), offsetOfReplacedData, lengthOfReplacedData);
+}
+
+
</ins><span class="cx"> #if ENABLE(TREE_DEBUGGING)
</span><span class="cx"> void Text::formatForDebugger(char* buffer, unsigned length) const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoredomTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.h (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.h        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/dom/Text.h        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx">
</span><span class="cx"> RenderText* renderer() const;
</span><span class="cx">
</span><ins>+ void updateRendererAfterContentChange(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData);
+
</ins><span class="cx"> protected:
</span><span class="cx"> Text(Document& document, const String& data, ConstructionType type)
</span><span class="cx"> : CharacterData(document, data, type)
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdatercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdater.cpp (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdater.cpp        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/style/RenderTreeUpdater.cpp        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(&m_document == &styleUpdate->document());
</span><span class="cx">
</span><del>- if (!m_document.shouldCreateRenderers())
</del><ins>+ if (!m_document.shouldCreateRenderers() || !m_document.renderView())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_styleUpdate = WTFMove(styleUpdate);
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleTreeResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -50,9 +50,6 @@
</span><span class="cx">
</span><span class="cx"> namespace Style {
</span><span class="cx">
</span><del>-static void attachTextRenderer(Text&, RenderTreePosition&);
-static void resolveTextNode(Text&, RenderTreePosition&);
-
</del><span class="cx"> class SelectorFilterPusher {
</span><span class="cx"> public:
</span><span class="cx"> enum PushMode { Push, NoPush };
</span><span class="lines">@@ -179,103 +176,6 @@
</span><span class="cx"> return WTFMove(elementStyle.renderStyle);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded(Node& current)
-{
- // FIXME: This needs to traverse in composed tree order.
-
- // This function finds sibling text renderers where the results of textRendererIsNeeded may have changed as a result of
- // the current node gaining or losing the renderer. This can only affect white space text nodes.
- for (Node* sibling = current.nextSibling(); sibling; sibling = sibling->nextSibling()) {
- if (sibling->needsStyleRecalc())
- return;
- if (is<Element>(*sibling)) {
- // Text renderers beyond rendered elements can't be affected.
- if (!sibling->renderer() || RenderTreePosition::isRendererReparented(*sibling->renderer()))
- continue;
- return;
- }
- if (!is<Text>(*sibling))
- continue;
- Text& textSibling = downcast<Text>(*sibling);
- if (!textSibling.containsOnlyWhitespace())
- continue;
- textSibling.setNeedsStyleRecalc();
- }
-}
-
-static bool textRendererIsNeeded(const Text& textNode, const RenderTreePosition& renderTreePosition)
-{
- const RenderElement& parentRenderer = renderTreePosition.parent();
- if (!parentRenderer.canHaveChildren())
- return false;
- if (parentRenderer.element() && !parentRenderer.element()->childShouldCreateRenderer(textNode))
- return false;
- if (textNode.isEditingText())
- return true;
- if (!textNode.length())
- return false;
- if (!textNode.containsOnlyWhitespace())
- return true;
- // This text node has nothing but white space. We may still need a renderer in some cases.
- if (parentRenderer.isTable() || parentRenderer.isTableRow() || parentRenderer.isTableSection() || parentRenderer.isRenderTableCol() || parentRenderer.isFrameSet())
- return false;
- if (parentRenderer.style().preserveNewline()) // pre/pre-wrap/pre-line always make renderers.
- return true;
-
- RenderObject* previousRenderer = renderTreePosition.previousSiblingRenderer(textNode);
- if (previousRenderer && previousRenderer->isBR()) // <span><br/> <br/></span>
- return false;
-
- if (parentRenderer.isRenderInline()) {
- // <span><div/> <div/></span>
- if (previousRenderer && !previousRenderer->isInline())
- return false;
- } else {
- if (parentRenderer.isRenderBlock() && !parentRenderer.childrenInline() && (!previousRenderer || !previousRenderer->isInline()))
- return false;
-
- RenderObject* first = parentRenderer.firstChild();
- while (first && first->isFloatingOrOutOfFlowPositioned())
- first = first->nextSibling();
- RenderObject* nextRenderer = renderTreePosition.nextSiblingRenderer(textNode);
- if (!first || nextRenderer == first) {
- // Whitespace at the start of a block just goes away. Don't even make a render object for this text.
- return false;
- }
- }
- return true;
-}
-
-static void createTextRendererIfNeeded(Text& textNode, RenderTreePosition& renderTreePosition)
-{
- ASSERT(!textNode.renderer());
-
- if (!textRendererIsNeeded(textNode, renderTreePosition))
- return;
-
- auto newRenderer = textNode.createTextRenderer(renderTreePosition.parent().style());
- ASSERT(newRenderer);
-
- renderTreePosition.computeNextSibling(textNode);
-
- if (!renderTreePosition.canInsert(*newRenderer))
- return;
-
- // Make sure the RenderObject already knows it is going to be added to a RenderFlowThread before we set the style
- // for the first time. Otherwise code using inRenderFlowThread() in the styleWillChange and styleDidChange will fail.
- newRenderer->setFlowThreadState(renderTreePosition.parent().flowThreadState());
-
- textNode.setRenderer(newRenderer.get());
- renderTreePosition.insert(*newRenderer.leakPtr());
-}
-
-void attachTextRenderer(Text& textNode, RenderTreePosition& renderTreePosition)
-{
- createTextRendererIfNeeded(textNode, renderTreePosition);
-
- textNode.clearNeedsStyleRecalc();
-}
-
</del><span class="cx"> void detachTextRenderer(Text& textNode)
</span><span class="cx"> {
</span><span class="cx"> if (textNode.renderer())
</span><span class="lines">@@ -283,21 +183,6 @@
</span><span class="cx"> textNode.setRenderer(0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void updateTextRendererAfterContentChange(Text& textNode, unsigned offsetOfReplacedData, unsigned lengthOfReplacedData)
-{
- auto* renderingParentNode = composedTreeAncestors(textNode).first();
- if (!renderingParentNode || !renderingParentNode->renderer())
- return;
-
- bool hadRenderer = textNode.renderer();
-
- RenderTreePosition renderTreePosition(*renderingParentNode->renderer());
- resolveTextNode(textNode, renderTreePosition);
-
- if (hadRenderer && textNode.renderer())
- textNode.renderer()->setTextWithOffset(textNode.data(), offsetOfReplacedData, lengthOfReplacedData);
-}
-
</del><span class="cx"> static void resetStyleForNonRenderedDescendants(Element& current)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: This is not correct with shadow trees. This should be done with ComposedTreeIterator.
</span><span class="lines">@@ -445,25 +330,6 @@
</span><span class="cx"> return update;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void resolveTextNode(Text& text, RenderTreePosition& renderTreePosition)
-{
- text.clearNeedsStyleRecalc();
-
- bool hasRenderer = text.renderer();
- bool needsRenderer = textRendererIsNeeded(text, renderTreePosition);
- if (hasRenderer) {
- if (needsRenderer)
- return;
- detachTextRenderer(text);
- invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded(text);
- return;
- }
- if (!needsRenderer)
- return;
- attachTextRenderer(text, renderTreePosition);
- invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded(text);
-}
-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> static EVisibility elementImplicitVisibility(const Element* element)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleTreeResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleTreeResolver.h (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleTreeResolver.h        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/style/StyleTreeResolver.h        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -112,8 +112,6 @@
</span><span class="cx"> void detachRenderTree(Element&, DetachType = NormalDetach);
</span><span class="cx"> void detachTextRenderer(Text&);
</span><span class="cx">
</span><del>-void updateTextRendererAfterContentChange(Text&, unsigned offsetOfReplacedData, unsigned lengthOfReplacedData);
-
</del><span class="cx"> void queuePostResolutionCallback(std::function<void ()>);
</span><span class="cx"> bool postResolutionCallbacksAreSuspended();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleUpdatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleUpdate.cpp (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleUpdate.cpp        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/style/StyleUpdate.cpp        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> void Update::addElement(Element& element, Element* parent, ElementUpdate& change)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_elements.contains(&element));
</span><del>- ASSERT(!parent || composedTreeAncestors(element).first() == parent);
</del><ins>+ ASSERT(composedTreeAncestors(element).first() == parent);
</ins><span class="cx">
</span><span class="cx"> addPossibleRoot(parent);
</span><span class="cx"> m_elements.add(&element, change);
</span><span class="lines">@@ -72,12 +72,17 @@
</span><span class="cx"> void Update::addText(Text& text, Element* parent)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_texts.contains(&text));
</span><del>- ASSERT(!parent || composedTreeAncestors(text).first() == parent);
</del><ins>+ ASSERT(composedTreeAncestors(text).first() == parent);
</ins><span class="cx">
</span><span class="cx"> addPossibleRoot(parent);
</span><span class="cx"> m_texts.add(&text);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Update::addText(Text& text)
+{
+ addText(text, composedTreeAncestors(text).first());
+}
+
</ins><span class="cx"> void Update::addPossibleRoot(Element* element)
</span><span class="cx"> {
</span><span class="cx"> if (!element) {
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleUpdateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleUpdate.h (199053 => 199054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleUpdate.h        2016-04-05 07:04:27 UTC (rev 199053)
+++ trunk/Source/WebCore/style/StyleUpdate.h        2016-04-05 10:29:31 UTC (rev 199054)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx">
</span><span class="cx"> void addElement(Element&, Element* parent, ElementUpdate&);
</span><span class="cx"> void addText(Text&, Element* parent);
</span><ins>+ void addText(Text&);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> void addPossibleRoot(Element*);
</span></span></pre>
</div>
</div>
</body>
</html>