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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 renderer->repaintRectangle(repaintRect); | 363 renderer->repaintRectangle(repaintRect); |
364 } | 364 } |
365 | 365 |
366 void FrameView::setFrameRect(const IntRect& newRect) | 366 void FrameView::setFrameRect(const IntRect& newRect) |
367 { | 367 { |
368 IntRect oldRect = frameRect(); | 368 IntRect oldRect = frameRect(); |
369 if (newRect == oldRect) | 369 if (newRect == oldRect) |
370 return; | 370 return; |
371 | 371 |
372 // Autosized font sizes depend on the width of the viewing area. | 372 // Autosized font sizes depend on the width of the viewing area. |
373 bool autosizerNeedsUpdating = false; | |
374 if (newRect.width() != oldRect.width()) { | 373 if (newRect.width() != oldRect.width()) { |
375 if (isMainFrame() && m_frame->settings()->textAutosizingEnabled()) { | 374 if (isMainFrame() && m_frame->settings()->textAutosizingEnabled()) { |
376 autosizerNeedsUpdating = true; | |
377 for (LocalFrame* frame = m_frame.get(); frame; frame = frame->tree()
.traverseNext()) { | 375 for (LocalFrame* frame = m_frame.get(); frame; frame = frame->tree()
.traverseNext()) { |
378 if (TextAutosizer* textAutosizer = frame->document()->textAutosi
zer()) | 376 if (TextAutosizer* textAutosizer = frame->document()->textAutosi
zer()) |
379 textAutosizer->recalculateMultipliers(); | 377 textAutosizer->recalculateMultipliers(); |
380 } | 378 } |
381 } | 379 } |
382 } | 380 } |
383 | 381 |
384 ScrollView::setFrameRect(newRect); | 382 ScrollView::setFrameRect(newRect); |
385 | 383 |
386 updateScrollableAreaSet(); | 384 updateScrollableAreaSet(); |
387 | 385 |
388 if (autosizerNeedsUpdating) { | |
389 // This needs to be after the call to ScrollView::setFrameRect, because
it reads the new width. | |
390 if (FastTextAutosizer* textAutosizer = m_frame->document()->fastTextAuto
sizer()) | |
391 textAutosizer->updatePageInfoInAllFrames(); | |
392 } | |
393 | |
394 if (RenderView* renderView = this->renderView()) { | 386 if (RenderView* renderView = this->renderView()) { |
395 if (renderView->usesCompositing()) | 387 if (renderView->usesCompositing()) |
396 renderView->compositor()->frameViewDidChangeSize(); | 388 renderView->compositor()->frameViewDidChangeSize(); |
397 } | 389 } |
398 | 390 |
399 viewportConstrainedVisibleContentSizeChanged(newRect.width() != oldRect.widt
h(), newRect.height() != oldRect.height()); | 391 viewportConstrainedVisibleContentSizeChanged(newRect.width() != oldRect.widt
h(), newRect.height() != oldRect.height()); |
400 } | 392 } |
401 | 393 |
402 bool FrameView::scheduleAnimation() | 394 bool FrameView::scheduleAnimation() |
403 { | 395 { |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 IntRect repaintRect = r; | 1734 IntRect repaintRect = r; |
1743 repaintRect.move(-scrollOffset()); | 1735 repaintRect.move(-scrollOffset()); |
1744 m_trackedRepaintRects.append(repaintRect); | 1736 m_trackedRepaintRects.append(repaintRect); |
1745 } | 1737 } |
1746 | 1738 |
1747 ScrollView::repaintContentRectangle(r); | 1739 ScrollView::repaintContentRectangle(r); |
1748 } | 1740 } |
1749 | 1741 |
1750 void FrameView::contentsResized() | 1742 void FrameView::contentsResized() |
1751 { | 1743 { |
1752 if (isMainFrame() && m_frame->document()) { | |
1753 if (FastTextAutosizer* textAutosizer = m_frame->document()->fastTextAuto
sizer()) | |
1754 textAutosizer->updatePageInfoInAllFrames(); | |
1755 } | |
1756 | |
1757 ScrollView::contentsResized(); | 1744 ScrollView::contentsResized(); |
1758 setNeedsLayout(); | 1745 setNeedsLayout(); |
1759 } | 1746 } |
1760 | 1747 |
1761 void FrameView::scrollbarExistenceDidChange() | 1748 void FrameView::scrollbarExistenceDidChange() |
1762 { | 1749 { |
1763 // We check to make sure the view is attached to a frame() as this method ca
n | 1750 // We check to make sure the view is attached to a frame() as this method ca
n |
1764 // be triggered before the view is attached by LocalFrame::createView(...) s
etting | 1751 // be triggered before the view is attached by LocalFrame::createView(...) s
etting |
1765 // various values such as setScrollBarModes(...) for example. An ASSERT is | 1752 // various values such as setScrollBarModes(...) for example. An ASSERT is |
1766 // triggered when a view is layout before being attached to a frame(). | 1753 // triggered when a view is layout before being attached to a frame(). |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3224 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) | 3211 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) |
3225 { | 3212 { |
3226 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 3213 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
3227 if (AXObjectCache* cache = axObjectCache()) { | 3214 if (AXObjectCache* cache = axObjectCache()) { |
3228 cache->remove(scrollbar); | 3215 cache->remove(scrollbar); |
3229 cache->handleScrollbarUpdate(this); | 3216 cache->handleScrollbarUpdate(this); |
3230 } | 3217 } |
3231 } | 3218 } |
3232 | 3219 |
3233 } // namespace WebCore | 3220 } // namespace WebCore |
OLD | NEW |