IE11 JavaScript: execCommand('foreColor',false,'') does not remove the color style if foreColor was set to #000000 before

Not reproducible Issue #101671

Details

Created
Apr 27, 2014
Privacy
This issue is public.
Found in build #
0.0011
Reports
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

URL = http://srvr-clw/65070/

URL:

Repro Steps:

1 Create a simple html with a blue link in it
<html>
<body>
<a href="">Internet Explorer</a>
</body>
</html>

2 Load the file into IE and open the F12 developer tools to test the execCommand behavior

3 Execute the following JavaScript in the debugger view
var textRange = document.body.createTextRange();
textRange.findText(‘Explorer’);

4 Change the foreColor to black (#000000)
textRange.execCommand(‘foreColor’,false,’#000000’);

5 Try to remove the style
textRange.execCommand(‘foreColor’,false,’’);

6 Selected text stays black

7 Try the same experiment with a different foreColor than black
textRange.execCommand(‘foreColor’,false,’#FF0000’);
textRange.execCommand(‘foreColor’,false,’’);

8 Setting the foreColor to red and then removing the style works as expected

Expected Results:

execCommand(‘foreColor’,false,’’) to remove the color style

Actual Results:

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “IPBS P.”

      Changed Assigned To from “IPBS P.” to “Bruce M.”

      Changed Assigned To to “Bo C.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Bo C.” to “Eugene V.”

      Changed Status from “Confirmed”

      Changed Assigned To to “Amit J.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Amit J.” to “IPBS P.”

      Changed Status from “Confirmed” to “Won’t fix”

      Changed Assigned To from “IPBS P.” to “Matt G.”

      Changed Assigned To from “Matt G.” to “Sarah K.”

      Changed Assigned To to “Amit J.”

      Changed Status from “Won’t fix”

      Changed Assigned To from “Amit J.” to “Grisha L.”

      Changed Assigned To from “Grisha L.” to “IPBS P.”

      Changed Status to “Not reproducible”

    You need to sign in to your Microsoft account to add a comment.

    Sign in