New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 783758 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Text formatting not getting applied properly on chrome version 62.

Project Member Reported by upasana....@synerzip.com, Nov 10 2017

Issue description

Chrome Version: (62.0.3202.62 (Official Build) (64-bit))
OS: (Windows, Linux, Chrome Book, MacOS)

What steps will reproduce the problem?

(1) Goto jsfiddle(https://jsfiddle.net/upasanak/knuetk4f/6/) --> select text from result area
(2) Click "Apply" button (It will apply bold formatting on selected text)
(3) Click "Remove" button (It will remove bold formatting)
(4) Again click "Apply" button
(5) Now click on "Remove" button 

What is the expected result?
After clicking on "Remove" button the bold formatting should be removed.

What happens instead?
Selected text does not reflect the formatting change.

Please note that this behavior is reproduced for italic and underline style also. 

Note: Please find attached html file.

More Info: Please note that this issue is reproducible from Chrome version 58 onwards. This issue was NOT reproducible up till version 57.

 
changeTextFormat.html
1.3 KB View Download

Comment 1 by sdoerner@google.com, Nov 10 2017

Labels: -Type-Bug -Pri-3 Pri-2 Type-Bug-Regression
Components: -Infra>Client>Chrome -Infra>Client>Chrome>Release Blink>Editing>Selection
Owner: rlanday@chromium.org
Status: WontFix (was: Untriaged)
Seems that in https://chromium.googlesource.com/chromium/src/+/d892f9592860691ae9a782c12260c94ed6bd1a63

a change was made that causes the selection to be preserved instead of cleared after clicking "Apply".

I think the main problem is that the provided test case is buggy and makes unsafe assumptions about how the selection is normalized. Applying bold creates a new <span> element and removing bold leaves the span, but clears out the class that was added. Then you're making an assumption about whether the selection only contains the text inside the innermost <span>, or it also contains one or more <span> elements.

Have you considered using execcommand('bold') to implement this behavior instead of trying to implement it yourselves? Rich text editing is somewhat involved to implement properly, and I don't believe the approach you're trying to take here works very well. For example, if I bold a word, unbold it, and then try to mark a selection containing that word and also some surrounding text as bold, it doesn't work because of how the DOM has been manipulated.

Marking this bug as wontfix because I don’t believe it’s a Chrome bug.

Sign in to add a comment