<!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>[189804] releases/WebKitGTK/webkit-2.10</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/189804">189804</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-09-15 01:57:56 -0700 (Tue, 15 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/189680">r189680</a> - Document.title does not behave according to specification
https://bugs.webkit.org/show_bug.cgi?id=149098

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-01-expected.txt:
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-02-expected.txt:

Source/WebCore:

Update Document.title to behave according to the latest DOM specification:
https://html.spec.whatwg.org/multipage/dom.html#document.title

In particular, the following Web-Exposed changes were made:
1. The title Element should be the first title element in the document
   (in tree order) [1]. Previously, WebKit would use the first title
   Element *added* to the Document. Document.title returns the text
   content of the title Element so this change is web-exposed.
2. If the title Element is replaced after the title has been set by the
   JS (via the document.title setter), we should update the value
   returned by the document.title getter. Previously, WebKit would set
   a flag if the title was explicitly set by JS via document.title
   setter and later title element changes would not override the title
   set by the JS. This behavior isn't specified and does not match the
   behavior of other browsers.

The new behavior is also consistent with the behavior of Firefox and
Chrome.

Some refactoring was made for the sake of clarity now that our
implementation has changed. See details below.

[1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2

No new tests, already covered by existing tests.

* dom/Document.cpp:
(WebCore::Document::updateTitleFromTitleElement):
New convenience method that calls updateTitle() with the text of the
document's current title Element. If there is no title Element, it
clears the title.

(WebCore::Document::updateTitleElement):
Method which updates the Document's title Element whenever a title
Element is added or removed from the Document. Once the title Element
is updated, it takes care of calling updateTitleFromTitleElement() to
update the Document's title.

(WebCore::Document::titleElementAdded):
(WebCore::Document::titleElementRemoved):
(WebCore::Document::titleElementTextChanged):
New Document public API called by HTMLTitleElement / SVGTitleElement
whenever a title Element is added / removed from the Document or
whenever the title element's text has changed. These methods will
take care of calling updateTitleElement() / updateTitleFromTitleElement()
as necessary.
Previously, we would only have 2 methods:
- setTitleElement() which would be called whenever a title Element was
  added to the document or when its text had changed. The name was
  confusing because it would not necessarily set the document's title
  Element and it would be used both for title element update and a
  simple title update. This method has been split into 2:
  titleElementAdded() and titleElementTextChanged().
- removeTitle() which would be called whenever a title Element was
  removed. The naming was confusing because it would not necessarily
  remove the Document's title Element. This is now called
  titleElementRemoved().

* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::insertedInto):
Call the new titleElementAdded() instead of setTitleElement().

(WebCore::HTMLTitleElement::removedFrom):
Call the new titleElementRemoved() instead of removeTitle().

(WebCore::HTMLTitleElement::childrenChanged):
Call the new titleElementTextChanged() instead of
setTitleElement() / removeTitle() as we don't really want
to remove or add a title Element. We merely want to notify
the document that the title element text has changed in
case it is the current title Element of the Document.

(WebCore::HTMLTitleElement::computedTextWithDirection):
Rename textWithDirection() to computedTextWithDirection() to
make it clear it is not a simple getter and make it private
as it is only used to set the m_title member which caches the
computed text.

* html/HTMLTitleElement.h:
Add new textWithDirection() getter which returns m_title. This
is needed so that Document can query the title of the Element.
Previously, HTMLTitleElement would pass directly m_title to
the Document when calling Document::setTitleElement().

* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::insertedInto):
Call the new titleElementAdded() instead of setTitleElement().

(WebCore::SVGTitleElement::removedFrom):
Call the new titleElementRemoved() instead of removeTitle().

(WebCore::SVGTitleElement::childrenChanged):
Call the new titleElementTextChanged() instead of
setTitleElement().</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsimportedw3cChangeLog">releases/WebKitGTK/webkit-2.10/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoredomDocumentcpp">releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoredomDocumenth">releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCorehtmlHTMLTitleElementcpp">releases/WebKitGTK/webkit-2.10/Source/WebCore/html/HTMLTitleElement.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCorehtmlHTMLTitleElementh">releases/WebKitGTK/webkit-2.10/Source/WebCore/html/HTMLTitleElement.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoresvgSVGTitleElementcpp">releases/WebKitGTK/webkit-2.10/Source/WebCore/svg/SVGTitleElement.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit210LayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/imported/w3c/ChangeLog (189803 => 189804)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/imported/w3c/ChangeLog        2015-09-15 08:39:09 UTC (rev 189803)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/imported/w3c/ChangeLog        2015-09-15 08:57:56 UTC (rev 189804)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2015-09-13  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Document.title does not behave according to specification
+        https://bugs.webkit.org/show_bug.cgi?id=149098
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaseline several W3C tests now that more checks are passing.
+
+        * web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-01-expected.txt:
+        * web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-02-expected.txt:
+
+2015-09-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         document.lastModified should use the user's local time zone
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=149092
</span><span class="cx">         &lt;rdar://problem/22567705&gt;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (189803 => 189804)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog        2015-09-15 08:39:09 UTC (rev 189803)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog        2015-09-15 08:57:56 UTC (rev 189804)
</span><span class="lines">@@ -1,5 +1,107 @@
</span><span class="cx"> 2015-09-13  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Document.title does not behave according to specification
+        https://bugs.webkit.org/show_bug.cgi?id=149098
+
+        Reviewed by Ryosuke Niwa.
+
+        Update Document.title to behave according to the latest DOM specification:
+        https://html.spec.whatwg.org/multipage/dom.html#document.title
+
+        In particular, the following Web-Exposed changes were made:
+        1. The title Element should be the first title element in the document
+           (in tree order) [1]. Previously, WebKit would use the first title
+           Element *added* to the Document. Document.title returns the text
+           content of the title Element so this change is web-exposed.
+        2. If the title Element is replaced after the title has been set by the
+           JS (via the document.title setter), we should update the value
+           returned by the document.title getter. Previously, WebKit would set
+           a flag if the title was explicitly set by JS via document.title
+           setter and later title element changes would not override the title
+           set by the JS. This behavior isn't specified and does not match the
+           behavior of other browsers.
+
+        The new behavior is also consistent with the behavior of Firefox and
+        Chrome.
+
+        Some refactoring was made for the sake of clarity now that our
+        implementation has changed. See details below.
+
+        [1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2
+
+        No new tests, already covered by existing tests.
+
+        * dom/Document.cpp:
+        (WebCore::Document::updateTitleFromTitleElement):
+        New convenience method that calls updateTitle() with the text of the
+        document's current title Element. If there is no title Element, it
+        clears the title.
+
+        (WebCore::Document::updateTitleElement):
+        Method which updates the Document's title Element whenever a title
+        Element is added or removed from the Document. Once the title Element
+        is updated, it takes care of calling updateTitleFromTitleElement() to
+        update the Document's title.
+
+        (WebCore::Document::titleElementAdded):
+        (WebCore::Document::titleElementRemoved):
+        (WebCore::Document::titleElementTextChanged):
+        New Document public API called by HTMLTitleElement / SVGTitleElement
+        whenever a title Element is added / removed from the Document or
+        whenever the title element's text has changed. These methods will
+        take care of calling updateTitleElement() / updateTitleFromTitleElement()
+        as necessary.
+        Previously, we would only have 2 methods:
+        - setTitleElement() which would be called whenever a title Element was
+          added to the document or when its text had changed. The name was
+          confusing because it would not necessarily set the document's title
+          Element and it would be used both for title element update and a
+          simple title update. This method has been split into 2:
+          titleElementAdded() and titleElementTextChanged().
+        - removeTitle() which would be called whenever a title Element was
+          removed. The naming was confusing because it would not necessarily
+          remove the Document's title Element. This is now called
+          titleElementRemoved().
+
+        * html/HTMLTitleElement.cpp:
+        (WebCore::HTMLTitleElement::insertedInto):
+        Call the new titleElementAdded() instead of setTitleElement().
+
+        (WebCore::HTMLTitleElement::removedFrom):
+        Call the new titleElementRemoved() instead of removeTitle().
+
+        (WebCore::HTMLTitleElement::childrenChanged):
+        Call the new titleElementTextChanged() instead of
+        setTitleElement() / removeTitle() as we don't really want
+        to remove or add a title Element. We merely want to notify
+        the document that the title element text has changed in
+        case it is the current title Element of the Document.
+
+        (WebCore::HTMLTitleElement::computedTextWithDirection):
+        Rename textWithDirection() to computedTextWithDirection() to
+        make it clear it is not a simple getter and make it private
+        as it is only used to set the m_title member which caches the
+        computed text.
+
+        * html/HTMLTitleElement.h:
+        Add new textWithDirection() getter which returns m_title. This
+        is needed so that Document can query the title of the Element.
+        Previously, HTMLTitleElement would pass directly m_title to
+        the Document when calling Document::setTitleElement().
+
+        * svg/SVGTitleElement.cpp:
+        (WebCore::SVGTitleElement::insertedInto):
+        Call the new titleElementAdded() instead of setTitleElement().
+
+        (WebCore::SVGTitleElement::removedFrom):
+        Call the new titleElementRemoved() instead of removeTitle().
+
+        (WebCore::SVGTitleElement::childrenChanged):
+        Call the new titleElementTextChanged() instead of
+        setTitleElement().
+
+2015-09-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         document.lastModified should use the user's local time zone
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=149092
</span><span class="cx">         &lt;rdar://problem/22567705&gt;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp (189803 => 189804)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp        2015-09-15 08:39:09 UTC (rev 189803)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp        2015-09-15 08:57:56 UTC (rev 189804)
</span><span class="lines">@@ -130,6 +130,7 @@
</span><span class="cx"> #include &quot;SVGElement.h&quot;
</span><span class="cx"> #include &quot;SVGElementFactory.h&quot;
</span><span class="cx"> #include &quot;SVGNames.h&quot;
</span><ins>+#include &quot;SVGTitleElement.h&quot;
</ins><span class="cx"> #include &quot;SchemeRegistry.h&quot;
</span><span class="cx"> #include &quot;ScopedEventQueue.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="lines">@@ -453,7 +454,6 @@
</span><span class="cx">     , m_frameElementsShouldIgnoreScrolling(false)
</span><span class="cx">     , m_updateFocusAppearanceRestoresSelection(false)
</span><span class="cx">     , m_ignoreDestructiveWriteCount(0)
</span><del>-    , m_titleSetExplicitly(false)
</del><span class="cx">     , m_markers(std::make_unique&lt;DocumentMarkerController&gt;())
</span><span class="cx">     , m_updateFocusAppearanceTimer(*this, &amp;Document::updateFocusAppearanceTimerFired)
</span><span class="cx">     , m_cssTarget(nullptr)
</span><span class="lines">@@ -1522,10 +1522,23 @@
</span><span class="cx">         loader-&gt;setTitle(m_title);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Document::updateTitleFromTitleElement()
+{
+    if (!m_titleElement) {
+        updateTitle(StringWithDirection());
+        return;
+    }
+
+    if (is&lt;HTMLTitleElement&gt;(*m_titleElement))
+        updateTitle(downcast&lt;HTMLTitleElement&gt;(*m_titleElement).textWithDirection());
+    else if (is&lt;SVGTitleElement&gt;(*m_titleElement)) {
+        // FIXME: does SVG have a title text direction?
+        updateTitle(StringWithDirection(downcast&lt;SVGTitleElement&gt;(*m_titleElement).textContent(), LTR));
+    }
+}
+
</ins><span class="cx"> void Document::setTitle(const String&amp; title)
</span><span class="cx"> {
</span><del>-    // Title set by JavaScript -- overrides any title elements.
-    m_titleSetExplicitly = true;
</del><span class="cx">     if (!isHTMLDocument() &amp;&amp; !isXHTMLDocument())
</span><span class="cx">         m_titleElement = nullptr;
</span><span class="cx">     else if (!m_titleElement) {
</span><span class="lines">@@ -1543,37 +1556,44 @@
</span><span class="cx">         downcast&lt;HTMLTitleElement&gt;(*m_titleElement).setText(title);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::setTitleElement(const StringWithDirection&amp; title, Element* titleElement)
</del><ins>+void Document::updateTitleElement(Element* newTitleElement)
</ins><span class="cx"> {
</span><del>-    if (titleElement != m_titleElement) {
-        if (m_titleElement || m_titleSetExplicitly) {
-            // Only allow the first title element to change the title -- others have no effect.
-            return;
-        }
-        m_titleElement = titleElement;
-    }
</del><ins>+    // Only allow the first title element in tree order to change the title -- others have no effect.
+    if (m_titleElement) {
+        if (isHTMLDocument() || isXHTMLDocument())
+            m_titleElement = descendantsOfType&lt;HTMLTitleElement&gt;(*this).first();
+        else if (isSVGDocument())
+            m_titleElement = descendantsOfType&lt;SVGTitleElement&gt;(*this).first();
+    } else
+        m_titleElement = newTitleElement;
</ins><span class="cx"> 
</span><del>-    updateTitle(title);
</del><ins>+    updateTitleFromTitleElement();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::removeTitle(Element* titleElement)
</del><ins>+void Document::titleElementAdded(Element&amp; titleElement)
</ins><span class="cx"> {
</span><del>-    if (m_titleElement != titleElement)
</del><ins>+    if (m_titleElement == &amp;titleElement)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_titleElement = nullptr;
-    m_titleSetExplicitly = false;
</del><ins>+    updateTitleElement(&amp;titleElement);
+}
</ins><span class="cx"> 
</span><del>-    // Update title based on first title element in the head, if one exists.
-    if (HTMLElement* headElement = head()) {
-        if (auto firstTitle = childrenOfType&lt;HTMLTitleElement&gt;(*headElement).first())
-            setTitleElement(firstTitle-&gt;textWithDirection(), firstTitle);
-    }
</del><ins>+void Document::titleElementRemoved(Element&amp; titleElement)
+{
+    if (m_titleElement != &amp;titleElement)
+        return;
</ins><span class="cx"> 
</span><del>-    if (!m_titleElement)
-        updateTitle(StringWithDirection());
</del><ins>+    updateTitleElement(nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Document::titleElementTextChanged(Element&amp; titleElement)
+{
+    if (m_titleElement != &amp;titleElement)
+        return;
+
+    updateTitleFromTitleElement();
+}
+
</ins><span class="cx"> void Document::registerForVisibilityStateChangedCallbacks(Element* element)
</span><span class="cx"> {
</span><span class="cx">     m_visibilityStateCallbackElements.add(element);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.h (189803 => 189804)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.h        2015-09-15 08:39:09 UTC (rev 189803)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.h        2015-09-15 08:57:56 UTC (rev 189804)
</span><span class="lines">@@ -836,8 +836,9 @@
</span><span class="cx">     String title() const { return m_title.string(); }
</span><span class="cx">     void setTitle(const String&amp;);
</span><span class="cx"> 
</span><del>-    void setTitleElement(const StringWithDirection&amp;, Element* titleElement);
-    void removeTitle(Element* titleElement);
</del><ins>+    void titleElementAdded(Element&amp; titleElement);
+    void titleElementRemoved(Element&amp; titleElement);
+    void titleElementTextChanged(Element&amp; titleElement);
</ins><span class="cx"> 
</span><span class="cx">     String cookie(ExceptionCode&amp;);
</span><span class="cx">     void setCookie(const String&amp;, ExceptionCode&amp;);
</span><span class="lines">@@ -1291,6 +1292,8 @@
</span><span class="cx">     friend class Node;
</span><span class="cx">     friend class IgnoreDestructiveWriteCountIncrementer;
</span><span class="cx"> 
</span><ins>+    void updateTitleElement(Element* newTitleElement);
+
</ins><span class="cx">     void commonTeardown();
</span><span class="cx"> 
</span><span class="cx">     RenderObject* renderer() const = delete;
</span><span class="lines">@@ -1324,6 +1327,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual double timerAlignmentInterval(bool hasReachedMaxNestingLevel) const override final;
</span><span class="cx"> 
</span><ins>+    void updateTitleFromTitleElement();
</ins><span class="cx">     void updateTitle(const StringWithDirection&amp;);
</span><span class="cx">     void updateFocusAppearanceTimerFired();
</span><span class="cx">     void updateBaseURL();
</span><span class="lines">@@ -1479,7 +1483,6 @@
</span><span class="cx"> 
</span><span class="cx">     StringWithDirection m_title;
</span><span class="cx">     StringWithDirection m_rawTitle;
</span><del>-    bool m_titleSetExplicitly;
</del><span class="cx">     RefPtr&lt;Element&gt; m_titleElement;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;AXObjectCache&gt; m_axObjectCache;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCorehtmlHTMLTitleElementcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/html/HTMLTitleElement.cpp (189803 => 189804)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/html/HTMLTitleElement.cpp        2015-09-15 08:39:09 UTC (rev 189803)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/html/HTMLTitleElement.cpp        2015-09-15 08:57:56 UTC (rev 189804)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> {
</span><span class="cx">     HTMLElement::insertedInto(insertionPoint);
</span><span class="cx">     if (inDocument() &amp;&amp; !isInShadowTree())
</span><del>-        document().setTitleElement(m_title, this);
</del><ins>+        document().titleElementAdded(*this);
</ins><span class="cx">     return InsertionDone;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -61,19 +61,14 @@
</span><span class="cx"> {
</span><span class="cx">     HTMLElement::removedFrom(insertionPoint);
</span><span class="cx">     if (insertionPoint.inDocument() &amp;&amp; !insertionPoint.isInShadowTree())
</span><del>-        document().removeTitle(this);
</del><ins>+        document().titleElementRemoved(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLTitleElement::childrenChanged(const ChildChange&amp; change)
</span><span class="cx"> {
</span><span class="cx">     HTMLElement::childrenChanged(change);
</span><del>-    m_title = textWithDirection();
-    if (inDocument()) {
-        if (!isInShadowTree())
-            document().setTitleElement(m_title, this);
-        else
-            document().removeTitle(this);
-    }
</del><ins>+    m_title = computedTextWithDirection();
+    document().titleElementTextChanged(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String HTMLTitleElement::text() const
</span><span class="lines">@@ -81,7 +76,7 @@
</span><span class="cx">     return TextNodeTraversal::contentsAsString(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-StringWithDirection HTMLTitleElement::textWithDirection()
</del><ins>+StringWithDirection HTMLTitleElement::computedTextWithDirection()
</ins><span class="cx"> {
</span><span class="cx">     TextDirection direction = LTR;
</span><span class="cx">     if (RenderStyle* computedStyle = this-&gt;computedStyle())
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCorehtmlHTMLTitleElementh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/html/HTMLTitleElement.h (189803 => 189804)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/html/HTMLTitleElement.h        2015-09-15 08:39:09 UTC (rev 189803)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/html/HTMLTitleElement.h        2015-09-15 08:57:56 UTC (rev 189804)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">     String text() const;
</span><span class="cx">     void setText(const String&amp;);
</span><span class="cx"> 
</span><del>-    StringWithDirection textWithDirection();
</del><ins>+    const StringWithDirection&amp; textWithDirection() const { return m_title; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HTMLTitleElement(const QualifiedName&amp;, Document&amp;);
</span><span class="lines">@@ -43,6 +43,8 @@
</span><span class="cx">     virtual void removedFrom(ContainerNode&amp;) override;
</span><span class="cx">     virtual void childrenChanged(const ChildChange&amp;) override;
</span><span class="cx"> 
</span><ins>+    StringWithDirection computedTextWithDirection();
+
</ins><span class="cx">     StringWithDirection m_title;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoresvgSVGTitleElementcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/svg/SVGTitleElement.cpp (189803 => 189804)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/svg/SVGTitleElement.cpp        2015-09-15 08:39:09 UTC (rev 189803)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/svg/SVGTitleElement.cpp        2015-09-15 08:57:56 UTC (rev 189804)
</span><span class="lines">@@ -43,10 +43,8 @@
</span><span class="cx">     if (!rootParent.inDocument())
</span><span class="cx">         return InsertionDone;
</span><span class="cx"> 
</span><del>-    if (firstChild() &amp;&amp; document().isSVGDocument()) {
-        // FIXME: does SVG have a title text direction?
-        document().setTitleElement(StringWithDirection(textContent(), LTR), this);
-    }
</del><ins>+    if (firstChild() &amp;&amp; document().isSVGDocument())
+        document().titleElementAdded(*this);
</ins><span class="cx">     return InsertionDone;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -54,16 +52,13 @@
</span><span class="cx"> {
</span><span class="cx">     SVGElement::removedFrom(rootParent);
</span><span class="cx">     if (rootParent.inDocument() &amp;&amp; document().isSVGDocument())
</span><del>-        document().removeTitle(this);
</del><ins>+        document().titleElementRemoved(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SVGTitleElement::childrenChanged(const ChildChange&amp; change)
</span><span class="cx"> {
</span><span class="cx">     SVGElement::childrenChanged(change);
</span><del>-    if (inDocument() &amp;&amp; document().isSVGDocument()) {
-        // FIXME: does SVG have title text direction?
-        document().setTitleElement(StringWithDirection(textContent(), LTR), this);
-    }
</del><ins>+    document().titleElementTextChanged(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>