Bug 117337

Summary: Applied background color is not retained after typing a characters
Product: WebKit Reporter: Sudarshan C P <sudarshan.cp>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major CC: arpitabahuguna, commit-queue, rniwa, vanivhegde
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
rniwa: review-
Patch none

Sudarshan C P
Reported 2013-06-07 03:23:29 PDT
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.
Attachments
Patch (11.10 KB, patch)
2013-07-24 05:31 PDT, vanivhegde
rniwa: review-
Patch (4.53 KB, patch)
2013-11-06 01:53 PST, Vani Hegde
no flags
vanivhegde
Comment 1 2013-07-24 05:31:11 PDT
Ryosuke Niwa
Comment 2 2013-07-24 11:01:53 PDT
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.
Ryosuke Niwa
Comment 3 2013-08-01 20:04:06 PDT
Comment on attachment 207387 [details] Patch r- due to an inadequate test.
Vani Hegde
Comment 4 2013-11-06 01:53:47 PST
Ryosuke Niwa
Comment 5 2013-11-06 02:13:28 PST
*** Bug 123872 has been marked as a duplicate of this bug. ***
WebKit Commit Bot
Comment 6 2013-11-06 19:47:45 PST
Comment on attachment 216156 [details] Patch Clearing flags on attachment: 216156 Committed r158815: <http://trac.webkit.org/changeset/158815>
WebKit Commit Bot
Comment 7 2013-11-06 19:47:47 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.