-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core: normalize node information in gathering #11405
Conversation
types/artifacts.d.ts
Outdated
@@ -217,6 +218,12 @@ declare global { | |||
export interface IFrameElement { | |||
/** The `id` attribute of the iframe. */ | |||
id: string, | |||
/** Details for node in DOM for the iframe element */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we consider making an object for this? ie node: NodeDetails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! There was a consideration to make a node object, although given that this pr was getting a bit hefty, I am planning on doing so in a separate one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good! patricks note re: iframe elements being "public" will be relevant, we can just duplicate the old properties there for now. We'll want to add a note in the #11207 issue to remove them on v7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I love the unification of these previously haphazard collection of very related properties :)
@adrianaixba is this waiting on me now? |
@patrickhulce finishing up on some of your suggestions! still 'waiting4committer' 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great cleanup @adrianaixba! 🎉 💯
Created a getNodeInfo function on page-functions that can be easily implemented to current/new element gatherers. This facilitates the addition of the element's node data and helps ensure that any necessary node data may always be consistently included.
Part of the node data included is 'boundingRect', although there are some elements that contain a 'clientRect', it seems as though some of those may be uniquely catered to that gatherer. So, I chose to leave boundingRect as somewhat of a 'standard' rect (would appreciate some input on this!)
Should help facilitate solving #9947