Closed
Bug 476063
Opened 16 years ago
Closed 16 years ago
[FIX]should construct <legend>s by display when they're not in a fieldset
Categories
(Core :: Layout: Form Controls, defect)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: bzbarsky)
References
Details
Attachments
(1 file, 1 obsolete file)
10.20 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
When <legend> elements are not in a fieldset, we should handle their frame construction based on the value of the 'display' CSS property rather than constructing an nsLegendFrame based on the tag name. (I think HTML5 is using legend for other things, so this is reasonably important.)
Flags: wanted1.9.2?
Assignee | ||
Comment 1•16 years ago
|
||
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #359693 -
Flags: superreview?(dbaron)
Attachment #359693 -
Flags: review?(dbaron)
Assignee | ||
Comment 2•16 years ago
|
||
Comment on attachment 359693 [details] [diff] [review]
Like so?
Actually, this might not handle dynamic insertion of legends in a fieldset correctly. I should double-check that (and write some tests to make sure).
Attachment #359693 -
Flags: superreview?(dbaron)
Attachment #359693 -
Flags: superreview-
Attachment #359693 -
Flags: review?(dbaron)
Attachment #359693 -
Flags: review-
Assignee | ||
Comment 3•16 years ago
|
||
Attachment #359693 -
Attachment is obsolete: true
Attachment #359695 -
Flags: superreview?(dbaron)
Attachment #359695 -
Flags: review?(dbaron)
Assignee | ||
Comment 4•16 years ago
|
||
The other option is to check our parent frame's content, I guess.
Summary: should construct <legend>s by display when they're not in a fieldset → [FIX]should construct <legend>s by display when they're not in a fieldset
Reporter | ||
Comment 5•16 years ago
|
||
Comment on attachment 359695 [details] [diff] [review]
Much better (dynamic insertion worked with the old patch, but _parsing_ works with this one!)
Might be good to have a comment explaining this check:
>+ (aParentFrame->GetType() != nsGkAtoms::fieldSetFrame &&
>+ aParentFrame->GetStyleContext()->GetPseudoType() !=
>+ nsCSSAnonBoxes::fieldsetContent))) {
I think checking the frame type is better; we'd want this check if we, in the future, supported changing what fieldsets look like using 'display'. Then again, that doesn't match html.css...
r+sr=dbaron
Attachment #359695 -
Flags: superreview?(dbaron)
Attachment #359695 -
Flags: superreview+
Attachment #359695 -
Flags: review?(dbaron)
Attachment #359695 -
Flags: review+
Assignee | ||
Comment 6•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Reporter | ||
Comment 7•16 years ago
|
||
It occurs to me... we should probably also have, in forms.css:
legend { display: block }
so that we're still mostly compatible with what we used to do (and, according to Hixie, what HTML5 intends for legend).
Comment 8•16 years ago
|
||
Note that bug 430416 still hinders the HTML5 case.
Assignee | ||
Comment 9•16 years ago
|
||
Sure. That's a pretty separate issue, though. At least this fix allows constructing a fieldset-less DOM in which <legend> behaves sanely layout-wise via explicit DOM manipulation.
Agreed on the display thing; checked in http://hg.mozilla.org/mozilla-central/rev/65e8380bf4f9 with that change.
Reporter | ||
Comment 10•16 years ago
|
||
And I added a test for the display issue:
http://hg.mozilla.org/mozilla-central/rev/3381c874e76c
Flags: wanted1.9.2?
You need to log in
before you can comment on or make changes to this bug.
Description
•