Spellcheck inserting HTML causes sibling elements to have bad formatting |
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 Steps to reproduce the problem: 1. Create a span in a content editable div that inherits from its parents and has a misspelled word. 2. Correct the misspelled word. Here is a JSFiddle that allows you to reproduce this: https://jsfiddle.net/1utet6z9/1/ 1. Click 'sppell' in the output, lower right square. 2. Correct to 'spell' 3. Observe behavior What is the expected behavior? Correct word should be inserted into the HTML, and the rest of the HTM L should remain untouched. What went wrong? HTML elements surrounding the corrected word get encapsulated into non-sense <font> tags which causes them to be the wrong font color and font family. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 60.0.3112.90 Channel: n/a OS Version: OS X 10.12.6 Flash Version: I am a Google employee (SWE) and I encountered this while developing an internal Google app. Please feel free to reach out to mollyf@ for more information. This bug blocks a feature release so if possible please CC me on it.
,
Oct 17 2017
A workaround is to remove all the "color: inherit; font-size: inherit; font-family: inherit" stuff since that happens automatically anyway. The bug(s) is likely in either ApplyStyleCommand::ApplyInlineStyleChange() or StyleChange::ExtractTextStyles().
,
Oct 18 2017
WebKit also does same thing. Per #c6, please attempt to remove redundant inline styles.
,
Oct 18 2017
Thanks for the quick response. Unfortunately for our use case we cannot remove the inline inherit styles, they are used to make pasted content match its parent's styles. The JSFiddle example is a simplified version of what our HTML looks like.
,
Oct 18 2017
If we fix this bug, the earliest we can get it into a Chrome release is M64, which won't go out until late January, and you will still encounter this bug in Safari, which we have no control over. If you want to launch your feature earlier or have it work in Safari, you would still need to work around the bug.
,
Oct 18 2017
Our app is an internal Google app that's run on Chrome only, so other browsers are not a concern. But thank you for the info on when the earliest we could see a fix is. We will try to come up with a work-around in Chrome.
,
Oct 19
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 30
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by mollyf@google.com
, Oct 17 2017