Title: [109653] trunk
Revision
109653
Author
[email protected]
Date
2012-03-02 21:48:54 -0800 (Fri, 02 Mar 2012)

Log Message

Editor's default paragraph separator is not reset when a frame's document is changed
https://bugs.webkit.org/show_bug.cgi?id=80065

Patch by Pablo Flouret <[email protected]> on 2012-03-02
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: editing/execCommand/reset-values-after-navigation.html

* editing/Editor.cpp:
(WebCore::Editor::clear):

LayoutTests:

* editing/execCommand/default-paragraph-separator.html: Last line of the test did a manual reset of the value to work around this problem. Removed.
* editing/execCommand/reset-values-after-navigation-expected.txt: Added.
* editing/execCommand/reset-values-after-navigation.html: Added.
* editing/execCommand/resources/reset-default-values-helper-1.html: Added.
* editing/execCommand/resources/reset-default-values-helper-2.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (109652 => 109653)


--- trunk/LayoutTests/ChangeLog	2012-03-03 05:31:13 UTC (rev 109652)
+++ trunk/LayoutTests/ChangeLog	2012-03-03 05:48:54 UTC (rev 109653)
@@ -1,3 +1,16 @@
+2012-03-02  Pablo Flouret  <[email protected]>
+
+        Editor's default paragraph separator is not reset when a frame's document is changed
+        https://bugs.webkit.org/show_bug.cgi?id=80065
+
+        Reviewed by Ryosuke Niwa.
+
+        * editing/execCommand/default-paragraph-separator.html: Last line of the test did a manual reset of the value to work around this problem. Removed.
+        * editing/execCommand/reset-values-after-navigation-expected.txt: Added.
+        * editing/execCommand/reset-values-after-navigation.html: Added.
+        * editing/execCommand/resources/reset-default-values-helper-1.html: Added.
+        * editing/execCommand/resources/reset-default-values-helper-2.html: Added.
+
 2012-03-02  Noel Gordon  <[email protected]>
 
         :empty should apply to elements made empty via page dynamics

Modified: trunk/LayoutTests/editing/execCommand/default-paragraph-separator.html (109652 => 109653)


--- trunk/LayoutTests/editing/execCommand/default-paragraph-separator.html	2012-03-03 05:31:13 UTC (rev 109652)
+++ trunk/LayoutTests/editing/execCommand/default-paragraph-separator.html	2012-03-03 05:48:54 UTC (rev 109653)
@@ -74,7 +74,6 @@
     shouldBeEqualToString("div.innerHTML", "<cite>a<cite>b</cite></cite><p><cite><cite>c</cite></cite></p>");
 
     div.innerHTML = "";
-    document.execCommand("DefaultParagraphSeparator", false, "div");
 </script>
 <script src=""
 </body>

Added: trunk/LayoutTests/editing/execCommand/reset-values-after-navigation-expected.txt (0 => 109653)


--- trunk/LayoutTests/editing/execCommand/reset-values-after-navigation-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/execCommand/reset-values-after-navigation-expected.txt	2012-03-03 05:48:54 UTC (rev 109653)
@@ -0,0 +1,6 @@
+PASS queryCommandValues["DefaultParagraphSeparator"] is "div"
+PASS queryCommandValues["StyleWithCSS"] is "false"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/editing/execCommand/reset-values-after-navigation.html (0 => 109653)


--- trunk/LayoutTests/editing/execCommand/reset-values-after-navigation.html	                        (rev 0)
+++ trunk/LayoutTests/editing/execCommand/reset-values-after-navigation.html	2012-03-03 05:48:54 UTC (rev 109653)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+    window.jsTestIsAsync = true;
+    window._onmessage_ = function (e) {
+        if (e.origin == location.protocol + "//" + location.host) {
+            queryCommandValues = JSON.parse(e.data);
+            shouldBeEqualToString('queryCommandValues["DefaultParagraphSeparator"]', "div");
+            shouldBeEqualToString('queryCommandValues["StyleWithCSS"]', "false");
+            finishJSTest();
+        }
+    }
+</script>
+</head>
+<body>
+<iframe style="display: none" src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/editing/execCommand/resources/reset-default-values-helper-1.html (0 => 109653)


--- trunk/LayoutTests/editing/execCommand/resources/reset-default-values-helper-1.html	                        (rev 0)
+++ trunk/LayoutTests/editing/execCommand/resources/reset-default-values-helper-1.html	2012-03-03 05:48:54 UTC (rev 109653)
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<script>
+    document.execCommand("DefaultParagraphSeparator", false, "p");
+    document.execCommand("StyleWithCSS", false, true);
+    location.href = ""
+</script>

Added: trunk/LayoutTests/editing/execCommand/resources/reset-default-values-helper-2.html (0 => 109653)


--- trunk/LayoutTests/editing/execCommand/resources/reset-default-values-helper-2.html	                        (rev 0)
+++ trunk/LayoutTests/editing/execCommand/resources/reset-default-values-helper-2.html	2012-03-03 05:48:54 UTC (rev 109653)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<script>
+    window.parent.postMessage(JSON.stringify({
+        DefaultParagraphSeparator: document.queryCommandValue("DefaultParagraphSeparator"),
+        StyleWithCSS: document.queryCommandValue("StyleWithCSS")
+    }), location.protocol + "//" + location.host);
+</script>
+

Modified: trunk/Source/WebCore/ChangeLog (109652 => 109653)


--- trunk/Source/WebCore/ChangeLog	2012-03-03 05:31:13 UTC (rev 109652)
+++ trunk/Source/WebCore/ChangeLog	2012-03-03 05:48:54 UTC (rev 109653)
@@ -1,3 +1,15 @@
+2012-03-02  Pablo Flouret  <[email protected]>
+
+        Editor's default paragraph separator is not reset when a frame's document is changed
+        https://bugs.webkit.org/show_bug.cgi?id=80065
+
+        Reviewed by Ryosuke Niwa.
+
+        Test: editing/execCommand/reset-values-after-navigation.html
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::clear):
+
 2012-03-02  Alexey Proskuryakov  <[email protected]>
 
         Have a copy of plug-in sandboxing API header in WebCore

Modified: trunk/Source/WebCore/editing/Editor.cpp (109652 => 109653)


--- trunk/Source/WebCore/editing/Editor.cpp	2012-03-03 05:31:13 UTC (rev 109652)
+++ trunk/Source/WebCore/editing/Editor.cpp	2012-03-03 05:48:54 UTC (rev 109653)
@@ -859,6 +859,7 @@
     m_compositionNode = 0;
     m_customCompositionUnderlines.clear();
     m_shouldStyleWithCSS = false;
+    m_defaultParagraphSeparator = EditorParagraphSeparatorIsDiv;
 }
 
 bool Editor::insertText(const String& text, Event* triggeringEvent)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to