Chromium Code Reviews| 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(); |