Open Bug 1515267 Opened 6 years ago Updated 2 years ago

execCommand('bold') behavior is different from Blink

Categories

(Core :: DOM: Editor, defect, P3)

64 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: dalius.dobravolskas, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [h2review-noted])

Attachments

(1 file)

Attached file editor.html
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0 Steps to reproduce: I have contentEditable with normal font-weigth set to 500. Actual results: execCommand('bold') is not working. Expected results: execCommand('bold') should be working like in other browsers or documentation should state that font-weight affects 'bold' command behavior. It is almost impossible to figure that out. Attaching editor.html that is sample taken from MDN and only has "font-weight: 500" line was added. This seems to be related to https://bugzilla.mozilla.org/show_bug.cgi?id=833889 that was marked as wontfix. Neither of these two documents mention that: * https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content
Component: Untriaged → Editor
Product: Firefox → Core
Priority: -- → P3

Note that Firefox thinks font-weight: 500 is bold enough and tries to un-bold it, while Chrome only does the same thing starting from font-weight: 600. It doesn't depend on how the font actually renders; for example, font-weight: 550 for Times New Roman means a bold text but Chrome still tries to make it bold again, getting no visual change just as this bug describes.

This is exactly the behavior difference described in the execCommand spec.

Masayuki, should Gecko behavior match Blink one? The spec author seems to think Blink one better matches intuition.

Flags: needinfo?(masayuki)

Well, if Safari is also using same threshold, changing our threshold must be better for web-compat, but I'm not sure about backward compatibility and usual font rendering result. Perhaps, I think that we should file new spec issue and ask other vendors if our behavior is better for font rendering result.

Flags: needinfo?(masayuki)
Summary: execCommand('bold') has non documented behavior → execCommand('bold') behavior is different from Blink
Whiteboard: [h2review-noted]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: