LayoutTests:
authorantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2007 11:37:21 +0000 (11:37 +0000)
committerantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2007 11:37:21 +0000 (11:37 +0000)
        Reviewed by Mitz.

        Test case for <rdar://problem/5058774>
        REGRESSION: In Mail, caret appears oversized when typing in a To Do note

        * editing/style/highlight-expected.checksum: Added.
        * editing/style/highlight-expected.png: Added.
        * editing/style/highlight-expected.txt: Added.
        * editing/style/highlight.html: Added.

WebCore:

        Reviewed by Mitz.

        Fix <rdar://problem/5058774>
        REGRESSION: In Mail, caret appears oversized when typing in a To Do note

        Horizontal and vertical were switched. Was regression from
        http://trac.webkit.org/projects/webkit/changeset/20103

        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::addHighlightOverflow):

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

LayoutTests/ChangeLog
LayoutTests/editing/style/highlight-expected.checksum [new file with mode: 0644]
LayoutTests/editing/style/highlight-expected.png [new file with mode: 0644]
LayoutTests/editing/style/highlight-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/highlight.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RootInlineBox.cpp

index f22fafa80595e52023bc1d763565b2f504de1183..d42586f311b9c309716a89189a9812aeafe68ae9 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-14  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Mitz.
+        
+        Test case for <rdar://problem/5058774>
+        REGRESSION: In Mail, caret appears oversized when typing in a To Do note
+
+        * editing/style/highlight-expected.checksum: Added.
+        * editing/style/highlight-expected.png: Added.
+        * editing/style/highlight-expected.txt: Added.
+        * editing/style/highlight.html: Added.
+
 2007-03-13  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by darin
diff --git a/LayoutTests/editing/style/highlight-expected.checksum b/LayoutTests/editing/style/highlight-expected.checksum
new file mode 100644 (file)
index 0000000..afa79ed
--- /dev/null
@@ -0,0 +1 @@
+5521a6ff21252670333b12883927120b
\ No newline at end of file
diff --git a/LayoutTests/editing/style/highlight-expected.png b/LayoutTests/editing/style/highlight-expected.png
new file mode 100644 (file)
index 0000000..18f2e39
Binary files /dev/null and b/LayoutTests/editing/style/highlight-expected.png differ
diff --git a/LayoutTests/editing/style/highlight-expected.txt b/LayoutTests/editing/style/highlight-expected.txt
new file mode 100644 (file)
index 0000000..a2f5425
--- /dev/null
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView 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 {DIV} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 135x18
+          text run at (0,0) width 135: "some highlighted text"
+caret: position 0 of child 0 {#text} of child 0 {DIV} of child 0 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/style/highlight.html b/LayoutTests/editing/style/highlight.html
new file mode 100644 (file)
index 0000000..59f90e4
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+<body><div id=e contenteditable style="-webkit-highlight:'green';">some highlighted text</div>
+<script>
+var e = document.getElementById('e');
+window.getSelection().setPosition(e,0);
+</script>
+</body>
+</html>
\ No newline at end of file
index ec3f8435bfa51afdb8c1fec1ed35652fe7fca72b..430d7d2cc46a23d612040de97060d286d59abef5 100644 (file)
@@ -1,3 +1,16 @@
+2007-03-14  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Mitz.
+        
+        Fix <rdar://problem/5058774>
+        REGRESSION: In Mail, caret appears oversized when typing in a To Do note
+        
+        Horizontal and vertical were switched. Was regression from
+        http://trac.webkit.org/projects/webkit/changeset/20103
+
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::addHighlightOverflow):
+
 2007-03-14  David Hyatt  <hyatt@apple.com>
 
         Tweak the data() functions of stylesheets and scripts to be internally consistent.
index 702c5dd5ad57d4362c6bd3f7e0e7e9928db5125d..a627c17fd58a2eebb3b26e07c9a57c3d26860604 100644 (file)
@@ -140,8 +140,8 @@ void RootInlineBox::addHighlightOverflow()
     // Highlight acts as a selection inflation.
     FloatRect rootRect(0, selectionTop(), width(), selectionHeight());
     IntRect inflatedRect = enclosingIntRect(object()->document()->frame()->customHighlightLineRect(object()->style()->highlight(), rootRect, object()->node()));
-    setVerticalOverflowPositions(min(leftOverflow(), inflatedRect.x()), max(rightOverflow(), inflatedRect.right()));
-    setHorizontalOverflowPositions(min(topOverflow(), inflatedRect.y()), max(bottomOverflow(), inflatedRect.bottom()));
+    setHorizontalOverflowPositions(min(leftOverflow(), inflatedRect.x()), max(rightOverflow(), inflatedRect.right()));
+    setVerticalOverflowPositions(min(topOverflow(), inflatedRect.y()), max(bottomOverflow(), inflatedRect.bottom()));
 }
 
 void RootInlineBox::paintCustomHighlight(RenderObject::PaintInfo& paintInfo, int tx, int ty, const AtomicString& highlightType)