Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up<link> elements need to clear any previous stylesheet before loading a new one #15101
Comments
|
@nwjsmith Do you know what page you were looking at when you encountered this? |
Frame 3 is bogus; that's really HTMLLinkElement::set_stylesheet where the assertion lives. |
|
The stack for
However, it is then loaded again when the
This ties in the work in #14930. We probably want to null out HTMLLinkElement's stylesheet field before starting a load to avoid this assertion. |
|
Please make a comment here if you intend to work on this issue. Thank you! |
|
Can I take this one? |
|
@SwagColoredKitteh Sure thing! Ask us any questions here or at #servo in irc.mozilla.org if you run into any problems! |
…k correctly for the same element
…k correctly for the same element
…k correctly for the same element
…k correctly for the same element
Prevent crashing when a link tag has two or more in-flight requests (fix for issue #15101) <!-- Please describe your changes on the following line: --> The `HTMLLinkElement::set_stylesheet` function now checks whether there already is a stylesheet, and if there is, calls `Document::invalidate_stylesheets` after modifying `self.stylesheet`. This PR also includes a minimal WPT that causes the panic. This is fundamentally a timing issue, so while this fix prevents the crash, it does not fix the underlying issue. Making a <link> element send a second request before the first can finish and then getting the two stylesheet responses out-of-order will apply the wrong stylesheet, as demonstrated with https://gist.github.com/SwagColoredKitteh/2c24c7fac635445042eda4a30e10420e. r? @emilio --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15101 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15145) <!-- Reviewable:end -->
assertion failed: self.stylesheet.borrow().is_none()
URL:
Servo Version:
Servo 0.0.1-f010fb5
Backtrace:
This report was generated by the browser.html issue reporter.