Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: Source/core/dom/Document.cpp

Issue 98373012: Don't set document.title when there is no <head> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/document-set-title-no-head-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 520a1547d5abf3e66f7469cfed58e0816a0c26c1..c4401be4da5428b00d3e0cf1dc53bf1a67c4641b 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1300,18 +1300,21 @@ void Document::updateTitle(const String& title)
m_frame->loader().client()->dispatchDidReceiveTitle(m_title);
}
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#document.title
davve 2013/12/20 14:39:13 I'm a bit unsure about adding this line. It's usef
jochen (gone - plz use gerrit) 2014/01/03 11:04:45 I think it's fine to leave this in
void Document::setTitle(const String& title)
{
- // Title set by JavaScript -- overrides any title elements.
- m_titleSetExplicitly = true;
if (!isHTMLDocument() && !isXHTMLDocument())
m_titleElement = 0;
else if (!m_titleElement) {
if (HTMLElement* headElement = head()) {
m_titleElement = createElement(titleTag, false);
headElement->appendChild(m_titleElement);
+ } else {
+ // "If the title element is null and the head element is null, then the attribute must do nothing."
+ return;
}
}
+ m_titleSetExplicitly = true;
if (m_titleElement)
m_titleElement->removeChildren();
« no previous file with comments | « LayoutTests/fast/dom/document-set-title-no-head-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698