| 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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1269 --builderIndex; | 1269 --builderIndex; |
| 1270 if (buffer[builderIndex] != ' ') | 1270 if (buffer[builderIndex] != ' ') |
| 1271 break; | 1271 break; |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 if (!builderIndex && buffer[builderIndex] == ' ') | 1274 if (!builderIndex && buffer[builderIndex] == ' ') |
| 1275 return String(); | 1275 return String(); |
| 1276 | 1276 |
| 1277 buffer.shrink(builderIndex + 1); | 1277 buffer.shrink(builderIndex + 1); |
| 1278 | 1278 |
| 1279 // Replace the backslashes with currency symbols if the encoding requires it
. | |
| 1280 document->displayBufferModifiedByEncoding(buffer.characters(), buffer.length
()); | |
| 1281 | |
| 1282 return String::adopt(buffer); | 1279 return String::adopt(buffer); |
| 1283 } | 1280 } |
| 1284 | 1281 |
| 1285 void Document::updateTitle(const String& title) | 1282 void Document::updateTitle(const String& title) |
| 1286 { | 1283 { |
| 1287 if (m_rawTitle == title) | 1284 if (m_rawTitle == title) |
| 1288 return; | 1285 return; |
| 1289 | 1286 |
| 1290 m_rawTitle = title; | 1287 m_rawTitle = title; |
| 1291 | 1288 |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2412 if (!beforeUnloadEvent->defaultPrevented()) | 2409 if (!beforeUnloadEvent->defaultPrevented()) |
| 2413 defaultEventHandler(beforeUnloadEvent.get()); | 2410 defaultEventHandler(beforeUnloadEvent.get()); |
| 2414 if (beforeUnloadEvent->returnValue().isNull()) | 2411 if (beforeUnloadEvent->returnValue().isNull()) |
| 2415 return true; | 2412 return true; |
| 2416 | 2413 |
| 2417 if (navigatingDocument->m_didAllowNavigationViaBeforeUnloadConfirmationPanel
) { | 2414 if (navigatingDocument->m_didAllowNavigationViaBeforeUnloadConfirmationPanel
) { |
| 2418 addConsoleMessage(JSMessageSource, ErrorMessageLevel, "Blocked attempt t
o show multiple 'beforeunload' confirmation panels for a single navigation."); | 2415 addConsoleMessage(JSMessageSource, ErrorMessageLevel, "Blocked attempt t
o show multiple 'beforeunload' confirmation panels for a single navigation."); |
| 2419 return true; | 2416 return true; |
| 2420 } | 2417 } |
| 2421 | 2418 |
| 2422 String text = displayStringModifiedByEncoding(beforeUnloadEvent->returnValue
()); | 2419 String text = beforeUnloadEvent->returnValue(); |
| 2423 if (chrome.runBeforeUnloadConfirmPanel(text, m_frame)) { | 2420 if (chrome.runBeforeUnloadConfirmPanel(text, m_frame)) { |
| 2424 navigatingDocument->m_didAllowNavigationViaBeforeUnloadConfirmationPanel
= true; | 2421 navigatingDocument->m_didAllowNavigationViaBeforeUnloadConfirmationPanel
= true; |
| 2425 return true; | 2422 return true; |
| 2426 } | 2423 } |
| 2427 return false; | 2424 return false; |
| 2428 } | 2425 } |
| 2429 | 2426 |
| 2430 void Document::dispatchUnloadEvents() | 2427 void Document::dispatchUnloadEvents() |
| 2431 { | 2428 { |
| 2432 RefPtr<Document> protect(this); | 2429 RefPtr<Document> protect(this); |
| (...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4743 if (m_scriptedAnimationController) | 4740 if (m_scriptedAnimationController) |
| 4744 m_scriptedAnimationController->suspend(); | 4741 m_scriptedAnimationController->suspend(); |
| 4745 } | 4742 } |
| 4746 | 4743 |
| 4747 void Document::resumeScriptedAnimationControllerCallbacks() | 4744 void Document::resumeScriptedAnimationControllerCallbacks() |
| 4748 { | 4745 { |
| 4749 if (m_scriptedAnimationController) | 4746 if (m_scriptedAnimationController) |
| 4750 m_scriptedAnimationController->resume(); | 4747 m_scriptedAnimationController->resume(); |
| 4751 } | 4748 } |
| 4752 | 4749 |
| 4753 String Document::displayStringModifiedByEncoding(const String& str) const | |
| 4754 { | |
| 4755 if (m_decoder) | |
| 4756 return m_decoder->encoding().displayString(str.impl()); | |
| 4757 return str; | |
| 4758 } | |
| 4759 | |
| 4760 PassRefPtr<StringImpl> Document::displayStringModifiedByEncoding(PassRefPtr<Stri
ngImpl> str) const | |
| 4761 { | |
| 4762 if (m_decoder) | |
| 4763 return m_decoder->encoding().displayString(str); | |
| 4764 return str; | |
| 4765 } | |
| 4766 | |
| 4767 template <typename CharacterType> | |
| 4768 void Document::displayBufferModifiedByEncodingInternal(CharacterType* buffer, un
signed len) const | |
| 4769 { | |
| 4770 if (m_decoder) | |
| 4771 m_decoder->encoding().displayBuffer(buffer, len); | |
| 4772 } | |
| 4773 | |
| 4774 // Generate definitions for both character types | |
| 4775 template void Document::displayBufferModifiedByEncodingInternal<LChar>(LChar*, u
nsigned) const; | |
| 4776 template void Document::displayBufferModifiedByEncodingInternal<UChar>(UChar*, u
nsigned) const; | |
| 4777 | |
| 4778 void Document::enqueuePageshowEvent(PageshowEventPersistence persisted) | 4750 void Document::enqueuePageshowEvent(PageshowEventPersistence persisted) |
| 4779 { | 4751 { |
| 4780 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36334 Pageshow event needs
to fire asynchronously. | 4752 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36334 Pageshow event needs
to fire asynchronously. |
| 4781 dispatchWindowEvent(PageTransitionEvent::create(EventTypeNames::pageshow, pe
rsisted), this); | 4753 dispatchWindowEvent(PageTransitionEvent::create(EventTypeNames::pageshow, pe
rsisted), this); |
| 4782 } | 4754 } |
| 4783 | 4755 |
| 4784 void Document::enqueueHashchangeEvent(const String& oldURL, const String& newURL
) | 4756 void Document::enqueueHashchangeEvent(const String& oldURL, const String& newURL
) |
| 4785 { | 4757 { |
| 4786 enqueueWindowEvent(HashChangeEvent::create(oldURL, newURL)); | 4758 enqueueWindowEvent(HashChangeEvent::create(oldURL, newURL)); |
| 4787 } | 4759 } |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5297 { | 5269 { |
| 5298 return DocumentLifecycleNotifier::create(this); | 5270 return DocumentLifecycleNotifier::create(this); |
| 5299 } | 5271 } |
| 5300 | 5272 |
| 5301 DocumentLifecycleNotifier* Document::lifecycleNotifier() | 5273 DocumentLifecycleNotifier* Document::lifecycleNotifier() |
| 5302 { | 5274 { |
| 5303 return static_cast<DocumentLifecycleNotifier*>(ExecutionContext::lifecycleNo
tifier()); | 5275 return static_cast<DocumentLifecycleNotifier*>(ExecutionContext::lifecycleNo
tifier()); |
| 5304 } | 5276 } |
| 5305 | 5277 |
| 5306 } // namespace WebCore | 5278 } // namespace WebCore |
| OLD | NEW |