This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10546 - It looks like at least some browsers restrict legend display values to "block"
Summary: It looks like at least some browsers restrict legend display values to "block"
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks: 10771
  Show dependency treegraph
 
Reported: 2010-09-04 04:15 UTC by contributor
Modified: 2010-10-13 01:20 UTC (History)
8 users (show)

See Also:


Attachments

Description contributor 2010-09-04 04:15:54 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/complete.html#display-types

Comment:
It looks like at least some browsers restrict legend display values to "block"

Posted from: 173.48.34.3
Comment 1 Boris Zbarsky 2010-09-04 04:16:44 UTC
Specifically, Webkit and Presto seem to have:

  fieldset > legend { display: block !important }

or some equivalent in their UA sheets.  Should the spec be calling for this?
Comment 2 Ian 'Hixie' Hickson 2010-09-26 00:47:25 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Did Not Understand Request
Change Description: no spec change
Rationale:

I don't know, is there any good reason to restrict it as such?

Is there any precedent in the HTML spec's rendering section to restrict a CSS property on an element in this way?
Comment 3 Tab Atkins Jr. 2010-09-26 06:34:30 UTC
(In reply to comment #1)
> Specifically, Webkit and Presto seem to have:
> 
>   fieldset > legend { display: block !important }
> 
> or some equivalent in their UA sheets.  Should the spec be calling for this?

IIRC, <legend> isn't fully handled through CSS at all in most current browsers.  The "equivalent" is just some magic handling of the display of the element in C++.  This should hopefully *not* be enshrined in the HTML5 spec, as it is a very weird area of current browsers.

Instead, we should be adding something to CSS that allows the proper display of <legend>, so browsers can remove the magic but still display legacy content as it always has.
Comment 4 Boris Zbarsky 2010-09-27 17:16:21 UTC
> Is there any precedent in the HTML spec's rendering section to restrict a CSS
> property on an element in this way?

Well, since the HTML spec describes rendering of legends in a way that's not expressible with CSS... it's already in this territory.

Note that this matters for web compat; for example if legends are allowed to have display other than "block" then first-letter and first-line would not work on them with those other display values... or would they?  There may well be sites that rely on that behavior (we certainly got bug reports about it in Gecko, which is why I raised the bug).

As things stand, implementing a web-compatible <legend> by reference to the HTML5 spec and the CSS2.1 spec is impossible as far as I can see.  I can guarantee that sites are styling <legend> with display:inline and expecting the "default" legend behavior...

Note, btw, that a legend with display:block uses shrink-wrap sizing; I don't believe the current spec specifies that either.
Comment 5 Ian 'Hixie' Hickson 2010-10-12 00:18:00 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.

Thanks for the help here.
Comment 6 contributor 2010-10-12 00:18:54 UTC
Checked in as WHATWG revision r5602.
Check-in comment: legend { display: list-item } should no longer get a bullet
http://html5.org/tools/web-apps-tracker?from=5601&to=5602
Comment 7 Boris Zbarsky 2010-10-13 01:20:54 UTC
That looks reasonable... dbaron, want to check it over too?