-
Notifications
You must be signed in to change notification settings - Fork 172
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
Including Text Content Now Filters For Text Content #6041
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Changed the parameter `withContent` for `getCanvasRectangleFromElement` to make it clear that it means text content. - `getCanvasRectangleFromElement` filters for text nodes when including text content in the dimensions.
#13281 Bundle Size — 62.51MiB (~+0.01%).
Warning Bundle contains 51 duplicate packages – View duplicate packages Bundle metrics
|
Current #13281 |
Baseline #13279 |
|
---|---|---|
Initial JS | 45.57MiB (~+0.01% ) |
45.57MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 21.69% |
22.06% |
Chunks | 30 |
30 |
Assets | 33 |
33 |
Modules | 4323 |
4323 |
Duplicate Modules | 524 |
524 |
Duplicate Code | 31.74% |
31.74% |
Packages | 450 |
450 |
Duplicate Packages | 51 |
51 |
Bundle size by type 2 changes
1 regression
1 improvement
Current #13281 |
Baseline #13279 |
|
---|---|---|
JS | 62.5MiB (~+0.01% ) |
62.5MiB |
HTML | 11.16KiB (-0.33% ) |
11.2KiB |
Bundle analysis report Branch fix/text-content-means-text-cont... Project dashboard
ruggi
approved these changes
Jul 5, 2024
for (const childNode of element.childNodes) { | ||
if (childNode.nodeType === Node.TEXT_NODE) { | ||
const range = document.createRange() | ||
// this is needed because jsdom can throw an error on the range.getBoundingClientRect() call, see https://github.com/jsdom/jsdom/issues/3002 |
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.
😬
bkrmendy
approved these changes
Jul 9, 2024
liady
pushed a commit
that referenced
this pull request
Dec 13, 2024
- Changed the parameter `withContent` for `getCanvasRectangleFromElement` to make it clear that it means text content. - `getCanvasRectangleFromElement` filters for text nodes when including text content in the dimensions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
In the example project it was observed that it is possible to highlight an element from outside its bounds.
Fix:
Elements that weren't text elements were being included in the content bounds.
Commit Details:
withContent
forgetCanvasRectangleFromElement
to make it clear that it means text content.getCanvasRectangleFromElement
filters for text nodes when including text content in the dimensions.Manual Tests:
I hereby swear that:
Fixes #5984