| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 else if (m_rawTitle.is8Bit()) | 1287 else if (m_rawTitle.is8Bit()) |
| 1288 m_title = canonicalizedTitle<LChar>(this, m_rawTitle); | 1288 m_title = canonicalizedTitle<LChar>(this, m_rawTitle); |
| 1289 else | 1289 else |
| 1290 m_title = canonicalizedTitle<UChar>(this, m_rawTitle); | 1290 m_title = canonicalizedTitle<UChar>(this, m_rawTitle); |
| 1291 | 1291 |
| 1292 if (!m_frame || oldTitle == m_title) | 1292 if (!m_frame || oldTitle == m_title) |
| 1293 return; | 1293 return; |
| 1294 m_frame->loader().client()->dispatchDidReceiveTitle(m_title); | 1294 m_frame->loader().client()->dispatchDidReceiveTitle(m_title); |
| 1295 } | 1295 } |
| 1296 | 1296 |
| 1297 // http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#document
.title | |
| 1298 void Document::setTitle(const String& title) | 1297 void Document::setTitle(const String& title) |
| 1299 { | 1298 { |
| 1299 // Title set by JavaScript -- overrides any title elements. |
| 1300 m_titleSetExplicitly = true; |
| 1300 if (!isHTMLDocument() && !isXHTMLDocument()) | 1301 if (!isHTMLDocument() && !isXHTMLDocument()) |
| 1301 m_titleElement = 0; | 1302 m_titleElement = 0; |
| 1302 else if (!m_titleElement) { | 1303 else if (!m_titleElement) { |
| 1303 if (HTMLElement* headElement = head()) { | 1304 if (HTMLElement* headElement = head()) { |
| 1304 m_titleElement = createElement(titleTag, false); | 1305 m_titleElement = createElement(titleTag, false); |
| 1305 headElement->appendChild(m_titleElement); | 1306 headElement->appendChild(m_titleElement); |
| 1306 } else { | |
| 1307 // "If the title element is null and the head element is null, then
the attribute must do nothing." | |
| 1308 return; | |
| 1309 } | 1307 } |
| 1310 } | 1308 } |
| 1311 m_titleSetExplicitly = true; | |
| 1312 | 1309 |
| 1313 if (m_titleElement) | 1310 if (m_titleElement) |
| 1314 m_titleElement->removeChildren(); | 1311 m_titleElement->removeChildren(); |
| 1315 | 1312 |
| 1316 updateTitle(title); | 1313 updateTitle(title); |
| 1317 | 1314 |
| 1318 if (m_titleElement && m_titleElement->hasTagName(titleTag)) | 1315 if (m_titleElement && m_titleElement->hasTagName(titleTag)) |
| 1319 toHTMLTitleElement(m_titleElement)->setText(title); | 1316 toHTMLTitleElement(m_titleElement)->setText(title); |
| 1320 } | 1317 } |
| 1321 | 1318 |
| (...skipping 3949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5271 } | 5268 } |
| 5272 | 5269 |
| 5273 FastTextAutosizer* Document::fastTextAutosizer() | 5270 FastTextAutosizer* Document::fastTextAutosizer() |
| 5274 { | 5271 { |
| 5275 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable
d()) | 5272 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable
d()) |
| 5276 m_fastTextAutosizer = FastTextAutosizer::create(this); | 5273 m_fastTextAutosizer = FastTextAutosizer::create(this); |
| 5277 return m_fastTextAutosizer.get(); | 5274 return m_fastTextAutosizer.get(); |
| 5278 } | 5275 } |
| 5279 | 5276 |
| 5280 } // namespace WebCore | 5277 } // namespace WebCore |
| OLD | NEW |