LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2007 00:13:15 +0000 (00:13 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2007 00:13:15 +0000 (00:13 +0000)
        Reviewed by hyatt

        <rdar://problem/5138441>
        GoogleDocs: Indented text looks like text that's been Quoted

        Demonstrates the bug:
        * editing/execCommand/5138441-expected.checksum: Added.
        * editing/execCommand/5138441-expected.png: Added.
        * editing/execCommand/5138441-expected.txt: Added.
        * editing/execCommand/5138441.html: Added.

        Added inline style declarations for indent blockquotes
        to match those that the engine creates:
        * editing/execCommand/indent-selection.html:
        * editing/execCommand/outdent-selection.html:

WebCore:

        Reviewed by hyatt

        <rdar://problem/5138441>
        GoogleDocs: Indented text looks like text that's been Quoted

        GoogleDocs uses FormatBlock, blockquotes and a style rule
        for blockquotes to implement a "Quote Text" feature.  Styles
        intended only for those blockquotes were added to the
        blockquotes that we use for indenting.

        * css/html4.css: Removed the webkit-indent-blockquote class rule.
        * editing/IndentOutdentCommand.cpp:
        (WebCore::createIndentBlockquoteElement): Use custom margins
        and turn off border and padding to override author rules for
        blockquotes.

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

LayoutTests/ChangeLog
LayoutTests/editing/execCommand/5138441-expected.checksum [new file with mode: 0644]
LayoutTests/editing/execCommand/5138441-expected.png [new file with mode: 0644]
LayoutTests/editing/execCommand/5138441-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/5138441.html [new file with mode: 0644]
LayoutTests/editing/execCommand/indent-selection.html
LayoutTests/editing/execCommand/outdent-selection.html
WebCore/ChangeLog
WebCore/css/html4.css
WebCore/editing/IndentOutdentCommand.cpp

index 6cce4eda7ca34f158aec3a68105af662d9ce43f0..8e6698327ed76d2a8d97defc57beafc869461c38 100644 (file)
@@ -1,3 +1,21 @@
+2007-04-17  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by hyatt
+        
+        <rdar://problem/5138441> 
+        GoogleDocs: Indented text looks like text that's been Quoted
+
+        Demonstrates the bug:
+        * editing/execCommand/5138441-expected.checksum: Added.
+        * editing/execCommand/5138441-expected.png: Added.
+        * editing/execCommand/5138441-expected.txt: Added.
+        * editing/execCommand/5138441.html: Added.
+        
+        Added inline style declarations for indent blockquotes
+        to match those that the engine creates:
+        * editing/execCommand/indent-selection.html:
+        * editing/execCommand/outdent-selection.html:
+
 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by darin
diff --git a/LayoutTests/editing/execCommand/5138441-expected.checksum b/LayoutTests/editing/execCommand/5138441-expected.checksum
new file mode 100644 (file)
index 0000000..d1705b3
--- /dev/null
@@ -0,0 +1 @@
+d4766307d5a6999b43187ef6bbc98bb2
\ No newline at end of file
diff --git a/LayoutTests/editing/execCommand/5138441-expected.png b/LayoutTests/editing/execCommand/5138441-expected.png
new file mode 100644 (file)
index 0000000..84a2f9f
Binary files /dev/null and b/LayoutTests/editing/execCommand/5138441-expected.png differ
diff --git a/LayoutTests/editing/execCommand/5138441-expected.txt b/LayoutTests/editing/execCommand/5138441-expected.txt
new file mode 100644 (file)
index 0000000..5cc3798
--- /dev/null
@@ -0,0 +1,19 @@
+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 {P} at (0,0) size 784x54
+        RenderText {#text} at (0,0) size 776x54
+          text run at (0,0) width 493: "This tests for a bug where indented text would appear quoted in GoogleDocs. "
+          text run at (493,0) width 218: "Google docs uses blockquotes and"
+          text run at (0,18) width 776: "FormatBlock to implement a \"Quote Text\" feature, and style rules for blockquotes appeared on the blockquotes that we use"
+          text run at (0,36) width 149: "to implement indenting."
+      RenderBlock {DIV} at (0,70) size 784x62
+        RenderBlock {BLOCKQUOTE} at (40,0) size 744x18
+          RenderText {#text} at (0,0) size 230x18
+            text run at (0,0) width 230: "This should be indented, not quoted."
+        RenderBlock {BLOCKQUOTE} at (8,26) size 768x36 [border: (1px dashed #AAAAAA)]
+          RenderText {#text} at (9,9) size 175x18
+            text run at (9,9) width 175: "This text should be Quoted."
+caret: position 0 of child 0 {#text} of child 1 {BLOCKQUOTE} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/execCommand/5138441.html b/LayoutTests/editing/execCommand/5138441.html
new file mode 100644 (file)
index 0000000..fd80914
--- /dev/null
@@ -0,0 +1,26 @@
+<html>
+<head>
+<style>
+blockquote {
+    border: 1px dashed #aaa;
+    padding: 0.5em;
+    margin: 0.5em;
+}
+</style>
+</head>
+<body>
+<p>This tests for a bug where indented text would appear quoted in GoogleDocs.  Google docs uses blockquotes and FormatBlock to implement a "Quote Text" feature, and style rules for blockquotes appeared on the blockquotes that we use to implement indenting.</p>
+<div contenteditable="true">
+<div id="div">This should be indented, not quoted.</div>
+<blockquote>This text should be Quoted.</blockquote>
+</div>
+
+<script>
+var selection = window.getSelection();
+var div = document.getElementById("div");
+
+selection.setPosition(div, 0);
+document.execCommand("Indent");
+</script>
+</body>
+</html>
index bc9a6898bb4429ca7fc1440ac29cf6bdb3e407a2..7bb6168df11d4f58d889825de4771d00176d3625 100644 (file)
@@ -9,7 +9,7 @@ This test uses the execCommand to indent the text below.
 <div contenteditable="true">
 <span id="item1">Lorem</span><br>
 more Lorem!
-<blockquote class="webkit-indent-blockquote">
+<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px;">
 ipsum<br>
 
 <ul>
index 9dfba191b49547920ebe8b24003208b38c12b66b..a820042fedc20c156ab0a3c691b062aefadb146e 100644 (file)
@@ -7,7 +7,7 @@ if (window.layoutTestController)
 <div contenteditable="true">
 <span id="item1">Lorem</span><br>
 more Lorem!
-<blockquote class="webkit-indent-blockquote">
+<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px;">
 ipsum<br>
 
 <ul>
index 89799f5597cebc0a80d39d74b472c68ae452942f..f63a786c823935fa7d5c51e7d6e304f24292bbce 100644 (file)
@@ -1,3 +1,21 @@
+2007-04-17  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by hyatt
+
+        <rdar://problem/5138441> 
+        GoogleDocs: Indented text looks like text that's been Quoted
+        
+        GoogleDocs uses FormatBlock, blockquotes and a style rule
+        for blockquotes to implement a "Quote Text" feature.  Styles
+        intended only for those blockquotes were added to the 
+        blockquotes that we use for indenting.
+
+        * css/html4.css: Removed the webkit-indent-blockquote class rule.
+        * editing/IndentOutdentCommand.cpp:
+        (WebCore::createIndentBlockquoteElement): Use custom margins
+        and turn off border and padding to override author rules for
+        blockquotes.
+
 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by darin
index 96b2f3ba2e19ba2e7c5bec88b2f6549234c59fb9..1f09fb0d1564e852317871af15eb02132206077f 100644 (file)
@@ -596,9 +596,4 @@ iframe {
     border: 2px inset
 }
 
-blockquote.webkit-indent-blockquote {
-    margin: 0 0 0 40px;
-}
-
-
 /* noscript is handled internally, as it depends on settings */
index 3c51fcfd261ec1ab44dfb61f6ab3173723db918c..848d88dde0744b9fc22ce77ee80dd3d28bf4064a 100644 (file)
@@ -51,6 +51,7 @@ static PassRefPtr<Element> createIndentBlockquoteElement(Document* document)
 {
     RefPtr<Element> indentBlockquoteElement = createElement(document, "blockquote");
     indentBlockquoteElement->setAttribute(classAttr, indentBlockquoteString());
+    indentBlockquoteElement->setAttribute(styleAttr, "margin: 0 0 0 40px; border: none; padding: 0px;");
     return indentBlockquoteElement.release();
 }