1. Go to your favorite contentEditble rich text editor (like http://www.mozilla.org/editor/midasdemo/) 2. Type several lines of text 3. Select-all and apply a background color 4. Select several lines and apply any of - numbered list, bulleted list, indent Result: Text is indented/listified, but the background color is lost. Expected result: background color remains.
Better demo, just click "Eval js now": http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20contentEditable%20id%3D'foo'%3E%3Cfont%20style%3D'background-color%3Ared'%3EI%20am%20red%3C%2Ffont%3E%3C%2Fdiv%3E%3Cdiv%20id%3D'c'%3E%3C%2Fdiv%3E&ohh=1&ohj=0&jt=foo.focus()%3B%0Adocument.execCommand('selectAll')%3B%0Adocument.execCommand('insertOrderedList')%3B%0A%0Avar%20text%20%3D%20document.createTextNode(foo.innerHTML)%3B%0Ac.appendChild(text)%3B%0Ac.innerHTML%20%2B%3D%20document.queryCommandValue('backColor')%3B&ojh=1&ojj=0&ms=100&oth=0&otj=0&cex=1
Ok, better demo, will alert PASS if this is fixed, FAIL otherwise. This demo tests indent. http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20contentEditable%20id%3D'foo'%3E%3Cfont%20style%3D'background-color%3Ared'%3EI%20am%20red%3C%2Ffont%3E%3C%2Fdiv%3E%3Cdiv%20id%3D'c'%3E%3C%2Fdiv%3E&ohh=1&ohj=0&jt=foo.focus()%3B%0Adocument.execCommand('selectAll')%3B%0Adocument.execCommand('indent')%3B%0A%0Avar%20text%20%3D%20document.createTextNode(foo.innerHTML)%3B%0Ac.appendChild(text)%3B%0Avar%20color%20%3D%20document.queryCommandValue('backColor')%3B%0Aif%20(color%20%3D%3D%20%22rgba(0%2C%200%2C%200%2C%200)%22)%20%7B%0A%20%20alert(%22FAIL%22)%3B%0A%7D%20else%20%7B%0A%20%20alert(%22PASS%22)%3B%0A%7D%0A&ojh=1&ojj=1&ms=100&oth=0&otj=0&cex=1
My patch for https://bugs.webkit.org/show_bug.cgi?id=26816 will fix this bug as well.
The problem has been solved for indentation.
This bug has been fixed by http://trac.webkit.org/changeset/47008. But we still need some test cases to prevent future regression.
Created attachment 40958 [details] Patch This is a patch for 28722 that contains a test case for this bug. The test case was the only missing thing to resolve the bug. For this particular bug, please look at the indent-with-style.html test case.
The missing test case was checked in with http://trac.webkit.org/changeset/49405. Resolving as fixed.
Comment on attachment 40958 [details] Patch Clearing review flag on this closed bug.