Closed Bug 593544 Opened 16 years ago Closed 16 years ago

:first-letter not applied to legend elements

Categories

(Core :: Layout: Form Controls, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla2.0b7

People

(Reporter: charette.s, Assigned: bzbarsky)

Details

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b6pre) Gecko/20100903 Firefox/4.0b6pre Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b6pre) Gecko/20100903 Firefox/4.0b6pre When specifying a legend:first-letter selector it is not matched. Same with the span element, but I found settings its css display to block fix the issue. Reproducible: Always Steps to Reproduce: See attachment Actual Results: The selector is not applied Expected Results: The selector should be applied
Attached file Test case —
:first-letter is only applied to block boxes. As you noted, <span> is an inline by default, so doesn't get a block box. <legend> generates a replaced element box in Gecko, not a block box, so also doesn't have :first-letter apply to it. We _could_ probably support :first-letter on <legend> if it's styled with display:block or display:inline-block, or just always. David, should we? Webkit and Presto seem to. They also don't allow changing the display of legend from "block", sidestepping the problem of what to do for other display types...
Status: UNCONFIRMED → NEW
Component: Layout: Text → Layout: Form Controls
Ever confirmed: true
QA Contact: layout.fonts-and-text → layout.form-controls
Summary: :first-letter not applied to legend elements and some non-block display elements → :first-letter not applied to legend elements
Attached patch If we decide we want to do this (obsolete) — — Splinter Review
Just joining the block box spec for reference: http://www.w3.org/TR/css3-selectors/#application-in-css
Attached patch Like so — — Splinter Review
Assignee: nobody → bzbarsky
Attachment #472110 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #472115 - Flags: review?(dbaron)
OS: Linux → All
Priority: -- → P2
Hardware: x86_64 → All
Whiteboard: [need review]
Comment on attachment 472115 [details] [diff] [review] Like so r=dbaron
Attachment #472115 - Flags: review?(dbaron) → review+
Priority: P2 → P3
Whiteboard: [need review] → [need approval]
Comment on attachment 472115 [details] [diff] [review] Like so Requesting approval for 2.0. This is a reasonably safe patch that aligns us with Webkit and Opera on the behavior of :first-line for <legend>. Nothing else other than <legend> is affected.
Attachment #472115 - Flags: approval2.0?
Whiteboard: [need approval] → [need landing]
Pushed http://hg.mozilla.org/mozilla-central/rev/922fac0b4b41, then backed out the forms.css part in http://hg.mozilla.org/mozilla-central/rev/f48f8389793d because Opera/Webkit do NOT force display:none to block. David, should I try to emulate their quirks or just not worry about this?
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla2.0b6
What quirks? Is the issue that you're allowing :first-letter on something that's not display:block? Or that they report legends as display:block even when specified otherwise? Or what?
Presto and Webkit both ignore all specified values for "display" on legend except for "none". So "display: none" ends up as "none"; anything else ends up as "block". At least as far as I can tell. I have no problem with allowing first-letter on <legend> no matter what its display is. I'm just not sure whether we should emulate the presto/webkit display behavior.
Isn't that part of an other issue?
(In reply to comment #11) > Presto and Webkit both ignore all specified values for "display" on legend > except for "none". So "display: none" ends up as "none"; anything else ends up > as "block". At least as far as I can tell. Is that based on examining computed style or something else?
> Isn't that part of an other issue? Not quite, since it impacts when first-letter should apply to <legend>. > Is that based on examining computed style or something else? Examining computed style.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: