Closed Bug 2002879 Opened 1 year ago Closed 22 days ago

Consider dropping opacity CSS style property while serializing for copy operation

Categories

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

defect

Tracking

()

RESOLVED FIXED
161 Branch
Size Estimate S
Tracking Status
firefox161 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome, parity-safari, webcompat:platform-bug)

User Story

user-impact-score:450
platform-scheduled:2026-11-30

Attachments

(1 external file)

This is filed from bug 2000366.
Test: https://bugzilla.mozilla.org/attachment.cgi?id=9529572

Chrome and Safari drops the opacity CSS style property while serializing for copy operation, which causes a webcompat issue on Twitter.

Blocks: 2000366
User Story: (updated)
Severity: -- → S4
Priority: -- → P3
Assignee: nobody → echen
User Story: (updated)
User Story: (updated)

When copying, serialize the inline style attribute from its parsed declaration
block instead of emitting the original attribute value, and drop the opacity
property from it, this aligns with the behavior of other browsers.

Size Estimate: --- → S
User Story: (updated)
Attachment #9605833 - Attachment description: WIP: Bug 2002879 - Serialize style attribute from parsed inline declaration block and drop opacity property when copying; → Bug 2002879 - Serialize style attribute from parsed inline declaration block and drop opacity property when copying; r?masayuki
Pushed by echen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ad98bb516219 https://hg.mozilla.org/integration/autoland/rev/1a92ca5fa070 Serialize style attribute from parsed inline declaration block and drop opacity property when copying; r=masayuki

Why only opacity and not e.g. visibility? If this is needed for compat can we add a wpt?

Flags: needinfo?(echen)
Pushed by amarc@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7af714a88dec https://hg.mozilla.org/integration/autoland/rev/5e17d6363baa Revert "Bug 2002879 - Serialize style attribute from parsed inline declaration block and drop opacity property when copying; r=masayuki" for causing build bustages at nsHTMLContentSerializer

Backed out for causing build bustages

(In reply to Emilio Cobos Álvarez [:emilio] from comment #3)

Why only opacity and not e.g. visibility? If this is needed for compat can we add a wpt?

This is for the specific web compat report (bug 2000366), so I only handle the opacity and only inline css attribute here. I have added a wpt in the patch.

Flags: needinfo?(echen)
Pushed by echen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/22c123959247 https://hg.mozilla.org/integration/autoland/rev/f7ef57f98cb0 Serialize style attribute from parsed inline declaration block and drop opacity property when copying; r=masayuki
Status: NEW → RESOLVED
Closed: 22 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/64765 for changes under testing/web-platform/tests

Upstream PR merged by moz-wptsync-bot

QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: