<!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>[203047] 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/203047">203047</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-07-10 22:06:24 -0700 (Sun, 10 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Setting document.title reuses <title>'s textnode child
https://bugs.webkit.org/show_bug.cgi?id=28864
<rdar://problem/7186473>
Reviewed by Benjamin Poulain.
Source/WebCore:
Setting document.title should be equivalent to setting the 'textContent'
IDL attribute of the <title> element:
- https://html.spec.whatwg.org/multipage/dom.html#document.title
In particular, this means we should always create a new Text node and
replace all the <title>'s children with this new Node, as per:
- https://dom.spec.whatwg.org/#dom-node-textcontent
Previously, WebKit would in some cases reuse the existing <title>'s
Text node and merely update its data.
Firefox and Chrome behave as per the specification so this aligns our
behavior with other major browsers as well.
Test: fast/dom/title-setter-new-text-node.html
* dom/Document.cpp:
(WebCore::Document::setTitle):
- Call Node::setTextContent() instead of HTMLTitleElement::setText(),
as per the specification.
- Take an ExceptionCode parameter and pass it to Node::setTextContent()
as it may throw.
* dom/Document.h:
* dom/Document.idl:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
Update implementation of HTMLTitleElement::setText() to call
setTextContent() as per the specification:
- https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
* html/HTMLTitleElement.h:
* html/HTMLTitleElement.idl:
* html/ImageDocument.cpp:
(WebCore::ImageDocument::finishedParsing):
* svg/SVGTitleElement.cpp:
* svg/SVGTitleElement.h:
Drop setText() setter which was duplicated from HTMLTitleElement::setText()
now that Document::setTitle() calls SVGTitleElement::setTextContent()
instead.
LayoutTests:
* fast/dom/title-setter-new-text-node-expected.txt: Added.
* fast/dom/title-setter-new-text-node.html: Added.
Add test coverage.
* fast/dom/title-text-property-2-expected.txt:
* fast/dom/title-text-property-expected.txt:
* http/tests/globalhistory/history-delegate-basic-title-expected.txt:
Rebaseline a few tests now that we do not reuse the <title>'s text
node child.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomtitletextproperty2expectedtxt">trunk/LayoutTests/fast/dom/title-text-property-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomtitletextpropertyexpectedtxt">trunk/LayoutTests/fast/dom/title-text-property-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsglobalhistoryhistorydelegatebasictitleexpectedtxt">trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentidl">trunk/Source/WebCore/dom/Document.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTitleElementcpp">trunk/Source/WebCore/html/HTMLTitleElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTitleElementh">trunk/Source/WebCore/html/HTMLTitleElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTitleElementidl">trunk/Source/WebCore/html/HTMLTitleElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDocumentcpp">trunk/Source/WebCore/html/ImageDocument.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGTitleElementcpp">trunk/Source/WebCore/svg/SVGTitleElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGTitleElementh">trunk/Source/WebCore/svg/SVGTitleElement.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomtitlesetternewtextnodeexpectedtxt">trunk/LayoutTests/fast/dom/title-setter-new-text-node-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomtitlesetternewtextnodesvgexpectedtxt">trunk/LayoutTests/fast/dom/title-setter-new-text-node-svg-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomtitlesetternewtextnodesvghtml">trunk/LayoutTests/fast/dom/title-setter-new-text-node-svg.html</a></li>
<li><a href="#trunkLayoutTestsfastdomtitlesetternewtextnodehtml">trunk/LayoutTests/fast/dom/title-setter-new-text-node.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/LayoutTests/ChangeLog        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-07-10 Chris Dumez <cdumez@apple.com>
+
+ Setting document.title reuses <title>'s textnode child
+ https://bugs.webkit.org/show_bug.cgi?id=28864
+ <rdar://problem/7186473>
+
+ Reviewed by Benjamin Poulain.
+
+ * fast/dom/title-setter-new-text-node-expected.txt: Added.
+ * fast/dom/title-setter-new-text-node.html: Added.
+ Add test coverage.
+
+ * fast/dom/title-text-property-2-expected.txt:
+ * fast/dom/title-text-property-expected.txt:
+ * http/tests/globalhistory/history-delegate-basic-title-expected.txt:
+ Rebaseline a few tests now that we do not reuse the <title>'s text
+ node child.
+
</ins><span class="cx"> 2016-07-10 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r203037.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomtitlesetternewtextnodeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/title-setter-new-text-node-expected.txt (0 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/title-setter-new-text-node-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/title-setter-new-text-node-expected.txt        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Tests that setting document.title does not reuse title's text node child
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.title is "aaa"
+PASS oldTextNode.textContent is "aaa"
+document.title = 'bbb'
+PASS oldTextNode.textContent is "aaa"
+PASS oldTextNode is not newTextNode
+PASS document.title is "bbb"
+PASS newTextNode.textContent is "bbb"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomtitlesetternewtextnodesvgexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/title-setter-new-text-node-svg-expected.txt (0 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/title-setter-new-text-node-svg-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/title-setter-new-text-node-svg-expected.txt        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Tests that setting document.title does not reuse title's text node child
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS svgDocument.title is "aaa"
+PASS oldTextNode.textContent is "aaa"
+svgDocument.title = 'bbb'
+PASS oldTextNode.textContent is "aaa"
+PASS oldTextNode is not newTextNode
+PASS svgDocument.title is "bbb"
+PASS newTextNode.textContent is "bbb"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomtitlesetternewtextnodesvghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/title-setter-new-text-node-svg.html (0 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/title-setter-new-text-node-svg.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/title-setter-new-text-node-svg.html        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+description("Tests that setting document.title does not reuse title's text node child");
+
+var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
+
+var svgDocument = document.implementation.createDocument(SVG_NAMESPACE, "svg", null);
+var title = svgDocument.createElementNS(SVG_NAMESPACE, "title");
+title.textContent = "aaa";
+svgDocument.documentElement.appendChild(title);
+
+oldTextNode = svgDocument.getElementsByTagName("title")[0].firstChild;
+shouldBeEqualToString("svgDocument.title", "aaa");
+shouldBeEqualToString("oldTextNode.textContent", "aaa");
+evalAndLog("svgDocument.title = 'bbb'");
+shouldBeEqualToString("oldTextNode.textContent", "aaa");
+newTextNode = svgDocument.getElementsByTagName("title")[0].firstChild;
+shouldNotBe("oldTextNode", "newTextNode");
+shouldBeEqualToString("svgDocument.title", "bbb");
+shouldBeEqualToString("newTextNode.textContent", "bbb");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomtitlesetternewtextnodehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/title-setter-new-text-node.html (0 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/title-setter-new-text-node.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/title-setter-new-text-node.html        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>aaa</title>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body onload="runTest()">
+<script>
+description("Tests that setting document.title does not reuse title's text node child");
+jsTestIsAsync = true;
+
+function runTest()
+{
+ oldTextNode = document.getElementsByTagName("title")[0].firstChild;
+ shouldBeEqualToString("document.title", "aaa");
+ shouldBeEqualToString("oldTextNode.textContent", "aaa");
+ evalAndLog("document.title = 'bbb'");
+ shouldBeEqualToString("oldTextNode.textContent", "aaa");
+ newTextNode = document.getElementsByTagName("title")[0].firstChild;
+ shouldNotBe("oldTextNode", "newTextNode");
+ shouldBeEqualToString("document.title", "bbb");
+ shouldBeEqualToString("newTextNode.textContent", "bbb");
+
+ finishJSTest();
+}
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomtitletextproperty2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/title-text-property-2-expected.txt (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/title-text-property-2-expected.txt        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/LayoutTests/fast/dom/title-text-property-2-expected.txt        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -1,4 +1,7 @@
</span><span class="cx"> TITLE CHANGED: '1. setting document.title'
</span><ins>+TITLE CHANGED: ''
+TITLE CHANGED: '1. setting document.title'
+TITLE CHANGED: ''
</ins><span class="cx"> TITLE CHANGED: '2. setting title.text'
</span><span class="cx"> TITLE CHANGED: ''
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomtitletextpropertyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/title-text-property-expected.txt (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/title-text-property-expected.txt        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/LayoutTests/fast/dom/title-text-property-expected.txt        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+TITLE CHANGED: ''
</ins><span class="cx"> TITLE CHANGED: 'This is the new title'
</span><span class="cx"> Original title is: 'Original Title'
</span><span class="cx"> Setting new title to: 'This is the new title'
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsglobalhistoryhistorydelegatebasictitleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -1,4 +1,6 @@
</span><span class="cx"> WebView navigated to url "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" with title "" with HTTP equivalent method "GET". The navigation was successful and was not a client redirect.
</span><span class="cx"> WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 1".
</span><span class="cx"> WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 2".
</span><ins>+WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "".
+WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 2".
</ins><span class="cx"> This test sees if the history delegate is notified of title changes.
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/ChangeLog        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2016-07-10 Chris Dumez <cdumez@apple.com>
+
+ Setting document.title reuses <title>'s textnode child
+ https://bugs.webkit.org/show_bug.cgi?id=28864
+ <rdar://problem/7186473>
+
+ Reviewed by Benjamin Poulain.
+
+ Setting document.title should be equivalent to setting the 'textContent'
+ IDL attribute of the <title> element:
+ - https://html.spec.whatwg.org/multipage/dom.html#document.title
+
+ In particular, this means we should always create a new Text node and
+ replace all the <title>'s children with this new Node, as per:
+ - https://dom.spec.whatwg.org/#dom-node-textcontent
+
+ Previously, WebKit would in some cases reuse the existing <title>'s
+ Text node and merely update its data.
+
+ Firefox and Chrome behave as per the specification so this aligns our
+ behavior with other major browsers as well.
+
+ Test: fast/dom/title-setter-new-text-node.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::setTitle):
+ - Call Node::setTextContent() instead of HTMLTitleElement::setText(),
+ as per the specification.
+ - Take an ExceptionCode parameter and pass it to Node::setTextContent()
+ as it may throw.
+
+ * dom/Document.h:
+ * dom/Document.idl:
+
+ * html/HTMLTitleElement.cpp:
+ (WebCore::HTMLTitleElement::setText):
+ Update implementation of HTMLTitleElement::setText() to call
+ setTextContent() as per the specification:
+ - https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
+
+ * html/HTMLTitleElement.h:
+ * html/HTMLTitleElement.idl:
+
+ * html/ImageDocument.cpp:
+ (WebCore::ImageDocument::finishedParsing):
+
+ * svg/SVGTitleElement.cpp:
+ * svg/SVGTitleElement.h:
+ Drop setText() setter which was duplicated from HTMLTitleElement::setText()
+ now that Document::setTitle() calls SVGTitleElement::setTextContent()
+ instead.
+
</ins><span class="cx"> 2016-07-10 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix LogicalSelectionOffsetCaches to work with detached render tree.
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -1623,7 +1623,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Document::setTitle(const String& title)
</del><ins>+void Document::setTitle(const String& title, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_titleElement) {
</span><span class="cx"> if (isHTMLDocument() || isXHTMLDocument()) {
</span><span class="lines">@@ -1646,9 +1646,9 @@
</span><span class="cx"> updateTitle(StringWithDirection(title, LTR));
</span><span class="cx">
</span><span class="cx"> if (is<HTMLTitleElement>(m_titleElement.get()))
</span><del>- downcast<HTMLTitleElement>(*m_titleElement).setText(title);
</del><ins>+ downcast<HTMLTitleElement>(*m_titleElement).setTextContent(title, ec);
</ins><span class="cx"> else if (is<SVGTitleElement>(m_titleElement.get()))
</span><del>- downcast<SVGTitleElement>(*m_titleElement).setText(title);
</del><ins>+ downcast<SVGTitleElement>(*m_titleElement).setTextContent(title, ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::updateTitleElement(Element* newTitleElement)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/dom/Document.h        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -863,7 +863,7 @@
</span><span class="cx">
</span><span class="cx"> // Used by DOM bindings; no direction known.
</span><span class="cx"> String title() const { return m_title.string(); }
</span><del>- void setTitle(const String&);
</del><ins>+ void setTitle(const String&, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> void titleElementAdded(Element& titleElement);
</span><span class="cx"> void titleElementRemoved(Element& titleElement);
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.idl (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.idl        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/dom/Document.idl        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx"> // Moved down from HTMLDocument
</span><span class="cx">
</span><span class="cx"> // FIXME: Should not have [TreatNullAs=EmptyString].
</span><del>- [TreatNullAs=EmptyString] attribute DOMString title;
</del><ins>+ [TreatNullAs=EmptyString, SetterRaisesException] attribute DOMString title;
</ins><span class="cx">
</span><span class="cx"> readonly attribute DOMString referrer;
</span><span class="cx"> #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTitleElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTitleElement.cpp (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTitleElement.cpp        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/html/HTMLTitleElement.cpp        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -92,25 +92,9 @@
</span><span class="cx"> return StringWithDirection(text(), direction);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLTitleElement::setText(const String& value)
</del><ins>+void HTMLTitleElement::setText(const String& value, ExceptionCode& ec)
</ins><span class="cx"> {
</span><del>- Ref<HTMLTitleElement> protectedThis(*this);
-
- if (!value.isEmpty() && hasOneChild() && is<Text>(*firstChild())) {
- downcast<Text>(*firstChild()).setData(value);
- return;
- }
-
- // We make a copy here because entity of "value" argument can be Document::m_title,
- // which goes empty during removeChildren() invocation below,
- // which causes HTMLTitleElement::childrenChanged(), which ends up calling Document::setTitle().
- String valueCopy(value);
-
- if (hasChildNodes())
- removeChildren();
-
- if (!valueCopy.isEmpty())
- appendChild(document().createTextNode(valueCopy), IGNORE_EXCEPTION);
</del><ins>+ setTextContent(value, ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTitleElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTitleElement.h (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTitleElement.h        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/html/HTMLTitleElement.h        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> static Ref<HTMLTitleElement> create(const QualifiedName&, Document&);
</span><span class="cx">
</span><span class="cx"> String text() const;
</span><del>- void setText(const String&);
</del><ins>+ void setText(const String&, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> const StringWithDirection& textWithDirection() const { return m_title; }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTitleElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTitleElement.idl (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTitleElement.idl        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/html/HTMLTitleElement.idl        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -18,6 +18,6 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> interface HTMLTitleElement : HTMLElement {
</span><del>- attribute DOMString text;
</del><ins>+ [SetterRaisesException] attribute DOMString text;
</ins><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageDocument.cpp (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.cpp        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/html/ImageDocument.cpp        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx"> String name = decodeURLEscapeSequences(url().lastPathComponent());
</span><span class="cx"> if (name.isEmpty())
</span><span class="cx"> name = url().host();
</span><del>- setTitle(imageTitle(name, size));
</del><ins>+ setTitle(imageTitle(name, size), IGNORE_EXCEPTION);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> imageUpdated();
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGTitleElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGTitleElement.cpp (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGTitleElement.cpp        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/svg/SVGTitleElement.cpp        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -63,25 +63,4 @@
</span><span class="cx"> document().titleElementTextChanged(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGTitleElement::setText(const String& value)
-{
- Ref<SVGTitleElement> protectedThis(*this);
-
- if (!value.isEmpty() && hasOneChild() && is<Text>(*firstChild())) {
- downcast<Text>(*firstChild()).setData(value);
- return;
- }
-
- // We make a copy here because entity of "value" argument can be Document::m_title,
- // which goes empty during removeChildren() invocation below,
- // which causes SVGTitleElement::childrenChanged(), which ends up calling Document::setTitle().
- String valueCopy(value);
-
- if (hasChildNodes())
- removeChildren();
-
- if (!valueCopy.isEmpty())
- appendChild(document().createTextNode(valueCopy), IGNORE_EXCEPTION);
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGTitleElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGTitleElement.h (203046 => 203047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGTitleElement.h        2016-07-11 04:28:03 UTC (rev 203046)
+++ trunk/Source/WebCore/svg/SVGTitleElement.h        2016-07-11 05:06:24 UTC (rev 203047)
</span><span class="lines">@@ -30,8 +30,6 @@
</span><span class="cx"> public:
</span><span class="cx"> static Ref<SVGTitleElement> create(const QualifiedName&, Document&);
</span><span class="cx">
</span><del>- void setText(const String&);
-
</del><span class="cx"> private:
</span><span class="cx"> SVGTitleElement(const QualifiedName&, Document&);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>