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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:00:34 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit fc6fb8c660431dea3cbf5d21338036ed1a06dfe6
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 10 05:49:43 2003 +0000

            Reviewed by Maciej.
    
            - fixed 3449280 -- REGRESSION: crash copying a selection that ends in a <br>
    
            * khtml/rendering/render_br.h: Add checkSelectionPointIgnoringContinuations.
            * khtml/rendering/render_br.cpp: (RenderBR::checkSelectionPointIgnoringContinuations):
            Override to never return an offset of 1. We can't use a character offset because the
            DOM doesn't know that we're implemented as a text object. So an offset of 1 turns into
            "after this element".
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5164 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 5540d23..9ab9b6a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,15 @@
+2003-10-09  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
+        - fixed 3449280 -- REGRESSION: crash copying a selection that ends in a <br>
+
+        * khtml/rendering/render_br.h: Add checkSelectionPointIgnoringContinuations.
+        * khtml/rendering/render_br.cpp: (RenderBR::checkSelectionPointIgnoringContinuations):
+        Override to never return an offset of 1. We can't use a character offset because the
+        DOM doesn't know that we're implemented as a text object. So an offset of 1 turns into
+        "after this element".
+
 2003-10-09  Maciej Stachowiak  <mjs at apple.com>
 
         - fixed crash I just added.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 5540d23..9ab9b6a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,15 @@
+2003-10-09  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
+        - fixed 3449280 -- REGRESSION: crash copying a selection that ends in a <br>
+
+        * khtml/rendering/render_br.h: Add checkSelectionPointIgnoringContinuations.
+        * khtml/rendering/render_br.cpp: (RenderBR::checkSelectionPointIgnoringContinuations):
+        Override to never return an offset of 1. We can't use a character offset because the
+        DOM doesn't know that we're implemented as a text object. So an offset of 1 turns into
+        "after this element".
+
 2003-10-09  Maciej Stachowiak  <mjs at apple.com>
 
         - fixed crash I just added.
diff --git a/WebCore/khtml/rendering/render_br.cpp b/WebCore/khtml/rendering/render_br.cpp
index 4cccfbe..901c921 100644
--- a/WebCore/khtml/rendering/render_br.cpp
+++ b/WebCore/khtml/rendering/render_br.cpp
@@ -47,8 +47,7 @@ void RenderBR::cursorPos(int /*offset*/, int &_x, int &_y, int &height)
     int absx, absy;
     absolutePosition(absx,absy);
     if (absx == -1) {
-        // we don't know out absoluate position, and there is not point returning
-        // just a relative one
+        // we don't know our absolute position, and there is no point returning just a relative one
         _x = _y = -1;
     }
     else {
@@ -59,3 +58,18 @@ void RenderBR::cursorPos(int /*offset*/, int &_x, int &_y, int &height)
 
 }
 
+FindSelectionResult RenderBR::checkSelectionPointIgnoringContinuations(int _x, int _y, int _tx, int _ty, DOM::NodeImpl*& node, int &offset)
+{
+    FindSelectionResult result = RenderText::checkSelectionPointIgnoringContinuations(_x, _y, _tx, _ty, node, offset);
+
+    // Since the DOM does not consider this to be a text element, we can't return an offset of 1,
+    // because that means after the first child (and we have none) rather than after the
+    // first character. Instead we return a result of "after" and an offset of 0.
+    if (offset == 1 && node == element()) {
+        offset = 0;
+        result = SelectionPointAfter;
+    }
+
+    return result;
+}
+
diff --git a/WebCore/khtml/rendering/render_br.h b/WebCore/khtml/rendering/render_br.h
index 06b3bdd..2874229 100644
--- a/WebCore/khtml/rendering/render_br.h
+++ b/WebCore/khtml/rendering/render_br.h
@@ -44,7 +44,6 @@ public:
     virtual void position(int, int, int, int, int, bool, bool, int) {}
     virtual unsigned int width(unsigned int, unsigned int, const Font *) const { return 0; }
     virtual unsigned int width( unsigned int, unsigned int, bool) const { return 0; }
-    virtual short width() const { return RenderText::width(); }
 
     virtual int height() const { return 0; }
 
@@ -55,7 +54,10 @@ public:
 
     virtual bool isBR() const { return true; }
     virtual void cursorPos(int offset, int &_x, int &_y, int &height);
-};
 
+    virtual FindSelectionResult checkSelectionPointIgnoringContinuations(int _x, int _y, int _tx, int _ty, DOM::NodeImpl*& node, int &offset);
 };
+
+}
+
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list