Title: [151612] trunk
- Revision
- 151612
- Author
- [email protected]
- Date
- 2013-06-14 21:42:23 -0700 (Fri, 14 Jun 2013)
Log Message
background-color is not preserved when inserting a new paragraph
https://bugs.webkit.org/show_bug.cgi?id=117138
Patch by Lukasz Gajowy <[email protected]> on 2013-06-14
Reviewed by Ryosuke Niwa.
Source/WebCore:
The style isn't copied because background-color isn't defined as inheritable property.
Test: editing/inserting/insert-paragraph-not-preserving-background-color.html
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion):
Passing EditingPropertiesInEffect instead of implicit parameter OnlyEditingInheritableProperties.
LayoutTests:
Adding layout test and expected result to reproduce the issue.
* editing/inserting/insert-paragraph-with-font-and-background-color-expected.txt: Added.
* editing/inserting/insert-paragraph-with-font-and-background-color.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (151611 => 151612)
--- trunk/LayoutTests/ChangeLog 2013-06-14 23:05:39 UTC (rev 151611)
+++ trunk/LayoutTests/ChangeLog 2013-06-15 04:42:23 UTC (rev 151612)
@@ -1,3 +1,15 @@
+2013-06-14 Lukasz Gajowy <[email protected]>
+
+ background-color is not preserved when inserting a new paragraph
+ https://bugs.webkit.org/show_bug.cgi?id=117138
+
+ Reviewed by Ryosuke Niwa.
+
+ Adding layout test and expected result to reproduce the issue.
+
+ * editing/inserting/insert-paragraph-with-font-and-background-color-expected.txt: Added.
+ * editing/inserting/insert-paragraph-with-font-and-background-color.html: Added.
+
2013-06-14 Adam Barth <[email protected]>
Threaded HTML parser can ASSERT in some situations
Added: trunk/LayoutTests/editing/inserting/insert-paragraph-with-font-and-background-color-expected.txt (0 => 151612)
--- trunk/LayoutTests/editing/inserting/insert-paragraph-with-font-and-background-color-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/inserting/insert-paragraph-with-font-and-background-color-expected.txt 2013-06-15 04:42:23 UTC (rev 151612)
@@ -0,0 +1,23 @@
+This test checks behaviour of insertParagraph method.
+The style and the font should be preserved in new line of text - the "Bar" should be green and have red background.
+
+| "
+"
+| <font>
+| color="#1b6f11"
+| "
+"
+| <span>
+| id="textSpan"
+| style="background-color: rgb(191,35,28);"
+| "Foo"
+| <div>
+| <font>
+| color="#1b6f11"
+| <span>
+| style="background-color: rgb(191, 35, 28);"
+| "Bar<#selection-caret>"
+| <br>
+| <br>
+| "
+"
Added: trunk/LayoutTests/editing/inserting/insert-paragraph-with-font-and-background-color.html (0 => 151612)
--- trunk/LayoutTests/editing/inserting/insert-paragraph-with-font-and-background-color.html (rev 0)
+++ trunk/LayoutTests/editing/inserting/insert-paragraph-with-font-and-background-color.html 2013-06-15 04:42:23 UTC (rev 151612)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div id="test" contenteditable="true">
+<font color="#1b6f11">
+<span id="textSpan" style="background-color: rgb(191,35,28);">Foo</span></font><br><br>
+</div>
+
+<script src=""
+<script>
+
+Markup.description('This test checks behaviour of insertParagraph method.\n'+
+'The style and the font should be preserved in new line of text - the "Bar" should be green and have red background.\n');
+var container = document.getElementById('test');
+var textSpan = document.getElementById('textSpan');
+window.getSelection().setPosition(textSpan, 1);
+document.execCommand("InsertParagraph");
+document.execCommand("InsertText", false, "Bar");
+Markup.dump(container);
+
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (151611 => 151612)
--- trunk/Source/WebCore/ChangeLog 2013-06-14 23:05:39 UTC (rev 151611)
+++ trunk/Source/WebCore/ChangeLog 2013-06-15 04:42:23 UTC (rev 151612)
@@ -1,3 +1,18 @@
+2013-06-14 Lukasz Gajowy <[email protected]>
+
+ background-color is not preserved when inserting a new paragraph
+ https://bugs.webkit.org/show_bug.cgi?id=117138
+
+ Reviewed by Ryosuke Niwa.
+
+ The style isn't copied because background-color isn't defined as inheritable property.
+
+ Test: editing/inserting/insert-paragraph-not-preserving-background-color.html
+
+ * editing/InsertParagraphSeparatorCommand.cpp:
+ (WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion):
+ Passing EditingPropertiesInEffect instead of implicit parameter OnlyEditingInheritableProperties.
+
2013-06-14 Adam Barth <[email protected]>
Threaded HTML parser can ASSERT in some situations
Modified: trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp (151611 => 151612)
--- trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp 2013-06-14 23:05:39 UTC (rev 151611)
+++ trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp 2013-06-15 04:42:23 UTC (rev 151612)
@@ -81,7 +81,7 @@
return;
ASSERT(pos.isNotNull());
- m_style = EditingStyle::create(pos);
+ m_style = EditingStyle::create(pos, EditingStyle::EditingPropertiesInEffect);
m_style->mergeTypingStyle(pos.anchorNode()->document());
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes