mirror of
https://github.com/servo/servo.git
synced 2025-06-20 07:08:59 +01:00
Access browsing context safely Current browsing context accessor in `Document` unwraps the browsing context `Option` which prevents document to handle correctly the case when there is no browsing context. This is the reason servo panics with `session-history.max-length=1` (https://github.com/servo/servo/issues/15877). As it is my first contribution, I added a `safe` method to retrieve the browsing context rather than change the existing method, but I am happy to change if you think this is the right approach. I did not as well replace all existing method call to the `safe` method, to focus on fixing the issue. If someone can give me a bit of guidance for the test, I will try to contribute one. --- <!-- 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 - [ ] `./mach test-tidy` does not report any errors - [X] These changes fix #15877. - [ ] There are tests for these changes <!-- 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/15906) <!-- Reviewable:end --> |
||
---|---|---|
.. | ||
docs | ||
dom | ||
task_source | ||
body.rs | ||
build.rs | ||
Cargo.toml | ||
clipboard_provider.rs | ||
CMakeLists.txt | ||
devtools.rs | ||
document_loader.rs | ||
fetch.rs | ||
layout_image.rs | ||
layout_wrapper.rs | ||
lib.rs | ||
mem.rs | ||
microtask.rs | ||
network_listener.rs | ||
script_runtime.rs | ||
script_thread.rs | ||
serviceworker_manager.rs | ||
serviceworkerjob.rs | ||
stylesheet_loader.rs | ||
test.rs | ||
textinput.rs | ||
timers.rs | ||
unpremultiplytable.rs | ||
webdriver_handlers.rs |