Open Bug 1483787 Opened 2 years ago Updated 2 years ago
Implement fieldset/legend in terms of '-webkit-appearance'
See proposal in https://github.com/whatwg/html/issues/3912
I took a stab at implementing the legend part of the draft spec to see if there are any implementation issues with it. It seems fairly straightforward to implement (although we also need to amend bug 1435658 for these values eventually). This patch allows an arbitrary (in-flow) box to become the rendered legend by setting -webkit-appearance:fieldset-legend. It's a bit unfortunate that the spec chose that property though, since setting it on <input> etc (that already have values in the UA sheet) loses its theme styling in that case, which seems unfortunate. So I wonder if a new property for this wouldn't be better after all, e.g. "legend: none | auto" so we don't interfere with an element's normal appearance. Thoughts? Also, is there a way to put individual -webkit-appearance values behind a pref? (FTR, I suspect we can probably get rid of the nsLegendFrame class as a follow-up after this, since it really doesn't do much.)
Also, this patch adds NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS *after* the <legend> frame subtree have been created rather than at the time the nsLegendFrame is created (before its kids). So I'm making the assumption that that bit doesn't influence frame construction of its descendants. Is that a valid assumption?
(In reply to Mats Palmgren (:mats) from comment #2) > Also, is there a way to put individual -webkit-appearance > values behind a pref? This can be done with #[parse(condition = "foo")], see the display values for an example. (In reply to Mats Palmgren (:mats) from comment #3) > Also, this patch adds NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS > *after* the <legend> frame subtree have been created rather > than at the time the nsLegendFrame is created (before its > kids). So I'm making the assumption that that bit doesn't > influence frame construction of its descendants. > Is that a valid assumption? I haven't seen anything that would break, but I haven't checked that carefully...
Does this need an intent to implement?
Summary: Implement fieldset/legend in terms of 'appearance' → Implement fieldset/legend in terms of '-webkit-appearance'
Assignee: nobody → mats
Attachment #9003499 - Attachment is obsolete: true
(In reply to Simon Pieters from comment #7) > Does this need an intent to implement? I'd like the draft spec to stabilize a bit more before that. In particular, I don't think '-webkit-appearance' is the right property to use to trigger the rendered legend layout. I've filed a spec issue: https://github.com/whatwg/html/issues/3968
Note to self: dom/html/test/test_bug557087-3.html asserts: MOZ_CRASH(nsFieldSetFrame::InsertFrames not supported) at layout/forms/nsFieldSetFrame.cpp:692
Implemented legend:none|auto. Put all the new stuff behind a pref: layout.css.new-fieldset-legend.enabled
Attachment #9004570 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.