| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 // This can return true in cases where the document does not have a body yet
. | 1872 // This can return true in cases where the document does not have a body yet
. |
| 1873 // Document::shouldScheduleLayout takes care of preventing us from schedulin
g | 1873 // Document::shouldScheduleLayout takes care of preventing us from schedulin
g |
| 1874 // layout in that case. | 1874 // layout in that case. |
| 1875 | 1875 |
| 1876 LayoutViewItem layoutViewItem = this->layoutViewItem(); | 1876 LayoutViewItem layoutViewItem = this->layoutViewItem(); |
| 1877 return layoutPending() | 1877 return layoutPending() |
| 1878 || (!layoutViewItem.isNull() && layoutViewItem.needsLayout()) | 1878 || (!layoutViewItem.isNull() && layoutViewItem.needsLayout()) |
| 1879 || isSubtreeLayout(); | 1879 || isSubtreeLayout(); |
| 1880 } | 1880 } |
| 1881 | 1881 |
| 1882 void FrameView::checkDoesNotNeedLayout() const | 1882 NOINLINE void FrameView::checkDoesNotNeedLayout() const |
| 1883 { | 1883 { |
| 1884 CHECK(!layoutPending()); | 1884 CHECK(!layoutPending()); |
| 1885 CHECK(layoutViewItem().isNull() || !layoutViewItem().needsLayout()); | 1885 CHECK(layoutViewItem().isNull() || !layoutViewItem().needsLayout()); |
| 1886 CHECK(!isSubtreeLayout()); | 1886 CHECK(!isSubtreeLayout()); |
| 1887 } | 1887 } |
| 1888 | 1888 |
| 1889 void FrameView::setNeedsLayout() | 1889 void FrameView::setNeedsLayout() |
| 1890 { | 1890 { |
| 1891 LayoutReplaced* box = embeddedReplacedContent(); | 1891 LayoutReplaced* box = embeddedReplacedContent(); |
| 1892 // It's illegal to ask for layout changes during the layout compositing or p
aint invalidation step. | 1892 // It's illegal to ask for layout changes during the layout compositing or p
aint invalidation step. |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2632 // that owns them needed layout. | 2632 // that owns them needed layout. |
| 2633 // TODO(leviw): This currently runs the entire lifecycle on plugin WebViews.
We | 2633 // TODO(leviw): This currently runs the entire lifecycle on plugin WebViews.
We |
| 2634 // should have a way to only run these other Documents to the same lifecycle
stage | 2634 // should have a way to only run these other Documents to the same lifecycle
stage |
| 2635 // as this frame. | 2635 // as this frame. |
| 2636 const ChildrenWidgetSet* viewChildren = children(); | 2636 const ChildrenWidgetSet* viewChildren = children(); |
| 2637 for (const Member<Widget>& child : *viewChildren) { | 2637 for (const Member<Widget>& child : *viewChildren) { |
| 2638 if ((*child).isPluginContainer()) | 2638 if ((*child).isPluginContainer()) |
| 2639 toPluginView(child.get())->updateAllLifecyclePhases(); | 2639 toPluginView(child.get())->updateAllLifecyclePhases(); |
| 2640 } | 2640 } |
| 2641 | 2641 |
| 2642 checkDoesNotNeedLayout(); |
| 2643 |
| 2642 // FIXME: Calling layout() shouldn't trigger script execution or have any | 2644 // FIXME: Calling layout() shouldn't trigger script execution or have any |
| 2643 // observable effects on the frame tree but we're not quite there yet. | 2645 // observable effects on the frame tree but we're not quite there yet. |
| 2644 HeapVector<Member<FrameView>> frameViews; | 2646 HeapVector<Member<FrameView>> frameViews; |
| 2645 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { | 2647 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { |
| 2646 if (!child->isLocalFrame()) | 2648 if (!child->isLocalFrame()) |
| 2647 continue; | 2649 continue; |
| 2648 if (FrameView* view = toLocalFrame(child)->view()) | 2650 if (FrameView* view = toLocalFrame(child)->view()) |
| 2649 frameViews.append(view); | 2651 frameViews.append(view); |
| 2650 } | 2652 } |
| 2651 | 2653 |
| 2652 for (const auto& frameView : frameViews) | 2654 for (const auto& frameView : frameViews) |
| 2653 frameView->updateStyleAndLayoutIfNeededRecursiveInternal(); | 2655 frameView->updateStyleAndLayoutIfNeededRecursiveInternal(); |
| 2654 | 2656 |
| 2657 checkDoesNotNeedLayout(); |
| 2658 |
| 2655 // When SVG filters are invalidated using Document::scheduleSVGFilterLayerUp
dateHack() they may trigger an | 2659 // When SVG filters are invalidated using Document::scheduleSVGFilterLayerUp
dateHack() they may trigger an |
| 2656 // extra style recalc. See PaintLayer::filterNeedsPaintInvalidation(). | 2660 // extra style recalc. See PaintLayer::filterNeedsPaintInvalidation(). |
| 2657 if (m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()) { | 2661 if (m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()) { |
| 2658 m_frame->document()->updateStyleAndLayoutTree(); | 2662 m_frame->document()->updateStyleAndLayoutTree(); |
| 2659 | 2663 |
| 2660 if (needsLayout()) | 2664 if (needsLayout()) |
| 2661 layout(); | 2665 layout(); |
| 2662 } | 2666 } |
| 2663 | 2667 |
| 2664 // These asserts ensure that parent frames are clean, when child frames fini
shed updating layout and style. | 2668 // These asserts ensure that parent frames are clean, when child frames fini
shed updating layout and style. |
| (...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4144 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4148 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
| 4145 } | 4149 } |
| 4146 | 4150 |
| 4147 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4151 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4148 { | 4152 { |
| 4149 ASSERT(!layoutViewItem().isNull()); | 4153 ASSERT(!layoutViewItem().isNull()); |
| 4150 return *layoutView(); | 4154 return *layoutView(); |
| 4151 } | 4155 } |
| 4152 | 4156 |
| 4153 } // namespace blink | 4157 } // namespace blink |
| OLD | NEW |