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.
Bug fixes:
1.0.0-beta.1
version we introduced a performance optimization to element width/height calculcation, but the optimization mistakenly included the scrollbar size forcontent
andpadding
widths/heights. Additionally, the optimization produces a bit less accurate values thangetBoundingClientRect()
, which is otherwise okay, but it also causes thegetRect()
method to return data where the offsets are not fully in sync with the dimensions. And that is not okay. So I decided to drop it for now and think about it a bit more.getHeight()
method where it would not always subtract the scrollbar correctly.padding
andcontent
sizes would be incorrect. Now that's fixed.I think we got this done in nicely performant way without needing to resolve to adding test elements in the DOM (which would have sucked big time).It turns out that subpixel scrollbars vary in behaviour between devices/browsers, which means that we can't use the same assumption for all cases, which also means we have to test the behaviour in the DOM to get accurate results :( I built a cache system to store the corresponding real values for the values thatwindow.getComputedStyle()
reports. This way we can keep the DOM testing at minimum and only test when there actually is a custom subpixel scrollbar value defined. Closes More accurate scrollbar width/height. #22