Text styling commands should change typing style
Reported by
j.k.tea...@gmail.com,
Jun 20 2018
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 Steps to reproduce the problem: 1. Download the attached HTML file and open it in chrome. 2. Focus into the content editable iframe by clicking into it. The cursor should appear as it is content editable. 3. Press the strikethough button. You will notice the console.log shows true as it has enabled strikethrough using document.execCommand. 4. Type some text it will have a strike through. 5. Using the backspace key to remove all the text. 6. Press the strikethough button again. YOu will see the console.log now shows false, as we have used document.execCommand to turn strikethrough off. 7. Type some more characters, strikethrough has now re enabled itself. What is the expected behavior? There to be no strikethrough when typeing text after pressing the button the second time. What went wrong? Strikethrough was re enabled despite explicitly turning it off. Did this work before? N/A Chrome version: 67.0.3396.87 Channel: stable OS Version: 10.0 Flash Version:
,
Jun 20 2018
,
Jun 20 2018
,
Jun 21 2018
Able to reproduce the issue on chrome reported version 67.0.3396.87 and on latest chrome 69.0.3466.0 using Mac 10.12.6, Ubuntu 14.04 and Windows-10. As this issue is seen from M-60(60.0.3112.0), hence considering this issue as Non-Regression and marking it as Untriaged. Thanks!
,
Jun 25 2018
,
Jul 10
Mark WontFix, it works as expected. This is the feature called "typing style". Chrome remembers "typing style". Chrome applies style specified so far event after remove these character removed. You can see this feature in following steps: 1. Visit data:text/html,<div contenteditable></div> 2. Place caret in editable 3. Press Ctrl+B to enter bold mode 4. Type characters "abc"; you see bold characters 5. Press Backspace or select "abc" and press Delete, etc to remove all characters from editable 6. Type "a"; you see bold "a". Online version of attached file of #c1 https://jsfiddle.net/2dph395g/1/
,
Sep 20
I can see how it is a valid feature based on YOUR replication steps. As if you turn on strikethrough you expect it to stay turned on even if you delete all the characters. However in my replication steps we explicitly turned off strikethrough and it turned itself back on again. I am writing a WYSIWYG editor relying on the fact that if the user clicks on a strikethrough toggle button, and strikethrough is already on, it should be turned off. I have attached a new file which is exactly the same as the previous one apart from the strikethrough has been replaced with bold. Follow my original replication steps on the new file and you will see that after explictly turning bold off it STAYS off. This is how strikethrough should work.
,
Sep 21
j.k.tearle@, thanks for more explanation. It seems once text styling commands, bold, italic, strikethrough, etc, change state of typing style, value of queryCommandState matches inserted text's style. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by j.k.tea...@gmail.com
, Jun 20 2018Line 27 of the file is missing the # on the selector and should read $('#StrikeThroughButton').click(function () {