servo/components/script
bors-servo e62d029ed6 Auto merge of #15906 - mchv:mchv-safe-browsing-context, r=asajeffrey
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 -->
2017-03-16 15:41:07 -07:00
..
docs Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
dom Auto merge of #15906 - mchv:mchv-safe-browsing-context, r=asajeffrey 2017-03-16 15:41:07 -07:00
task_source
body.rs
build.rs Fix hardcoded path to link.exe 2017-02-03 13:33:37 +01:00
Cargo.toml Implement the form owner concept 2017-03-15 16:39:55 +01:00
clipboard_provider.rs
CMakeLists.txt
devtools.rs Added some same-origin-domain checks. 2017-03-14 14:36:03 -05:00
document_loader.rs Remove mutability requirement from fetch_async_background. 2017-02-28 10:23:23 -05:00
fetch.rs Use RootedTraceableBox for dictionaries. 2017-02-16 11:03:26 +01:00
layout_image.rs Extract layout image request into separate file. Do not block the document load event. 2017-02-22 14:19:35 -05:00
layout_wrapper.rs Skip update_animations if we have no running animations and the element becomes display:none. 2017-03-10 11:37:05 +09:00
lib.rs Update cssparser for https://github.com/servo/rust-cssparser/pull/123 2017-02-28 17:16:36 +01:00
mem.rs
microtask.rs Generalize promise job queue into solitary microtask queue. 2017-02-01 12:54:33 -05:00
network_listener.rs Separate the async bluetooth handling from networking code. 2016-12-21 14:52:39 +01:00
script_runtime.rs Generalize promise job queue into solitary microtask queue. 2017-02-01 12:54:33 -05:00
script_thread.rs Implement dissimilar-origin postMessage. 2017-03-15 14:57:25 -05:00
serviceworker_manager.rs Removed util. 2016-12-14 18:04:37 -06:00
serviceworkerjob.rs Remove incorrect uses of asynchronous tasks from ServiceWorker job queue. 2017-02-01 12:54:33 -05:00
stylesheet_loader.rs fix issue #15101 and make sure out-of-order stylesheet loads work correctly for the same element 2017-01-24 15:52:01 +01:00
test.rs Added compiletest to verify TrustedPromise does not implement Clone 2017-01-22 20:12:07 +00:00
textinput.rs
timers.rs script: Use a timer when rAF is used for non-animation purposes 2017-03-03 23:25:29 +01:00
unpremultiplytable.rs
webdriver_handlers.rs Added some same-origin-domain checks. 2017-03-14 14:36:03 -05:00