Re: [css3-selectors]: Proposal: Adop the ::wrap pseudo element

2016-10-07 4:21 GMT+08:00 Tab Atkins Jr. <jackalmage@gmail.com>:

> On Thu, Oct 6, 2016 at 1:45 AM, Ian Yang <ian.html@gmail.com> wrote:
> > Any advice, please? Personally, I hope this pseudo element could be
> adopted
> > as early as possible. It's not like developers can use it right away
> once it
> > is adopted because it takes time for major browsers to implement it.
> >
> > This pseudo element can do a lot more than just wrapping <dt> and <dd>
> > pairs. For years, we have been adding extra <div>s or <span>s into our
> HTML
> > codes just because we have to achieve a certain layout or positioning.
> With
> > ::wrap pseudo element, we can say good bye to that inflexible approach
> and
> > styling or redesigning web pages would become impressively flexible and
> > time-saving. I really don't see any reason not to welcome it and see it
> > joins the CSS family.
>
> As fantasai and I stated earlier in the thread:
>
> > Yeah, this is the big thing.  New pseudos that wrap "real" elements in
> > some way are... not popular among implementors. The idea for ::wrap
> > goes back well over a decade, and the complexity it adds to the
> > platform versus the benefit you get, when compared to just adding
> > wrapper elements in your HTML, has meant that implementors have never
> > bitten at the idea.
>
> To be clear, we only add features to the spec that have use cases and
> interest in being implemented in at least two major browser engines.
> (Those are the most important steps of the process as described by
> WHATWG <https://wiki.whatwg.org/wiki/FAQ#Is_there_a_process_for_
> adding_new_features_to_a_specification.3F>,
> which we generally follow as well.) So there is nothing really simple
> about this; adding features to the web platform is generally a
> multi-year effort that involves convincing a lot of people that what
> you want is (a) important; (b) cannot be accomplished any other way;
> (c) will be used by lots of people (on the same order as existing
> features of the web); (d) is something browser engine engineers want
> to spend their resources on.
>
> It's definitely not impossible!  But neither is it just a matter of
> having a good idea and then sitting back.  This idea, in particular,
> has been suggested for over a decade, and implementors have never been
> interested in it (as it ends up adding significant complexity, both to
> the CSS language itself, and to implementations), so you're facing an
> extreme uphill battle here.
>
> ~TJ
>

Speaking of importance and use cases, I can assure you that there is no
dedicated web developers in the world who value the maintainability and
semantics of HTML while doubt the importance and use cases of ::wrap pseudo
element.

Take this lists.w3.org page
<https://lists.w3.org/Archives/Public/www-style/2016Sep/> for example, the
metadata area under the heading should have been markuped with <dl>. But
because there has been no way to wrap <dt> and <dd> pairs with CSS, the
developer had to use the less semantic <ul> and <dfn>.

Yet another example is that, "left and right columns" layout design is
everywhere so we have been having to add two wrapper <div>s into HTML for
that kind of purpose.

The aforementioned examples are just a tip of iceberg. The use cases of
::wrap are apparently more than the use cases of :first-child and so on.

Since getting more people involved seems to be a necessary step in
proposing a feature like this one, I will go through the step. Is there a
CSS equivalent of whatwg/html on GitHub
<https://github.com/whatwg/html/issues> in which I can open a new issue?

Received on Friday, 7 October 2016 02:50:17 UTC