WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 May 2006 12:35:50 +0000 (12:35 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 May 2006 12:35:50 +0000 (12:35 +0000)
2006-05-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>

        Reviewed and landed by Anders.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8866
          REGRESSION: Incorrect caret position in RTL text

        Test: fast/text/international/rtl-caret.html

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::positionForOffset): Added missing m_toAdd argument.

LayoutTests:

2006-05-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>

        Reviewed and landed by Anders.

        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8866
          REGRESSION: Incorrect caret position in RTL text

        * fast/text/international/rtl-caret-expected.checksum: Added.
        * fast/text/international/rtl-caret-expected.png: Added.
        * fast/text/international/rtl-caret-expected.txt: Added.
        * fast/text/international/rtl-caret.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/text/international/rtl-caret-expected.checksum [new file with mode: 0644]
LayoutTests/fast/text/international/rtl-caret-expected.png [new file with mode: 0644]
LayoutTests/fast/text/international/rtl-caret-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/international/rtl-caret.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/InlineTextBox.cpp

index 69da47ae6b971d514c2081cc66a3827183b5de92..97d21496dfe6abab22267941fd35fd77d46f519f 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed and landed by Anders.
+        
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8866
+          REGRESSION: Incorrect caret position in RTL text
+
+        * fast/text/international/rtl-caret-expected.checksum: Added.
+        * fast/text/international/rtl-caret-expected.png: Added.
+        * fast/text/international/rtl-caret-expected.txt: Added.
+        * fast/text/international/rtl-caret.html: Added.
+
 2006-05-11  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/text/international/rtl-caret-expected.checksum b/LayoutTests/fast/text/international/rtl-caret-expected.checksum
new file mode 100644 (file)
index 0000000..823c77d
--- /dev/null
@@ -0,0 +1 @@
+d54fab5dfb6862bea3cf2cf92a19e7ac
\ No newline at end of file
diff --git a/LayoutTests/fast/text/international/rtl-caret-expected.png b/LayoutTests/fast/text/international/rtl-caret-expected.png
new file mode 100644 (file)
index 0000000..5ca30a6
Binary files /dev/null and b/LayoutTests/fast/text/international/rtl-caret-expected.png differ
diff --git a/LayoutTests/fast/text/international/rtl-caret-expected.txt b/LayoutTests/fast/text/international/rtl-caret-expected.txt
new file mode 100644 (file)
index 0000000..1f10fed
--- /dev/null
@@ -0,0 +1,29 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 172x18
+          text run at (0,0) width 172: "This is a regression test for "
+        RenderInline {I} at (0,0) size 777x36
+          RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+            RenderText {#text} at (172,0) size 348x18
+              text run at (172,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8866"
+          RenderText {#text} at (520,0) size 777x36
+            text run at (520,0) width 4: " "
+            text run at (524,0) width 253: "REGRESSION: Incorrect caret position"
+            text run at (0,18) width 70: "in RTL text"
+        RenderText {#text} at (70,18) size 4x18
+          text run at (70,18) width 4: "."
+      RenderBlock {P} at (0,52) size 784x18
+        RenderText {#text} at (0,0) size 346x18
+          text run at (0,0) width 346: "The caret should be in the middle of the Hebrew word."
+      RenderBlock {HR} at (0,86) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (0,96) size 784x18
+        RenderText {#text} at (0,0) size 64x18
+          text run at (0,0) width 64 RTL: "\x{5D0}\x{5D5}\x{5DB}\x{5DE}\x{5E0}\x{5D9}\x{5D5}\x{5EA}"
+caret: position 5 of child 0 {#text} of child 7 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/fast/text/international/rtl-caret.html b/LayoutTests/fast/text/international/rtl-caret.html
new file mode 100644 (file)
index 0000000..e17e029
--- /dev/null
@@ -0,0 +1,22 @@
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+<p>
+    This is a regression test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=8866">http://bugzilla.opendarwin.org/show_bug.cgi?id=8866</a>
+    REGRESSION: Incorrect caret position in RTL text</i>.
+</p>
+<p>
+    The caret should be in the middle of the Hebrew word.
+</p>
+<hr>
+<div id="t" contenteditable>
+&#x05d0;&#x05d5;&#x05db;&#x05de;&#x05e0;&#x05d9;&#x05d5;&#x05ea;
+</div>
+<script type="text/javascript">
+    var text = document.getElementById('t').childNodes[0];
+    window.getSelection().setBaseAndExtent(text, 5, text, 5);
+</script>
+</body>
+</html>
index 1999f371c029a75fafc6c14e4411c36a1953da67..54308a9a94f7a1a63f29fd88c2e5d6f6890735e3 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed and landed by Anders.
+        
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8866
+          REGRESSION: Incorrect caret position in RTL text
+
+        Test: fast/text/international/rtl-caret.html
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::positionForOffset): Added missing m_toAdd argument.
+
 2006-05-12  David Hyatt  <hyatt@apple.com>
 
         Bug 8864. Lift WebCoreTextStyle up into the API (as TextStyle).
index 5812a45a6672219e9fe0c7c95e1ce0f3f9976033..c6447f34ab4de49f747b41e1c5b456b67fe3e992 100644 (file)
@@ -697,7 +697,7 @@ int InlineTextBox::positionForOffset(int offset) const
     int to = m_reversed ? m_len : offset - m_start;
     // FIXME: Do we need to add rightBearing here?
     return enclosingIntRect(f->selectionRectForText(TextRun(text->string(), m_start, m_len, from, to),
-                                                    TextStyle(text->tabWidth(), textPos(), m_reversed, m_dirOverride),
+                                                    TextStyle(text->tabWidth(), textPos(), m_toAdd, m_reversed, m_dirOverride),
                                                     IntPoint(m_x, 0), 0)).right();
 }