Repository navigation
Conversation
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
This file contains hidden or 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
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
The DOM platform sets an empty inline
canvas.style.boxSizingtoborder-boxwhen acquiring the context, but does not save that property alongside the other styles restored byreleaseContext().After
chart.destroy(), the injected inline rule therefore continues to override the page's CSS. For example, a 300 x 150 CSS-pixel canvas withbox-sizing: content-box, 20px padding and a 5px border starts at an outer size of 350 x 200px. After creating and destroying a nonresponsive chart, it remains 300 x 150px instead of returning to its initial size. Reusing the canvas also treats this leftover inline value as its initial state.Change
Save the initial inline
boxSizingwithdisplay,heightandwidth, so the existing release path restores it. This leaves chart-time sizing behavior unchanged and does not add a public option.Tests
Add six native DOM tests covering empty, explicit
content-boxand explicitborder-boxinline values, with and without a stylesheet that supplies padding, borders andcontent-boxsizing. Each checks chart-time sizing, restored inline/computed styles, outer dimensions and a second create/destroy cycle.pnpm build, declaration generation,tsc --noEmit, and ESLint on the two changed files pass.Used a local headless launcher adjustment for this environment; it is not part of the PR. Firefox and downstream integration projects were not run.