Closed Bug 1811161 Opened 1 year ago Closed 1 year ago

`Document.execCommand("forecolor")` should use normalized value at setting HTML attribute value

Categories

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

defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome)

Attachments

(1 file)

Chrome sets corresponding attribute value to #[0-9a-f]{6} even if color name is specified. However, our style editor sets given color value as-is. We should align the behavior to Chrome.

Duplicate of this bug: 760211

Currently, our editor sets color attribute of <font> to given value as-is.
However, the other browsers normalize it to #[0-9a-z]{6} before setting the
value, and some WTP expects the behavior. Therefore, we need to follow it for
avoiding meaningless failures.

According to WPT, the parameter can be "transparent" even without
styleWithCSS. Additionally, CSS color values are also allowed if
styleWithCSS is true. Therefore, this patch includes some fixes for them
too to avoid new failures.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/0659120fb8f2
Make the style editor sets `color` attribute value of `<font>` to normalized color value r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/38193 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: