Re: HTML <fieldset> rendering

17.01.2014, 00:11, "Robert O'Callahan" <robert@ocallahan.org>:
> On Fri, Jan 17, 2014 at 7:55 AM, Marat Tanalin <mtanalin@yandex.ru> wrote:
>> 16.01.2014, 21:40, "Boris Zbarsky" <bzbarsky@MIT.EDU>:
>>> That's not web-compatible, unfortunately. šTons of websites out there
>>> style fieldsets as "inline" or "block" and expect them to keep looking
>>> like fieldsets. šIf only we'd set this up to start with...
>>
>> Web compatibility is probably not crucial here since styling/rendering of FIELDSET/LEGEND is quite inconsistent across browsers anyway.
>
> In all current browsers, styling a fieldset as display:block does not cause it to stop looking like a fieldset. display:block fieldsets don't look exactly the same across browsers or platforms, but they do look quite similar. No serious browser would be willing to break that.

No problem, my proposed concept is not necessarily should use the `display` property itself. As Boris noted, a new property could be used.

For example, form-related elements could have property like `native-styling` set to `true` by default:

    native-styling: true

and if web developer sets it to false:

    native-styling: false

then the element becomes unstyled like DIV.

So my previous proposal can be reformulated as follows:

1. default FIELSET's and LEGEND's `native-styling`-property value is `true`, and FIELSET/LEGEND are rendered OS-native way;

2. if FIELSET has `native-styling` value set to `false`, then the FIELSET and its LEGEND are rendered as regular (like DIV) elements, without any special styling;

3. if LEGEND only (with FIELDSET's default styles untouched) has `native-styling` value set to `false`, then the LEGEND only is rendered as regular (like DIV) element (without any special styling): entirely inside FIELDSET, without any implicit styling like top offset of half-line height.

Received on Thursday, 16 January 2014 22:21:11 UTC