Closed Bug 1634543 Opened 5 years ago Closed 5 years ago

contenteditable element with ::after pseudoelement (with content) is collapsed

Categories

(Core :: DOM: Editor, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: miketaylr, Assigned: emilio)

References

()

Details

Attachments

(3 files)

Attached file imgflip.html

STR:

  1. load https://imgflip.com/ai-meme

Expected: the "[optional] prefix text e.g. Eric" text fits in its containing contenteditable div
Actual: it doesn't. Compare to Chrome.

In the TC, there's a gray bg in Chrome, but no visible bg in Firefox.

Flags: needinfo?(emilio)
Assignee: nobody → emilio

Like abspos and other out of flows. Seems to match more what other browsers do.

Even with the fix above, we get the caret baseline wrong because the
line is non-empty, but the baseline is all the way to the top.

Maybe an alternative to this would be to move the line-height hack to
the beginning of layout but that sounds a bit more fishy.

Otherwise we should do this more often, I suspect. I added one test that
fails because of nsInlineFrame... Anyhow probably follow-up material?

Depends on D73362

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b97ab5796dec Make emptiness check for contenteditable also account for empty frames. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/a38299795286 Fix caret baseline of a block with only empty lines. r=jfkthame
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/autoland/rev/dac68a1f3d81 Followup: Remove one too many consts to unbust the build.
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/23370 for changes under testing/web-platform/tests
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: