-
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
misc: deduplicate all the dom helpers #15960
Conversation
@@ -15,25 +15,13 @@ import {ReportRenderer} from '../../../report/renderer/report-renderer.js'; | |||
import {TextEncoding} from '../../../report/renderer/text-encoding.js'; | |||
import {renderFlowReport} from '../../../flow-report/api'; | |||
|
|||
// @ts-expect-error Legacy use of report renderer | |||
const dom = new DOM(document); |
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.
Why not just add document.documentElement
to get rid of the type error?
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.
Could it be a standalone function that these files could import and that |
That's a reasonable further refactor. Note that treemap uses createElement/createChildOf too. |
fixes #11992
This reduces 4 instances of
find
to 1. I also adopted treemap's default second param to the canonical instance inDOM
.