Changeset 99511 in webkit
- Timestamp:
- Nov 7, 2011 6:11:06 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r99510 r99511 1 2011-11-07 Emil A Eklund <eae@chromium.org> 2 3 Revert platform and scrolling to ints 4 https://bugs.webkit.org/show_bug.cgi?id=71585 5 6 Reviewed by Eric Seidel. 7 8 Replace all uses of LayoutUnit and related types with ints in platform 9 and scrolling code. 10 11 No new tests. 12 13 * page/FrameView.cpp: 14 * page/FrameView.h: 15 * platform/PopupMenuClient.h: 16 * platform/ScrollAnimatorNone.cpp: 17 * platform/ScrollAnimatorNone.h: 18 * platform/ScrollView.cpp: 19 * platform/ScrollView.h: 20 * platform/ScrollableArea.h: 21 * rendering/RenderLayer.cpp: 22 * rendering/RenderLayer.h: 23 * rendering/RenderListBox.cpp: 24 * rendering/RenderListBox.h: 25 * rendering/RenderMenuList.cpp: 26 * rendering/RenderMenuList.h: 27 * rendering/RenderTextControlSingleLine.cpp: 28 * rendering/RenderTextControlSingleLine.h: 29 1 30 2011-11-07 Kentaro Hara <haraken@chromium.org> 2 31 -
trunk/Source/WebCore/page/FrameView.cpp
r99508 r99511 1358 1358 } 1359 1359 1360 LayoutUnit FrameView::scrollXForFixedPosition() const1361 { 1362 LayoutUnit visibleContentWidth = visibleContentRect().width();1363 LayoutUnit maxX = contentsWidth() - visibleContentWidth;1360 int FrameView::scrollXForFixedPosition() const 1361 { 1362 int visibleContentWidth = visibleContentRect().width(); 1363 int maxX = contentsWidth() - visibleContentWidth; 1364 1364 1365 1365 if (maxX == 0) 1366 1366 return 0; 1367 1367 1368 LayoutUnit x = scrollX();1368 int x = scrollX(); 1369 1369 1370 1370 if (!scrollOrigin().x()) { … … 1393 1393 } 1394 1394 1395 LayoutUnit FrameView::scrollYForFixedPosition() const1396 { 1397 LayoutUnit visibleContentHeight = visibleContentRect().height();1398 1399 LayoutUnit maxY = contentsHeight() - visibleContentHeight;1395 int FrameView::scrollYForFixedPosition() const 1396 { 1397 int visibleContentHeight = visibleContentRect().height(); 1398 1399 int maxY = contentsHeight() - visibleContentHeight; 1400 1400 if (maxY == 0) 1401 1401 return 0; 1402 1402 1403 LayoutUnit y = scrollY();1403 int y = scrollY(); 1404 1404 1405 1405 if (!scrollOrigin().y()) { … … 1424 1424 } 1425 1425 1426 LayoutSize FrameView::scrollOffsetForFixedPosition() const1427 { 1428 return LayoutSize(scrollXForFixedPosition(), scrollYForFixedPosition());1429 } 1430 1431 LayoutPoint FrameView::currentMousePosition() const1426 IntSize FrameView::scrollOffsetForFixedPosition() const 1427 { 1428 return IntSize(scrollXForFixedPosition(), scrollYForFixedPosition()); 1429 } 1430 1431 IntPoint FrameView::currentMousePosition() const 1432 1432 { 1433 1433 return m_frame ? m_frame->eventHandler()->currentMousePosition() : IntPoint(); -
trunk/Source/WebCore/page/FrameView.h
r99040 r99511 28 28 #include "AdjustViewSizeOrNot.h" 29 29 #include "Color.h" 30 #include "LayoutTypes.h" 30 31 #include "PaintPhase.h" 31 32 #include "ScrollView.h" … … 65 66 virtual HostWindow* hostWindow() const; 66 67 67 virtual void invalidateRect(const LayoutRect&);68 virtual void setFrameRect(const LayoutRect&);68 virtual void invalidateRect(const IntRect&); 69 virtual void setFrameRect(const IntRect&); 69 70 70 71 #if ENABLE(REQUEST_ANIMATION_FRAME) … … 89 90 virtual void willRemoveHorizontalScrollbar(Scrollbar*); 90 91 91 virtual void setContentsSize(const LayoutSize&);92 virtual void setContentsSize(const IntSize&); 92 93 93 94 void layout(bool allowSubtree = true); … … 167 168 168 169 virtual void setFixedVisibleContentRect(const IntRect&) OVERRIDE; 169 void setScrollPosition(const LayoutPoint&);170 void setScrollPosition(const IntPoint&); 170 171 void scrollPositionChangedViaPlatformWidget(); 171 172 virtual void repaintFixedElementsAfterScrolling(); … … 192 193 // Functions for querying the current scrolled position, negating the effects of overhang 193 194 // and adjusting for page scale. 194 LayoutUnit scrollXForFixedPosition() const;195 LayoutUnit scrollYForFixedPosition() const;196 LayoutSize scrollOffsetForFixedPosition() const;195 int scrollXForFixedPosition() const; 196 int scrollYForFixedPosition() const; 197 IntSize scrollOffsetForFixedPosition() const; 197 198 198 199 void beginDeferredRepaints(); … … 268 269 269 270 // Methods to convert points and rects between the coordinate space of the renderer, and this view. 270 virtual LayoutRect convertFromRenderer(const RenderObject*, const LayoutRect&) const;271 virtual LayoutRect convertToRenderer(const RenderObject*, const LayoutRect&) const;272 virtual LayoutPoint convertFromRenderer(const RenderObject*, const LayoutPoint&) const;273 virtual LayoutPoint convertToRenderer(const RenderObject*, const LayoutPoint&) const;271 virtual IntRect convertFromRenderer(const RenderObject*, const IntRect&) const; 272 virtual IntRect convertToRenderer(const RenderObject*, const IntRect&) const; 273 virtual IntPoint convertFromRenderer(const RenderObject*, const IntPoint&) const; 274 virtual IntPoint convertToRenderer(const RenderObject*, const IntPoint&) const; 274 275 275 276 bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; } … … 286 287 static void setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(double p); 287 288 288 virtual LayoutPoint currentMousePosition() const;289 virtual IntPoint currentMousePosition() const; 289 290 290 291 // FIXME: Remove this method once plugin loading is decoupled from layout. … … 302 303 bool isTrackingRepaints() const { return m_isTrackingRepaints; } 303 304 void resetTrackedRepaints() { m_trackedRepaintRects.clear(); } 304 const Vector< LayoutRect>& trackedRepaintRects() const { return m_trackedRepaintRects; }305 const Vector<IntRect>& trackedRepaintRects() const { return m_trackedRepaintRects; } 305 306 306 307 protected: … … 342 343 // Override ScrollView methods to do point conversion via renderers, in order to 343 344 // take transforms into account. 344 virtual LayoutRect convertToContainingView(const LayoutRect&) const;345 virtual LayoutRect convertFromContainingView(const LayoutRect&) const;346 virtual LayoutPoint convertToContainingView(const LayoutPoint&) const;347 virtual LayoutPoint convertFromContainingView(const LayoutPoint&) const;345 virtual IntRect convertToContainingView(const IntRect&) const; 346 virtual IntRect convertFromContainingView(const IntRect&) const; 347 virtual IntPoint convertToContainingView(const IntPoint&) const; 348 virtual IntPoint convertFromContainingView(const IntPoint&) const; 348 349 349 350 // ScrollableArea interface 350 virtual void invalidateScrollbarRect(Scrollbar*, const LayoutRect&);351 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&); 351 352 virtual bool isActive() const; 352 virtual void getTickmarks(Vector< LayoutRect>&) const;353 virtual void getTickmarks(Vector<IntRect>&) const; 353 354 virtual void scrollTo(const IntSize&); 354 355 virtual void didStartRubberBand(const IntSize&) const; … … 356 357 virtual void didStartAnimatedScroll() const; 357 358 virtual void didCompleteAnimatedScroll() const; 358 virtual void setVisibleScrollerThumbRect(const LayoutRect&);359 virtual void setVisibleScrollerThumbRect(const IntRect&); 359 360 virtual bool isOnActivePage() const; 360 361 virtual ScrollableArea* enclosingScrollableArea() const; … … 457 458 458 459 bool m_isTrackingRepaints; // Used for testing. 459 Vector< LayoutRect> m_trackedRepaintRects;460 Vector<IntRect> m_trackedRepaintRects; 460 461 461 462 bool m_shouldUpdateWhileOffscreen; -
trunk/Source/WebCore/platform/PopupMenuClient.h
r99016 r99511 23 23 #define PopupMenuClient_h 24 24 25 #include "LayoutTypes.h"26 25 #include "PopupMenuStyle.h" 27 26 #include "ScrollTypes.h" … … 53 52 virtual int clientInsetLeft() const = 0; 54 53 virtual int clientInsetRight() const = 0; 55 virtual LayoutUnit clientPaddingLeft() const = 0;56 virtual LayoutUnit clientPaddingRight() const = 0;54 virtual int clientPaddingLeft() const = 0; 55 virtual int clientPaddingRight() const = 0; 57 56 virtual int listSize() const = 0; 58 57 virtual int selectedIndex() const = 0; -
trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp
r97902 r99511 203 203 } 204 204 205 ScrollAnimatorNone::PerAxisData::PerAxisData(ScrollAnimatorNone* parent, float* currentPosition, LayoutUnit visibleLength)205 ScrollAnimatorNone::PerAxisData::PerAxisData(ScrollAnimatorNone* parent, float* currentPosition, int visibleLength) 206 206 : m_currentPosition(currentPosition) 207 207 , m_visibleLength(visibleLength) … … 367 367 } 368 368 369 void ScrollAnimatorNone::PerAxisData::updateVisibleLength( LayoutUnit visibleLength)369 void ScrollAnimatorNone::PerAxisData::updateVisibleLength(int visibleLength) 370 370 { 371 371 m_visibleLength = visibleLength; -
trunk/Source/WebCore/platform/ScrollAnimatorNone.h
r97195 r99511 34 34 #if ENABLE(SMOOTH_SCROLLING) 35 35 36 #include "LayoutTypes.h"37 36 #include "ScrollAnimator.h" 38 37 #include "Timer.h" … … 94 93 95 94 struct PerAxisData { 96 PerAxisData(ScrollAnimatorNone* parent, float* currentPos, LayoutUnit visibleLength);95 PerAxisData(ScrollAnimatorNone* parent, float* currentPos, int visibleLength); 97 96 void reset(); 98 97 bool updateDataFromParameters(float step, float multiplier, float scrollableSize, double currentTime, Parameters*); 99 98 bool animateScroll(double currentTime); 100 void updateVisibleLength( LayoutUnit visibleLength);99 void updateVisibleLength(int visibleLength); 101 100 102 101 static double curveAt(Curve, double t); … … 130 129 Curve m_releaseCurve; 131 130 132 LayoutUnit m_visibleLength;131 int m_visibleLength; 133 132 }; 134 133 -
trunk/Source/WebCore/platform/ScrollView.cpp
r99040 r99511 232 232 return m_fixedVisibleContentRect; 233 233 234 LayoutUnit verticalScrollbarWidth = verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar()234 int verticalScrollbarWidth = verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar() 235 235 && !includeScrollbars ? verticalScrollbar()->width() : 0; 236 LayoutUnit horizontalScrollbarHeight = horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar()236 int horizontalScrollbarHeight = horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar() 237 237 && !includeScrollbars ? horizontalScrollbar()->height() : 0; 238 238 239 return LayoutRect(LayoutPoint(m_scrollOffset.width(), m_scrollOffset.height()),240 LayoutSize(max<LayoutUnit>(0, width() - verticalScrollbarWidth),241 max<LayoutUnit>(0, height() - horizontalScrollbarHeight)));242 243 } 244 #endif 245 246 LayoutUnit ScrollView::layoutWidth() const239 return IntRect(m_scrollOffset.width(), 240 m_scrollOffset.height(), 241 max(0, width() - verticalScrollbarWidth), 242 max(0, height() - horizontalScrollbarHeight)); 243 } 244 #endif 245 246 int ScrollView::layoutWidth() const 247 247 { 248 248 return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? visibleWidth() : m_fixedLayoutSize.width(); 249 249 } 250 250 251 LayoutUnit ScrollView::layoutHeight() const251 int ScrollView::layoutHeight() const 252 252 { 253 253 return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? visibleHeight() : m_fixedLayoutSize.height(); 254 254 } 255 255 256 LayoutSize ScrollView::fixedLayoutSize() const256 IntSize ScrollView::fixedLayoutSize() const 257 257 { 258 258 return m_fixedLayoutSize; 259 259 } 260 260 261 void ScrollView::setFixedLayoutSize(const LayoutSize& newSize)261 void ScrollView::setFixedLayoutSize(const IntSize& newSize) 262 262 { 263 263 if (fixedLayoutSize() == newSize) … … 280 280 } 281 281 282 LayoutSize ScrollView::contentsSize() const282 IntSize ScrollView::contentsSize() const 283 283 { 284 284 return m_contentsSize; 285 285 } 286 286 287 void ScrollView::setContentsSize(const LayoutSize& newSize)287 void ScrollView::setContentsSize(const IntSize& newSize) 288 288 { 289 289 if (contentsSize() == newSize) … … 406 406 } 407 407 408 LayoutSize ScrollView::overhangAmount() const409 { 410 LayoutSize stretch;411 412 LayoutUnit physicalScrollY = scrollPosition().y() + scrollOrigin().y();408 IntSize ScrollView::overhangAmount() const 409 { 410 IntSize stretch; 411 412 int physicalScrollY = scrollPosition().y() + scrollOrigin().y(); 413 413 if (physicalScrollY < 0) 414 414 stretch.setHeight(physicalScrollY); … … 416 416 stretch.setHeight(physicalScrollY - (contentsHeight() - visibleHeight())); 417 417 418 LayoutUnit physicalScrollX = scrollPosition().x() + scrollOrigin().x();418 int physicalScrollX = scrollPosition().x() + scrollOrigin().x(); 419 419 if (physicalScrollX < 0) 420 420 stretch.setWidth(physicalScrollX); … … 449 449 } 450 450 451 LayoutRect oldScrollCornerRect = scrollCornerRect();451 IntRect oldScrollCornerRect = scrollCornerRect(); 452 452 453 453 bool hasHorizontalScrollbar = m_horizontalScrollbar; … … 473 473 bool sendContentResizedNotification = false; 474 474 475 LayoutSize docSize = contentsSize();476 LayoutSize frameSize = frameRect().size();475 IntSize docSize = contentsSize(); 476 IntSize frameSize = frameRect().size(); 477 477 478 478 if (hScroll == ScrollbarAuto) { … … 516 516 contentsResized(); 517 517 visibleContentsResized(); 518 LayoutSize newDocSize = contentsSize();518 IntSize newDocSize = contentsSize(); 519 519 if (newDocSize == docSize) { 520 520 // The layout with the new scroll state had no impact on … … 536 536 if (m_horizontalScrollbar) { 537 537 int clientWidth = visibleWidth(); 538 LayoutUnit pageStep = max<LayoutUnit>(max<LayoutUnit>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);539 LayoutRect oldRect(m_horizontalScrollbar->frameRect());540 LayoutRect hBarRect = LayoutRect(0,541 542 543 538 int pageStep = max(max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1); 539 IntRect oldRect(m_horizontalScrollbar->frameRect()); 540 IntRect hBarRect(0, 541 height() - m_horizontalScrollbar->height(), 542 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0), 543 m_horizontalScrollbar->height()); 544 544 m_horizontalScrollbar->setFrameRect(hBarRect); 545 545 if (!m_scrollbarsSuppressed && oldRect != m_horizontalScrollbar->frameRect()) … … 557 557 if (m_verticalScrollbar) { 558 558 int clientHeight = visibleHeight(); 559 LayoutUnit pageStep = max<LayoutUnit>(max<LayoutUnit>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);560 LayoutRect oldRect(m_verticalScrollbar->frameRect());561 LayoutRect vBarRect = LayoutRect(width() - m_verticalScrollbar->width(),562 0,563 m_verticalScrollbar->width(),564 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0));559 int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1); 560 IntRect oldRect(m_verticalScrollbar->frameRect()); 561 IntRect vBarRect(width() - m_verticalScrollbar->width(), 562 0, 563 m_verticalScrollbar->width(), 564 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0)); 565 565 m_verticalScrollbar->setFrameRect(vBarRect); 566 566 if (!m_scrollbarsSuppressed && oldRect != m_verticalScrollbar->frameRect()) … … 604 604 IntRect scrollViewRect = convertToContainingWindow(IntRect(0, 0, visibleWidth(), visibleHeight())); 605 605 if (hasOverlayScrollbars()) { 606 LayoutUnit verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0;607 LayoutUnit horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0;606 int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0; 607 int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0; 608 608 609 609 scrollViewRect.setWidth(scrollViewRect.width() - verticalScrollbarWidth); … … 631 631 // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers. 632 632 // https://bugs.webkit.org/show_bug.cgi?id=47837 633 LayoutUnit panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary634 LayoutPoint panIconDirtySquareLocation = LayoutPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));635 LayoutRect panScrollIconDirtyRect = LayoutRect(panIconDirtySquareLocation , LayoutSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));633 int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary 634 IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2)); 635 IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength)); 636 636 panScrollIconDirtyRect.intersect(clipRect); 637 637 hostWindow()->invalidateContentsAndWindow(panScrollIconDirtyRect, false /*immediate*/); … … 649 649 650 650 // Invalidate the overhang areas if they are visible. 651 LayoutRect horizontalOverhangRect;652 LayoutRect verticalOverhangRect;651 IntRect horizontalOverhangRect; 652 IntRect verticalOverhangRect; 653 653 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect); 654 654 #if USE(ACCELERATED_COMPOSITING) && PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING) … … 723 723 IntRect ScrollView::windowToContents(const IntRect& windowRect) const 724 724 { 725 LayoutRect viewRect = convertFromContainingWindow(windowRect);725 IntRect viewRect = convertFromContainingWindow(windowRect); 726 726 viewRect.move(scrollOffset()); 727 727 return viewRect; … … 744 744 } 745 745 746 LayoutPoint ScrollView::screenToContents(const IntPoint& point) const746 IntPoint ScrollView::screenToContents(const IntPoint& point) const 747 747 { 748 748 if (platformWidget()) 749 749 return platformScreenToContents(point); 750 750 if (!hostWindow()) 751 return LayoutPoint();751 return IntPoint(); 752 752 return windowToContents(hostWindow()->screenToWindow(point)); 753 753 } … … 813 813 return 0; 814 814 815 LayoutPoint viewPoint = convertFromContainingWindow(windowPoint);815 IntPoint viewPoint = convertFromContainingWindow(windowPoint); 816 816 if (m_horizontalScrollbar && m_horizontalScrollbar->frameRect().contains(viewPoint)) 817 817 return m_horizontalScrollbar.get(); … … 851 851 #endif 852 852 853 void ScrollView::setFrameRect(const LayoutRect& newRect)854 { 855 LayoutRect oldRect = frameRect();853 void ScrollView::setFrameRect(const IntRect& newRect) 854 { 855 IntRect oldRect = frameRect(); 856 856 857 857 if (newRect == oldRect) … … 884 884 return; 885 885 graphicsLayer->setDrawsContent(true); 886 LayoutRect scrollbarRect = scrollbar->frameRect();886 IntRect scrollbarRect = scrollbar->frameRect(); 887 887 graphicsLayer->setPosition(scrollbarRect.location()); 888 888 if (scrollbarRect.size() != graphicsLayer->size()) … … 891 891 } 892 892 893 static void positionScrollCornerLayer(GraphicsLayer* graphicsLayer, const LayoutRect& cornerRect)893 static void positionScrollCornerLayer(GraphicsLayer* graphicsLayer, const IntRect& cornerRect) 894 894 { 895 895 if (!graphicsLayer) … … 913 913 } 914 914 915 void ScrollView::repaintContentRectangle(const LayoutRect& rect, bool now)916 { 917 LayoutRect paintRect = rect;915 void ScrollView::repaintContentRectangle(const IntRect& rect, bool now) 916 { 917 IntRect paintRect = rect; 918 918 if (clipsRepaints() && !paintsEntireContents()) 919 919 paintRect.intersect(visibleContentRect()); … … 931 931 } 932 932 933 LayoutRect ScrollView::scrollCornerRect() const934 { 935 LayoutRect cornerRect;933 IntRect ScrollView::scrollCornerRect() const 934 { 935 IntRect cornerRect; 936 936 937 937 if (hasOverlayScrollbars()) … … 939 939 940 940 if (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0) { 941 cornerRect.unite( LayoutRect(m_horizontalScrollbar->width(),942 943 944 941 cornerRect.unite(IntRect(m_horizontalScrollbar->width(), 942 height() - m_horizontalScrollbar->height(), 943 width() - m_horizontalScrollbar->width(), 944 m_horizontalScrollbar->height())); 945 945 } 946 946 947 947 if (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0) { 948 cornerRect.unite( LayoutRect(width() - m_verticalScrollbar->width(),949 950 951 948 cornerRect.unite(IntRect(width() - m_verticalScrollbar->width(), 949 m_verticalScrollbar->height(), 950 m_verticalScrollbar->width(), 951 height() - m_verticalScrollbar->height())); 952 952 } 953 953 … … 970 970 } 971 971 972 void ScrollView::paintScrollCorner(GraphicsContext* context, const LayoutRect& cornerRect)972 void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect) 973 973 { 974 974 ScrollbarTheme::theme()->paintScrollCorner(this, context, cornerRect); 975 975 } 976 976 977 void ScrollView::invalidateScrollCornerRect(const LayoutRect& rect)977 void ScrollView::invalidateScrollCornerRect(const IntRect& rect) 978 978 { 979 979 invalidateRect(rect); 980 980 } 981 981 982 void ScrollView::paintScrollbars(GraphicsContext* context, const LayoutRect& rect)982 void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect) 983 983 { 984 984 if (m_horizontalScrollbar … … 1008 1008 } 1009 1009 1010 void ScrollView::paint(GraphicsContext* context, const LayoutRect& rect)1010 void ScrollView::paint(GraphicsContext* context, const IntRect& rect) 1011 1011 { 1012 1012 if (platformWidget()) { … … 1023 1023 m_containsScrollableAreaWithOverlayScrollbars = false; 1024 1024 1025 LayoutRect clipRect = frameRect();1025 IntRect clipRect = frameRect(); 1026 1026 if (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar()) 1027 1027 clipRect.setWidth(clipRect.width() - verticalScrollbar()->width()); … … 1029 1029 clipRect.setHeight(clipRect.height() - horizontalScrollbar()->height()); 1030 1030 1031 LayoutRect documentDirtyRect = rect;1031 IntRect documentDirtyRect = rect; 1032 1032 documentDirtyRect.intersect(clipRect); 1033 1033 … … 1058 1058 if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) { 1059 1059 GraphicsContextStateSaver stateSaver(*context); 1060 LayoutRect scrollViewDirtyRect = rect;1060 IntRect scrollViewDirtyRect = rect; 1061 1061 scrollViewDirtyRect.intersect(frameRect()); 1062 1062 context->translate(x(), y()); … … 1071 1071 } 1072 1072 1073 void ScrollView::calculateOverhangAreasForPainting( LayoutRect& horizontalOverhangRect, LayoutRect& verticalOverhangRect)1074 { 1075 LayoutUnit verticalScrollbarWidth = (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())1073 void ScrollView::calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect) 1074 { 1075 int verticalScrollbarWidth = (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar()) 1076 1076 ? verticalScrollbar()->width() : 0; 1077 LayoutUnit horizontalScrollbarHeight = (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())1077 int horizontalScrollbarHeight = (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar()) 1078 1078 ? horizontalScrollbar()->height() : 0; 1079 1079 1080 LayoutUnit physicalScrollY = scrollPosition().y() + scrollOrigin().y();1080 int physicalScrollY = scrollPosition().y() + scrollOrigin().y(); 1081 1081 if (physicalScrollY < 0) { 1082 1082 horizontalOverhangRect = frameRect(); 1083 1083 horizontalOverhangRect.setHeight(-physicalScrollY); 1084 1084 } else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) { 1085 LayoutUnit height = physicalScrollY - (contentsHeight() - visibleHeight());1085 int height = physicalScrollY - (contentsHeight() - visibleHeight()); 1086 1086 horizontalOverhangRect = frameRect(); 1087 1087 horizontalOverhangRect.setY(frameRect().maxY() - height - horizontalScrollbarHeight); … … 1089 1089 } 1090 1090 1091 LayoutUnit physicalScrollX = scrollPosition().x() + scrollOrigin().x();1091 int physicalScrollX = scrollPosition().x() + scrollOrigin().x(); 1092 1092 if (physicalScrollX < 0) { 1093 1093 verticalOverhangRect.setWidth(-physicalScrollX); … … 1099 1099 verticalOverhangRect.setY(frameRect().y()); 1100 1100 } else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) { 1101 LayoutUnit width = physicalScrollX - (contentsWidth() - visibleWidth());1101 int width = physicalScrollX - (contentsWidth() - visibleWidth()); 1102 1102 verticalOverhangRect.setWidth(width); 1103 1103 verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height()); … … 1110 1110 } 1111 1111 1112 void ScrollView::paintOverhangAreas(GraphicsContext* context, const LayoutRect& horizontalOverhangRect, const LayoutRect& verticalOverhangRect, const LayoutRect& dirtyRect)1112 void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect) 1113 1113 { 1114 1114 ScrollbarTheme::theme()->paintOverhangAreas(this, context, horizontalOverhangRect, verticalOverhangRect, dirtyRect); 1115 1115 } 1116 1116 1117 void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const LayoutRect& dirtyRect)1118 { 1119 LayoutRect horizontalOverhangRect;1120 LayoutRect verticalOverhangRect;1117 void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const IntRect& dirtyRect) 1118 { 1119 IntRect horizontalOverhangRect; 1120 IntRect verticalOverhangRect; 1121 1121 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect); 1122 1122 … … 1130 1130 return false; 1131 1131 1132 LayoutPoint viewPoint = convertFromContainingWindow(windowPoint);1132 IntPoint viewPoint = convertFromContainingWindow(windowPoint); 1133 1133 1134 1134 if (m_horizontalScrollbar) { 1135 LayoutUnit horizontalScrollbarYMin = m_horizontalScrollbar->frameRect().y();1136 LayoutUnit horizontalScrollbarYMax = m_horizontalScrollbar->frameRect().y() + m_horizontalScrollbar->frameRect().height();1137 LayoutUnit horizontalScrollbarXMin = m_horizontalScrollbar->frameRect().x() + m_horizontalScrollbar->frameRect().width();1135 int horizontalScrollbarYMin = m_horizontalScrollbar->frameRect().y(); 1136 int horizontalScrollbarYMax = m_horizontalScrollbar->frameRect().y() + m_horizontalScrollbar->frameRect().height(); 1137 int horizontalScrollbarXMin = m_horizontalScrollbar->frameRect().x() + m_horizontalScrollbar->frameRect().width(); 1138 1138 1139 1139 return viewPoint.y() > horizontalScrollbarYMin && viewPoint.y() < horizontalScrollbarYMax && viewPoint.x() > horizontalScrollbarXMin; 1140 1140 } 1141 1141 1142 LayoutUnit verticalScrollbarXMin = m_verticalScrollbar->frameRect().x();1143 LayoutUnit verticalScrollbarXMax = m_verticalScrollbar->frameRect().x() + m_verticalScrollbar->frameRect().width();1144 LayoutUnit verticalScrollbarYMin = m_verticalScrollbar->frameRect().y() + m_verticalScrollbar->frameRect().height();1142 int verticalScrollbarXMin = m_verticalScrollbar->frameRect().x(); 1143 int verticalScrollbarXMax = m_verticalScrollbar->frameRect().x() + m_verticalScrollbar->frameRect().width(); 1144 int verticalScrollbarYMin = m_verticalScrollbar->frameRect().y() + m_verticalScrollbar->frameRect().height(); 1145 1145 1146 1146 return viewPoint.x() > verticalScrollbarXMin && viewPoint.x() < verticalScrollbarXMax && viewPoint.y() > verticalScrollbarYMin; … … 1153 1153 } 1154 1154 1155 LayoutRect ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutRect& localRect) const1155 IntRect ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& localRect) const 1156 1156 { 1157 1157 // Scrollbars won't be transformed within us 1158 LayoutRect newRect = localRect;1158 IntRect newRect = localRect; 1159 1159 newRect.moveBy(scrollbar->location()); 1160 1160 return newRect; 1161 1161 } 1162 1162 1163 LayoutRect ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutRect& parentRect) const1164 { 1165 LayoutRect newRect = parentRect;1163 IntRect ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const 1164 { 1165 IntRect newRect = parentRect; 1166 1166 // Scrollbars won't be transformed within us 1167 1167 newRect.moveBy(-scrollbar->location()); … … 1170 1170 1171 1171 // FIXME: test these on windows 1172 LayoutPoint ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutPoint& localPoint) const1172 IntPoint ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& localPoint) const 1173 1173 { 1174 1174 // Scrollbars won't be transformed within us 1175 LayoutPoint newPoint = localPoint;1175 IntPoint newPoint = localPoint; 1176 1176 newPoint.moveBy(scrollbar->location()); 1177 1177 return newPoint; 1178 1178 } 1179 1179 1180 LayoutPoint ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutPoint& parentPoint) const1181 { 1182 LayoutPoint newPoint = parentPoint;1180 IntPoint ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const 1181 { 1182 IntPoint newPoint = parentPoint; 1183 1183 // Scrollbars won't be transformed within us 1184 1184 newPoint.moveBy(-scrollbar->location()); … … 1243 1243 1244 1244 1245 void ScrollView::addPanScrollIcon(const LayoutPoint& iconPosition)1245 void ScrollView::addPanScrollIcon(const IntPoint& iconPosition) 1246 1246 { 1247 1247 if (!hostWindow()) … … 1347 1347 } 1348 1348 1349 IntRect ScrollView::platformContentsToScreen(const LayoutRect& rect) const1349 IntRect ScrollView::platformContentsToScreen(const IntRect& rect) const 1350 1350 { 1351 1351 return rect; 1352 1352 } 1353 1353 1354 LayoutPoint ScrollView::platformScreenToContents(const IntPoint& point) const1354 IntPoint ScrollView::platformScreenToContents(const IntPoint& point) const 1355 1355 { 1356 1356 return point; … … 1366 1366 } 1367 1367 1368 void ScrollView::platformRepaintContentRectangle(const LayoutRect&, bool /*now*/)1368 void ScrollView::platformRepaintContentRectangle(const IntRect&, bool /*now*/) 1369 1369 { 1370 1370 } -
trunk/Source/WebCore/platform/ScrollView.h
r99002 r99511 147 147 virtual IntRect visibleContentRect(bool includeScrollbars = false) const; 148 148 virtual void setFixedVisibleContentRect(const IntRect& visibleContentRect) { m_fixedVisibleContentRect = visibleContentRect; } 149 LayoutUnit visibleWidth() const { return visibleContentRect().width(); }150 LayoutUnit visibleHeight() const { return visibleContentRect().height(); }149 int visibleWidth() const { return visibleContentRect().width(); } 150 int visibleHeight() const { return visibleContentRect().height(); } 151 151 152 152 // Functions for getting/setting the size webkit should use to layout the contents. By default this is the same as the visible … … 280 280 virtual bool isPointInScrollbarCorner(const IntPoint&); 281 281 virtual bool scrollbarCornerPresent() const; 282 virtual LayoutRect scrollCornerRect() const;282 virtual IntRect scrollCornerRect() const; 283 283 virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect); 284 284 -
trunk/Source/WebCore/platform/ScrollableArea.h
r99002 r99511 27 27 #define ScrollableArea_h 28 28 29 #include "LayoutTypes.h"30 29 #include "Scrollbar.h" 31 30 #include <wtf/Vector.h> … … 93 92 void invalidateScrollbar(Scrollbar*, const IntRect&); 94 93 virtual bool isScrollCornerVisible() const = 0; 95 virtual LayoutRect scrollCornerRect() const = 0;94 virtual IntRect scrollCornerRect() const = 0; 96 95 void invalidateScrollCorner(const IntRect&); 97 96 virtual void getTickmarks(Vector<IntRect>&) const { } … … 128 127 virtual IntPoint maximumScrollPosition() const { ASSERT_NOT_REACHED(); return IntPoint(); } 129 128 virtual IntRect visibleContentRect(bool /*includeScrollbars*/ = false) const { ASSERT_NOT_REACHED(); return IntRect(); } 130 virtual LayoutUnit visibleHeight() const { ASSERT_NOT_REACHED(); return 0; }131 virtual LayoutUnit visibleWidth() const { ASSERT_NOT_REACHED(); return 0; }129 virtual int visibleHeight() const { ASSERT_NOT_REACHED(); return 0; } 130 virtual int visibleWidth() const { ASSERT_NOT_REACHED(); return 0; } 132 131 virtual IntSize contentsSize() const { ASSERT_NOT_REACHED(); return IntSize(); } 133 132 virtual IntSize overhangAmount() const { ASSERT_NOT_REACHED(); return IntSize(); } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r99307 r99511 1298 1298 return; 1299 1299 1300 LayoutPoint currentMousePosition = frame->eventHandler()->currentMousePosition();1300 IntPoint currentMousePosition = frame->eventHandler()->currentMousePosition(); 1301 1301 1302 1302 // We need to check if the current mouse position is out of the window. When the mouse is out of the window, the position is incoherent 1303 static LayoutPoint previousMousePosition;1303 static IntPoint previousMousePosition; 1304 1304 if (currentMousePosition.x() < 0 || currentMousePosition.y() < 0) 1305 1305 currentMousePosition = previousMousePosition; … … 1307 1307 previousMousePosition = currentMousePosition; 1308 1308 1309 LayoutUnit xDelta = currentMousePosition.x() - sourcePoint.x();1310 LayoutUnit yDelta = currentMousePosition.y() - sourcePoint.y();1309 int xDelta = currentMousePosition.x() - sourcePoint.x(); 1310 int yDelta = currentMousePosition.y() - sourcePoint.y(); 1311 1311 1312 1312 if (abs(xDelta) <= ScrollView::noPanScrollRadius) // at the center we let the space for the icon … … 1346 1346 // If we are here, we were called on a renderer that can be programmatically scrolled, but doesn't 1347 1347 // have an overflow clip. Which means that it is a document node that can be scrolled. 1348 renderer()->view()->frameView()->scrollBy( LayoutSize(xDelta, yDelta));1348 renderer()->view()->frameView()->scrollBy(IntSize(xDelta, yDelta)); 1349 1349 // FIXME: If we didn't scroll the whole way, do we want to try looking at the frames ownerElement? 1350 1350 // https://bugs.webkit.org/show_bug.cgi?id=28237 … … 1369 1369 } 1370 1370 1371 void RenderLayer::scrollTo( LayoutUnit x, LayoutUnit y)1371 void RenderLayer::scrollTo(int x, int y) 1372 1372 { 1373 1373 RenderBox* box = renderBox(); … … 1386 1386 // is either occluded by another layer or clipped by an enclosing 1387 1387 // layer or contains fixed backgrounds, etc.). 1388 LayoutSize newScrollOffset = LayoutSize(x - scrollOrigin().x(), y - scrollOrigin().y());1388 IntSize newScrollOffset = IntSize(x - scrollOrigin().x(), y - scrollOrigin().y()); 1389 1389 if (m_scrollOffset == newScrollOffset) 1390 1390 return; … … 1502 1502 yOffset = max<LayoutUnit>(0, min(frameView->contentsHeight(), yOffset)); 1503 1503 1504 frameView->setScrollPosition( LayoutPoint(xOffset, yOffset));1504 frameView->setScrollPosition(IntPoint(xOffset, yOffset)); 1505 1505 parentLayer = renderer()->document()->ownerElement()->renderer()->enclosingLayer(); 1506 1506 newRect.setX(rect.x() - frameView->scrollX() + frameView->x()); … … 1619 1619 #endif 1620 1620 1621 LayoutPoint currentDocumentPosition = frameView->windowToContents(frame->eventHandler()->currentMousePosition());1621 IntPoint currentDocumentPosition = frameView->windowToContents(frame->eventHandler()->currentMousePosition()); 1622 1622 scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); 1623 1623 } … … 1688 1688 } 1689 1689 1690 LayoutUnit RenderLayer::scrollSize(ScrollbarOrientation orientation) const1690 int RenderLayer::scrollSize(ScrollbarOrientation orientation) const 1691 1691 { 1692 1692 Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_hBar : m_vBar).get(); … … 1694 1694 } 1695 1695 1696 void RenderLayer::setScrollOffset(const LayoutPoint& offset)1696 void RenderLayer::setScrollOffset(const IntPoint& offset) 1697 1697 { 1698 1698 scrollTo(offset.x(), offset.y()); 1699 1699 } 1700 1700 1701 LayoutUnit RenderLayer::scrollPosition(Scrollbar* scrollbar) const1701 int RenderLayer::scrollPosition(Scrollbar* scrollbar) const 1702 1702 { 1703 1703 if (scrollbar->orientation() == HorizontalScrollbar) … … 1708 1708 } 1709 1709 1710 LayoutPoint RenderLayer::scrollPosition() const1710 IntPoint RenderLayer::scrollPosition() const 1711 1711 { 1712 1712 return scrollOrigin() + m_scrollOffset; 1713 1713 } 1714 1714 1715 LayoutPoint RenderLayer::minimumScrollPosition() const1715 IntPoint RenderLayer::minimumScrollPosition() const 1716 1716 { 1717 1717 return scrollOrigin(); 1718 1718 } 1719 1719 1720 LayoutPoint RenderLayer::maximumScrollPosition() const1720 IntPoint RenderLayer::maximumScrollPosition() const 1721 1721 { 1722 1722 // FIXME: m_scrollSize may not be up-to-date if m_scrollDimensionsDirty is true. … … 1738 1738 } 1739 1739 1740 LayoutSize RenderLayer::overhangAmount() const1741 { 1742 return LayoutSize();1743 } 1744 1745 void RenderLayer::didCompleteRubberBand(const LayoutSize&) const1740 IntSize RenderLayer::overhangAmount() const 1741 { 1742 return IntSize(); 1743 } 1744 1745 void RenderLayer::didCompleteRubberBand(const IntSize&) const 1746 1746 { 1747 1747 } … … 1753 1753 } 1754 1754 1755 static LayoutRect cornerRect(const RenderLayer* layer, const LayoutRect& bounds)1755 static IntRect cornerRect(const RenderLayer* layer, const IntRect& bounds) 1756 1756 { 1757 1757 int horizontalThickness; … … 1772 1772 verticalThickness = layer->horizontalScrollbar()->height(); 1773 1773 } 1774 return LayoutRect(bounds.maxX() - horizontalThickness - layer->renderer()->style()->borderRightWidth(),1775 1776 1777 } 1778 1779 LayoutRect RenderLayer::scrollCornerRect() const1774 return IntRect(bounds.maxX() - horizontalThickness - layer->renderer()->style()->borderRightWidth(), 1775 bounds.maxY() - verticalThickness - layer->renderer()->style()->borderBottomWidth(), 1776 horizontalThickness, verticalThickness); 1777 } 1778 1779 IntRect RenderLayer::scrollCornerRect() const 1780 1780 { 1781 1781 // We have a scrollbar corner when a scrollbar is visible and not filling the entire length of the box. … … 1788 1788 if ((hasHorizontalBar && hasVerticalBar) || (hasResizer && (hasHorizontalBar || hasVerticalBar))) 1789 1789 return cornerRect(this, renderBox()->borderBoxRect()); 1790 return LayoutRect();1791 } 1792 1793 static LayoutRect resizerCornerRect(const RenderLayer* layer, const LayoutRect& bounds)1790 return IntRect(); 1791 } 1792 1793 static IntRect resizerCornerRect(const RenderLayer* layer, const IntRect& bounds) 1794 1794 { 1795 1795 ASSERT(layer->renderer()->isBox()); 1796 1796 if (layer->renderer()->style()->resize() == RESIZE_NONE) 1797 return LayoutRect();1797 return IntRect(); 1798 1798 return cornerRect(layer, bounds); 1799 1799 } 1800 1800 1801 LayoutRect RenderLayer::scrollCornerAndResizerRect() const1801 IntRect RenderLayer::scrollCornerAndResizerRect() const 1802 1802 { 1803 1803 RenderBox* box = renderBox(); 1804 1804 if (!box) 1805 return LayoutRect();1806 LayoutRect scrollCornerAndResizer = scrollCornerRect();1805 return IntRect(); 1806 IntRect scrollCornerAndResizer = scrollCornerRect(); 1807 1807 if (scrollCornerAndResizer.isEmpty()) 1808 1808 scrollCornerAndResizer = resizerCornerRect(this, box->borderBoxRect()); … … 1816 1816 } 1817 1817 1818 LayoutRect RenderLayer::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutRect& scrollbarRect) const1818 IntRect RenderLayer::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const 1819 1819 { 1820 1820 RenderView* view = renderer()->view(); … … 1822 1822 return scrollbarRect; 1823 1823 1824 LayoutRect rect = scrollbarRect;1824 IntRect rect = scrollbarRect; 1825 1825 rect.move(scrollbarOffset(scrollbar)); 1826 1826 … … 1828 1828 } 1829 1829 1830 LayoutRect RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutRect& parentRect) const1830 IntRect RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const 1831 1831 { 1832 1832 RenderView* view = renderer()->view(); … … 1834 1834 return parentRect; 1835 1835 1836 LayoutRect rect = view->frameView()->convertToRenderer(renderer(), parentRect);1836 IntRect rect = view->frameView()->convertToRenderer(renderer(), parentRect); 1837 1837 rect.move(-scrollbarOffset(scrollbar)); 1838 1838 return rect; 1839 1839 } 1840 1840 1841 LayoutPoint RenderLayer::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutPoint& scrollbarPoint) const1841 IntPoint RenderLayer::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const 1842 1842 { 1843 1843 RenderView* view = renderer()->view(); … … 1845 1845 return scrollbarPoint; 1846 1846 1847 LayoutPoint point = scrollbarPoint;1847 IntPoint point = scrollbarPoint; 1848 1848 point.move(scrollbarOffset(scrollbar)); 1849 1849 return view->frameView()->convertFromRenderer(renderer(), point); 1850 1850 } 1851 1851 1852 LayoutPoint RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutPoint& parentPoint) const1852 IntPoint RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const 1853 1853 { 1854 1854 RenderView* view = renderer()->view(); … … 1856 1856 return parentPoint; 1857 1857 1858 LayoutPoint point = view->frameView()->convertToRenderer(renderer(), parentPoint);1858 IntPoint point = view->frameView()->convertToRenderer(renderer(), parentPoint); 1859 1859 1860 1860 point.move(-scrollbarOffset(scrollbar)); … … 1862 1862 } 1863 1863 1864 LayoutSize RenderLayer::contentsSize() const1865 { 1866 return LayoutSize(const_cast<RenderLayer*>(this)->scrollWidth(), const_cast<RenderLayer*>(this)->scrollHeight());1867 } 1868 1869 LayoutUnit RenderLayer::visibleHeight() const1864 IntSize RenderLayer::contentsSize() const 1865 { 1866 return IntSize(const_cast<RenderLayer*>(this)->scrollWidth(), const_cast<RenderLayer*>(this)->scrollHeight()); 1867 } 1868 1869 int RenderLayer::visibleHeight() const 1870 1870 { 1871 1871 return m_layerSize.height(); 1872 1872 } 1873 1873 1874 LayoutUnit RenderLayer::visibleWidth() const1874 int RenderLayer::visibleWidth() const 1875 1875 { 1876 1876 return m_layerSize.width(); … … 1890 1890 } 1891 1891 1892 LayoutPoint RenderLayer::currentMousePosition() const1893 { 1894 return renderer()->frame() ? renderer()->frame()->eventHandler()->currentMousePosition() : LayoutPoint();1895 } 1896 1897 LayoutSize RenderLayer::scrollbarOffset(const Scrollbar* scrollbar) const1892 IntPoint RenderLayer::currentMousePosition() const 1893 { 1894 return renderer()->frame() ? renderer()->frame()->eventHandler()->currentMousePosition() : IntPoint(); 1895 } 1896 1897 IntSize RenderLayer::scrollbarOffset(const Scrollbar* scrollbar) const 1898 1898 { 1899 1899 RenderBox* box = renderBox(); 1900 1900 1901 1901 if (scrollbar == m_vBar.get()) 1902 return LayoutSize(box->width() - box->borderRight() - scrollbar->width(), box->borderTop());1902 return IntSize(box->width() - box->borderRight() - scrollbar->width(), box->borderTop()); 1903 1903 1904 1904 if (scrollbar == m_hBar.get()) 1905 return LayoutSize(box->borderLeft(), box->height() - box->borderBottom() - scrollbar->height());1905 return IntSize(box->borderLeft(), box->height() - box->borderBottom() - scrollbar->height()); 1906 1906 1907 1907 ASSERT_NOT_REACHED(); 1908 return LayoutSize();1909 } 1910 1911 void RenderLayer::invalidateScrollbarRect(Scrollbar* scrollbar, const LayoutRect& rect)1908 return IntSize(); 1909 } 1910 1911 void RenderLayer::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect) 1912 1912 { 1913 1913 #if USE(ACCELERATED_COMPOSITING) … … 1924 1924 } 1925 1925 #endif 1926 LayoutRect scrollRect = rect;1926 IntRect scrollRect = rect; 1927 1927 RenderBox* box = renderBox(); 1928 1928 ASSERT(box); … … 1934 1934 } 1935 1935 1936 void RenderLayer::invalidateScrollCornerRect(const LayoutRect& rect)1936 void RenderLayer::invalidateScrollCornerRect(const IntRect& rect) 1937 1937 { 1938 1938 #if USE(ACCELERATED_COMPOSITING) … … 2104 2104 return; 2105 2105 2106 const LayoutRect&borderBox = box->borderBoxRect();2107 const LayoutRect& scrollCorner = scrollCornerRect();2108 LayoutRect absBounds(borderBox.location() + offsetFromLayer, borderBox.size());2106 const IntRect borderBox = box->borderBoxRect(); 2107 const IntRect& scrollCorner = scrollCornerRect(); 2108 IntRect absBounds(borderBox.location() + offsetFromLayer, borderBox.size()); 2109 2109 if (m_vBar) 2110 m_vBar->setFrameRect( LayoutRect(absBounds.maxX() - box->borderRight() - m_vBar->width(),2111 2112 2113 2110 m_vBar->setFrameRect(IntRect(absBounds.maxX() - box->borderRight() - m_vBar->width(), 2111 absBounds.y() + box->borderTop(), 2112 m_vBar->width(), 2113 absBounds.height() - (box->borderTop() + box->borderBottom()) - scrollCorner.height())); 2114 2114 2115 2115 if (m_hBar) 2116 m_hBar->setFrameRect( LayoutRect(absBounds.x() + box->borderLeft(),2117 2118 2119 2116 m_hBar->setFrameRect(IntRect(absBounds.x() + box->borderLeft(), 2117 absBounds.maxY() - box->borderBottom() - m_hBar->height(), 2118 absBounds.width() - (box->borderLeft() + box->borderRight()) - scrollCorner.width(), 2119 m_hBar->height())); 2120 2120 2121 2121 #if USE(ACCELERATED_COMPOSITING) … … 2208 2208 m_scrollSize.setHeight(overflowBottom() - overflowTop()); 2209 2209 2210 setScrollOrigin( LayoutPoint(-m_scrollOverflow.width(), -m_scrollOverflow.height()));2210 setScrollOrigin(IntPoint(-m_scrollOverflow.width(), -m_scrollOverflow.height())); 2211 2211 2212 2212 if (needHBar) … … 2253 2253 // Layout may cause us to be in an invalid scroll position. In this case we need 2254 2254 // to pull our scroll offsets back to the max (or push them up to the min). 2255 LayoutUnit newX = max<LayoutUnit>(0, min(scrollXOffset(), scrollWidth() - box->clientWidth()));2256 LayoutUnit newY = max<LayoutUnit>(0, min(scrollYOffset(), scrollHeight() - box->clientHeight()));2255 int newX = max(0, min(scrollXOffset(), scrollWidth() - box->clientWidth())); 2256 int newY = max(0, min(scrollYOffset(), scrollHeight() - box->clientHeight())); 2257 2257 if (newX != scrollXOffset() || newY != scrollYOffset()) 2258 2258 scrollToOffset(newX, newY); … … 2503 2503 ASSERT(box); 2504 2504 2505 LayoutRect resizeControlRect;2505 IntRect resizeControlRect; 2506 2506 if (renderer()->style()->resize() != RESIZE_NONE) { 2507 2507 resizeControlRect = resizerCornerRect(this, box->borderBoxRect()); … … 2510 2510 } 2511 2511 2512 LayoutUnit resizeControlSize = max<LayoutUnit>(resizeControlRect.height(), 0);2512 int resizeControlSize = max(resizeControlRect.height(), 0); 2513 2513 2514 2514 if (m_vBar) { … … 2523 2523 } 2524 2524 2525 resizeControlSize = max <LayoutUnit>(resizeControlRect.width(), 0);2525 resizeControlSize = max(resizeControlRect.width(), 0); 2526 2526 if (m_hBar) { 2527 2527 LayoutRect hBarRect(box->borderLeft(), -
trunk/Source/WebCore/rendering/RenderLayer.h
r99002 r99511 260 260 void setLocation(LayoutUnit x, LayoutUnit y) { m_topLeft = LayoutPoint(x, y); } 261 261 262 const LayoutSize& size() const { return m_layerSize; }263 void setSize(const LayoutSize& size) { m_layerSize = size; }262 const IntSize& size() const { return m_layerSize; } 263 void setSize(const IntSize& size) { m_layerSize = size; } 264 264 265 265 LayoutRect rect() const { return LayoutRect(location(), size()); } … … 280 280 LayoutSize scrolledContentOffset() const { return scrollOffset() + m_scrollOverflow; } 281 281 282 LayoutUnit scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x(); }283 LayoutUnit scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().y(); }284 LayoutSize scrollOffset() const { return LayoutSize(scrollXOffset(), scrollYOffset()); }282 int scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x(); } 283 int scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().y(); } 284 IntSize scrollOffset() const { return IntSize(scrollXOffset(), scrollYOffset()); } 285 285 286 286 void scrollToOffset(LayoutUnit, LayoutUnit, ScrollOffsetClamping = ScrollOffsetUnclamped); … … 593 593 bool shouldBeNormalFlowOnly() const; 594 594 595 LayoutUnit scrollPosition(Scrollbar*) const;595 int scrollPosition(Scrollbar*) const; 596 596 597 597 // ScrollableArea interface 598 virtual void invalidateScrollbarRect(Scrollbar*, const LayoutRect&);599 virtual void invalidateScrollCornerRect(const LayoutRect&);598 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&); 599 virtual void invalidateScrollCornerRect(const IntRect&); 600 600 virtual bool isActive() const; 601 601 virtual bool isScrollCornerVisible() const; 602 virtual LayoutRect scrollCornerRect() const;603 virtual LayoutRect convertFromScrollbarToContainingView(const Scrollbar*, const LayoutRect&) const;604 virtual LayoutRect convertFromContainingViewToScrollbar(const Scrollbar*, const LayoutRect&) const;605 virtual LayoutPoint convertFromScrollbarToContainingView(const Scrollbar*, const LayoutPoint&) const;606 virtual LayoutPoint convertFromContainingViewToScrollbar(const Scrollbar*, const LayoutPoint&) const;607 virtual LayoutUnit scrollSize(ScrollbarOrientation) const;608 virtual void setScrollOffset(const LayoutPoint&);609 virtual LayoutPoint scrollPosition() const;610 virtual LayoutPoint minimumScrollPosition() const;611 virtual LayoutPoint maximumScrollPosition() const;602 virtual IntRect scrollCornerRect() const; 603 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const; 604 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const; 605 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const; 606 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const; 607 virtual int scrollSize(ScrollbarOrientation) const; 608 virtual void setScrollOffset(const IntPoint&); 609 virtual IntPoint scrollPosition() const; 610 virtual IntPoint minimumScrollPosition() const; 611 virtual IntPoint maximumScrollPosition() const; 612 612 virtual IntRect visibleContentRect(bool includeScrollbars) const; 613 virtual LayoutUnit visibleHeight() const;614 virtual LayoutUnit visibleWidth() const;615 virtual LayoutSize contentsSize() const;616 virtual LayoutSize overhangAmount() const;617 virtual LayoutPoint currentMousePosition() const;618 virtual void didCompleteRubberBand(const LayoutSize&) const;613 virtual int visibleHeight() const; 614 virtual int visibleWidth() const; 615 virtual IntSize contentsSize() const; 616 virtual IntSize overhangAmount() const; 617 virtual IntPoint currentMousePosition() const; 618 virtual void didCompleteRubberBand(const IntSize&) const; 619 619 virtual bool shouldSuspendScrollAnimations() const; 620 620 virtual bool isOnActivePage() const; 621 621 622 622 // Rectangle encompassing the scroll corner and resizer rect. 623 LayoutRect scrollCornerAndResizerRect() const;623 IntRect scrollCornerAndResizerRect() const; 624 624 625 625 virtual void disconnectFromPage() { m_scrollableAreaPage = 0; } 626 626 627 627 // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea. 628 void scrollTo( LayoutUnit, LayoutUnit);629 630 LayoutSize scrollbarOffset(const Scrollbar*) const;628 void scrollTo(int, int); 629 630 IntSize scrollbarOffset(const Scrollbar*) const; 631 631 632 632 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); … … 756 756 757 757 // The layer's width/height 758 LayoutSize m_layerSize;758 IntSize m_layerSize; 759 759 760 760 // Our scroll offsets if the view is scrolled. 761 LayoutSize m_scrollOffset;761 IntSize m_scrollOffset; 762 762 763 763 LayoutSize m_scrollOverflow; 764 764 765 765 // The width/height of our scrolled area. 766 LayoutSize m_scrollSize;766 IntSize m_scrollSize; 767 767 768 768 // For layers with overflow, we have a pair of scrollbars. -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r99016 r99511 542 542 void RenderListBox::autoscroll() 543 543 { 544 LayoutPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->currentMousePosition());544 IntPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->currentMousePosition()); 545 545 546 546 int endIndex = scrollToward(pos); … … 709 709 } 710 710 711 void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const LayoutRect& rect)712 { 713 LayoutRect scrollRect = rect;711 void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect) 712 { 713 IntRect scrollRect = rect; 714 714 scrollRect.move(width() - borderRight() - scrollbar->width(), borderTop()); 715 715 repaintRectangle(scrollRect); 716 716 } 717 717 718 LayoutRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutRect& scrollbarRect) const718 IntRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const 719 719 { 720 720 RenderView* view = this->view(); … … 722 722 return scrollbarRect; 723 723 724 LayoutRect rect = scrollbarRect;725 726 LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();727 LayoutUnit scrollbarTop = borderTop();724 IntRect rect = scrollbarRect; 725 726 int scrollbarLeft = width() - borderRight() - scrollbar->width(); 727 int scrollbarTop = borderTop(); 728 728 rect.move(scrollbarLeft, scrollbarTop); 729 729 … … 731 731 } 732 732 733 LayoutRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutRect& parentRect) const733 IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const 734 734 { 735 735 RenderView* view = this->view(); … … 737 737 return parentRect; 738 738 739 LayoutRect rect = view->frameView()->convertToRenderer(this, parentRect);740 741 LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();742 LayoutUnit scrollbarTop = borderTop();739 IntRect rect = view->frameView()->convertToRenderer(this, parentRect); 740 741 int scrollbarLeft = width() - borderRight() - scrollbar->width(); 742 int scrollbarTop = borderTop(); 743 743 rect.move(-scrollbarLeft, -scrollbarTop); 744 744 return rect; 745 745 } 746 746 747 LayoutPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutPoint& scrollbarPoint) const747 IntPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const 748 748 { 749 749 RenderView* view = this->view(); … … 751 751 return scrollbarPoint; 752 752 753 LayoutPoint point = scrollbarPoint;754 755 LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();756 LayoutUnit scrollbarTop = borderTop();753 IntPoint point = scrollbarPoint; 754 755 int scrollbarLeft = width() - borderRight() - scrollbar->width(); 756 int scrollbarTop = borderTop(); 757 757 point.move(scrollbarLeft, scrollbarTop); 758 758 … … 760 760 } 761 761 762 LayoutPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutPoint& parentPoint) const762 IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const 763 763 { 764 764 RenderView* view = this->view(); … … 766 766 return parentPoint; 767 767 768 LayoutPoint point = view->frameView()->convertToRenderer(this, parentPoint);769 770 LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();771 LayoutUnit scrollbarTop = borderTop();768 IntPoint point = view->frameView()->convertToRenderer(this, parentPoint); 769 770 int scrollbarLeft = width() - borderRight() - scrollbar->width(); 771 int scrollbarTop = borderTop(); 772 772 point.move(-scrollbarLeft, -scrollbarTop); 773 773 return point; 774 774 } 775 775 776 LayoutSize RenderListBox::contentsSize() const777 { 778 return LayoutSize(scrollWidth(), scrollHeight());779 } 780 781 LayoutUnit RenderListBox::visibleHeight() const776 IntSize RenderListBox::contentsSize() const 777 { 778 return IntSize(scrollWidth(), scrollHeight()); 779 } 780 781 int RenderListBox::visibleHeight() const 782 782 { 783 783 return height(); 784 784 } 785 785 786 LayoutUnit RenderListBox::visibleWidth() const786 int RenderListBox::visibleWidth() const 787 787 { 788 788 return width(); 789 789 } 790 790 791 LayoutPoint RenderListBox::currentMousePosition() const791 IntPoint RenderListBox::currentMousePosition() const 792 792 { 793 793 RenderView* view = this->view(); 794 794 if (!view) 795 return LayoutPoint();795 return IntPoint(); 796 796 return view->frameView()->currentMousePosition(); 797 797 } -
trunk/Source/WebCore/rendering/RenderListBox.h
r99016 r99511 103 103 virtual LayoutUnit scrollPosition(Scrollbar*) const; 104 104 virtual void setScrollOffset(const LayoutPoint&); 105 virtual void invalidateScrollbarRect(Scrollbar*, const LayoutRect&);105 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&); 106 106 virtual bool isActive() const; 107 107 virtual bool isScrollCornerVisible() const { return false; } // We don't support resize on list boxes yet. If we did these would have to change. 108 virtual LayoutRect scrollCornerRect() const { return LayoutRect(); }109 virtual void invalidateScrollCornerRect(const LayoutRect&) { }110 virtual LayoutRect convertFromScrollbarToContainingView(const Scrollbar*, const LayoutRect&) const;111 virtual LayoutRect convertFromContainingViewToScrollbar(const Scrollbar*, const LayoutRect&) const;112 virtual LayoutPoint convertFromScrollbarToContainingView(const Scrollbar*, const LayoutPoint&) const;113 virtual LayoutPoint convertFromContainingViewToScrollbar(const Scrollbar*, const LayoutPoint&) const;108 virtual IntRect scrollCornerRect() const { return IntRect(); } 109 virtual void invalidateScrollCornerRect(const IntRect&) { } 110 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const; 111 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const; 112 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const; 113 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const; 114 114 virtual Scrollbar* verticalScrollbar() const { return m_vBar.get(); } 115 virtual LayoutSize contentsSize() const;116 virtual LayoutUnit visibleHeight() const;117 virtual LayoutUnit visibleWidth() const;118 virtual LayoutPoint currentMousePosition() const;115 virtual IntSize contentsSize() const; 116 virtual int visibleHeight() const; 117 virtual int visibleWidth() const; 118 virtual IntPoint currentMousePosition() const; 119 119 virtual bool shouldSuspendScrollAnimations() const; 120 120 virtual bool isOnActivePage() const; -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r99035 r99511 503 503 } 504 504 505 LayoutUnit RenderMenuList::clientPaddingLeft() const505 int RenderMenuList::clientPaddingLeft() const 506 506 { 507 507 return paddingLeft() + m_innerBlock->paddingLeft(); … … 509 509 510 510 const int endOfLinePadding = 2; 511 LayoutUnit RenderMenuList::clientPaddingRight() const511 int RenderMenuList::clientPaddingRight() const 512 512 { 513 513 if (style()->appearance() == MenulistPart || style()->appearance() == MenulistButtonPart) { -
trunk/Source/WebCore/rendering/RenderMenuList.h
r99016 r99511 93 93 virtual int clientInsetLeft() const; 94 94 virtual int clientInsetRight() const; 95 virtual LayoutUnit clientPaddingLeft() const;96 virtual LayoutUnit clientPaddingRight() const;95 virtual int clientPaddingLeft() const; 96 virtual int clientPaddingRight() const; 97 97 virtual int listSize() const; 98 98 virtual int selectedIndex() const; -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r99016 r99511 629 629 } 630 630 631 LayoutUnit RenderTextControlSingleLine::clientPaddingLeft() const632 { 633 LayoutUnit padding = paddingLeft();631 int RenderTextControlSingleLine::clientPaddingLeft() const 632 { 633 int padding = paddingLeft(); 634 634 635 635 HTMLElement* resultsButton = resultsButtonElement(); … … 640 640 } 641 641 642 LayoutUnit RenderTextControlSingleLine::clientPaddingRight() const643 { 644 LayoutUnit padding = paddingRight();642 int RenderTextControlSingleLine::clientPaddingRight() const 643 { 644 int padding = paddingRight(); 645 645 646 646 HTMLElement* cancelButton = cancelButtonElement(); -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h
r99016 r99511 103 103 virtual int clientInsetLeft() const; 104 104 virtual int clientInsetRight() const; 105 virtual LayoutUnit clientPaddingLeft() const;106 virtual LayoutUnit clientPaddingRight() const;105 virtual int clientPaddingLeft() const; 106 virtual int clientPaddingRight() const; 107 107 virtual int listSize() const; 108 108 virtual int selectedIndex() const; -
trunk/Source/WebKit/chromium/ChangeLog
r99509 r99511 1 2011-11-07 Emil A Eklund <eae@chromium.org> 2 3 Revert platform and scrolling to ints 4 https://bugs.webkit.org/show_bug.cgi?id=71585 5 6 Reviewed by Eric Seidel. 7 8 Replace all uses of LayoutUnit and related types with ints in platform 9 and scrolling code. 10 11 * tests/ScrollAnimatorNoneTest.cpp: 12 (MockScrollableArea::visibleHeight): 13 (MockScrollableArea::visibleWidth): 14 1 15 2011-11-07 Adam Barth <abarth@webkit.org> 2 16 -
trunk/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp
r95901 r99511 65 65 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*()); 66 66 67 virtual LayoutUnit visibleHeight() const { return 768; }68 virtual LayoutUnit visibleWidth() const { return 1024; }67 virtual int visibleHeight() const { return 768; } 68 virtual int visibleWidth() const { return 1024; } 69 69 70 70 bool scrollAnimatorEnabled() const { return m_scrollAnimatorEnabled; } -
trunk/Source/WebKit2/ChangeLog
r99509 r99511 1 2011-11-07 Emil A Eklund <eae@chromium.org> 2 3 Revert platform and scrolling to ints 4 https://bugs.webkit.org/show_bug.cgi?id=71585 5 6 Reviewed by Eric Seidel. 7 8 Replace all uses of LayoutUnit and related types with ints in platform 9 and scrolling code. 10 11 * WebProcess/Plugins/PDF/BuiltInPDFView.cpp: 12 (WebKit::BuiltInPDFView::invalidateScrollbarRect): 13 (WebKit::BuiltInPDFView::visibleHeight): 14 (WebKit::BuiltInPDFView::visibleWidth): 15 * WebProcess/Plugins/PDF/BuiltInPDFView.h: 16 1 17 2011-11-07 Adam Barth <abarth@webkit.org> 2 18 -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp
r99493 r99511 607 607 void BuiltInPDFView::invalidateScrollbarRect(Scrollbar* scrollbar, const LayoutRect& rect) 608 608 { 609 LayoutRect dirtyRect = rect;609 IntRect dirtyRect = rect; 610 610 dirtyRect.moveBy(scrollbar->location()); 611 611 dirtyRect.moveBy(-pluginView()->location()); … … 653 653 } 654 654 655 LayoutUnit BuiltInPDFView::visibleHeight() const655 int BuiltInPDFView::visibleHeight() const 656 656 { 657 657 return m_pluginSize.height(); 658 658 } 659 659 660 LayoutUnit BuiltInPDFView::visibleWidth() const660 int BuiltInPDFView::visibleWidth() const 661 661 { 662 662 return m_pluginSize.width(); -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
r99241 r99511 127 127 virtual WebCore::IntPoint minimumScrollPosition() const; 128 128 virtual WebCore::IntPoint maximumScrollPosition() const; 129 virtual WebCore::LayoutUnit visibleHeight() const;130 virtual WebCore::LayoutUnit visibleWidth() const;129 virtual int visibleHeight() const; 130 virtual int visibleWidth() const; 131 131 virtual WebCore::IntSize contentsSize() const; 132 132 virtual WebCore::Scrollbar* horizontalScrollbar() const { return m_horizontalScrollbar.get(); }
Note: See TracChangeset
for help on using the changeset viewer.