-1

So i've read a lot of topics about ancestors selectors in css and most of them where about if there are any. Now its clear to me that there are no ancestors selectors until so far.However i have a hard time understanding why. Obviously they could be very useful but for some reason they are not a part of css so far. Can someone tell me what problem could the use of ancestor selectors cause so they decided to have no ancestors selectors at all?

  • 1
    I think it's under development the last time I've heard. – Patrick Gregorio Apr 14 '16 at 16:25
  • 2
    No, to understand why there isn't one yet you would need to have a discussion with the CSS working group. – TylerH Apr 14 '16 at 16:26
  • i did not asked why there are no ancestor selectors.. i asked what problem they could cause and therefor are not used... – Aggelos Sfakianos Apr 14 '16 at 16:29
  • 1
    What you asked was why there are no ancestor selectors available for use. That's a design decision to be made by the CSS working group and the browser vendors who implement the working group's drafts. – TylerH Apr 14 '16 at 16:31
  • Look at some of the answers to this question: http://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector My understanding is that it would be difficult for browsers to implement such a selector efficiently. – SpoonMeiser Apr 14 '16 at 16:35

1 Answers1

1

Well, according to CSS-Tricks,

With parent selectors it becomes extremely easy to accidentally cause a document-wide grovel. People can and will misuse this selector. Supporting it is giving people a whole lot of rope to hang themselves with.

The things to be considered are,

  • There are huge performance concerns
  • Those concerns can be thought of as trade-offs we should evaluate, not show-stoppers.
  • Want!

You may also read about CSS Selectors here and CSS pattern matching here

Alfred
  • 19,306
  • 58
  • 155
  • 232