mojolicious / dom.js

:crystal_ball: A fast and very small HTML/XML DOM parser with CSS selectors
https://www.npmjs.com/package/@mojojs/dom
MIT License
20 stars 3 forks source link

Support for :scope and :has selectors #2

Open kraih opened 2 years ago

kraih commented 2 years ago

These two CSS 4 selectors are supported by Mojo::DOM and still missing in @mojojs/dom.

Pattern Represents
E:scope an E element being a designated reference element
E:has(rs1, rs2, …) an E element, if either of the relative selectors rs1 or rs2, when evaluated with E as the :scope elements, match an element

Scope handling already partially exists in the code, but is not used for anything yet.

kraih commented 2 years ago

Commit that added :scope. https://github.com/mojolicious/mojo/commit/bd2602d08a77ea2f91ad3f6c397823a3ad937c02

kraih commented 2 years ago

Commit that added :has. https://github.com/mojolicious/mojo/commit/5084309552f3ede2665225d68cf8dbaf1385ef8c