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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 using namespace HTMLNames; | 87 using namespace HTMLNames; |
88 | 88 |
89 double FrameView::s_currentFrameTimeStamp = 0.0; | 89 double FrameView::s_currentFrameTimeStamp = 0.0; |
90 bool FrameView::s_inPaintContents = false; | 90 bool FrameView::s_inPaintContents = false; |
91 | 91 |
92 | 92 |
93 // REPAINT_THROTTLING now chooses default values for throttling parameters. | 93 // REPAINT_THROTTLING now chooses default values for throttling parameters. |
94 // Should be removed when applications start using runtime configuration. | 94 // Should be removed when applications start using runtime configuration. |
95 #if ENABLE(REPAINT_THROTTLING) | 95 #if ENABLE(REPAINT_THROTTLING) |
96 // Normal delay | 96 // Normal delay |
97 double FrameView::s_normalDeferredRepaintDelay = 0.016; | 97 static const double s_normalDeferredRepaintDelay = 0.016; |
98 // Negative value would mean that first few repaints happen without a delay | 98 // Negative value would mean that first few repaints happen without a delay |
99 double FrameView::s_initialDeferredRepaintDelayDuringLoading = 0; | 99 static const double s_initialDeferredRepaintDelayDuringLoading = 0; |
100 // The delay grows on each repaint to this maximum value | 100 // The delay grows on each repaint to this maximum value |
101 double FrameView::s_maxDeferredRepaintDelayDuringLoading = 2.5; | 101 static const double s_maxDeferredRepaintDelayDuringLoading = 2.5; |
102 // On each repaint the delay increses by this amount | 102 // On each repaint the delay increses by this amount |
103 double FrameView::s_deferredRepaintDelayIncrementDuringLoading = 0.5; | 103 static const double s_deferredRepaintDelayIncrementDuringLoading = 0.5; |
104 #else | 104 #else |
105 // FIXME: Repaint throttling could be good to have on all platform. | 105 // FIXME: Repaint throttling could be good to have on all platform. |
106 // The balance between CPU use and repaint frequency will need some tuning for d
esktop. | 106 // The balance between CPU use and repaint frequency will need some tuning for d
esktop. |
107 // More hooks may be needed to reset the delay on things like GIF and CSS animat
ions. | 107 // More hooks may be needed to reset the delay on things like GIF and CSS animat
ions. |
108 double FrameView::s_normalDeferredRepaintDelay = 0; | 108 static const double s_normalDeferredRepaintDelay = 0; |
109 double FrameView::s_initialDeferredRepaintDelayDuringLoading = 0; | 109 static const double s_initialDeferredRepaintDelayDuringLoading = 0; |
110 double FrameView::s_maxDeferredRepaintDelayDuringLoading = 0; | 110 static const double s_maxDeferredRepaintDelayDuringLoading = 0; |
111 double FrameView::s_deferredRepaintDelayIncrementDuringLoading = 0; | 111 static const double s_deferredRepaintDelayIncrementDuringLoading = 0; |
112 #endif | 112 #endif |
113 | 113 |
114 // The maximum number of updateWidgets iterations that should be done before ret
urning. | 114 // The maximum number of updateWidgets iterations that should be done before ret
urning. |
115 static const unsigned maxUpdateWidgetsIterations = 2; | 115 static const unsigned maxUpdateWidgetsIterations = 2; |
116 | 116 |
117 static RenderLayer::UpdateLayerPositionsFlags updateLayerPositionFlags(RenderLay
er* layer, bool isRelayoutingSubtree, bool didFullRepaint) | 117 static RenderLayer::UpdateLayerPositionsFlags updateLayerPositionFlags(RenderLay
er* layer, bool isRelayoutingSubtree, bool didFullRepaint) |
118 { | 118 { |
119 RenderLayer::UpdateLayerPositionsFlags flags = RenderLayer::defaultFlags; | 119 RenderLayer::UpdateLayerPositionsFlags flags = RenderLayer::defaultFlags; |
120 | 120 |
121 if (didFullRepaint) { | 121 if (didFullRepaint) { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 RenderPart* renderer = m_frame->ownerRenderer(); | 232 RenderPart* renderer = m_frame->ownerRenderer(); |
233 if (renderer && renderer->widget() == this) | 233 if (renderer && renderer->widget() == this) |
234 renderer->setWidget(0); | 234 renderer->setWidget(0); |
235 } | 235 } |
236 | 236 |
237 void FrameView::reset() | 237 void FrameView::reset() |
238 { | 238 { |
239 m_cannotBlitToWindow = false; | 239 m_cannotBlitToWindow = false; |
240 m_isOverlapped = false; | 240 m_isOverlapped = false; |
241 m_contentIsOpaque = false; | 241 m_contentIsOpaque = false; |
242 m_borderX = 30; | |
243 m_borderY = 30; | |
244 m_layoutTimer.stop(); | 242 m_layoutTimer.stop(); |
245 m_layoutRoot = 0; | 243 m_layoutRoot = 0; |
246 m_delayedLayout = false; | 244 m_delayedLayout = false; |
247 m_doFullRepaint = true; | 245 m_doFullRepaint = true; |
248 m_layoutSchedulingEnabled = true; | 246 m_layoutSchedulingEnabled = true; |
249 m_inLayout = false; | 247 m_inLayout = false; |
250 m_doingPreLayoutStyleUpdate = false; | 248 m_doingPreLayoutStyleUpdate = false; |
251 m_inSynchronousPostLayout = false; | 249 m_inSynchronousPostLayout = false; |
252 m_layoutCount = 0; | 250 m_layoutCount = 0; |
253 m_nestedLayoutCount = 0; | 251 m_nestedLayoutCount = 0; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 { | 435 { |
438 return frame().contentRenderer(); | 436 return frame().contentRenderer(); |
439 } | 437 } |
440 | 438 |
441 void FrameView::setCanHaveScrollbars(bool canHaveScrollbars) | 439 void FrameView::setCanHaveScrollbars(bool canHaveScrollbars) |
442 { | 440 { |
443 m_canHaveScrollbars = canHaveScrollbars; | 441 m_canHaveScrollbars = canHaveScrollbars; |
444 ScrollView::setCanHaveScrollbars(canHaveScrollbars); | 442 ScrollView::setCanHaveScrollbars(canHaveScrollbars); |
445 } | 443 } |
446 | 444 |
447 void FrameView::updateCanHaveScrollbars() | |
448 { | |
449 ScrollbarMode hMode; | |
450 ScrollbarMode vMode; | |
451 scrollbarModes(hMode, vMode); | |
452 if (hMode == ScrollbarAlwaysOff && vMode == ScrollbarAlwaysOff) | |
453 setCanHaveScrollbars(false); | |
454 else | |
455 setCanHaveScrollbars(true); | |
456 } | |
457 | |
458 bool FrameView::shouldUseCustomScrollbars(Element*& customScrollbarElement, Fram
e*& customScrollbarFrame) | 445 bool FrameView::shouldUseCustomScrollbars(Element*& customScrollbarElement, Fram
e*& customScrollbarFrame) |
459 { | 446 { |
460 customScrollbarElement = 0; | 447 customScrollbarElement = 0; |
461 customScrollbarFrame = 0; | 448 customScrollbarFrame = 0; |
462 | 449 |
463 if (Settings* settings = m_frame->settings()) { | 450 if (Settings* settings = m_frame->settings()) { |
464 if (!settings->allowCustomScrollbarInMainFrame() && isMainFrame()) | 451 if (!settings->allowCustomScrollbarInMainFrame() && isMainFrame()) |
465 return false; | 452 return false; |
466 } | 453 } |
467 | 454 |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 // Note that this gets called at painting time. | 1519 // Note that this gets called at painting time. |
1533 void FrameView::setIsOverlapped(bool isOverlapped) | 1520 void FrameView::setIsOverlapped(bool isOverlapped) |
1534 { | 1521 { |
1535 if (isOverlapped == m_isOverlapped) | 1522 if (isOverlapped == m_isOverlapped) |
1536 return; | 1523 return; |
1537 | 1524 |
1538 m_isOverlapped = isOverlapped; | 1525 m_isOverlapped = isOverlapped; |
1539 updateCanBlitOnScrollRecursively(); | 1526 updateCanBlitOnScrollRecursively(); |
1540 } | 1527 } |
1541 | 1528 |
1542 bool FrameView::isOverlappedIncludingAncestors() const | |
1543 { | |
1544 if (isOverlapped()) | |
1545 return true; | |
1546 | |
1547 if (FrameView* parentView = parentFrameView()) { | |
1548 if (parentView->isOverlapped()) | |
1549 return true; | |
1550 } | |
1551 | |
1552 return false; | |
1553 } | |
1554 | |
1555 void FrameView::setContentIsOpaque(bool contentIsOpaque) | 1529 void FrameView::setContentIsOpaque(bool contentIsOpaque) |
1556 { | 1530 { |
1557 if (contentIsOpaque == m_contentIsOpaque) | 1531 if (contentIsOpaque == m_contentIsOpaque) |
1558 return; | 1532 return; |
1559 | 1533 |
1560 m_contentIsOpaque = contentIsOpaque; | 1534 m_contentIsOpaque = contentIsOpaque; |
1561 updateCanBlitOnScrollRecursively(); | 1535 updateCanBlitOnScrollRecursively(); |
1562 } | 1536 } |
1563 | 1537 |
1564 void FrameView::restoreScrollbar() | 1538 void FrameView::restoreScrollbar() |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2602 | 2576 |
2603 void FrameView::scrollbarStyleChanged(int newStyle, bool forceUpdate) | 2577 void FrameView::scrollbarStyleChanged(int newStyle, bool forceUpdate) |
2604 { | 2578 { |
2605 if (!isMainFrame()) | 2579 if (!isMainFrame()) |
2606 return; | 2580 return; |
2607 | 2581 |
2608 if (forceUpdate) | 2582 if (forceUpdate) |
2609 ScrollView::scrollbarStyleChanged(newStyle, forceUpdate); | 2583 ScrollView::scrollbarStyleChanged(newStyle, forceUpdate); |
2610 } | 2584 } |
2611 | 2585 |
2612 void FrameView::setAnimatorsAreActive() | |
2613 { | |
2614 Page* page = m_frame->page(); | |
2615 if (!page) | |
2616 return; | |
2617 | |
2618 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) | |
2619 scrollAnimator->setIsActive(); | |
2620 | |
2621 if (!m_scrollableAreas) | |
2622 return; | |
2623 | |
2624 for (HashSet<ScrollableArea*>::const_iterator it = m_scrollableAreas->begin(
), end = m_scrollableAreas->end(); it != end; ++it) { | |
2625 ScrollableArea* scrollableArea = *it; | |
2626 | |
2627 ASSERT(scrollableArea->scrollbarsCanBeActive()); | |
2628 scrollableArea->scrollAnimator()->setIsActive(); | |
2629 } | |
2630 } | |
2631 | |
2632 void FrameView::notifyPageThatContentAreaWillPaint() const | 2586 void FrameView::notifyPageThatContentAreaWillPaint() const |
2633 { | 2587 { |
2634 Page* page = m_frame->page(); | 2588 Page* page = m_frame->page(); |
2635 if (!page) | 2589 if (!page) |
2636 return; | 2590 return; |
2637 | 2591 |
2638 contentAreaWillPaint(); | 2592 contentAreaWillPaint(); |
2639 | 2593 |
2640 if (!m_scrollableAreas) | 2594 if (!m_scrollableAreas) |
2641 return; | 2595 return; |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 -renderer->borderTop() - renderer->paddingTop()); | 3185 -renderer->borderTop() - renderer->paddingTop()); |
3232 return point; | 3186 return point; |
3233 } | 3187 } |
3234 | 3188 |
3235 return Widget::convertFromContainingView(parentPoint); | 3189 return Widget::convertFromContainingView(parentPoint); |
3236 } | 3190 } |
3237 | 3191 |
3238 return parentPoint; | 3192 return parentPoint; |
3239 } | 3193 } |
3240 | 3194 |
3241 // Normal delay | |
3242 void FrameView::setRepaintThrottlingDeferredRepaintDelay(double p) | |
3243 { | |
3244 s_normalDeferredRepaintDelay = p; | |
3245 } | |
3246 | |
3247 // Negative value would mean that first few repaints happen without a delay | |
3248 void FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(do
uble p) | |
3249 { | |
3250 s_initialDeferredRepaintDelayDuringLoading = p; | |
3251 } | |
3252 | |
3253 // The delay grows on each repaint to this maximum value | |
3254 void FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(double
p) | |
3255 { | |
3256 s_maxDeferredRepaintDelayDuringLoading = p; | |
3257 } | |
3258 | |
3259 // On each repaint the delay increases by this amount | |
3260 void FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(d
ouble p) | |
3261 { | |
3262 s_deferredRepaintDelayIncrementDuringLoading = p; | |
3263 } | |
3264 | |
3265 void FrameView::setTracksRepaints(bool trackRepaints) | 3195 void FrameView::setTracksRepaints(bool trackRepaints) |
3266 { | 3196 { |
3267 if (trackRepaints == m_isTrackingRepaints) | 3197 if (trackRepaints == m_isTrackingRepaints) |
3268 return; | 3198 return; |
3269 | 3199 |
3270 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav
erseNext()) { | 3200 for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().trav
erseNext()) { |
3271 if (RenderView* renderView = frame->contentRenderer()) | 3201 if (RenderView* renderView = frame->contentRenderer()) |
3272 renderView->compositor()->setTracksRepaints(trackRepaints); | 3202 renderView->compositor()->setTracksRepaints(trackRepaints); |
3273 } | 3203 } |
3274 | 3204 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3430 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) | 3360 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o
rientation) |
3431 { | 3361 { |
3432 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 3362 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
3433 if (AXObjectCache* cache = axObjectCache()) { | 3363 if (AXObjectCache* cache = axObjectCache()) { |
3434 cache->remove(scrollbar); | 3364 cache->remove(scrollbar); |
3435 cache->handleScrollbarUpdate(this); | 3365 cache->handleScrollbarUpdate(this); |
3436 } | 3366 } |
3437 } | 3367 } |
3438 | 3368 |
3439 } // namespace WebCore | 3369 } // namespace WebCore |
OLD | NEW |