Changeset 113466 in webkit
- Timestamp:
- Apr 6, 2012 11:34:43 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113462 r113466 1 2012-04-06 Levi Weintraub <leviw@chromium.org> 2 3 Update LayoutUnit usage in Editor and Frame 4 https://bugs.webkit.org/show_bug.cgi?id=83278 5 6 Reviewed by Eric Seidel. 7 8 Frame and Editor both take input from the embedder, which passes along coordinates in screen 9 coordinates, which aren't fractional. Updating a few remaining functions to show this, and correcting 10 some inconsistencies in LayoutUnit usage. 11 12 No new tests. No change in behavior. 13 14 * editing/Editor.cpp: 15 (WebCore::Editor::rangeForPoint): windowToContents returns an IntPoint. 16 (WebCore::Editor::countMatchesForText): Using enclosingIntRect since we're (fake) repainting the entire 17 view rect. 18 * editing/Editor.h: 19 (Editor): Correcting mismatched function signature. 20 * page/Frame.cpp: 21 (WebCore::Frame::visiblePositionForPoint): Frame takes points in screen coordinates, usually from the 22 embedder. Changing these functions to be in IntPoints. 23 (WebCore::Frame::documentAtPoint): Ditto. 24 (WebCore::Frame::rangeForPoint): Ditto. 25 * page/Frame.h: 26 (Frame): 27 * platform/graphics/IntRect.h: 28 (enclosingIntRect): Adding an inline no-op copy of the FractionalLayoutRect method enclosingIntRect. 29 1 30 2012-04-06 Tommy Widenflycht <tommyw@google.com> 2 31 -
trunk/Source/WebCore/editing/Editor.cpp
r113405 r113466 2249 2249 if (!frameView) 2250 2250 return 0; 2251 LayoutPoint framePoint = frameView->windowToContents(windowPoint);2251 IntPoint framePoint = frameView->windowToContents(windowPoint); 2252 2252 VisibleSelection selection(frame->visiblePositionForPoint(framePoint)); 2253 2253 return avoidIntersectionWithNode(selection.toNormalizedRange().get(), m_deleteButtonController->containerElement()); … … 2869 2869 PaintBehavior oldBehavior = m_frame->view()->paintBehavior(); 2870 2870 m_frame->view()->setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers); 2871 m_frame->view()->paintContents(&context, visibleRect);2871 m_frame->view()->paintContents(&context, enclosingIntRect(visibleRect)); 2872 2872 m_frame->view()->setPaintBehavior(oldBehavior); 2873 2873 } -
trunk/Source/WebCore/editing/Editor.h
r113187 r113466 301 301 void setStartNewKillRingSequence(bool); 302 302 303 PassRefPtr<Range> rangeForPoint(const LayoutPoint& windowPoint);303 PassRefPtr<Range> rangeForPoint(const IntPoint& windowPoint); 304 304 305 305 void clear(); -
trunk/Source/WebCore/page/Frame.cpp
r111836 r113466 726 726 } 727 727 728 VisiblePosition Frame::visiblePositionForPoint(const LayoutPoint& framePoint)728 VisiblePosition Frame::visiblePositionForPoint(const IntPoint& framePoint) 729 729 { 730 730 HitTestResult result = eventHandler()->hitTestResultAtPoint(framePoint, true); … … 746 746 return 0; 747 747 748 LayoutPoint pt = view()->windowToContents(point);748 IntPoint pt = view()->windowToContents(point); 749 749 HitTestResult result = HitTestResult(pt); 750 750 … … 754 754 } 755 755 756 PassRefPtr<Range> Frame::rangeForPoint(const LayoutPoint& framePoint)756 PassRefPtr<Range> Frame::rangeForPoint(const IntPoint& framePoint) 757 757 { 758 758 VisiblePosition position = visiblePositionForPoint(framePoint); -
trunk/Source/WebCore/page/Frame.h
r111361 r113466 180 180 DragImageRef dragImageForSelection(); 181 181 182 VisiblePosition visiblePositionForPoint(const LayoutPoint& framePoint);182 VisiblePosition visiblePositionForPoint(const IntPoint& framePoint); 183 183 Document* documentAtPoint(const IntPoint& windowPoint); 184 PassRefPtr<Range> rangeForPoint(const LayoutPoint& framePoint);184 PassRefPtr<Range> rangeForPoint(const IntPoint& framePoint); 185 185 186 186 String searchForLabelsAboveCell(RegularExpression*, HTMLTableCellElement*, size_t* resultDistanceFromStartOfCell); -
trunk/Source/WebCore/platform/graphics/IntRect.h
r113030 r113466 273 273 } 274 274 275 // FIXME: This method is here only to ease the transition to sub-pixel layout. It should 276 // be removed when we close http://webkit.org/b/60318 277 inline IntRect enclosingIntRect(const IntRect& rect) 278 { 279 return rect; 280 } 281 275 282 #if USE(CG) || USE(SKIA_ON_MAC_CHROMIUM) 276 283 IntRect enclosingIntRect(const CGRect&);
Note: See TracChangeset
for help on using the changeset viewer.