2007-08-25 Mitz Pettel <mitz@webkit.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Aug 2007 12:21:02 +0000 (12:21 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Aug 2007 12:21:02 +0000 (12:21 +0000)
        Reviewed by Justin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=14792
          <rdar://problem/5367763> REGRESSION: Copy inserts carriage return in middle of selection

        Test: editing/pasteboard/newlines-around-floating-or-positioned.html

        * editing/TextIterator.cpp:
        (WebCore::shouldEmitNewlinesBeforeAndAfterNode): Do not emit newlines around
        floating or positioned blocks. This behavior seems to match WinIE's.

2007-08-25  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Justin.

        - test and updated results for http://bugs.webkit.org/show_bug.cgi?id=14792
          <rdar://problem/5367763> REGRESSION: Copy inserts carriage return in middle of selection

        * editing/pasteboard/newlines-around-floating-or-positioned-expected.txt: Added.
        * editing/pasteboard/newlines-around-floating-or-positioned.html: Added.
        * fast/events/capture-on-target-expected.txt:
        * fast/events/mouseclick-target-and-positioning-expected.txt:
        * fast/events/mouseover-mouseout-expected.txt:
        * fast/events/mouseover-mouseout2-expected.txt:
        * fast/events/window-events-bubble-expected.txt:
        * fast/events/window-events-bubble2-expected.txt:
        * fast/events/window-events-capture-expected.txt:
        * fast/forms/input-appearance-elementFromPoint-expected.txt:
        * fast/forms/onselect-textarea-expected.txt:
        * fast/forms/onselect-textfield-expected.txt:

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

15 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/newlines-around-floating-or-positioned-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/newlines-around-floating-or-positioned.html [new file with mode: 0644]
LayoutTests/fast/events/capture-on-target-expected.txt
LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt
LayoutTests/fast/events/mouseover-mouseout-expected.txt
LayoutTests/fast/events/mouseover-mouseout2-expected.txt
LayoutTests/fast/events/window-events-bubble-expected.txt
LayoutTests/fast/events/window-events-bubble2-expected.txt
LayoutTests/fast/events/window-events-capture-expected.txt
LayoutTests/fast/forms/input-appearance-elementFromPoint-expected.txt
LayoutTests/fast/forms/onselect-textarea-expected.txt
LayoutTests/fast/forms/onselect-textfield-expected.txt
WebCore/ChangeLog
WebCore/editing/TextIterator.cpp

index 65fb80e0f839815c2f1e8e3ed41e50ee4e7009e7..7ce2a583e9c90ec97ba97d98c26ec04ef0c38761 100644 (file)
@@ -1,3 +1,23 @@
+2007-08-25  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Justin.
+
+        - test and updated results for http://bugs.webkit.org/show_bug.cgi?id=14792
+          <rdar://problem/5367763> REGRESSION: Copy inserts carriage return in middle of selection
+
+        * editing/pasteboard/newlines-around-floating-or-positioned-expected.txt: Added.
+        * editing/pasteboard/newlines-around-floating-or-positioned.html: Added.
+        * fast/events/capture-on-target-expected.txt:
+        * fast/events/mouseclick-target-and-positioning-expected.txt:
+        * fast/events/mouseover-mouseout-expected.txt:
+        * fast/events/mouseover-mouseout2-expected.txt:
+        * fast/events/window-events-bubble-expected.txt:
+        * fast/events/window-events-bubble2-expected.txt:
+        * fast/events/window-events-capture-expected.txt:
+        * fast/forms/input-appearance-elementFromPoint-expected.txt:
+        * fast/forms/onselect-textarea-expected.txt:
+        * fast/forms/onselect-textfield-expected.txt:
+
 2007-08-24  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Darin.
diff --git a/LayoutTests/editing/pasteboard/newlines-around-floating-or-positioned-expected.txt b/LayoutTests/editing/pasteboard/newlines-around-floating-or-positioned-expected.txt
new file mode 100644 (file)
index 0000000..6052af3
--- /dev/null
@@ -0,0 +1,8 @@
+test1 PASS: innerText is Lorem-ipsum as expected
+test2 PASS: innerText is Loremipsum as expected
+test3 PASS: innerText is Lorem-ipsum as expected
+test4 PASS: innerText is Loremipsum as expected
+Lorem-ipsum
+Loremipsum
+Lorem-ipsum
+Loremipsum
diff --git a/LayoutTests/editing/pasteboard/newlines-around-floating-or-positioned.html b/LayoutTests/editing/pasteboard/newlines-around-floating-or-positioned.html
new file mode 100644 (file)
index 0000000..4a2d680
--- /dev/null
@@ -0,0 +1,29 @@
+<pre id="console"></pre>
+<div id="test1">Lorem<span style="float: left;">-</span>ipsum</div>
+<div id="test2">Lorem<span style="float: left;"></span>ipsum</div>
+<div id="test3">Lorem<div style="position: absolute;">-</div>ipsum</div>
+<div id="test4">Lorem<div style="position: absolute;"></div>ipsum</div>
+<script>
+    function log(message)
+    {
+        var console = document.getElementById("console");
+        console.appendChild(document.createTextNode(message + "\n"));
+    }
+
+    function test(id, expected)
+    {
+        var actual = document.getElementById(id).innerText;
+        if (actual == expected)
+            log(id + " PASS: innerText is " + actual + " as expected");
+        else
+            log(id + " FAIL: innerText is " + actual + " instead of " + expected);
+    }
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    test("test1", "Lorem-ipsum");
+    test("test2", "Loremipsum");
+    test("test3", "Lorem-ipsum");
+    test("test4", "Loremipsum");
+</script>
index 3828c910f82d755a2e36e3a955ebdda14dc06605..46730b7e921e24c74f1b6c84fef0b34ce2b1c37a 100644 (file)
@@ -1,7 +1,6 @@
 This tests checks that capturing event handlers trigger on the node that is the target of the event, and that stopPropagation in such a handler prevents further bubble handlers from triggering.
 
 Click here
-
 targetClickFired: true
 containerClickFired: false
 test passed
index 8060d496211f62df04be4b0bf3fc3fa552d6c1e2..5e838209b6c1c7493b093552450bca567c53f3b4 100644 (file)
@@ -1,7 +1,6 @@
 This page tests whether a click event propogates with the correct target and positioning. See rdar://problem/4477126.
 
-click inside the red box:
-[]
+click inside the red box:[]
 PASS: event target should be [object HTMLElement] and is
 PASS: event.pageX should be 175 and is
 PASS: event.pageY should be 105 and is
index e57183e9494f3f201c0af96cf8fcac2685960f41..229657813ca731510301155aa104bed7291952ce 100644 (file)
@@ -2,13 +2,7 @@ Tests for bugs 3439, 5764, 7701 - Mouse events vs. DOM manipulation.
 
 Move the mouse pointer from left to right:
 
-1              
-1              
-2
-3
-4
-5
-
+1               1               2345
 Log    Expected results
 mouseover on t1_1
 mouseout on t1_1
index a06d1105ecba9435ef1e729c866b2b61661a9fbd..3cd4fe0151d09192d6aa73e6e906258c979d8202 100644 (file)
@@ -2,12 +2,7 @@ Tests for bugs 3439, 5764, 7701 - Mouse events vs. DOM manipulation.
 
 Move the mouse pointer from left to right:
 
-
-3
-4
-
-5
-6
+3456
 Log    Expected results
 mouseover on frame1
 mouseover on t1
index c4c5c6fd6e6a984a4e520dba699cdeb6fa06cb1e..f8805653d097918612cefa5839a10d396b677424 100644 (file)
@@ -1,4 +1 @@
-Test that stopPropagation() will not allow window events to bubble.
-Clicking on this should not fire window.onclick. This matches our old behavior and Firefox behavior.
-stopPropagation called. Test Passed.
-
+Test that stopPropagation() will not allow window events to bubble. Clicking on this should not fire window.onclick. This matches our old behavior and Firefox behavior. stopPropagation called. Test Passed.
index edc7bfd4110f6fdb6b09ef992cd51df0966d6d44..3a3e3765908d3bf8bb084ee5e5aea4e0b8e4eef2 100644 (file)
@@ -1,4 +1 @@
-Tests that preventDefault() will still allow window events to bubble.
-Clicking here should fire window.onclick. This will match Firefox behavior.
-Window.onClick fired. Test Passed.
-
+Tests that preventDefault() will still allow window events to bubble. Clicking here should fire window.onclick. This will match Firefox behavior. Window.onClick fired. Test Passed.
index c297d78a6a17245654a69d3f6536d3560b271e9e..00207790deae97ac05ad76d3c0bc48fb344b816d 100644 (file)
@@ -1,6 +1,4 @@
-This tests that window events will fire in the capture phase.
-Click here
-
+This tests that window events will fire in the capture phase. Click here
 Capture: Window.onClick is called
 stopPropagation called.
 Default behavior for link
index e2c9620749d2a06932ab6af9cdaff3e871927312..77b0b9d604c973a5fc9442f63437470f417012b1 100644 (file)
@@ -1,3 +1 @@
-This tests that elementFromPoint will get the input element. 
-Test Passed
-
+This tests that elementFromPoint will get the input element. Test Passed
index 13024cf021b52f8dfc8513a4027a10a06927a8dc..baea6ed599733116ef91fc7da3d4b1069ec20de6 100644 (file)
@@ -2,7 +2,6 @@
 This tests onSelect for textareas. 
 This also makes sure that the correct selection is restored when the element regains focus.
 
-
 Calling focus on textarea
 After focus: textarea selection start: 0 end: 0
 
index 13103db33bd307303a64f23b3efe5ed145005fcd..64272d0fac14389da7bb02880710c70d1ebcc361 100644 (file)
@@ -1,7 +1,6 @@
 
 This tests onSelect for text fields. 
 
-
 Calling focus on text field
 After focus: text field selection start: 0 end: 10
 
index 304a36ba8858207702ff9b09e0670fc0789af34f..a8dcd5ef7687a5ec7d857b8d2826a58c62db4a87 100644 (file)
@@ -1,3 +1,16 @@
+2007-08-25  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Justin.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=14792
+          <rdar://problem/5367763> REGRESSION: Copy inserts carriage return in middle of selection
+
+        Test: editing/pasteboard/newlines-around-floating-or-positioned.html
+
+        * editing/TextIterator.cpp:
+        (WebCore::shouldEmitNewlinesBeforeAndAfterNode): Do not emit newlines around
+        floating or positioned blocks. This behavior seems to match WinIE's.
+
 2007-08-23  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Darin.
index 9c444629a25ce8d1252904ca7a0112933e22393a..0231682b2e0acf6b66fab953e278afc5b84b7ca6 100644 (file)
@@ -454,7 +454,7 @@ static bool shouldEmitNewlinesBeforeAndAfterNode(Node* node)
             return true;
     }
     
-    return !r->isInline() && r->isRenderBlock() && !r->isBody();
+    return !r->isInline() && r->isRenderBlock() && !r->isFloatingOrPositioned() && !r->isBody();
 }
 
 static bool shouldEmitNewlineAfterNode(Node* node)