Implement fieldset/legend in terms of '-webkit-appearance'

NEW
Assigned to

Status

()

P3
normal
7 months ago
7 months ago

People

(Reporter: zcorpan, Assigned: mats)

Tracking

(Depends on: 1 bug, Blocks: 4 bugs)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox63 affected)

Details

Attachments

(3 attachments, 2 obsolete attachments)

(Reporter)

Description

7 months ago
See proposal in https://github.com/whatwg/html/issues/3912
(Reporter)

Updated

7 months ago
Blocks: 1483781
This would need fixing bug 1435658 to make dynamic changes work properly.
Depends on: 1435658
Priority: -- → P3
(Assignee)

Comment 2

7 months ago
Posted patch wip (obsolete) — Splinter Review
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.)
(Assignee)

Comment 3

7 months ago
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?
(Assignee)

Comment 5

7 months ago
(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...
(Reporter)

Comment 7

7 months ago
Does this need an intent to implement?
Summary: Implement fieldset/legend in terms of 'appearance' → Implement fieldset/legend in terms of '-webkit-appearance'
(Assignee)

Comment 8

7 months ago
Posted patch wip2 (obsolete) — Splinter Review
Assignee: nobody → mats
Attachment #9003499 - Attachment is obsolete: true
(Assignee)

Comment 9

7 months ago
(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
(Assignee)

Comment 10

7 months ago
Note to self: dom/html/test/test_bug557087-3.html asserts:
MOZ_CRASH(nsFieldSetFrame::InsertFrames not supported) at layout/forms/nsFieldSetFrame.cpp:692
(Assignee)

Updated

7 months ago
Blocks: 1339911
(Assignee)

Updated

7 months ago
Blocks: 1368723
(Assignee)

Updated

7 months ago
Blocks: 1487110
(Assignee)

Comment 11

7 months ago
Posted patch wip3Splinter Review
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.