[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:32:27 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a441d226c90d1117f5b624344b50f19321f0351f
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Apr 6 15:25:15 2004 +0000

            Reviewed by Dave
    
            Caret height is now the height of the tallest element on the line,
            mimicking NSText behavior.
    
            * khtml/rendering/render_box.cpp:
            (RenderBox::caretPos): Use root line box topOverflow and bottomOverflow
            for the calculation of caret height.
            * khtml/rendering/render_text.cpp:
            (RenderText::caretPos): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6316 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 37b640d..bd0cce5 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,18 @@
 2004-04-06  Ken Kocienda  <kocienda at apple.com>
 
+        Reviewed by Dave
+
+        Caret height is now the height of the tallest element on the line,
+        mimicking NSText behavior.
+
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::caretPos): Use root line box topOverflow and bottomOverflow 
+        for the calculation of caret height.
+        * khtml/rendering/render_text.cpp:
+        (RenderText::caretPos): Ditto.
+
+2004-04-06  Ken Kocienda  <kocienda at apple.com>
+
         Reviewed by me
 
         Added a new suite of layout tests for editing, all added
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 4b19878..edee388 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -1408,8 +1408,15 @@ void RenderBox::caretPos(int offset, bool override, int &_x, int &_y, int &width
     // offset 0 means left, offset 1 means right
     if (_x == -1) {
         _x = xPos() + (offset == 0 ? 0 : m_width);
-        _y = yPos();
-        height = m_height;
+        InlineBox *box = inlineBoxWrapper();
+        if (box) {
+            height = box->root()->bottomOverflow() - box->root()->topOverflow();
+            _y = box->root()->topOverflow();
+        }
+        else {
+            _y = yPos();
+            height = m_height;
+        }
         width = override && offset == 0 ? m_width : 1;
         // If height of box is smaller than font height, use the latter one,
         // otherwise the caret might become invisible.
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 3cae19a..8b1120c 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -526,8 +526,8 @@ void RenderText::caretPos(int offset, bool override, int &_x, int &_y, int &widt
         return;
     }
 
-    _y = box->m_y;
-    height = box->m_height;
+    height = box->root()->bottomOverflow() - box->root()->topOverflow();
+    _y = box->root()->topOverflow();
 
     const QFontMetrics &fm = metrics(box->isFirstLineStyle());
     QString string(str->s + box->m_start, box->m_len);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list