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

core: normalize node information in gathering #11405

Merged
merged 22 commits into from
Sep 16, 2020
Merged

Conversation

adrianaixba
Copy link
Collaborator

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

@adrianaixba adrianaixba requested a review from a team as a code owner September 10, 2020 16:49
@adrianaixba adrianaixba requested review from paulirish and removed request for a team September 10, 2020 16:49
@connorjclark connorjclark changed the title core(element gatherers): standardize node information for elements core: normalize node information in gathering Sep 10, 2020
types/artifacts.d.ts Outdated Show resolved Hide resolved
@@ -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 */
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator

@connorjclark connorjclark Sep 10, 2020

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.

lighthouse-core/gather/gatherers/accessibility.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@patrickhulce patrickhulce left a 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 :)

lighthouse-core/gather/gatherers/iframe-elements.js Outdated Show resolved Hide resolved
lighthouse-core/gather/gatherers/iframe-elements.js Outdated Show resolved Hide resolved
types/artifacts.d.ts Outdated Show resolved Hide resolved
@patrickhulce
Copy link
Collaborator

@adrianaixba is this waiting on me now?

@adrianaixba
Copy link
Collaborator Author

@adrianaixba is this waiting on me now?

@patrickhulce finishing up on some of your suggestions! still 'waiting4committer' 😁

Copy link
Collaborator

@patrickhulce patrickhulce left a 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! 🎉 💯

types/artifacts.d.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants