| 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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 // FIXME: This instrumentation event is not strictly accurate since cach
ed media query results | 768 // FIXME: This instrumentation event is not strictly accurate since cach
ed media query results |
| 769 // do not persist across StyleResolver rebuilds. | 769 // do not persist across StyleResolver rebuilds. |
| 770 InspectorInstrumentation::mediaQueryResultChanged(document); | 770 InspectorInstrumentation::mediaQueryResultChanged(document); |
| 771 } else { | 771 } else { |
| 772 document->evaluateMediaQueryList(); | 772 document->evaluateMediaQueryList(); |
| 773 } | 773 } |
| 774 | 774 |
| 775 // Always ensure our style info is up-to-date. This can happen in situations
where | 775 // Always ensure our style info is up-to-date. This can happen in situations
where |
| 776 // the layout beats any sort of style recalc update that needs to occur. | 776 // the layout beats any sort of style recalc update that needs to occur. |
| 777 TemporaryChange<bool> changeDoingPreLayoutStyleUpdate(m_doingPreLayoutStyleU
pdate, true); | 777 TemporaryChange<bool> changeDoingPreLayoutStyleUpdate(m_doingPreLayoutStyleU
pdate, true); |
| 778 document->updateStyleIfNeeded(); | 778 document->updateRenderTreeIfNeeded(); |
| 779 lifecycle().advanceTo(DocumentLifecycle::StyleClean); | 779 lifecycle().advanceTo(DocumentLifecycle::StyleClean); |
| 780 } | 780 } |
| 781 | 781 |
| 782 void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay
out) | 782 void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay
out) |
| 783 { | 783 { |
| 784 TRACE_EVENT0("webkit", "FrameView::performLayout"); | 784 TRACE_EVENT0("webkit", "FrameView::performLayout"); |
| 785 | 785 |
| 786 ASSERT(!isInPerformLayout()); | 786 ASSERT(!isInPerformLayout()); |
| 787 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); | 787 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); |
| 788 | 788 |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 } | 1580 } |
| 1581 | 1581 |
| 1582 void FrameView::maintainScrollPositionAtAnchor(Node* anchorNode) | 1582 void FrameView::maintainScrollPositionAtAnchor(Node* anchorNode) |
| 1583 { | 1583 { |
| 1584 m_maintainScrollPositionAnchor = anchorNode; | 1584 m_maintainScrollPositionAnchor = anchorNode; |
| 1585 if (!m_maintainScrollPositionAnchor) | 1585 if (!m_maintainScrollPositionAnchor) |
| 1586 return; | 1586 return; |
| 1587 | 1587 |
| 1588 // We need to update the layout before scrolling, otherwise we could | 1588 // We need to update the layout before scrolling, otherwise we could |
| 1589 // really mess things up if an anchor scroll comes at a bad moment. | 1589 // really mess things up if an anchor scroll comes at a bad moment. |
| 1590 m_frame->document()->updateStyleIfNeeded(); | 1590 m_frame->document()->updateRenderTreeIfNeeded(); |
| 1591 // Only do a layout if changes have occurred that make it necessary. | 1591 // Only do a layout if changes have occurred that make it necessary. |
| 1592 RenderView* renderView = this->renderView(); | 1592 RenderView* renderView = this->renderView(); |
| 1593 if (renderView && renderView->needsLayout()) | 1593 if (renderView && renderView->needsLayout()) |
| 1594 layout(); | 1594 layout(); |
| 1595 else | 1595 else |
| 1596 scrollToAnchor(); | 1596 scrollToAnchor(); |
| 1597 } | 1597 } |
| 1598 | 1598 |
| 1599 void FrameView::scrollElementToRect(Element* element, const IntRect& rect) | 1599 void FrameView::scrollElementToRect(Element* element, const IntRect& rect) |
| 1600 { | 1600 { |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2791 { | 2791 { |
| 2792 // We have to crawl our entire tree looking for any FrameViews that need | 2792 // We have to crawl our entire tree looking for any FrameViews that need |
| 2793 // layout and make sure they are up to date. | 2793 // layout and make sure they are up to date. |
| 2794 // Mac actually tests for intersection with the dirty region and tries not t
o | 2794 // Mac actually tests for intersection with the dirty region and tries not t
o |
| 2795 // update layout for frames that are outside the dirty region. Not only doe
s this seem | 2795 // update layout for frames that are outside the dirty region. Not only doe
s this seem |
| 2796 // pointless (since those frames will have set a zero timer to layout anyway
), but | 2796 // pointless (since those frames will have set a zero timer to layout anyway
), but |
| 2797 // it is also incorrect, since if two frames overlap, the first could be exc
luded from the dirty | 2797 // it is also incorrect, since if two frames overlap, the first could be exc
luded from the dirty |
| 2798 // region but then become included later by the second frame adding rects to
the dirty region | 2798 // region but then become included later by the second frame adding rects to
the dirty region |
| 2799 // when it lays out. | 2799 // when it lays out. |
| 2800 | 2800 |
| 2801 m_frame->document()->updateStyleIfNeeded(); | 2801 m_frame->document()->updateRenderTreeIfNeeded(); |
| 2802 | 2802 |
| 2803 if (needsLayout()) | 2803 if (needsLayout()) |
| 2804 layout(); | 2804 layout(); |
| 2805 | 2805 |
| 2806 // FIXME: Calling layout() shouldn't trigger scripe execution or have any | 2806 // FIXME: Calling layout() shouldn't trigger scripe execution or have any |
| 2807 // observable effects on the frame tree but we're not quite there yet. | 2807 // observable effects on the frame tree but we're not quite there yet. |
| 2808 Vector<RefPtr<FrameView> > frameViews; | 2808 Vector<RefPtr<FrameView> > frameViews; |
| 2809 for (LocalFrame* child = m_frame->tree().firstChild(); child; child = child-
>tree().nextSibling()) { | 2809 for (LocalFrame* child = m_frame->tree().firstChild(); child; child = child-
>tree().nextSibling()) { |
| 2810 if (FrameView* view = child->view()) | 2810 if (FrameView* view = child->view()) |
| 2811 frameViews.append(view); | 2811 frameViews.append(view); |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3211 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) | 3211 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) |
| 3212 { | 3212 { |
| 3213 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 3213 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
| 3214 if (AXObjectCache* cache = axObjectCache()) { | 3214 if (AXObjectCache* cache = axObjectCache()) { |
| 3215 cache->remove(scrollbar); | 3215 cache->remove(scrollbar); |
| 3216 cache->handleScrollbarUpdate(this); | 3216 cache->handleScrollbarUpdate(this); |
| 3217 } | 3217 } |
| 3218 } | 3218 } |
| 3219 | 3219 |
| 3220 } // namespace WebCore | 3220 } // namespace WebCore |
| OLD | NEW |