Changeset 93269 in webkit
- Timestamp:
- Aug 17, 2011 5:36:48 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93268 r93269 1 2011-08-17 Levi Weintraub <leviw@chromium.org> 2 3 Switch Document, DocumentMarker, Clipboard, and Range to new layout types 4 https://bugs.webkit.org/show_bug.cgi?id=66330 5 6 Reviewed by Eric Seidel. 7 8 Converting the remaining DOM classes to use the LayoutUnit abstraction. 9 10 No new tests, no new behavior. 11 12 * dom/Clipboard.h: 13 (WebCore::Clipboard::dragLocation): 14 * dom/Document.cpp: 15 (WebCore::Document::nodesFromRect): 16 (WebCore::nodeFromPoint): 17 (WebCore::Document::caretRangeFromPoint): 18 (WebCore::Document::prepareMouseEvent): 19 * dom/Document.h: 20 * dom/DocumentMarkerController.cpp: 21 (WebCore::DocumentMarkerController::markerContainingPoint): 22 (WebCore::DocumentMarkerController::renderedRectsForMarkers): 23 (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): 24 * dom/DocumentMarkerController.h: 25 * dom/Range.cpp: 26 (WebCore::adjustFloatQuadsForScrollAndAbsoluteZoomAndPageScale): 27 * dom/RenderedDocumentMarker.h: 28 (WebCore::RenderedDocumentMarker::contains): 29 (WebCore::RenderedDocumentMarker::setRenderedRect): 30 (WebCore::RenderedDocumentMarker::renderedRect): 31 (WebCore::RenderedDocumentMarker::invalidMarkerRect): 32 (WebCore::RenderedDocumentMarker::invalidate): 33 1 34 2011-08-17 Dan Bernstein <mitz@apple.com> 2 35 -
trunk/Source/WebCore/dom/Clipboard.h
r87499 r93269 70 70 virtual PassRefPtr<FileList> files() const = 0; 71 71 72 IntPoint dragLocation() const { return m_dragLoc; }72 LayoutPoint dragLocation() const { return m_dragLoc; } 73 73 CachedImage* dragImage() const { return m_dragImage.get(); } 74 virtual void setDragImage(CachedImage*, const IntPoint&) = 0;74 virtual void setDragImage(CachedImage*, const LayoutPoint&) = 0; 75 75 Node* dragImageElement() const { return m_dragImageElement.get(); } 76 virtual void setDragImageElement(Node*, const IntPoint&) = 0;76 virtual void setDragImageElement(Node*, const LayoutPoint&) = 0; 77 77 78 virtual DragImageRef createDragImage( IntPoint& dragLocation) const = 0;78 virtual DragImageRef createDragImage(LayoutPoint& dragLocation) const = 0; 79 79 #if ENABLE(DRAG_SUPPORT) 80 80 virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*) = 0; … … 118 118 119 119 protected: 120 IntPoint m_dragLoc;120 LayoutPoint m_dragLoc; 121 121 CachedResourceHandle<CachedImage> m_dragImage; 122 122 RefPtr<Node> m_dragImageElement; -
trunk/Source/WebCore/dom/Document.cpp
r93038 r93269 1128 1128 1129 1129 float zoomFactor = frame->pageZoomFactor(); 1130 IntPoint point = roundedIntPoint(FloatPoint(centerX * zoomFactor + view()->scrollX(), centerY * zoomFactor + view()->scrollY()));1130 LayoutPoint point = roundedLayoutPoint(FloatPoint(centerX * zoomFactor + view()->scrollX(), centerY * zoomFactor + view()->scrollY())); 1131 1131 1132 1132 int type = HitTestRequest::ReadOnly | HitTestRequest::Active; … … 1167 1167 } 1168 1168 1169 static Node* nodeFromPoint(Frame* frame, RenderView* renderView, int x, int y, IntPoint* localPoint = 0)1169 static Node* nodeFromPoint(Frame* frame, RenderView* renderView, int x, int y, LayoutPoint* localPoint = 0) 1170 1170 { 1171 1171 if (!frame) … … 1207 1207 if (!renderer()) 1208 1208 return 0; 1209 IntPoint localPoint;1209 LayoutPoint localPoint; 1210 1210 Node* node = nodeFromPoint(frame(), renderView(), x, y, &localPoint); 1211 1211 if (!node) … … 2637 2637 } 2638 2638 2639 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const IntPoint& documentPoint, const PlatformMouseEvent& event)2639 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const LayoutPoint& documentPoint, const PlatformMouseEvent& event) 2640 2640 { 2641 2641 ASSERT(!renderer() || renderer()->isRenderView()); 2642 2642 2643 2643 if (!renderer()) 2644 return MouseEventWithHitTestResults(event, HitTestResult( IntPoint()));2644 return MouseEventWithHitTestResults(event, HitTestResult(LayoutPoint())); 2645 2645 2646 2646 HitTestResult result(documentPoint); -
trunk/Source/WebCore/dom/Document.h
r92906 r93269 676 676 void resetActiveLinkColor(); 677 677 678 MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const IntPoint&, const PlatformMouseEvent&);678 MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const LayoutPoint&, const PlatformMouseEvent&); 679 679 680 680 StyleSheetList* styleSheets(); -
trunk/Source/WebCore/dom/DocumentMarkerController.cpp
r92441 r93269 292 292 } 293 293 294 DocumentMarker* DocumentMarkerController::markerContainingPoint(const IntPoint& point, DocumentMarker::MarkerType markerType)294 DocumentMarker* DocumentMarkerController::markerContainingPoint(const LayoutPoint& point, DocumentMarker::MarkerType markerType) 295 295 { 296 296 if (!possiblyHasMarkers(markerType)) … … 376 376 } 377 377 378 Vector< IntRect> DocumentMarkerController::renderedRectsForMarkers(DocumentMarker::MarkerType markerType)379 { 380 Vector< IntRect> result;378 Vector<LayoutRect> DocumentMarkerController::renderedRectsForMarkers(DocumentMarker::MarkerType markerType) 379 { 380 Vector<LayoutRect> result; 381 381 382 382 if (!possiblyHasMarkers(markerType)) … … 508 508 } 509 509 510 void DocumentMarkerController::invalidateRenderedRectsForMarkersInRect(const IntRect& r)510 void DocumentMarkerController::invalidateRenderedRectsForMarkersInRect(const LayoutRect& r) 511 511 { 512 512 // outer loop: process each markered node in the document -
trunk/Source/WebCore/dom/DocumentMarkerController.h
r89452 r93269 29 29 30 30 #include "DocumentMarker.h" 31 #include "LayoutTypes.h" 31 32 #include <wtf/HashMap.h> 32 33 #include <wtf/Vector.h> … … 34 35 namespace WebCore { 35 36 36 class IntPoint;37 class IntRect;38 37 class Node; 39 38 class Range; … … 65 64 void removeMarkers(Node*, DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); 66 65 void repaintMarkers(DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); 67 void invalidateRenderedRectsForMarkersInRect(const IntRect&);66 void invalidateRenderedRectsForMarkersInRect(const LayoutRect&); 68 67 void shiftMarkers(Node*, unsigned startOffset, int delta); 69 68 void setMarkersActive(Range*, bool); 70 69 void setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool); 71 70 72 DocumentMarker* markerContainingPoint(const IntPoint&, DocumentMarker::MarkerType);71 DocumentMarker* markerContainingPoint(const LayoutPoint&, DocumentMarker::MarkerType); 73 72 Vector<DocumentMarker*> markersFor(Node*); 74 73 Vector<DocumentMarker*> markersInRange(Range*, DocumentMarker::MarkerTypes); 75 74 Vector<DocumentMarker> markersForNode(Node*); 76 Vector< IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType);75 Vector<LayoutRect> renderedRectsForMarkers(DocumentMarker::MarkerType); 77 76 void clearDescriptionOnMarkersIntersectingRange(Range*, DocumentMarker::MarkerTypes); 78 77 -
trunk/Source/WebCore/dom/Range.cpp
r93199 r93269 1974 1974 } 1975 1975 1976 IntRect visibleContentRect = view->visibleContentRect();1976 LayoutRect visibleContentRect = view->visibleContentRect(); 1977 1977 for (size_t i = 0; i < quads.size(); ++i) { 1978 1978 quads[i].move(-visibleContentRect.x(), -visibleContentRect.y()); -
trunk/Source/WebCore/dom/RenderedDocumentMarker.h
r87483 r93269 41 41 42 42 bool isRendered() const { return invalidMarkerRect() != m_renderedRect; } 43 bool contains(const IntPoint& point) const { return isRendered() && m_renderedRect.contains(point); }44 void setRenderedRect(const IntRect& r) { m_renderedRect = r; }45 const IntRect& renderedRect() const { return m_renderedRect; }46 void invalidate(const IntRect&);43 bool contains(const LayoutPoint& point) const { return isRendered() && m_renderedRect.contains(point); } 44 void setRenderedRect(const LayoutRect& r) { m_renderedRect = r; } 45 const LayoutRect& renderedRect() const { return m_renderedRect; } 46 void invalidate(const LayoutRect&); 47 47 void invalidate() { m_renderedRect = invalidMarkerRect(); } 48 48 49 49 private: 50 static const IntRect& invalidMarkerRect()50 static const LayoutRect& invalidMarkerRect() 51 51 { 52 static const IntRect rect = IntRect(-1, -1, -1, -1);52 static const LayoutRect rect = LayoutRect(-1, -1, -1, -1); 53 53 return rect; 54 54 } 55 55 56 IntRect m_renderedRect;56 LayoutRect m_renderedRect; 57 57 }; 58 58 59 inline void RenderedDocumentMarker::invalidate(const IntRect& r)59 inline void RenderedDocumentMarker::invalidate(const LayoutRect& r) 60 60 { 61 61 if (m_renderedRect.intersects(r))
Note: See TracChangeset
for help on using the changeset viewer.