w3c / w3c/editing

When should UA synthesize heights of an element?

Open
#70 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ContentEditableEvents
Dominant language
HTML
Stars
202
Forks
43
PR merge metrics
No merged PRs in 30d

Description

Currently, Blink and WebKit synthesize heights of elements under certain conditions. Without this, since CSS defines an empty element has zero-height, you can't place a caret inside of an empty element (or logically you can, but it can't be visible because the height is zero.) See this example. A div gets the height of line-height if CE.

Blink and WebKit today disallows to set carets to where height=0. With CE=events, JS can set carets to anywhere, but without synthesizing heights, it won't be visible.

The example above is simple, but it gets more complicated if the div has empty children, or replaced elements of height=0.

Maybe related with #68?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked jsbin example and compare the described Blink and WebKit behavior for empty elements, empty children, and zero-height replaced elements. Review the relationship to #68 and define the conditions under which user agents should synthesize a height so a caret can be visibly placed; the issue is done when those conditions are specified clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.