HTML content : <html> <head> <script type="text/javascript"> function ChangeTextColor() { document.execCommand("ForeColor", false, "red"); } function ChangeTextBack() { document.execCommand("HiliteColor", false, "green"); } </script> </head> <body contenteditable="true"> <input type="Button" onclick="ChangeTextColor()" value="Font Color" /> <input type="Button" onclick="ChangeTextBack()" value="BackGround Color" /> <div > Type text here and apply fontcolor and cut and paste two time and apply backcolor and type </div> </body> </html> Steps to reproduce the issue : 1.select all the text 2.select Font color button 3.select all and cut 4.paste twice the cut content 5.select all and apply Background color by tapping BackGround color button 6.type text Expected behavior : Background color should retain for typing text.
Created attachment 207387 [details] Patch
Comment on attachment 207387 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=207387&action=review > Source/WebCore/ChangeLog:12 > + While deleting a selection, only inheritable style properties were > + saved. Since background color is considered as noninheritable style > + property, it was not being saved and hence was lost. Before deleting > + a selection we should save all style properties applied on that > + particular selection. This doesn't explain why it was lost. Which code is removing the node with background color? > LayoutTests/editing/style/background-color-retained-expected.txt:44 > +PASS span.style.backgroundColor is green > +This is the test case for defect 117337 : Applied background color is not retained after typing a characters > +This tests whether background style is retained when old text is deleted/cut and new text is typed in. > +The background color of the text below should be green. > + > +New Text > + This output doesn't tell us whether the typed text is green or not.
Comment on attachment 207387 [details] Patch r- due to an inadequate test.
Created attachment 216156 [details] Patch
*** Bug 123872 has been marked as a duplicate of this bug. ***
Comment on attachment 216156 [details] Patch Clearing flags on attachment: 216156 Committed r158815: <http://trac.webkit.org/changeset/158815>
All reviewed patches have been landed. Closing bug.