Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use XPath to select elements #1056

Merged
merged 1 commit into from
Nov 5, 2019
Merged

Use XPath to select elements #1056

merged 1 commit into from
Nov 5, 2019

Conversation

chancancode
Copy link
Member

This renames the inspectDOMElement API to inspectDOMNode, and changes the argument from a CSS selector to an XPath selector.

The problem with CSS selectors are that they only support selecting elements, whereas XPath allows us to select any arbitrary DOM node, including text nodes, comments etc.

This commit sets a better foundation for supporting things other than classic components. Since Glimmer components, route templates, "tagless" classic components etc have "outer HTML" semantics, they don't necessarily have a single element. Going forward, we will likely want to select the first node in a component's "bounds", which could be an arbitrary DOM node (i.e. may or may not be an element node, so CSS selectors are not sufficient).

This renames the `inspectDOMElement` API to `inspectDOMNode`, and
changes the argument from a CSS selector to an XPath selector.

The problem with CSS selectors are that they only support selecting
elements, whereas XPath allows us to select any arbitrary DOM node,
including text nodes, comments etc.

This commit sets a better foundation for supporting things other
than classic components. Since Glimmer components, route templates,
"tagless" classic components etc have "outer HTML" semantics, they
don't necessarily have a single element. Going forward, we will
likely want to select the first node in a component's "bounds",
which could be an arbitrary DOM node (i.e. may or may not be an
element node, so CSS selectors are not sufficient).
@RobbieTheWagner RobbieTheWagner merged commit 3357dff into master Nov 5, 2019
@delete-merged-branch delete-merged-branch bot deleted the use-xpath branch November 5, 2019 02:56
patricklx pushed a commit to patricklx/ember-inspector that referenced this pull request Sep 19, 2022
This renames the `inspectDOMElement` API to `inspectDOMNode`, and
changes the argument from a CSS selector to an XPath selector.

The problem with CSS selectors are that they only support selecting
elements, whereas XPath allows us to select any arbitrary DOM node,
including text nodes, comments etc.

This commit sets a better foundation for supporting things other
than classic components. Since Glimmer components, route templates,
"tagless" classic components etc have "outer HTML" semantics, they
don't necessarily have a single element. Going forward, we will
likely want to select the first node in a component's "bounds",
which could be an arbitrary DOM node (i.e. may or may not be an
element node, so CSS selectors are not sufficient).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants