Title: [189787] releases/WebKitGTK/webkit-2.10
Revision
189787
Author
carlo...@webkit.org
Date
2015-09-15 00:38:08 -0700 (Tue, 15 Sep 2015)

Log Message

Merge r189555 - Setting document.title when there is no title and no head element should no nothing
https://bugs.webkit.org/show_bug.cgi?id=149005
<rdar://problem/22567524>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline 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:

Setting document.title when there is no title element and no head
element should no nothing:
- https://html.spec.whatwg.org/multipage/dom.html#document.title

Firefox and Chrome comply with the specification. However, WebKit
was returning the updated title when querying document.title after
setting it.

No new tests, covered by existing tests.

* dom/Document.cpp:
(WebCore::Document::setTitle):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/imported/w3c/ChangeLog (189786 => 189787)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/imported/w3c/ChangeLog	2015-09-15 07:33:13 UTC (rev 189786)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/imported/w3c/ChangeLog	2015-09-15 07:38:08 UTC (rev 189787)
@@ -1,3 +1,16 @@
+2015-09-09  Chris Dumez  <cdu...@apple.com>
+
+        Setting document.title when there is no title and no head element should no nothing
+        https://bugs.webkit.org/show_bug.cgi?id=149005
+        <rdar://problem/22567524>
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaseline 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-08  Chris Dumez  <cdu...@apple.com>
 
         document.importNode(node, deep): deep's default value should be false

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (189786 => 189787)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-09-15 07:33:13 UTC (rev 189786)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-09-15 07:38:08 UTC (rev 189787)
@@ -1,3 +1,24 @@
+2015-09-09  Chris Dumez  <cdu...@apple.com>
+
+        Setting document.title when there is no title and no head element should no nothing
+        https://bugs.webkit.org/show_bug.cgi?id=149005
+        <rdar://problem/22567524>
+
+        Reviewed by Ryosuke Niwa.
+
+        Setting document.title when there is no title element and no head
+        element should no nothing:
+        - https://html.spec.whatwg.org/multipage/dom.html#document.title
+
+        Firefox and Chrome comply with the specification. However, WebKit
+        was returning the updated title when querying document.title after
+        setting it.
+
+        No new tests, covered by existing tests.
+
+        * dom/Document.cpp:
+        (WebCore::Document::setTitle):
+
 2015-09-08  David Hyatt  <hy...@apple.com>
 
         REGRESSION: Inline-block baseline is wrong when zero-width replaced child is present

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp (189786 => 189787)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp	2015-09-15 07:33:13 UTC (rev 189786)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp	2015-09-15 07:38:08 UTC (rev 189787)
@@ -1533,10 +1533,11 @@
     if (!isHTMLDocument() && !isXHTMLDocument())
         m_titleElement = nullptr;
     else if (!m_titleElement) {
-        if (HTMLElement* headElement = head()) {
-            m_titleElement = createElement(titleTag, false);
-            headElement->appendChild(m_titleElement, ASSERT_NO_EXCEPTION);
-        }
+        auto* headElement = head();
+        if (!headElement)
+            return;
+        m_titleElement = createElement(titleTag, false);
+        headElement->appendChild(m_titleElement, ASSERT_NO_EXCEPTION);
     }
 
     // The DOM API has no method of specifying direction, so assume LTR.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to