Changeset 42583 in webkit
- Timestamp:
- Apr 16, 2009 11:11:29 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r42577 r42583 1 2009-04-16 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 https://bugs.webkit.org/show_bug.cgi?id=25228 6 SelectionController::absoluteCaretBounds returns an inflated caret (the caret repaint rect) 7 8 * editing/selection/25228.html: Added. 9 * platform/mac/editing/selection/25228-expected.checksum: Added. 10 * platform/mac/editing/selection/25228-expected.png: Added. 11 * platform/mac/editing/selection/25228-expected.txt: Added. 12 1 13 2009-04-16 Dan Bernstein <mitz@apple.com> 2 14 -
trunk/WebCore/ChangeLog
r42581 r42583 1 2009-04-16 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 https://bugs.webkit.org/show_bug.cgi?id=25228 6 SelectionController::absoluteCaretBounds returns an inflated caret (the caret repaint rect) 7 8 Return the bounds of the transformed caret, not the transformed repaint rect for the caret (which is inflated). 9 10 * editing/SelectionController.cpp: 11 (WebCore::SelectionController::localCaretRect): 12 (WebCore::SelectionController::absoluteBoundsForLocalRect): 13 (WebCore::SelectionController::caretRepaintRect): 14 (WebCore::SelectionController::recomputeCaretRect): 15 * editing/SelectionController.h: 16 1 17 2009-04-16 Pierre d'Herbemont <pdherbemont@apple.com> 2 18 -
trunk/WebCore/editing/SelectionController.cpp
r42377 r42583 877 877 { 878 878 if (m_needsLayout) 879 const_cast<SelectionController 879 const_cast<SelectionController*>(this)->layout(); 880 880 881 881 return m_caretRect; 882 } 883 884 IntRect SelectionController::absoluteBoundsForLocalRect(const IntRect& rect) const 885 { 886 RenderObject* caretPainter = caretRenderer(); 887 if (!caretPainter) 888 return IntRect(); 889 890 return caretPainter->localToAbsoluteQuad(FloatRect(rect)).enclosingBoundingBox(); 882 891 } 883 892 … … 900 909 IntRect SelectionController::caretRepaintRect() const 901 910 { 902 IntRect localRect = repaintRectForCaret(localCaretRect()); 903 904 RenderObject* caretPainter = caretRenderer(); 905 if (caretPainter) 906 return caretPainter->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox(); 907 908 return IntRect(); 911 return absoluteBoundsForLocalRect(repaintRectForCaret(localCaretRect())); 909 912 } 910 913 … … 922 925 923 926 IntRect oldRect = m_caretRect; 924 m_needsLayout = true;925 927 IntRect newRect = localCaretRect(); 926 928 if (oldRect == newRect && !m_absCaretBoundsDirty) 927 929 return false; 928 930 929 IntRect oldAbsRepaintRect = m_absCaretBounds; 930 m_absCaretBounds = caretRepaintRect(); 931 IntRect oldAbsCaretBounds = m_absCaretBounds; 932 // FIXME: Rename m_caretRect to m_localCaretRect. 933 m_absCaretBounds = absoluteBoundsForLocalRect(m_caretRect); 931 934 m_absCaretBoundsDirty = false; 932 935 933 if (oldAbsRepaintRect == m_absCaretBounds) 934 return false; 936 if (oldAbsCaretBounds == m_absCaretBounds) 937 return false; 938 939 IntRect oldAbsoluteCaretRepaintBounds = m_absoluteCaretRepaintBounds; 940 // We believe that we need to inflate the local rect before transforming it to obtain the repaint bounds. 941 m_absoluteCaretRepaintBounds = caretRepaintRect(); 935 942 936 943 if (RenderView* view = toRenderView(m_frame->document()->renderer())) { 937 944 // FIXME: make caret repainting container-aware. 938 view->repaintRectangleInViewAndCompositedLayers(oldAbs RepaintRect, false);939 view->repaintRectangleInViewAndCompositedLayers(m_abs CaretBounds, false);945 view->repaintRectangleInViewAndCompositedLayers(oldAbsoluteCaretRepaintBounds, false); 946 view->repaintRectangleInViewAndCompositedLayers(m_absoluteCaretRepaintBounds, false); 940 947 } 941 948 -
trunk/WebCore/editing/SelectionController.h
r42054 r42583 155 155 void focusedOrActiveStateChanged(); 156 156 bool caretRendersInsideNode(Node*) const; 157 158 IntRect absoluteBoundsForLocalRect(const IntRect&) const; 157 159 158 160 Frame* m_frame; … … 163 165 IntRect m_caretRect; // caret rect in coords local to the renderer responsible for painting the caret 164 166 IntRect m_absCaretBounds; // absolute bounding rect for the caret 167 IntRect m_absoluteCaretRepaintBounds; 165 168 166 169 bool m_needsLayout : 1; // true if the caret and expectedVisible rectangles need to be calculated
Note: See TracChangeset
for help on using the changeset viewer.