Commit dcdb2794 authored by justing's avatar justing

LayoutTests:

        Reviewed by darin
        
        <rdar://problem/5065910> REGRESSION: In Mail and GMail, Can't apply color to pasted line of text
        <rdar://problem/5084241> After deleting a paragraph of colored text, can't change text color
        <rdar://problem/5065605> REGRESSION: Text copied with Select All + Copy loses color on Paste
        <rdar://problem/4916887> GMAIL: Can't apply color to text once it becomes indented

        * editing/pasteboard/5065605-expected.checksum: Added.
        * editing/pasteboard/5065605-expected.png: Added.
        * editing/pasteboard/5065605-expected.txt: Added.
        * editing/pasteboard/5065605.html: Added.
        * editing/style/4916887-expected.checksum: Added.
        * editing/style/4916887-expected.png: Added.
        * editing/style/4916887-expected.txt: Added.
        * editing/style/4916887.html: Added.
        * editing/style/5065910-expected.checksum: Added.
        * editing/style/5065910-expected.png: Added.
        * editing/style/5065910-expected.txt: Added.
        * editing/style/5065910.html: Added.
        * editing/style/5084241-expected.checksum: Added.
        * editing/style/5084241-expected.png: Added.
        * editing/style/5084241-expected.txt: Added.
        * editing/style/5084241.html: Added.

WebCore:

        Reviewed by darin
        
        <rdar://problem/5065910> REGRESSION: In Mail and GMail, Can't apply color to pasted line of text
        <rdar://problem/5084241> After deleting a paragraph of colored text, can't change text color
        <rdar://problem/5065605> REGRESSION: Text copied with Select All + Copy loses color on Paste
        <rdar://problem/4916887> GMAIL: Can't apply color to text once it becomes indented

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::CSSComputedStyleDeclaration::copyInheritableProperties):
        If a node's text fill color is invalid, then its children use 
        their font-color as their text fill color (they don't inherit 
        it).  Likewise for stroke color.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c3c0159f
2007-03-26 Justin Garcia <justin.garcia@apple.com>
Reviewed by darin
<rdar://problem/5065910> REGRESSION: In Mail and GMail, Can't apply color to pasted line of text
<rdar://problem/5084241> After deleting a paragraph of colored text, can't change text color
<rdar://problem/5065605> REGRESSION: Text copied with Select All + Copy loses color on Paste
<rdar://problem/4916887> GMAIL: Can't apply color to text once it becomes indented
* editing/pasteboard/5065605-expected.checksum: Added.
* editing/pasteboard/5065605-expected.png: Added.
* editing/pasteboard/5065605-expected.txt: Added.
* editing/pasteboard/5065605.html: Added.
* editing/style/4916887-expected.checksum: Added.
* editing/style/4916887-expected.png: Added.
* editing/style/4916887-expected.txt: Added.
* editing/style/4916887.html: Added.
* editing/style/5065910-expected.checksum: Added.
* editing/style/5065910-expected.png: Added.
* editing/style/5065910-expected.txt: Added.
* editing/style/5065910.html: Added.
* editing/style/5084241-expected.checksum: Added.
* editing/style/5084241-expected.png: Added.
* editing/style/5084241-expected.txt: Added.
* editing/style/5084241.html: Added.
2007-03-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
7c60481eaee48947f7a0db2ebb41aa09
\ 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 784x18
RenderText {#text} at (0,0) size 517x18
text run at (0,0) width 517: "This tests for a bug where text copied with Select All + Copy would lose its color."
RenderBlock {DIV} at (0,34) size 784x72
RenderBlock (anonymous) at (0,0) size 784x18
RenderInline {FONT} at (0,0) size 148x18 [color=#FF0000]
RenderText {#text} at (0,0) size 148x18
text run at (0,0) width 148: "This text should be red."
RenderBlock {DIV} at (0,18) size 784x18
RenderInline {FONT} at (0,0) size 148x18 [color=#FF0000]
RenderText {#text} at (0,0) size 148x18
text run at (0,0) width 148: "This text should be red."
RenderBlock {DIV} at (0,36) size 784x36
RenderBlock (anonymous) at (0,0) size 784x18
RenderInline {FONT} at (0,0) size 148x18 [color=#FF0000]
RenderInline {SPAN} at (0,0) size 148x18 [color=#000000]
RenderInline {FONT} at (0,0) size 148x18 [color=#FF0000]
RenderText {#text} at (0,0) size 148x18
text run at (0,0) width 148: "This text should be red."
RenderBlock (anonymous) at (0,18) size 784x18
RenderBlock {DIV} at (0,0) size 784x18
RenderInline {FONT} at (0,0) size 148x18 [color=#FF0000]
RenderText {#text} at (0,0) size 148x18
text run at (0,0) width 148: "This text should be red."
RenderBlock (anonymous) at (0,36) size 784x0
RenderInline {FONT} at (0,0) size 0x0 [color=#FF0000]
RenderInline {SPAN} at (0,0) size 0x0 [color=#000000]
caret: position 24 of child 0 {#text} of child 0 {FONT} of child 1 {DIV} of child 0 {SPAN} of child 0 {FONT} of child 2 {DIV} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This tests for a bug where text copied with Select All + Copy would lose its color.</p>
<div id="div" contenteditable="true"><br></div>
<script>
var div = document.getElementById("div");
div.focus();
document.execCommand("InsertText", false, "This text should be red.");
document.execCommand("InsertParagraph");
document.execCommand("InsertText", false, "This text should be red.");
document.execCommand("SelectAll");
document.execCommand("ForeColor", false, "red");
document.execCommand("Copy");
window.getSelection().modify("move", "forward", "character");
document.execCommand("InsertParagraph");
document.execCommand("Paste");
</script>
7afc60d7f5849e2f697628adca564c3d
\ 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 784x18
RenderText {#text} at (0,0) size 458x18
text run at (0,0) width 458: "This tests for a bug where the color of indented text couldn't be changed."
RenderBlock {DIV} at (0,34) size 784x18
RenderBlock {BLOCKQUOTE} at (40,0) size 744x18
RenderInline {FONT} at (0,0) size 155x18 [color=#0000FF]
RenderText {#text} at (0,0) size 155x18
text run at (0,0) width 155: "This text should be blue."
RenderBlock (anonymous) at (0,18) size 784x0
selection start: position 0 of child 0 {#text} of child 0 {FONT} of child 0 {BLOCKQUOTE} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
selection end: position 25 of child 0 {#text} of child 0 {FONT} of child 0 {BLOCKQUOTE} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This tests for a bug where the color of indented text couldn't be changed.</p>
<div id="div" contenteditable="true"><br></div>
<script>
var div = document.getElementById("div");
div.focus();
document.execCommand("InsertText", false, "This text should be blue.");
document.execCommand("SelectAll");
document.execCommand("ForeColor", false, "red");
document.execCommand("Indent");
document.execCommand("ForeColor", false, "blue");
</script>
a84b8ff017e6d0abea1bca1f05b37c9f
\ 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 784x18
RenderText {#text} at (0,0) size 447x18
text run at (0,0) width 447: "This tests for a bug where the color of pasted text couldn't be changed.'"
RenderBlock {DIV} at (0,34) size 784x36
RenderBlock (anonymous) at (0,0) size 784x18
RenderInline {FONT} at (0,0) size 148x18 [color=#FF0000]
RenderText {#text} at (0,0) size 148x18
text run at (0,0) width 148: "This text should be red."
RenderBlock {DIV} at (0,18) size 784x18
RenderInline {FONT} at (0,0) size 124x18 [color=#0000FF]
RenderText {#text} at (0,0) size 124x18
text run at (0,0) width 124: "This text should be "
RenderInline {FONT} at (0,0) size 235x18 [color=#008000]
RenderText {#text} at (124,0) size 235x18
text run at (124,0) width 235: "a combination of green and blue, not "
RenderInline {FONT} at (0,0) size 24x18 [color=#0000FF]
RenderText {#text} at (359,0) size 24x18
text run at (359,0) width 24: "red."
caret: position 37 of child 0 {#text} of child 1 {FONT} of child 1 {DIV} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This tests for a bug where the color of pasted text couldn't be changed.'</p>
<div id="div" contenteditable="true"><br></div>
<script>
var div = document.getElementById("div");
div.focus();
document.execCommand("InsertText", false, "This text should be red.");
document.execCommand("SelectAll");
document.execCommand("ForeColor", false, "red");
document.execCommand("Copy");
window.getSelection().modify("move", "forward", "character");
document.execCommand("InsertParagraph");
document.execCommand("Paste");
window.getSelection().modify("extend", "backward", "paragraphBoundary");
document.execCommand("ForeColor", false, "blue");
window.getSelection().modify("move", "forward", "character");
window.getSelection().modify("move", "backward", "word");
document.execCommand("ForeColor", false, "green");
document.execCommand("InsertText", false, "a combination of green and blue, not ");
</script>
d16933934006e136e7437873278ca14d
\ 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 784x36
RenderText {#text} at (0,0) size 771x36
text run at (0,0) width 771: "This tests for a bug where deleting everything in a paragraph of colored text would prevent the user from changing the text"
text run at (0,18) width 36: "color."
RenderBlock {DIV} at (0,52) size 784x18
RenderInline {FONT} at (0,0) size 148x18 [color=#FF0000]
RenderText {#text} at (0,0) size 148x18
text run at (0,0) width 148: "This text should be red."
RenderInline {FONT} at (0,0) size 155x18 [color=#0000FF]
RenderText {#text} at (148,0) size 155x18
text run at (148,0) width 155: "This text should be blue."
caret: position 25 of child 0 {#text} of child 1 {FONT} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This tests for a bug where deleting everything in a paragraph of colored text would prevent the user from changing the text color.</p>
<div id="div" contenteditable="true"><br></div>
<script>
var div = document.getElementById("div");
div.focus();
document.execCommand("InsertText", false, "This text should be red.");
document.execCommand("SelectAll");
document.execCommand("ForeColor", false, "red");
document.execCommand("Delete");
document.execCommand("InsertText", false, "This text should be red.");
document.execCommand("ForeColor", false, "blue");
document.execCommand("InsertText", false, "This text should be blue.");
</script>
2007-03-26 Justin Garcia <justin.garcia@apple.com>
Reviewed by darin
<rdar://problem/5065910> REGRESSION: In Mail and GMail, Can't apply color to pasted line of text
<rdar://problem/5084241> After deleting a paragraph of colored text, can't change text color
<rdar://problem/5065605> REGRESSION: Text copied with Select All + Copy loses color on Paste
<rdar://problem/4916887> GMAIL: Can't apply color to text once it becomes indented
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::copyInheritableProperties):
If a node's text fill color is invalid, then its children use
their font-color as their text fill color (they don't inherit
it). Likewise for stroke color.
2007-03-27 Anders Carlsson <acarlsson@apple.com>
* platform/ScrollBar.h:
......
......@@ -1688,7 +1688,19 @@ void CSSComputedStyleDeclaration::removeComputedInheritablePropertiesFrom(CSSMut
PassRefPtr<CSSMutableStyleDeclaration> CSSComputedStyleDeclaration::copyInheritableProperties() const
{
return copyPropertiesInSet(inheritableProperties, numInheritableProperties);
RefPtr<CSSMutableStyleDeclaration> style = copyPropertiesInSet(inheritableProperties, numInheritableProperties);
if (style) {
// If a node's text fill color is invalid, then its children use
// their font-color as their text fill color (they don't
// inherit it). Likewise for stroke color.
ExceptionCode ec = 0;
if (!m_node->renderer()->style()->textFillColor().isValid())
style->removeProperty(CSS_PROP__WEBKIT_TEXT_FILL_COLOR, ec);
if (!m_node->renderer()->style()->textStrokeColor().isValid())
style->removeProperty(CSS_PROP__WEBKIT_TEXT_STROKE_COLOR, ec);
ASSERT(ec == 0);
}
return style.release();
}
PassRefPtr<CSSMutableStyleDeclaration> CSSComputedStyleDeclaration::copy() const
......
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