Changeset 55669 in webkit
- Timestamp:
- Mar 8, 2010 9:54:36 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55664 r55669 1 2010-03-08 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Simon Fraser. 4 5 https://bugs.webkit.org/show_bug.cgi?id=34819 6 7 Tests that we do not repaint the caret rectangle when the associated selection is 8 not in a content editable element. 9 10 * fast/repaint/no-caret-repaint-in-non-content-editable-element.html: Added. 11 * platform/mac/fast/repaint/no-caret-repaint-in-non-content-editable-element-expected.checksum: Added. 12 * platform/mac/fast/repaint/no-caret-repaint-in-non-content-editable-element-expected.png: Added. 13 * platform/mac/fast/repaint/no-caret-repaint-in-non-content-editable-element-expected.txt: Added. 14 1 15 2010-03-08 Shu Chang <Chang.Shu@nokia.com> 2 16 -
trunk/WebCore/ChangeLog
r55668 r55669 1 2010-03-08 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Simon Fraser. 4 5 https://bugs.webkit.org/show_bug.cgi?id=34819 6 7 Fixes an issue where we repaint the caret rectangle even if the associated 8 selection is not in a content editable element. This is extraneous since the 9 caret is only visible when the selection is in a content editable element. 10 Hence, we should only repaint the caret rectangle when the associated selection 11 is in a content editable element. 12 13 Note, we always paint the caret when caret browsing is enabled. 14 15 Test: fast/repaint/no-caret-repaint-in-non-content-editable-element.html 16 17 * editing/SelectionController.cpp: 18 (WebCore::SelectionController::recomputeCaretRect): Modified to call method 19 SelectionController::shouldRepaintCaret. 20 (WebCore::SelectionController::shouldRepaintCaret): Added. 21 (WebCore::SelectionController::invalidateCaretRect): Modified to call method 22 SelectionController::shouldRepaintCaret. 23 * editing/SelectionController.h: 24 1 25 2010-03-08 Eric Carlson <eric.carlson@apple.com> 2 26 -
trunk/WebCore/editing/SelectionController.cpp
r54980 r55669 974 974 // FIXME: make caret repainting container-aware. 975 975 view->repaintRectangleInViewAndCompositedLayers(oldAbsoluteCaretRepaintBounds, false); 976 view->repaintRectangleInViewAndCompositedLayers(m_absoluteCaretRepaintBounds, false); 976 if (shouldRepaintCaret(view)) 977 view->repaintRectangleInViewAndCompositedLayers(m_absoluteCaretRepaintBounds, false); 977 978 } 978 979 979 980 return true; 981 } 982 983 bool SelectionController::shouldRepaintCaret(const RenderView* view) const 984 { 985 ASSERT(view); 986 Frame* frame = view->frameView() ? view->frameView()->frame() : 0; // The frame where the selection started. 987 bool caretBrowsing = frame && frame->settings() && frame->settings()->caretBrowsingEnabled(); 988 return (caretBrowsing || isContentEditable()); 980 989 } 981 990 … … 1005 1014 1006 1015 if (!caretRectChanged) { 1007 if (RenderView* view = toRenderView(d->renderer())) 1016 RenderView* view = toRenderView(d->renderer()); 1017 if (view && shouldRepaintCaret(view)) 1008 1018 view->repaintRectangleInViewAndCompositedLayers(caretRepaintRect(), false); 1009 1019 } -
trunk/WebCore/editing/SelectionController.h
r54980 r55669 38 38 class GraphicsContext; 39 39 class RenderObject; 40 class RenderView; 40 41 class VisiblePosition; 41 42 … … 156 157 void layout(); 157 158 IntRect caretRepaintRect() const; 159 bool shouldRepaintCaret(const RenderView* view) const; 158 160 159 161 int xPosForVerticalArrowNavigation(EPositionType);
Note: See TracChangeset
for help on using the changeset viewer.