Commit 889c96c8 authored by justing's avatar justing

LayoutTests:

        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: http://svn.webkit.org/repository/webkit/trunk@20925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 597cb568
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
d4766307d5a6999b43187ef6bbc98bb2
\ No newline at end of file
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
<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>
......@@ -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>
......
......@@ -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>
......
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
......@@ -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 */
......@@ -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();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment