|
|
|
|
|
by cluckindan
583 days ago
|
|
This should have been obvious before the fact to anyone who understands how CSS selectors work in browsers. As in, they are matched right-to-left, which implies that a selector like ”p a” first selects all the <a> nodes, and for each of them, it then traverses up the DOM tree until it encounters a <p> node (selector matches) or the root node (selector doesn’t match). That said, the traversing shouldn’t happen for plain tag selectors like ”h1”. There must be something wrong with the library they used. |
|
For sure, but that's somewhat reductive. This is not exactly common knowledge. Certainly not something you would expect any given engineer to have immediately jump to mind.