soupsieve icon indicating copy to clipboard operation
soupsieve copied to clipboard

Selectors :nth-col() and :nth-last-col()

Open facelessuser opened this issue 6 years ago • 2 comments

I don't know if these will make it into version 1.0 or not. There are no real implementations of this available. Some things seem to still be in flux, such as its renaming recently.

~~In parent || child is parent always compared against col and child against td? What happens if specify something else: p || span?~~

Same question applies to :nth-col(), is the implied target td:nth-col() if you do something like .class:nth-col()?

There are a number of questions that I have which will need to be understood before this is implemented. There is also a bit of complexity involved here.

  • child must be verified to meet cell requirement and selector requirements.
  • parent must meet column requirement and selector requirements.
  • We would most likely:
    • verify that child is a td
    • verify location in row
    • crawl up and verify whether there are col tags in table header
    • capture appropriate column span considerations
    • determine td column and span based on captured info
    • calculate nth position and whether the td fits within the relation.

facelessuser avatar Dec 09 '18 17:12 facelessuser

Combinator || has been moved to a separate issue as it is specifically an "at-risk" feature. We still need better understanding to implement :nth-col and :nth-last-col, but this breaks up the tasks into more manageable pieces.

facelessuser avatar Jan 04 '19 17:01 facelessuser