servo/components/script
bors-servo 40c8a6389a Auto merge of #17083 - danielj41:javascript-url-global-3, r=jdm
"javascript:" urls: execute in correct global scope

<!-- Please describe your changes on the following line: -->

#### Summary

This pull request makes `javascript:` urls execute in the correct global scope.

#### Example

```html
<script> var x = 4; </script>

<!-- this branch: logs "4" -->
<!-- master: undefined variable error -->
<a href="javascript:console.log(x)">link</a>
```

#### Questions

I'm new to servo and rust, so I'm unsure about these changes. In particular:
  * What's the appropriate place to evaluate the js?
    * I moved it to `handle_navigate`, but I'm not sure if this will catch all occurrences of `javascript:` urls. I also don't know if this will execute in the correct thread and the correct window.
  * What should I do with the result of the js evaluation?
    * I just ignored it. The previous behavior displayed it as the content of a new page load.

---
<!-- 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 #15147, #16718

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/17083)
<!-- Reviewable:end -->
2017-09-09 04:39:43 -05:00
..
docs Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
dom Auto merge of #17083 - danielj41:javascript-url-global-3, r=jdm 2017-09-09 04:39:43 -05:00
task_source Reformat some task-related functions 2017-09-08 10:19:06 +02:00
body.rs order derivable traits lists 2017-08-23 21:38:44 +02:00
build.rs order derivable traits lists 2017-08-23 21:38:44 +02:00
Cargo.toml Parse at-rule without block in two stages 2017-09-01 16:21:22 +10:00
clipboard_provider.rs make use of ScriptToConstellationChan 2017-08-15 08:22:09 +02:00
CMakeLists.txt
devtools.rs Added some same-origin-domain checks. 2017-03-14 14:36:03 -05:00
document_loader.rs order derivable traits lists 2017-08-23 21:38:44 +02:00
fetch.rs Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
layout_image.rs Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
lib.rs style: Remove NODE_NEEDS_DIRTY_ON_VIEWPORT_SIZE_CHANGE. 2017-08-28 14:40:48 +02:00
mem.rs
microtask.rs order derivable traits lists 2017-08-23 21:38:44 +02:00
network_listener.rs
script_runtime.rs Make Performance Timeline API work in Workers 2017-09-05 17:07:15 +02:00
script_thread.rs Auto merge of #17083 - danielj41:javascript-url-global-3, r=jdm 2017-09-09 04:39:43 -05:00
serviceworker_manager.rs remove extra spaces after keywords 2017-07-20 00:45:02 +03:00
serviceworkerjob.rs order derivable traits lists 2017-08-23 21:38:44 +02:00
stylesheet_loader.rs style: Don't look for viewport units in stylesheets. 2017-08-28 12:05:22 +02:00
test.rs script: Move the layout_wrapper outside of script. 2017-07-15 16:41:12 +02:00
textinput.rs order derivable traits lists 2017-08-23 21:38:44 +02:00
timers.rs order derivable traits lists 2017-08-23 21:38:44 +02:00
unpremultiplytable.rs
webdriver_handlers.rs Replace downcast with is 2017-08-02 21:51:17 +02:00