| 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 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1869 } | 1869 } |
| 1870 | 1870 |
| 1871 void Document::setNeedsFocusedElementCheck() | 1871 void Document::setNeedsFocusedElementCheck() |
| 1872 { | 1872 { |
| 1873 setNeedsStyleRecalc(LocalStyleChange); | 1873 setNeedsStyleRecalc(LocalStyleChange); |
| 1874 } | 1874 } |
| 1875 | 1875 |
| 1876 void Document::clearFocusedElementSoon() | 1876 void Document::clearFocusedElementSoon() |
| 1877 { | 1877 { |
| 1878 if (!m_clearFocusedElementTimer.isActive()) | 1878 if (!m_clearFocusedElementTimer.isActive()) |
| 1879 m_clearFocusedElementTimer.startOneShot(0); | 1879 m_clearFocusedElementTimer.startOneShot(0, FROM_HERE); |
| 1880 } | 1880 } |
| 1881 | 1881 |
| 1882 void Document::clearFocusedElementTimerFired(Timer<Document>*) | 1882 void Document::clearFocusedElementTimerFired(Timer<Document>*) |
| 1883 { | 1883 { |
| 1884 updateStyleIfNeeded(); | 1884 updateStyleIfNeeded(); |
| 1885 m_clearFocusedElementTimer.stop(); | 1885 m_clearFocusedElementTimer.stop(); |
| 1886 | 1886 |
| 1887 if (m_focusedElement && !m_focusedElement->isFocusable()) | 1887 if (m_focusedElement && !m_focusedElement->isFocusable()) |
| 1888 setFocusedElement(nullptr); | 1888 setFocusedElement(nullptr); |
| 1889 } | 1889 } |
| (...skipping 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4443 | 4443 |
| 4444 f->loader().finishedParsing(); | 4444 f->loader().finishedParsing(); |
| 4445 | 4445 |
| 4446 InspectorInstrumentation::domContentLoadedEventFired(f.get()); | 4446 InspectorInstrumentation::domContentLoadedEventFired(f.get()); |
| 4447 } | 4447 } |
| 4448 | 4448 |
| 4449 // Schedule dropping of the ElementDataCache. We keep it alive for a while a
fter parsing finishes | 4449 // Schedule dropping of the ElementDataCache. We keep it alive for a while a
fter parsing finishes |
| 4450 // so that dynamically inserted content can also benefit from sharing optimi
zations. | 4450 // so that dynamically inserted content can also benefit from sharing optimi
zations. |
| 4451 // Note that we don't refresh the timer on cache access since that could lea
d to huge caches being kept | 4451 // Note that we don't refresh the timer on cache access since that could lea
d to huge caches being kept |
| 4452 // alive indefinitely by something innocuous like JS setting .innerHTML repe
atedly on a timer. | 4452 // alive indefinitely by something innocuous like JS setting .innerHTML repe
atedly on a timer. |
| 4453 m_elementDataCacheClearTimer.startOneShot(10); | 4453 m_elementDataCacheClearTimer.startOneShot(10, FROM_HERE); |
| 4454 | 4454 |
| 4455 // Parser should have picked up all preloads by now | 4455 // Parser should have picked up all preloads by now |
| 4456 m_fetcher->clearPreloads(); | 4456 m_fetcher->clearPreloads(); |
| 4457 | 4457 |
| 4458 if (m_import) | 4458 if (m_import) |
| 4459 m_import->didFinishParsing(); | 4459 m_import->didFinishParsing(); |
| 4460 } | 4460 } |
| 4461 | 4461 |
| 4462 void Document::elementDataCacheClearTimerFired(Timer<Document>*) | 4462 void Document::elementDataCacheClearTimerFired(Timer<Document>*) |
| 4463 { | 4463 { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4675 | 4675 |
| 4676 bool Document::isContextThread() const | 4676 bool Document::isContextThread() const |
| 4677 { | 4677 { |
| 4678 return isMainThread(); | 4678 return isMainThread(); |
| 4679 } | 4679 } |
| 4680 | 4680 |
| 4681 void Document::updateFocusAppearanceSoon(bool restorePreviousSelection) | 4681 void Document::updateFocusAppearanceSoon(bool restorePreviousSelection) |
| 4682 { | 4682 { |
| 4683 m_updateFocusAppearanceRestoresSelection = restorePreviousSelection; | 4683 m_updateFocusAppearanceRestoresSelection = restorePreviousSelection; |
| 4684 if (!m_updateFocusAppearanceTimer.isActive()) | 4684 if (!m_updateFocusAppearanceTimer.isActive()) |
| 4685 m_updateFocusAppearanceTimer.startOneShot(0); | 4685 m_updateFocusAppearanceTimer.startOneShot(0, FROM_HERE); |
| 4686 } | 4686 } |
| 4687 | 4687 |
| 4688 void Document::cancelFocusAppearanceUpdate() | 4688 void Document::cancelFocusAppearanceUpdate() |
| 4689 { | 4689 { |
| 4690 m_updateFocusAppearanceTimer.stop(); | 4690 m_updateFocusAppearanceTimer.stop(); |
| 4691 } | 4691 } |
| 4692 | 4692 |
| 4693 void Document::updateFocusAppearanceTimerFired(Timer<Document>*) | 4693 void Document::updateFocusAppearanceTimerFired(Timer<Document>*) |
| 4694 { | 4694 { |
| 4695 Element* element = focusedElement(); | 4695 Element* element = focusedElement(); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4910 } | 4910 } |
| 4911 return 0; | 4911 return 0; |
| 4912 } | 4912 } |
| 4913 | 4913 |
| 4914 void Document::decrementLoadEventDelayCount() | 4914 void Document::decrementLoadEventDelayCount() |
| 4915 { | 4915 { |
| 4916 ASSERT(m_loadEventDelayCount); | 4916 ASSERT(m_loadEventDelayCount); |
| 4917 --m_loadEventDelayCount; | 4917 --m_loadEventDelayCount; |
| 4918 | 4918 |
| 4919 if (frame() && !m_loadEventDelayCount && !m_loadEventDelayTimer.isActive()) | 4919 if (frame() && !m_loadEventDelayCount && !m_loadEventDelayTimer.isActive()) |
| 4920 m_loadEventDelayTimer.startOneShot(0); | 4920 m_loadEventDelayTimer.startOneShot(0, FROM_HERE); |
| 4921 } | 4921 } |
| 4922 | 4922 |
| 4923 void Document::loadEventDelayTimerFired(Timer<Document>*) | 4923 void Document::loadEventDelayTimerFired(Timer<Document>*) |
| 4924 { | 4924 { |
| 4925 if (frame()) | 4925 if (frame()) |
| 4926 frame()->loader().checkCompleted(); | 4926 frame()->loader().checkCompleted(); |
| 4927 } | 4927 } |
| 4928 | 4928 |
| 4929 void Document::loadPluginsSoon() | 4929 void Document::loadPluginsSoon() |
| 4930 { | 4930 { |
| 4931 // FIXME: Remove this timer once we don't need to compute layout to load plu
gins. | 4931 // FIXME: Remove this timer once we don't need to compute layout to load plu
gins. |
| 4932 if (!m_pluginLoadingTimer.isActive()) | 4932 if (!m_pluginLoadingTimer.isActive()) |
| 4933 m_pluginLoadingTimer.startOneShot(0); | 4933 m_pluginLoadingTimer.startOneShot(0, FROM_HERE); |
| 4934 } | 4934 } |
| 4935 | 4935 |
| 4936 void Document::pluginLoadingTimerFired(Timer<Document>*) | 4936 void Document::pluginLoadingTimerFired(Timer<Document>*) |
| 4937 { | 4937 { |
| 4938 updateLayout(); | 4938 updateLayout(); |
| 4939 } | 4939 } |
| 4940 | 4940 |
| 4941 ScriptedAnimationController& Document::ensureScriptedAnimationController() | 4941 ScriptedAnimationController& Document::ensureScriptedAnimationController() |
| 4942 { | 4942 { |
| 4943 if (!m_scriptedAnimationController) { | 4943 if (!m_scriptedAnimationController) { |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5338 | 5338 |
| 5339 return *m_templateDocument.get(); | 5339 return *m_templateDocument.get(); |
| 5340 } | 5340 } |
| 5341 | 5341 |
| 5342 void Document::didAssociateFormControl(Element* element) | 5342 void Document::didAssociateFormControl(Element* element) |
| 5343 { | 5343 { |
| 5344 if (!frame() || !frame()->page()) | 5344 if (!frame() || !frame()->page()) |
| 5345 return; | 5345 return; |
| 5346 m_associatedFormControls.add(element); | 5346 m_associatedFormControls.add(element); |
| 5347 if (!m_didAssociateFormControlsTimer.isActive()) | 5347 if (!m_didAssociateFormControlsTimer.isActive()) |
| 5348 m_didAssociateFormControlsTimer.startOneShot(0); | 5348 m_didAssociateFormControlsTimer.startOneShot(0, FROM_HERE); |
| 5349 } | 5349 } |
| 5350 | 5350 |
| 5351 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) | 5351 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) |
| 5352 { | 5352 { |
| 5353 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer); | 5353 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer); |
| 5354 if (!frame() || !frame()->page()) | 5354 if (!frame() || !frame()->page()) |
| 5355 return; | 5355 return; |
| 5356 | 5356 |
| 5357 Vector<RefPtr<Element> > associatedFormControls; | 5357 Vector<RefPtr<Element> > associatedFormControls; |
| 5358 copyToVector(m_associatedFormControls, associatedFormControls); | 5358 copyToVector(m_associatedFormControls, associatedFormControls); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5484 } | 5484 } |
| 5485 | 5485 |
| 5486 void Document::invalidateNodeListCaches(const QualifiedName* attrName) | 5486 void Document::invalidateNodeListCaches(const QualifiedName* attrName) |
| 5487 { | 5487 { |
| 5488 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end(
); | 5488 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end(
); |
| 5489 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument.
begin(); it != end; ++it) | 5489 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument.
begin(); it != end; ++it) |
| 5490 (*it)->invalidateCache(attrName); | 5490 (*it)->invalidateCache(attrName); |
| 5491 } | 5491 } |
| 5492 | 5492 |
| 5493 } // namespace WebCore | 5493 } // namespace WebCore |
| OLD | NEW |