https://bugs.webkit.org/show_bug.cgi?id=49228
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Nov 2010 01:41:02 +0000 (01:41 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Nov 2010 01:41:02 +0000 (01:41 +0000)
Reviewed by Simon Fraser.

REGRESSION: caret too short when a positive line height is specified.  Now that lineTop no longer
accidentally incorporates the top leading, we need to use selectionTop/Bottom for the caret rect.

* rendering/RenderText.cpp:
(WebCore::RenderText::localCaretRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@71589 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/rendering/RenderText.cpp

index 3253aec..c7f86b8 100644 (file)
@@ -1,3 +1,15 @@
+2010-11-08  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49228
+        
+        REGRESSION: caret too short when a positive line height is specified.  Now that lineTop no longer
+        accidentally incorporates the top leading, we need to use selectionTop/Bottom for the caret rect.
+
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::localCaretRect):
+
 2010-11-08  Pierre-Antoine LaFayette  <pierre.lafayette@gmail.com>
 
         Reviewed by Darin Fisher.
index 1a2ce30..551c429 100644 (file)
@@ -484,8 +484,8 @@ IntRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, int* e
 
     InlineTextBox* box = static_cast<InlineTextBox*>(inlineBox);
 
-    int height = box->root()->lineBottom() - box->root()->lineTop();
-    int top = box->root()->lineTop();
+    int height = box->root()->selectionHeight();
+    int top = box->root()->selectionTop();
 
     int left = box->positionForOffset(caretOffset);