Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Перейти к файлу
Daniel Johnson 4a3e899ce4 servo: Merge #17083 - "javascript:" urls: execute in correct global scope (from danielj41:javascript-url-global-3); r=jdm
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 40c8a6389afdad8fdffdf4a5616627f9a51b1822

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : da92cf37bf7b879cc6766a5bd816c943e8b18b17
2017-09-09 04:39:43 -05:00
.cargo
.vscode
accessible merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-09 11:44:38 +02:00
addon-sdk Bug 1186409 - Use Cu.getGlobalForObject when importing properties off a JSM global. r=kmag 2017-06-23 13:51:14 -07:00
browser merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-09 11:44:38 +02:00
build Bug 1324892: Update Mac builds to use the OS X 10.11 SDK. r=mshal 2017-09-08 15:49:13 -04:00
caps Bug 1186409 - Use Cu.getGlobalForObject when importing properties off a JSM global. r=kmag 2017-06-23 13:51:14 -07:00
chrome
config Bug 1396158 - Remove pocketsphinx references from the build system. r=chmanchester 2017-09-06 08:37:00 -07:00
db
devtools Merge inbound to central, a=merge 2017-09-08 13:36:31 -07:00
docshell Bug 1398379 part 1: Make callers of GetRootScrollFrameAsScrollableExternal() use its equivalent non-"External" version instead. r=mats 2017-09-08 16:36:32 -07:00
dom merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-09 11:44:38 +02:00
editor Merge m-c to inbound, a=merge 2017-09-08 13:41:21 -07:00
embedding
extensions
gfx merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-09 11:44:38 +02:00
gradle/wrapper
hal
image Bug 1397223 - Gracefully handle failures in SurfaceCacheImpl::StartTracking. r=tnikkel 2017-09-06 20:17:04 -07:00
intl merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-09 11:44:38 +02:00
ipc Backed out 3 changesets (bug 1245527) for ASan browser-chrome leaks and Android mochitest bustage 2017-09-09 00:09:21 -07:00
js Merge inbound to central, a=merge 2017-09-08 13:36:31 -07:00
layout merge mozilla-central to autoland. r=merge a=merge 2017-09-09 11:46:02 +02:00
media merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-07 12:39:12 +02:00
memory Bug 1396892 - turn off -Wtautological-pointer-compare in memory/build/ for Android; r=njn 2017-09-07 08:20:12 -04:00
mfbt Backed out 2 changesets (bug 1396723) for !ElementAccess::Get(mHead).mPrev assertion failures 2017-09-06 21:39:20 -07:00
mobile Bug 1395645: Increase Pocket Stories refresh to once an hour. r=liuche 2017-09-08 14:22:21 -07:00
modules merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-09 11:44:38 +02:00
mozglue Backed out changeset 0c2b838c91e4 (bug 1386304) for eslint failures in asan-reporter/bootstrap.js a=backout 2017-09-07 16:51:48 -07:00
netwerk merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-09 11:44:38 +02:00
nsprpub
other-licenses
parser merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-07 12:39:12 +02:00
probes
python Bug 1395457 - De-hardcode product name when producing webext-langpack. r=kmag 2017-09-07 13:16:20 -07:00
rdf
security Backed out 3 changesets (bug 1245527) for ASan browser-chrome leaks and Android mochitest bustage 2017-09-09 00:09:21 -07:00
services Bug 1394525 - Reset tracker scores before syncing. r=markh 2017-08-28 11:24:26 -07:00
servo servo: Merge #17083 - "javascript:" urls: execute in correct global scope (from danielj41:javascript-url-global-3); r=jdm 2017-09-09 04:39:43 -05:00
startupcache
storage
taskcluster Bug 1324892: Update toolchain paths to point to the macOS 10.11 SDK. r=ted 2017-09-08 15:49:29 -04:00
testing Merge inbound to central, a=merge 2017-09-08 13:36:31 -07:00
third_party Bug 1341102 - Revendor rust deps; r=bustage 2017-09-08 13:33:21 -07:00
toolkit merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-09 11:44:38 +02:00
tools merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-09-07 23:59:58 +02:00
uriloader Bug 1395527 part 2 - Delegate IsASCII and IsUTF8 to encoding_rs. r=froydnj 2017-09-01 11:53:31 +03:00
view Bug 1362382 - Move RegisterDragDrop to be called during idle time, if possible r=jimm 2017-08-30 11:18:25 -07:00
widget Merge inbound to central, a=merge 2017-09-08 13:36:31 -07:00
xpcom Bug 1385991 - Provide a chrome side notification informing the user about an incompatible version of JAWS screen reader. r=felipe 2017-09-08 16:05:06 -05:00
xpfe
.clang-format
.clang-format-ignore No bug - Remove an non-breaking space r=me DONTBUILD 2017-09-01 11:41:39 +02:00
.clang-tidy
.cron.yml
.eslintignore Bug 1395545 - test that an invalid source map is reported to the console; r=nchevobbe 2017-08-31 12:03:24 -06:00
.eslintrc.js
.flake8
.gdbinit
.gdbinit_python
.gitignore
.hgignore
.hgtags
.inferconfig
.lldbinit
.taskcluster.yml Backed out 4 changesets (bug 1394883) for Windows signing chain-of-trust failures 2017-08-31 20:02:34 -07:00
.yamllint
.ycm_extra_conf.py
AUTHORS
CLOBBER Bug 1395486 followup. Clobber to fix packaging failure for Android builds. r=clobber 2017-09-02 13:46:34 +02:00
GNUmakefile
LEGAL
LICENSE
Makefile.in
README.txt
aclocal.m4
build.gradle
client.mk
client.py
configure.in
configure.py
gradle.properties
gradlew
mach
moz.build Backed out changeset 8586bf76d73d (bug 1383880) 2017-09-06 17:47:24 +02:00
moz.configure Bug 1396730 - Log "checking watchman" before checking for watchman. r=chmanchester 2017-08-30 17:25:30 +09:00
mozilla-config.h.in
npm-shrinkwrap.json Backed out changeset df8215261c7e (bug 1349689) on request from rchien. r=backout 2017-08-31 16:58:32 +02:00
old-configure.in
package.json
settings.gradle
test.mozbuild

README.txt

An explanation of the Mozilla Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://developer.mozilla.org/en/Mozilla_Source_Code_Directory_Structure

For information on how to build Mozilla from the source code, see:

    https://developer.mozilla.org/en/docs/Build_Documentation

To have your bug fix / feature added to Mozilla, you should create a patch and
submit it to Bugzilla (https://bugzilla.mozilla.org). Instructions are at:

    https://developer.mozilla.org/en/docs/Creating_a_patch
    https://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree

If you have a question about developing Mozilla, and can't find the solution
on https://developer.mozilla.org, you can try asking your question in a
mozilla.* Usenet group, or on IRC at irc.mozilla.org. [The Mozilla news groups
are accessible on Google Groups, or news.mozilla.org with a NNTP reader.]

You can download nightly development builds from the Mozilla FTP server.
Keep in mind that nightly builds, which are used by Mozilla developers for
testing, may be buggy. Firefox nightlies, for example, can be found at:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    https://nightly.mozilla.org/