-webkit-appearance:fieldset-legend considered harmful

Open
#3,968 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
css, html
Domain
frontend

Research direction

Start with the linked HTML rendering section and the issue's example showing -webkit-appearance on form controls. Review how the rendered legend behavior is specified and evaluate the proposed separation into a dedicated property. Done means the specification has an agreed, unambiguous direction for triggering rendered legend layout without changing themed control appearance.

Written by the indexing model from the issue text.

Description

topic: fieldset

https://whatpr.org/html/3934/rendering.html#the-fieldset-and-legend-elements

The child's used value of '-webkit-appearance' is 'fieldset-legend'.

Using -webkit-appearance to trigger the special rendered legend layout has the side-effect that it resets the themed appearance that some form controls have by default. For example,

<fieldset>
  <input type=button style="-webkit-appearance:fieldset-legend" value="button">
  <input type=button value="button">
</fieldset>

renders as (screenshot from my prototype implementation of -webkit-appearance:fieldset/fieldset-legend in Gecko):
image

I think that some of the HTML form control elements could be useful as a rendered legend so I think -webkit-appearance is not the right property to use for this. I think it would be better to mint a new CSS property to trigger the rendered legend layout, something like legend:auto|none. Then there is no risk of it affecting the default appearance of the element the author chooses to use as the rendered legend.

Dominant language
HTML
Stars
9.4k
Forks
3.2k
Avg merge
3d 9h
Merged PRs (30d)
38

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.

More from whatwg/html

All issues in whatwg/html

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.