LayoutTests:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 May 2006 03:24:02 +0000 (03:24 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 May 2006 03:24:02 +0000 (03:24 +0000)
        Reviewed by Darin.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8835
          REGRESSION: Line moves but selection highlight stays behind

        * fast/dynamic/selection-highlight-adjust-expected.checksum: Added.
        * fast/dynamic/selection-highlight-adjust-expected.png: Added.
        * fast/dynamic/selection-highlight-adjust-expected.txt: Added.
        * fast/dynamic/selection-highlight-adjust.html: Added.

WebCore:

        Reviewed by Darin.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8835
          REGRESSION: Line moves but selection highlight stays behind

        Test: fast/dynamic/selection-highlight-adjust.html

        * rendering/render_line.cpp:
        (WebCore::RootInlineBox::adjustPosition): Adjust m_selectionTop
        and m_selectionBottom.

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

LayoutTests/ChangeLog
LayoutTests/fast/dynamic/selection-highlight-adjust-expected.checksum [new file with mode: 0644]
LayoutTests/fast/dynamic/selection-highlight-adjust-expected.png [new file with mode: 0644]
LayoutTests/fast/dynamic/selection-highlight-adjust-expected.txt [new file with mode: 0644]
LayoutTests/fast/dynamic/selection-highlight-adjust.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/render_line.cpp

index 97d21496dfe6abab22267941fd35fd77d46f519f..f21f4a881990801b38ed37b300289056fe2a1ab2 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8835
+          REGRESSION: Line moves but selection highlight stays behind
+
+        * fast/dynamic/selection-highlight-adjust-expected.checksum: Added.
+        * fast/dynamic/selection-highlight-adjust-expected.png: Added.
+        * fast/dynamic/selection-highlight-adjust-expected.txt: Added.
+        * fast/dynamic/selection-highlight-adjust.html: Added.
+
 2006-05-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed and landed by Anders.
diff --git a/LayoutTests/fast/dynamic/selection-highlight-adjust-expected.checksum b/LayoutTests/fast/dynamic/selection-highlight-adjust-expected.checksum
new file mode 100644 (file)
index 0000000..6adaeaa
--- /dev/null
@@ -0,0 +1,2 @@
+e56c68d92aca47bb7fb1365983fb5390
+\ No newline at end of file
diff --git a/LayoutTests/fast/dynamic/selection-highlight-adjust-expected.png b/LayoutTests/fast/dynamic/selection-highlight-adjust-expected.png
new file mode 100644 (file)
index 0000000..f0a0ff0
Binary files /dev/null and b/LayoutTests/fast/dynamic/selection-highlight-adjust-expected.png differ
diff --git a/LayoutTests/fast/dynamic/selection-highlight-adjust-expected.txt b/LayoutTests/fast/dynamic/selection-highlight-adjust-expected.txt
new file mode 100644 (file)
index 0000000..d1faf38
--- /dev/null
@@ -0,0 +1,32 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x156
+  RenderBlock {HTML} at (0,0) size 800x156
+    RenderBody {BODY} at (8,16) size 784x132
+      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 784x36
+          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=8835"
+          RenderText {#text} at (520,0) size 784x36
+            text run at (520,0) width 4: " "
+            text run at (524,0) width 260: "REGRESSION: Line moves but selection"
+            text run at (0,18) width 138: "highlight stays behind"
+        RenderText {#text} at (138,18) size 4x18
+          text run at (138,18) width 4: "."
+      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (0,62) size 784x70
+        RenderImage {IMG} at (0,0) size 0x30
+        RenderBR {BR} at (0,16) size 0x18
+        RenderBR {BR} at (0,34) size 0x18
+        RenderInline {SPAN} at (0,0) size 309x18
+          RenderText {#text} at (0,52) size 309x18
+            text run at (0,52) width 309: "The highlight should be on this line, not above it."
+        RenderText {#text} at (309,52) size 4x18
+          text run at (309,52) width 4: " "
+        RenderBR {BR} at (313,52) size 0x18
+selection start: position 0 of child 0 {#text} of child 6 {SPAN} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+selection end:   position 51 of child 0 {#text} of child 6 {SPAN} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/fast/dynamic/selection-highlight-adjust.html b/LayoutTests/fast/dynamic/selection-highlight-adjust.html
new file mode 100644 (file)
index 0000000..34661d1
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title></title>
+    <script type="text/javascript">
+        function test()
+        {
+            var span = document.getElementById('span');
+            window.getSelection().setBaseAndExtent(span, 0, span, 1);
+            var image = document.getElementById('image');
+            image.style.height = "30px";
+        }
+    </script>
+</head>
+<body onload="test()">
+<p>
+    This is a regression test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=8835">http://bugzilla.opendarwin.org/show_bug.cgi?id=8835</a>
+    REGRESSION: Line moves but selection highlight stays behind</i>.
+</p>
+<hr>
+<div>
+<img style="height: 2px;" id="image"><br>
+<br>
+<span id="span">The highlight should be on this line, not above it.</span>
+<br>
+</div>
+</body>
+</html>
index c7ae60f0a25cc9959293a0223264044496ed4b5f..9bc08d6c54aacadf291d8b8db0cfa3b609a379f2 100644 (file)
@@ -1,3 +1,16 @@
+2006-05-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8835
+          REGRESSION: Line moves but selection highlight stays behind
+
+        Test: fast/dynamic/selection-highlight-adjust.html
+
+        * rendering/render_line.cpp:
+        (WebCore::RootInlineBox::adjustPosition): Adjust m_selectionTop
+        and m_selectionBottom.
+
 2006-05-12  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Darin.
index 2d1db68c113c2f0cc91f96c107fbecaaeadde67e..b5582139f34ed4e816271ba6a249ccbbe9b95c85 100644 (file)
@@ -1215,6 +1215,8 @@ void RootInlineBox::adjustPosition(int dx, int dy)
     m_topOverflow += dy;
     m_bottomOverflow += dy;
     m_blockHeight += dy;
+    m_selectionTop += dy;
+    m_selectionBottom += dy;
 }
 
 void RootInlineBox::childRemoved(InlineBox* box)