| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 #include "core/page/MouseEventWithHitTestResults.h" | 144 #include "core/page/MouseEventWithHitTestResults.h" |
| 145 #include "core/page/Page.h" | 145 #include "core/page/Page.h" |
| 146 #include "core/page/PageConsole.h" | 146 #include "core/page/PageConsole.h" |
| 147 #include "core/page/PointerLockController.h" | 147 #include "core/page/PointerLockController.h" |
| 148 #include "core/page/Settings.h" | 148 #include "core/page/Settings.h" |
| 149 #include "core/page/animation/AnimationController.h" | 149 #include "core/page/animation/AnimationController.h" |
| 150 #include "core/page/scrolling/ScrollingCoordinator.h" | 150 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 151 #include "core/platform/DateComponents.h" | 151 #include "core/platform/DateComponents.h" |
| 152 #include "core/platform/HistogramSupport.h" | 152 #include "core/platform/HistogramSupport.h" |
| 153 #include "core/platform/Language.h" | 153 #include "core/platform/Language.h" |
| 154 #include "core/platform/ScrollbarTheme.h" |
| 154 #include "core/platform/Timer.h" | 155 #include "core/platform/Timer.h" |
| 155 #include "core/platform/chromium/TraceEvent.h" | 156 #include "core/platform/chromium/TraceEvent.h" |
| 156 #include "core/platform/network/HTTPParsers.h" | 157 #include "core/platform/network/HTTPParsers.h" |
| 157 #include "core/platform/text/PlatformLocale.h" | 158 #include "core/platform/text/PlatformLocale.h" |
| 158 #include "core/platform/text/SegmentedString.h" | 159 #include "core/platform/text/SegmentedString.h" |
| 159 #include "core/rendering/HitTestRequest.h" | 160 #include "core/rendering/HitTestRequest.h" |
| 160 #include "core/rendering/HitTestResult.h" | 161 #include "core/rendering/HitTestResult.h" |
| 161 #include "core/rendering/RenderView.h" | 162 #include "core/rendering/RenderView.h" |
| 162 #include "core/rendering/RenderWidget.h" | 163 #include "core/rendering/RenderWidget.h" |
| 163 #include "core/rendering/TextAutosizer.h" | 164 #include "core/rendering/TextAutosizer.h" |
| (...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1745 oe->document()->updateLayout(); | 1746 oe->document()->updateLayout(); |
| 1746 | 1747 |
| 1747 updateStyleIfNeeded(); | 1748 updateStyleIfNeeded(); |
| 1748 | 1749 |
| 1749 StackStats::LayoutCheckPoint layoutCheckPoint; | 1750 StackStats::LayoutCheckPoint layoutCheckPoint; |
| 1750 | 1751 |
| 1751 // Only do a layout if changes have occurred that make it necessary. | 1752 // Only do a layout if changes have occurred that make it necessary. |
| 1752 if (frameView && renderer() && (frameView->layoutPending() || renderer()->ne
edsLayout())) | 1753 if (frameView && renderer() && (frameView->layoutPending() || renderer()->ne
edsLayout())) |
| 1753 frameView->layout(); | 1754 frameView->layout(); |
| 1754 | 1755 |
| 1756 if (frameView) |
| 1757 frameView->resetPartialLayoutState(); |
| 1758 |
| 1755 setNeedsFocusedElementCheck(); | 1759 setNeedsFocusedElementCheck(); |
| 1756 } | 1760 } |
| 1757 | 1761 |
| 1758 void Document::setNeedsFocusedElementCheck() | 1762 void Document::setNeedsFocusedElementCheck() |
| 1759 { | 1763 { |
| 1760 // FIXME: Using a Task doesn't look a good idea. | 1764 // FIXME: Using a Task doesn't look a good idea. |
| 1761 if (!m_focusedElement || m_didPostCheckFocusedElementTask) | 1765 if (!m_focusedElement || m_didPostCheckFocusedElementTask) |
| 1762 return; | 1766 return; |
| 1763 postTask(CheckFocusedElementTask::create()); | 1767 postTask(CheckFocusedElementTask::create()); |
| 1764 m_didPostCheckFocusedElementTask = true; | 1768 m_didPostCheckFocusedElementTask = true; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1791 // may not have had their real style calculated yet. Normally this g
ets cleaned when style sheets arrive | 1795 // may not have had their real style calculated yet. Normally this g
ets cleaned when style sheets arrive |
| 1792 // but here we need up-to-date style immediately. | 1796 // but here we need up-to-date style immediately. |
| 1793 recalcStyle(Force); | 1797 recalcStyle(Force); |
| 1794 } | 1798 } |
| 1795 | 1799 |
| 1796 updateLayout(); | 1800 updateLayout(); |
| 1797 | 1801 |
| 1798 m_ignorePendingStylesheets = oldIgnore; | 1802 m_ignorePendingStylesheets = oldIgnore; |
| 1799 } | 1803 } |
| 1800 | 1804 |
| 1805 void Document::tryPartialUpdateLayoutIgnorePendingStylesheets(RenderObject* stop
LayoutAtRenderer) |
| 1806 { |
| 1807 if (stopLayoutAtRenderer) { |
| 1808 // Non-overlay scrollbars can cause layout during layout. |
| 1809 // FIXME: Temporarily ignore non-overlay scrollbars for test coverage. |
| 1810 if (true || ScrollbarTheme::theme()->usesOverlayScrollbars()) { |
| 1811 // FIXME: Text autosizing will not work with partial layout. |
| 1812 bool canPartialLayout = true; |
| 1813 RenderObject* renderer = stopLayoutAtRenderer; |
| 1814 do { |
| 1815 if (!renderer->supportsPartialLayout()) { |
| 1816 canPartialLayout = false; |
| 1817 break; |
| 1818 } |
| 1819 } while ((renderer = renderer->parent())); |
| 1820 if (canPartialLayout) |
| 1821 view()->setStopLayoutAtRenderer(stopLayoutAtRenderer); |
| 1822 } |
| 1823 } |
| 1824 |
| 1825 updateLayoutIgnorePendingStylesheets(); |
| 1826 } |
| 1827 |
| 1801 PassRefPtr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Elem
ent* element) | 1828 PassRefPtr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Elem
ent* element) |
| 1802 { | 1829 { |
| 1803 ASSERT_ARG(element, element->document() == this); | 1830 ASSERT_ARG(element, element->document() == this); |
| 1804 TemporaryChange<bool> ignoreStyleSheets(m_ignorePendingStylesheets, true); | 1831 TemporaryChange<bool> ignoreStyleSheets(m_ignorePendingStylesheets, true); |
| 1805 return styleResolver()->styleForElement(element, element->parentNode() ? ele
ment->parentNode()->computedStyle() : 0); | 1832 return styleResolver()->styleForElement(element, element->parentNode() ? ele
ment->parentNode()->computedStyle() : 0); |
| 1806 } | 1833 } |
| 1807 | 1834 |
| 1808 PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex) | 1835 PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex) |
| 1809 { | 1836 { |
| 1810 return styleResolver()->styleForPage(pageIndex); | 1837 return styleResolver()->styleForPage(pageIndex); |
| (...skipping 3413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5224 { | 5251 { |
| 5225 return DocumentLifecycleNotifier::create(this); | 5252 return DocumentLifecycleNotifier::create(this); |
| 5226 } | 5253 } |
| 5227 | 5254 |
| 5228 DocumentLifecycleNotifier* Document::lifecycleNotifier() | 5255 DocumentLifecycleNotifier* Document::lifecycleNotifier() |
| 5229 { | 5256 { |
| 5230 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec
ycleNotifier()); | 5257 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec
ycleNotifier()); |
| 5231 } | 5258 } |
| 5232 | 5259 |
| 5233 } // namespace WebCore | 5260 } // namespace WebCore |
| OLD | NEW |