[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
mario at webkit.org
mario at webkit.org
Mon Feb 21 00:30:19 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 6698d35d9efda0c68bdb8fd3d8a547c8bd66b4e4
Author: mario at webkit.org <mario at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Feb 1 09:49:25 2011 +0000
2011-02-01 Mario Sanchez Prada <msanchez at igalia.com>
Reviewed by Martin Robinson.
[GTK] Caret Offset is one off at the end of wrapped lines
https://bugs.webkit.org/show_bug.cgi?id=53300
Consider linebreaks as special cases.
* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(objectAndOffsetUnignored): In order to avoid getting wrong values
when around linebreaks, we need to workaround this by explicitly
avoiding those '\n' text nodes from affecting the result of
calling to TextIterator:rangeLength().
2011-02-01 Mario Sanchez Prada <msanchez at igalia.com>
Reviewed by Martin Robinson.
[GTK] Caret Offset is one off at the end of wrapped lines
https://bugs.webkit.org/show_bug.cgi?id=53300
Update unit test to check the fix for this bug.
* tests/testatk.c:
(testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces): Set and get
the caret offset at the edge of the line.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 02146ec..ae4b349 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2011-02-01 Mario Sanchez Prada <msanchez at igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Caret Offset is one off at the end of wrapped lines
+ https://bugs.webkit.org/show_bug.cgi?id=53300
+
+ Consider linebreaks as special cases.
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (objectAndOffsetUnignored): In order to avoid getting wrong values
+ when around linebreaks, we need to workaround this by explicitly
+ avoiding those '\n' text nodes from affecting the result of
+ calling to TextIterator:rangeLength().
+
2011-02-01 Roland Steiner <rolandsteiner at chromium.org>
Unreviewed, rolling out r77229.
diff --git a/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index df798cd..b675af8 100644
--- a/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -63,6 +63,7 @@
#include "TextEncoding.h"
#include "TextIterator.h"
#include "WebKitAccessibleHyperlink.h"
+#include "visible_units.h"
#include <atk/atk.h>
#include <glib.h>
@@ -2489,8 +2490,19 @@ AccessibilityObject* objectAndOffsetUnignored(AccessibilityObject* coreObject, i
Node* node = realObject->node();
if (node) {
- RefPtr<Range> range = Range::create(node->document(), firstPositionInNode(node), realObject->selection().end());
- offset = TextIterator::rangeLength(range.get());
+ VisiblePosition startPosition = VisiblePosition(node, 0, DOWNSTREAM);
+ VisiblePosition endPosition = realObject->selection().visibleEnd();
+
+ if (startPosition == endPosition)
+ offset = 0;
+ else if (!isStartOfLine(endPosition)) {
+ RefPtr<Range> range = makeRange(startPosition, endPosition.previous());
+ offset = TextIterator::rangeLength(range.get()) + 1;
+ } else {
+ RefPtr<Range> range = makeRange(startPosition, endPosition);
+ offset = TextIterator::rangeLength(range.get());
+ }
+
}
return realObject;
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index 6c2c3ec..4de0efb 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,16 @@
+2011-02-01 Mario Sanchez Prada <msanchez at igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Caret Offset is one off at the end of wrapped lines
+ https://bugs.webkit.org/show_bug.cgi?id=53300
+
+ Update unit test to check the fix for this bug.
+
+ * tests/testatk.c:
+ (testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces): Set and get
+ the caret offset at the edge of the line.
+
2011-01-31 Mario Sanchez Prada <msanchez at igalia.com>
Reviewed by Martin Robinson.
diff --git a/Source/WebKit/gtk/tests/testatk.c b/Source/WebKit/gtk/tests/testatk.c
index b6a4c8d..9940c6d 100644
--- a/Source/WebKit/gtk/tests/testatk.c
+++ b/Source/WebKit/gtk/tests/testatk.c
@@ -368,6 +368,12 @@ static void testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces()
gint caretOffset = atk_text_get_caret_offset(textObject);
g_assert_cmpint(caretOffset, ==, characterCount - 1);
+ result = atk_text_set_caret_offset(textObject, characterCount);
+ g_assert_cmpint(result, ==, TRUE);
+
+ caretOffset = atk_text_get_caret_offset(textObject);
+ g_assert_cmpint(caretOffset, ==, characterCount);
+
g_object_unref(webView);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list