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

Side by Side Diff: Source/WebCore/dom/Document.cpp

Issue 10957065: Merge 129270 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5750 matching lines...) Expand 10 before | Expand all | Expand 10 after
5761 if (!m_fullScreenRenderer) 5761 if (!m_fullScreenRenderer)
5762 return; 5762 return;
5763 5763
5764 RefPtr<RenderStyle> newStyle = RenderStyle::clone(m_fullScreenRenderer->styl e()); 5764 RefPtr<RenderStyle> newStyle = RenderStyle::clone(m_fullScreenRenderer->styl e());
5765 newStyle->setBackgroundColor(backgroundColor); 5765 newStyle->setBackgroundColor(backgroundColor);
5766 m_fullScreenRenderer->setStyle(newStyle); 5766 m_fullScreenRenderer->setStyle(newStyle);
5767 } 5767 }
5768 5768
5769 void Document::fullScreenChangeDelayTimerFired(Timer<Document>*) 5769 void Document::fullScreenChangeDelayTimerFired(Timer<Document>*)
5770 { 5770 {
5771 // Since we dispatch events in this function, it's possible that the
5772 // document will be detached and GC'd. We protect it here to make sure we
5773 // can finish the function successfully.
5774 RefPtr<Document> protectDocument(this);
5771 Deque<RefPtr<Node> > changeQueue; 5775 Deque<RefPtr<Node> > changeQueue;
5772 m_fullScreenChangeEventTargetQueue.swap(changeQueue); 5776 m_fullScreenChangeEventTargetQueue.swap(changeQueue);
5773 5777
5774 while (!changeQueue.isEmpty()) { 5778 while (!changeQueue.isEmpty()) {
5775 RefPtr<Node> node = changeQueue.takeFirst(); 5779 RefPtr<Node> node = changeQueue.takeFirst();
5776 if (!node) 5780 if (!node)
5777 node = documentElement(); 5781 node = documentElement();
5782 // The dispatchEvent below may have blown away our documentElement.
5783 if (!node)
5784 continue;
5778 5785
5779 // If the element was removed from our tree, also message the documentEl ement. Since we may 5786 // If the element was removed from our tree, also message the documentEl ement. Since we may
5780 // have a document hierarchy, check that node isn't in another document. 5787 // have a document hierarchy, check that node isn't in another document.
5781 if (!contains(node.get()) && !node->inDocument()) 5788 if (!contains(node.get()) && !node->inDocument())
5782 changeQueue.append(documentElement()); 5789 changeQueue.append(documentElement());
5783 5790
5784 node->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEve nt, true, false)); 5791 node->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEve nt, true, false));
5785 } 5792 }
5786 5793
5787 Deque<RefPtr<Node> > errorQueue; 5794 Deque<RefPtr<Node> > errorQueue;
5788 m_fullScreenErrorEventTargetQueue.swap(errorQueue); 5795 m_fullScreenErrorEventTargetQueue.swap(errorQueue);
5789 5796
5790 while (!errorQueue.isEmpty()) { 5797 while (!errorQueue.isEmpty()) {
5791 RefPtr<Node> node = errorQueue.takeFirst(); 5798 RefPtr<Node> node = errorQueue.takeFirst();
5792 if (!node) 5799 if (!node)
5793 node = documentElement(); 5800 node = documentElement();
5801 // The dispatchEvent below may have blown away our documentElement.
5802 if (!node)
5803 continue;
5794 5804
5795 // If the element was removed from our tree, also message the documentEl ement. Since we may 5805 // If the element was removed from our tree, also message the documentEl ement. Since we may
5796 // have a document hierarchy, check that node isn't in another document. 5806 // have a document hierarchy, check that node isn't in another document.
5797 if (!contains(node.get()) && !node->inDocument()) 5807 if (!contains(node.get()) && !node->inDocument())
5798 errorQueue.append(documentElement()); 5808 errorQueue.append(documentElement());
5799 5809
5800 node->dispatchEvent(Event::create(eventNames().webkitfullscreenerrorEven t, true, false)); 5810 node->dispatchEvent(Event::create(eventNames().webkitfullscreenerrorEven t, true, false));
5801 } 5811 }
5802 } 5812 }
5803 5813
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
6378 AtomicString localeKey = locale; 6388 AtomicString localeKey = locale;
6379 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr olUIEnabled()) 6389 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr olUIEnabled())
6380 localeKey = defaultLanguage(); 6390 localeKey = defaultLanguage();
6381 LocaleToLocalizerMap::AddResult result = m_localizerCache.add(localeKey, nul lptr); 6391 LocaleToLocalizerMap::AddResult result = m_localizerCache.add(localeKey, nul lptr);
6382 if (result.isNewEntry) 6392 if (result.isNewEntry)
6383 result.iterator->second = Localizer::create(localeKey); 6393 result.iterator->second = Localizer::create(localeKey);
6384 return *(result.iterator->second); 6394 return *(result.iterator->second);
6385 } 6395 }
6386 6396
6387 } // namespace WebCore 6397 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698