[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 15:35:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d350017b5991bcdd60299e328a8cf95a597aa495
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 8 23:59:58 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=49217
    
    Reviewed by Simon Fraser.
    
    Fix coordinate space mismatch in RenderReplaced and make sure RenderText retains its old behavior of
    preferring later lines when there is overlap.
    
    WebCore:
    
    * rendering/RenderReplaced.cpp:
    (WebCore::RenderReplaced::positionForPoint):
    * rendering/RenderText.cpp:
    (WebCore::RenderText::positionForPoint):
    
    LayoutTests:
    
    * fast/dom/Document/CaretRangeFromPoint/replace-element-expected.txt:
    * fast/dom/Document/CaretRangeFromPoint/replace-element.html:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71582 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7c3a57f..28bf547 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-08  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49217
+        
+        Fix coordinate space mismatch in RenderReplaced and make sure RenderText retains its old behavior of
+        preferring later lines when there is overlap.
+
+        * fast/dom/Document/CaretRangeFromPoint/replace-element-expected.txt:
+        * fast/dom/Document/CaretRangeFromPoint/replace-element.html:
+
 2010-11-08  No'am Rosenthal  <noam.rosenthal at nokia.com>
 
         Unreviewed bot fix.
diff --git a/LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element-expected.txt b/LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element-expected.txt
index a1977b6..47a3294 100644
--- a/LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element-expected.txt
+++ b/LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element-expected.txt
@@ -5,6 +5,6 @@ Testing right of the image
 PASS: range.startContainer == image.nextSibling.
 PASS: range.startOffset == 1.
 Testing on the image
-PASS: range.startContainer == image.previousSibling.
-PASS: range.startOffset == 35.
+PASS: range.startContainer == image.parentNode.
+PASS: range.startOffset == 2.
 
diff --git a/LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element.html b/LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element.html
index 2e466c1..1b0d791 100644
--- a/LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element.html
+++ b/LayoutTests/fast/dom/Document/CaretRangeFromPoint/replace-element.html
@@ -66,7 +66,7 @@
             test((imageRect.left + imageRect.width) + 10, (imageRect.top + imageRect.height) - 5, "image.nextSibling", "1");
 
             log("Testing on the image");
-            test((imageRect.left + (imageRect.width / 2)) , (imageRect.top + imageRect.height) - 5, "image.previousSibling", "35");
+            test((imageRect.left + (imageRect.width / 2) + 1) , (imageRect.top + imageRect.height) - 5, "image.parentNode", "2");
 
             swapInLog();
         }
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 511825c..e5c93f7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-08  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49217
+        
+        Fix coordinate space mismatch in RenderReplaced and make sure RenderText retains its old behavior of
+        preferring later lines when there is overlap.
+
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::positionForPoint):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::positionForPoint):
+
 2010-11-08  Steve Block  <steveblock at google.com>
 
         Reviewed by David Levin.
diff --git a/WebCore/rendering/RenderReplaced.cpp b/WebCore/rendering/RenderReplaced.cpp
index f0c7e77..b1a7711 100644
--- a/WebCore/rendering/RenderReplaced.cpp
+++ b/WebCore/rendering/RenderReplaced.cpp
@@ -297,7 +297,7 @@ VisiblePosition RenderReplaced::positionForPoint(const IntPoint& point)
         return createVisiblePosition(caretMaxOffset(), DOWNSTREAM); // coordinates are below
     
     if (node()) {
-        if (lineDirectionPosition <= box->logicalWidth() / 2)
+        if (lineDirectionPosition <= box->logicalLeft() + (box->logicalWidth() / 2))
             return createVisiblePosition(0, DOWNSTREAM);
         return createVisiblePosition(1, DOWNSTREAM);
     }
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index 89e1e54..1a2ce30 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -437,8 +437,11 @@ VisiblePosition RenderText::positionForPoint(const IntPoint& point)
 
     InlineTextBox* lastBoxAbove = 0;
     for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
-        if (pointBlockDirection >= box->root()->lineTop()) {
-            int bottom = box->root()->nextRootBox() ? box->root()->nextRootBox()->selectionTop() : box->root()->selectionBottom();
+        RootInlineBox* rootBox = box->root();
+        if (pointBlockDirection >= rootBox->selectionTop()) {
+            int bottom = rootBox->selectionBottom();
+            if (rootBox->nextRootBox())
+                bottom = min(bottom, rootBox->nextRootBox()->lineTop());
             if (pointBlockDirection < bottom) {
                 offset = box->offsetForPosition(pointLineDirection);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list