New issue
Advanced search Search tips

Issue 854629 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Feature



Sign in to add a comment

Text styling commands should change typing style

Reported by j.k.tea...@gmail.com, Jun 20 2018

Issue description

UserAgent: 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:
 
IframeBug.html
1.3 KB View Download
Line 27 of the file is missing the # on the selector and should read $('#StrikeThroughButton').click(function () {
IframeBug.html
1.3 KB View Download
Components: -Blink Blink>DOM
Labels: FoundIn-66 FoundIn-67 Needs-Bisect Needs-Triage-M67
Cc: viswa.karala@chromium.org
Labels: -Needs-Bisect Triaged-ET M-69 FoundIn-69 Target-69 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
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!

Comment 5 by fergal@chromium.org, Jun 25 2018

Components: -Blink>DOM Blink>Editing
Status: WontFix (was: Untriaged)
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/
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.
IframeBug.html
1.2 KB View Download
Components: -Blink>Editing Blink>Editing>Command
Labels: -Type-Bug Type-Feature
Status: Available (was: WontFix)
Summary: Text styling commands should change typing style (was: Strikethrough (when in a content editable iframe) is not always turned off properly while using document.execCommand)
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