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 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 void FrameView::didUpdateElasticOverscroll() | 1495 void FrameView::didUpdateElasticOverscroll() |
1496 { | 1496 { |
1497 Page* page = frame().page(); | 1497 Page* page = frame().page(); |
1498 if (!page) | 1498 if (!page) |
1499 return; | 1499 return; |
1500 FloatSize elasticOverscroll = page->chromeClient().elasticOverscroll(); | 1500 FloatSize elasticOverscroll = page->chromeClient().elasticOverscroll(); |
1501 if (m_horizontalScrollbar) { | 1501 if (m_horizontalScrollbar) { |
1502 float delta = elasticOverscroll.width() - m_horizontalScrollbar->elastic
Overscroll(); | 1502 float delta = elasticOverscroll.width() - m_horizontalScrollbar->elastic
Overscroll(); |
1503 if (delta != 0) { | 1503 if (delta != 0) { |
1504 m_horizontalScrollbar->setElasticOverscroll(elasticOverscroll.width(
)); | 1504 m_horizontalScrollbar->setElasticOverscroll(elasticOverscroll.width(
)); |
1505 scrollAnimator()->notifyContentAreaScrolled(FloatSize(delta, 0)); | 1505 scrollAnimator().notifyContentAreaScrolled(FloatSize(delta, 0)); |
1506 setScrollbarNeedsPaintInvalidation(m_horizontalScrollbar.get()); | 1506 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); |
1507 } | 1507 } |
1508 } | 1508 } |
1509 if (m_verticalScrollbar) { | 1509 if (m_verticalScrollbar) { |
1510 float delta = elasticOverscroll.height() - m_verticalScrollbar->elasticO
verscroll(); | 1510 float delta = elasticOverscroll.height() - m_verticalScrollbar->elasticO
verscroll(); |
1511 if (delta != 0) { | 1511 if (delta != 0) { |
1512 m_verticalScrollbar->setElasticOverscroll(elasticOverscroll.height()
); | 1512 m_verticalScrollbar->setElasticOverscroll(elasticOverscroll.height()
); |
1513 scrollAnimator()->notifyContentAreaScrolled(FloatSize(0, delta)); | 1513 scrollAnimator().notifyContentAreaScrolled(FloatSize(0, delta)); |
1514 setScrollbarNeedsPaintInvalidation(m_verticalScrollbar.get()); | 1514 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); |
1515 } | 1515 } |
1516 } | 1516 } |
1517 } | 1517 } |
1518 | 1518 |
1519 IntSize FrameView::layoutSize(IncludeScrollbarsInRect scrollbarInclusion) const | 1519 IntSize FrameView::layoutSize(IncludeScrollbarsInRect scrollbarInclusion) const |
1520 { | 1520 { |
1521 return scrollbarInclusion == ExcludeScrollbars ? excludeScrollbars(m_layoutS
ize) : m_layoutSize; | 1521 return scrollbarInclusion == ExcludeScrollbars ? excludeScrollbars(m_layoutS
ize) : m_layoutSize; |
1522 } | 1522 } |
1523 | 1523 |
1524 void FrameView::setLayoutSize(const IntSize& size) | 1524 void FrameView::setLayoutSize(const IntSize& size) |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 clearScrollAnchor(); | 2072 clearScrollAnchor(); |
2073 updateLayersAndCompositingAfterScrollIfNeeded(); | 2073 updateLayersAndCompositingAfterScrollIfNeeded(); |
2074 scrollPositionChanged(); | 2074 scrollPositionChanged(); |
2075 frame().loader().client()->didChangeScrollOffset(); | 2075 frame().loader().client()->didChangeScrollOffset(); |
2076 } | 2076 } |
2077 | 2077 |
2078 void FrameView::invalidatePaintForTickmarks() | 2078 void FrameView::invalidatePaintForTickmarks() |
2079 { | 2079 { |
2080 if (Scrollbar* scrollbar = verticalScrollbar()) { | 2080 if (Scrollbar* scrollbar = verticalScrollbar()) { |
2081 scrollbar->setTrackNeedsRepaint(true); | 2081 scrollbar->setTrackNeedsRepaint(true); |
2082 setScrollbarNeedsPaintInvalidation(scrollbar); | 2082 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); |
2083 } | 2083 } |
2084 } | 2084 } |
2085 | 2085 |
2086 void FrameView::getTickmarks(Vector<IntRect>& tickmarks) const | 2086 void FrameView::getTickmarks(Vector<IntRect>& tickmarks) const |
2087 { | 2087 { |
2088 if (!m_tickmarks.isEmpty()) | 2088 if (!m_tickmarks.isEmpty()) |
2089 tickmarks = m_tickmarks; | 2089 tickmarks = m_tickmarks; |
2090 else | 2090 else |
2091 tickmarks = frame().document()->markers().renderedRectsForMarkers(Docume
ntMarker::TextMatch); | 2091 tickmarks = frame().document()->markers().renderedRectsForMarkers(Docume
ntMarker::TextMatch); |
2092 } | 2092 } |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2947 m_layoutSize = size; | 2947 m_layoutSize = size; |
2948 | 2948 |
2949 if (Document* document = m_frame->document()) { | 2949 if (Document* document = m_frame->document()) { |
2950 if (document->isActive()) | 2950 if (document->isActive()) |
2951 document->notifyResizeForViewportUnits(); | 2951 document->notifyResizeForViewportUnits(); |
2952 } | 2952 } |
2953 | 2953 |
2954 contentsResized(); | 2954 contentsResized(); |
2955 } | 2955 } |
2956 | 2956 |
2957 void FrameView::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orien
tation) | 2957 void FrameView::didAddScrollbar(Scrollbar& scrollbar, ScrollbarOrientation orien
tation) |
2958 { | 2958 { |
2959 ScrollableArea::didAddScrollbar(scrollbar, orientation); | 2959 ScrollableArea::didAddScrollbar(scrollbar, orientation); |
2960 if (AXObjectCache* cache = axObjectCache()) | 2960 if (AXObjectCache* cache = axObjectCache()) |
2961 cache->handleScrollbarUpdate(this); | 2961 cache->handleScrollbarUpdate(this); |
2962 } | 2962 } |
2963 | 2963 |
2964 void FrameView::setTopControlsViewportAdjustment(float adjustment) | 2964 void FrameView::setTopControlsViewportAdjustment(float adjustment) |
2965 { | 2965 { |
2966 m_topControlsViewportAdjustment = adjustment; | 2966 m_topControlsViewportAdjustment = adjustment; |
2967 } | 2967 } |
(...skipping 17 matching lines...) Expand all Loading... |
2985 } | 2985 } |
2986 | 2986 |
2987 void FrameView::setHasHorizontalScrollbar(bool hasBar) | 2987 void FrameView::setHasHorizontalScrollbar(bool hasBar) |
2988 { | 2988 { |
2989 if (hasBar == !!m_horizontalScrollbar) | 2989 if (hasBar == !!m_horizontalScrollbar) |
2990 return; | 2990 return; |
2991 | 2991 |
2992 if (hasBar) { | 2992 if (hasBar) { |
2993 m_horizontalScrollbar = createScrollbar(HorizontalScrollbar); | 2993 m_horizontalScrollbar = createScrollbar(HorizontalScrollbar); |
2994 addChild(m_horizontalScrollbar.get()); | 2994 addChild(m_horizontalScrollbar.get()); |
2995 didAddScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar); | 2995 didAddScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); |
2996 m_horizontalScrollbar->styleChanged(); | 2996 m_horizontalScrollbar->styleChanged(); |
2997 } else { | 2997 } else { |
2998 willRemoveScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar); | 2998 willRemoveScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); |
2999 if (AXObjectCache* cache = axObjectCache()) | 2999 if (AXObjectCache* cache = axObjectCache()) |
3000 cache->remove(m_horizontalScrollbar.get()); | 3000 cache->remove(m_horizontalScrollbar.get()); |
3001 // If the scrollbar has been marked as overlapping the window resizer, | 3001 // If the scrollbar has been marked as overlapping the window resizer, |
3002 // then its removal should reduce the count. | 3002 // then its removal should reduce the count. |
3003 if (m_horizontalScrollbar->overlapsResizer()) | 3003 if (m_horizontalScrollbar->overlapsResizer()) |
3004 adjustScrollbarsAvoidingResizerCount(-1); | 3004 adjustScrollbarsAvoidingResizerCount(-1); |
3005 removeChild(m_horizontalScrollbar.get()); | 3005 removeChild(m_horizontalScrollbar.get()); |
3006 m_horizontalScrollbar->disconnectFromScrollableArea(); | 3006 m_horizontalScrollbar->disconnectFromScrollableArea(); |
3007 m_horizontalScrollbar = nullptr; | 3007 m_horizontalScrollbar = nullptr; |
3008 if (AXObjectCache* cache = axObjectCache()) | 3008 if (AXObjectCache* cache = axObjectCache()) |
3009 cache->handleScrollbarUpdate(this); | 3009 cache->handleScrollbarUpdate(this); |
3010 } | 3010 } |
3011 | 3011 |
3012 setScrollCornerNeedsPaintInvalidation(); | 3012 setScrollCornerNeedsPaintInvalidation(); |
3013 } | 3013 } |
3014 | 3014 |
3015 void FrameView::setHasVerticalScrollbar(bool hasBar) | 3015 void FrameView::setHasVerticalScrollbar(bool hasBar) |
3016 { | 3016 { |
3017 if (hasBar == !!m_verticalScrollbar) | 3017 if (hasBar == !!m_verticalScrollbar) |
3018 return; | 3018 return; |
3019 | 3019 |
3020 if (hasBar) { | 3020 if (hasBar) { |
3021 m_verticalScrollbar = createScrollbar(VerticalScrollbar); | 3021 m_verticalScrollbar = createScrollbar(VerticalScrollbar); |
3022 addChild(m_verticalScrollbar.get()); | 3022 addChild(m_verticalScrollbar.get()); |
3023 didAddScrollbar(m_verticalScrollbar.get(), VerticalScrollbar); | 3023 didAddScrollbar(*m_verticalScrollbar, VerticalScrollbar); |
3024 m_verticalScrollbar->styleChanged(); | 3024 m_verticalScrollbar->styleChanged(); |
3025 } else { | 3025 } else { |
3026 willRemoveScrollbar(m_verticalScrollbar.get(), VerticalScrollbar); | 3026 willRemoveScrollbar(*m_verticalScrollbar, VerticalScrollbar); |
3027 if (AXObjectCache* cache = axObjectCache()) | 3027 if (AXObjectCache* cache = axObjectCache()) |
3028 cache->remove(m_verticalScrollbar.get()); | 3028 cache->remove(m_verticalScrollbar.get()); |
3029 // If the scrollbar has been marked as overlapping the window resizer, | 3029 // If the scrollbar has been marked as overlapping the window resizer, |
3030 // then its removal should reduce the count. | 3030 // then its removal should reduce the count. |
3031 if (m_verticalScrollbar->overlapsResizer()) | 3031 if (m_verticalScrollbar->overlapsResizer()) |
3032 adjustScrollbarsAvoidingResizerCount(-1); | 3032 adjustScrollbarsAvoidingResizerCount(-1); |
3033 removeChild(m_verticalScrollbar.get()); | 3033 removeChild(m_verticalScrollbar.get()); |
3034 m_verticalScrollbar->disconnectFromScrollableArea(); | 3034 m_verticalScrollbar->disconnectFromScrollableArea(); |
3035 m_verticalScrollbar = nullptr; | 3035 m_verticalScrollbar = nullptr; |
3036 if (AXObjectCache* cache = axObjectCache()) | 3036 if (AXObjectCache* cache = axObjectCache()) |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3196 | 3196 |
3197 void FrameView::updateScrollbarGeometry() | 3197 void FrameView::updateScrollbarGeometry() |
3198 { | 3198 { |
3199 if (m_horizontalScrollbar) { | 3199 if (m_horizontalScrollbar) { |
3200 int clientWidth = visibleWidth(); | 3200 int clientWidth = visibleWidth(); |
3201 IntRect oldRect(m_horizontalScrollbar->frameRect()); | 3201 IntRect oldRect(m_horizontalScrollbar->frameRect()); |
3202 IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_verticalScro
llbar) ? m_verticalScrollbar->width() : 0, | 3202 IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_verticalScro
llbar) ? m_verticalScrollbar->width() : 0, |
3203 height() - m_horizontalScrollbar->height(), | 3203 height() - m_horizontalScrollbar->height(), |
3204 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0), | 3204 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0), |
3205 m_horizontalScrollbar->height()); | 3205 m_horizontalScrollbar->height()); |
3206 m_horizontalScrollbar->setFrameRect(adjustScrollbarRectForResizer(hBarRe
ct, m_horizontalScrollbar.get())); | 3206 m_horizontalScrollbar->setFrameRect(adjustScrollbarRectForResizer(hBarRe
ct, *m_horizontalScrollbar)); |
3207 if (oldRect != m_horizontalScrollbar->frameRect()) | 3207 if (oldRect != m_horizontalScrollbar->frameRect()) |
3208 setScrollbarNeedsPaintInvalidation(m_horizontalScrollbar.get()); | 3208 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); |
3209 | 3209 |
3210 m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth); | 3210 m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth); |
3211 m_horizontalScrollbar->setProportion(clientWidth, contentsWidth()); | 3211 m_horizontalScrollbar->setProportion(clientWidth, contentsWidth()); |
3212 m_horizontalScrollbar->offsetDidChange(); | 3212 m_horizontalScrollbar->offsetDidChange(); |
3213 } | 3213 } |
3214 | 3214 |
3215 if (m_verticalScrollbar) { | 3215 if (m_verticalScrollbar) { |
3216 int clientHeight = visibleHeight(); | 3216 int clientHeight = visibleHeight(); |
3217 IntRect oldRect(m_verticalScrollbar->frameRect()); | 3217 IntRect oldRect(m_verticalScrollbar->frameRect()); |
3218 IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m
_verticalScrollbar->width()), | 3218 IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m
_verticalScrollbar->width()), |
3219 0, | 3219 0, |
3220 m_verticalScrollbar->width(), | 3220 m_verticalScrollbar->width(), |
3221 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height()
: 0)); | 3221 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height()
: 0)); |
3222 m_verticalScrollbar->setFrameRect(adjustScrollbarRectForResizer(vBarRect
, m_verticalScrollbar.get())); | 3222 m_verticalScrollbar->setFrameRect(adjustScrollbarRectForResizer(vBarRect
, *m_verticalScrollbar)); |
3223 if (oldRect != m_verticalScrollbar->frameRect()) | 3223 if (oldRect != m_verticalScrollbar->frameRect()) |
3224 setScrollbarNeedsPaintInvalidation(m_verticalScrollbar.get()); | 3224 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); |
3225 | 3225 |
3226 m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight); | 3226 m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight); |
3227 m_verticalScrollbar->setProportion(clientHeight, contentsHeight()); | 3227 m_verticalScrollbar->setProportion(clientHeight, contentsHeight()); |
3228 m_verticalScrollbar->offsetDidChange(); | 3228 m_verticalScrollbar->offsetDidChange(); |
3229 } | 3229 } |
3230 } | 3230 } |
3231 | 3231 |
3232 IntRect FrameView::adjustScrollbarRectForResizer(const IntRect& rect, Scrollbar*
scrollbar) | 3232 IntRect FrameView::adjustScrollbarRectForResizer(const IntRect& rect, Scrollbar&
scrollbar) |
3233 { | 3233 { |
3234 // Get our window resizer rect and see if we overlap. Adjust to avoid the ov
erlap | 3234 // Get our window resizer rect and see if we overlap. Adjust to avoid the ov
erlap |
3235 // if necessary. | 3235 // if necessary. |
3236 IntRect adjustedRect(rect); | 3236 IntRect adjustedRect(rect); |
3237 bool overlapsResizer = false; | 3237 bool overlapsResizer = false; |
3238 if (!rect.isEmpty() && !windowResizerRect().isEmpty()) { | 3238 if (!rect.isEmpty() && !windowResizerRect().isEmpty()) { |
3239 IntRect resizerRect = convertFromRootFrame(windowResizerRect()); | 3239 IntRect resizerRect = convertFromRootFrame(windowResizerRect()); |
3240 if (rect.intersects(resizerRect)) { | 3240 if (rect.intersects(resizerRect)) { |
3241 if (scrollbar->orientation() == HorizontalScrollbar) { | 3241 if (scrollbar.orientation() == HorizontalScrollbar) { |
3242 int overlap = rect.maxX() - resizerRect.x(); | 3242 int overlap = rect.maxX() - resizerRect.x(); |
3243 if (overlap > 0 && resizerRect.maxX() >= rect.maxX()) { | 3243 if (overlap > 0 && resizerRect.maxX() >= rect.maxX()) { |
3244 adjustedRect.setWidth(rect.width() - overlap); | 3244 adjustedRect.setWidth(rect.width() - overlap); |
3245 overlapsResizer = true; | 3245 overlapsResizer = true; |
3246 } | 3246 } |
3247 } else { | 3247 } else { |
3248 int overlap = rect.maxY() - resizerRect.y(); | 3248 int overlap = rect.maxY() - resizerRect.y(); |
3249 if (overlap > 0 && resizerRect.maxY() >= rect.maxY()) { | 3249 if (overlap > 0 && resizerRect.maxY() >= rect.maxY()) { |
3250 adjustedRect.setHeight(rect.height() - overlap); | 3250 adjustedRect.setHeight(rect.height() - overlap); |
3251 overlapsResizer = true; | 3251 overlapsResizer = true; |
3252 } | 3252 } |
3253 } | 3253 } |
3254 } | 3254 } |
3255 } | 3255 } |
3256 if (overlapsResizer != scrollbar->overlapsResizer()) { | 3256 if (overlapsResizer != scrollbar.overlapsResizer()) { |
3257 scrollbar->setOverlapsResizer(overlapsResizer); | 3257 scrollbar.setOverlapsResizer(overlapsResizer); |
3258 adjustScrollbarsAvoidingResizerCount(overlapsResizer ? 1 : -1); | 3258 adjustScrollbarsAvoidingResizerCount(overlapsResizer ? 1 : -1); |
3259 } | 3259 } |
3260 return adjustedRect; | 3260 return adjustedRect; |
3261 } | 3261 } |
3262 | 3262 |
3263 bool FrameView::adjustScrollbarExistence(ComputeScrollbarExistenceOption option) | 3263 bool FrameView::adjustScrollbarExistence(ComputeScrollbarExistenceOption option) |
3264 { | 3264 { |
3265 ASSERT(m_inUpdateScrollbars); | 3265 ASSERT(m_inUpdateScrollbars); |
3266 | 3266 |
3267 // If we came in here with the view already needing a layout, then go ahead
and do that | 3267 // If we came in here with the view already needing a layout, then go ahead
and do that |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3654 ScrollBehavior FrameView::scrollBehaviorStyle() const | 3654 ScrollBehavior FrameView::scrollBehaviorStyle() const |
3655 { | 3655 { |
3656 Element* scrollElement = m_frame->document()->scrollingElement(); | 3656 Element* scrollElement = m_frame->document()->scrollingElement(); |
3657 LayoutObject* layoutObject = scrollElement ? scrollElement->layoutObject() :
nullptr; | 3657 LayoutObject* layoutObject = scrollElement ? scrollElement->layoutObject() :
nullptr; |
3658 if (layoutObject && layoutObject->style()->scrollBehavior() == ScrollBehavio
rSmooth) | 3658 if (layoutObject && layoutObject->style()->scrollBehavior() == ScrollBehavio
rSmooth) |
3659 return ScrollBehaviorSmooth; | 3659 return ScrollBehaviorSmooth; |
3660 | 3660 |
3661 return ScrollBehaviorInstant; | 3661 return ScrollBehaviorInstant; |
3662 } | 3662 } |
3663 | 3663 |
3664 void FrameView::paint(GraphicsContext* context, const CullRect& cullRect) const | 3664 void FrameView::paint(GraphicsContext& context, const CullRect& cullRect) const |
3665 { | 3665 { |
3666 paint(context, GlobalPaintNormalPhase, cullRect); | 3666 paint(context, GlobalPaintNormalPhase, cullRect); |
3667 } | 3667 } |
3668 | 3668 |
3669 void FrameView::paint(GraphicsContext* context, const GlobalPaintFlags globalPai
ntFlags, const CullRect& cullRect) const | 3669 void FrameView::paint(GraphicsContext& context, const GlobalPaintFlags globalPai
ntFlags, const CullRect& cullRect) const |
3670 { | 3670 { |
3671 // TODO(skyostil): Remove this early-out in favor of painting cached scrollb
ars. | 3671 // TODO(skyostil): Remove this early-out in favor of painting cached scrollb
ars. |
3672 if (shouldThrottleRendering()) | 3672 if (shouldThrottleRendering()) |
3673 return; | 3673 return; |
3674 FramePainter(*this).paint(context, globalPaintFlags, cullRect); | 3674 FramePainter(*this).paint(context, globalPaintFlags, cullRect); |
3675 } | 3675 } |
3676 | 3676 |
3677 void FrameView::paintContents(GraphicsContext* context, const GlobalPaintFlags g
lobalPaintFlags, const IntRect& damageRect) const | 3677 void FrameView::paintContents(GraphicsContext& context, const GlobalPaintFlags g
lobalPaintFlags, const IntRect& damageRect) const |
3678 { | 3678 { |
3679 if (shouldThrottleRendering()) | 3679 if (shouldThrottleRendering()) |
3680 return; | 3680 return; |
3681 FramePainter(*this).paintContents(context, globalPaintFlags, damageRect); | 3681 FramePainter(*this).paintContents(context, globalPaintFlags, damageRect); |
3682 } | 3682 } |
3683 | 3683 |
3684 bool FrameView::isPointInScrollbarCorner(const IntPoint& pointInRootFrame) | 3684 bool FrameView::isPointInScrollbarCorner(const IntPoint& pointInRootFrame) |
3685 { | 3685 { |
3686 if (!scrollbarCornerPresent()) | 3686 if (!scrollbarCornerPresent()) |
3687 return false; | 3687 return false; |
(...skipping 14 matching lines...) Expand all Loading... |
3702 | 3702 |
3703 return framePoint.x() > verticalScrollbarXMin && framePoint.x() < verticalSc
rollbarXMax && framePoint.y() > verticalScrollbarYMin; | 3703 return framePoint.x() > verticalScrollbarXMin && framePoint.x() < verticalSc
rollbarXMax && framePoint.y() > verticalScrollbarYMin; |
3704 } | 3704 } |
3705 | 3705 |
3706 bool FrameView::scrollbarCornerPresent() const | 3706 bool FrameView::scrollbarCornerPresent() const |
3707 { | 3707 { |
3708 return (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() >
0) | 3708 return (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() >
0) |
3709 || (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0)
; | 3709 || (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0)
; |
3710 } | 3710 } |
3711 | 3711 |
3712 IntRect FrameView::convertFromScrollbarToContainingWidget(const Scrollbar* scrol
lbar, const IntRect& localRect) const | 3712 IntRect FrameView::convertFromScrollbarToContainingWidget(const Scrollbar& scrol
lbar, const IntRect& localRect) const |
3713 { | 3713 { |
3714 // Scrollbars won't be transformed within us | 3714 // Scrollbars won't be transformed within us |
3715 IntRect newRect = localRect; | 3715 IntRect newRect = localRect; |
3716 newRect.moveBy(scrollbar->location()); | 3716 newRect.moveBy(scrollbar.location()); |
3717 return newRect; | 3717 return newRect; |
3718 } | 3718 } |
3719 | 3719 |
3720 IntRect FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar* scrol
lbar, const IntRect& parentRect) const | 3720 IntRect FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar& scrol
lbar, const IntRect& parentRect) const |
3721 { | 3721 { |
3722 IntRect newRect = parentRect; | 3722 IntRect newRect = parentRect; |
3723 // Scrollbars won't be transformed within us | 3723 // Scrollbars won't be transformed within us |
3724 newRect.moveBy(-scrollbar->location()); | 3724 newRect.moveBy(-scrollbar.location()); |
3725 return newRect; | 3725 return newRect; |
3726 } | 3726 } |
3727 | 3727 |
3728 // FIXME: test these on windows | 3728 // FIXME: test these on windows |
3729 IntPoint FrameView::convertFromScrollbarToContainingWidget(const Scrollbar* scro
llbar, const IntPoint& localPoint) const | 3729 IntPoint FrameView::convertFromScrollbarToContainingWidget(const Scrollbar& scro
llbar, const IntPoint& localPoint) const |
3730 { | 3730 { |
3731 // Scrollbars won't be transformed within us | 3731 // Scrollbars won't be transformed within us |
3732 IntPoint newPoint = localPoint; | 3732 IntPoint newPoint = localPoint; |
3733 newPoint.moveBy(scrollbar->location()); | 3733 newPoint.moveBy(scrollbar.location()); |
3734 return newPoint; | 3734 return newPoint; |
3735 } | 3735 } |
3736 | 3736 |
3737 IntPoint FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar* scro
llbar, const IntPoint& parentPoint) const | 3737 IntPoint FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar& scro
llbar, const IntPoint& parentPoint) const |
3738 { | 3738 { |
3739 IntPoint newPoint = parentPoint; | 3739 IntPoint newPoint = parentPoint; |
3740 // Scrollbars won't be transformed within us | 3740 // Scrollbars won't be transformed within us |
3741 newPoint.moveBy(-scrollbar->location()); | 3741 newPoint.moveBy(-scrollbar.location()); |
3742 return newPoint; | 3742 return newPoint; |
3743 } | 3743 } |
3744 | 3744 |
3745 void FrameView::setParentVisible(bool visible) | 3745 void FrameView::setParentVisible(bool visible) |
3746 { | 3746 { |
3747 if (isParentVisible() == visible) | 3747 if (isParentVisible() == visible) |
3748 return; | 3748 return; |
3749 | 3749 |
3750 Widget::setParentVisible(visible); | 3750 Widget::setParentVisible(visible); |
3751 | 3751 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3985 return m_hiddenForThrottling && m_crossOriginForThrottling; | 3985 return m_hiddenForThrottling && m_crossOriginForThrottling; |
3986 } | 3986 } |
3987 | 3987 |
3988 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 3988 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
3989 { | 3989 { |
3990 ASSERT(layoutView()); | 3990 ASSERT(layoutView()); |
3991 return *layoutView(); | 3991 return *layoutView(); |
3992 } | 3992 } |
3993 | 3993 |
3994 } // namespace blink | 3994 } // namespace blink |
OLD | NEW |