aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlscriptelement.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Added off thread compilationAbhishekSharma1022020-07-211-40/+221
| | | | | Co-authored-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com> Co-authored-by: Abhishek Sharma <20724848+AbhishekSharma102@users.noreply.github.com>
* Auto merge of #27026 - CYBAI:dynamic-module, r=jdmbors-servo2020-07-191-60/+91
|\ | | | | | | | | | | | | | | | | | | Introduce dynamic module --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #25439 - [x] There are tests for these changes
| * Set private reference for classic scriptCYBAI2020-07-181-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | Web developers can use `Dynamic Import` in a classic script; thus, we need to save the script's private reference so that we can reuse it when we're going to fetch a dynamic import module for a classic script. Besides, because it's possible to use different executing context for a dynamic import module (like `dynamic-import/string-compilation-other-document.html` WPT test), we can't initialize a module owner at the timing of `SetScriptPrivate`; thus, if the private module script doesn't hold an owner, we'll use a DynamicImport owner for it.
| * checkpoint - dynamic load inside of a module and classic script works.Josh Matthews2020-07-181-58/+69
| |
* | Auto merge of #27303 - camelid:async-to-asynch, r=jdmbors-servo2020-07-171-9/+9
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `asynch` instead of `r#async` <!-- Please describe your changes on the following line: --> This is a vestige of the transition from 2015 to 2018 edition Rust. `async` was added as a keyword in 2018 edition Rust, so `cargo fix` changed the variable name here to `r#async`. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because this is just an internal name change <!-- 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. -->
| * Use `asynch` instead of `r#async`Camelid2020-07-161-9/+9
| | | | | | | | | | | | This is a vestige of the transition from 2015 to 2018 edition Rust. `async` was added as a keyword in 2018 edition Rust, so `cargo fix` changed the variable name here to `r#async`.
* | One fewer `Rc::clone()`Camelid2020-07-161-1/+1
| |
* | Fewer clonesCamelid2020-07-161-2/+4
| |
* | Use `Rc` instead of cloning the `DOMString`Camelid2020-07-141-10/+12
|/ | | | | | | | | | Specifically, I changed the `text` field of `ScriptOrigin` from a `DOMString` to an `Rc<DOMString>`. Then I updated all the related code to work with an `Rc`. This is just a first pass to get the code to compile. There are probably more things I can do that will improve the code and further reduce cloning.
* Fix invalid use of ReferrerUrlMatthias Deiml2020-06-171-1/+1
|
* Make url for "client" referrer mandatoryMatthias Deiml2020-06-171-2/+1
|
* Move away from Promise.all way and check if we need to finish manuallyCYBAI2020-06-131-40/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous Promise.all way, we registered a promise for every module script which means we will need to do many complex checkings like "is this top level?" and it will make us much more difficult to understand how the module script algorithm works. In the new manual checking way, we will only register promises for top level modules to notify its owner (e.g. the script element) to finish the load. So, we can understand it much more easily and would be more spec-aligned. Also, I think the `Ready` and `FetchFailed` status are quite confusing and we actually don't need them so they're removed in this patch. Then, we will always go to `Finished` instead. It would basically be following steps: +-----------------+ | Failed to fetch | ----------+ +--------------+ +----------+ / +-----------------+ | | Fetch module | ----> | Fetching | ---+ v +--------------+ +----------+ \ +---------+ +---------------------+ | Fetched | | Advance to Finished | +---------+ +---------------------+ | ^ v | +-------------------+ | | Fetch descendants | ----- if no descendants +-------------------+ | V +----------------------+ | Fetching Descendants | +----------------------+ In `Advance to Finished`, it means that module script is about to finished so it will 1. Notify all of its `ready` and `not finished` parents to finish 2. Link (instantiate) the module 3. Resolve its promise to notify owner(s) to finish
* reading unminified scripts from diskskrzyp12020-06-021-10/+56
|
* Set `currentScript` to `null` for module scriptsCYBAI2020-05-271-2/+6
| | | | | | I misunderstood the test case when I worked on #23545. That test case is actually not related to dynamic import; instead, the reason why it crashes is, `currentScript` should be updated to `null`.
* Use temporary files instead of pipes for JS unminification.Josh Matthews2020-05-221-18/+27
|
* Auto merge of #26005 - jdm:hubs-csp, r=noxbors-servo2020-03-251-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | Update content-security-policy. This allows hubs.mozilla.org to load instead of panicking due to unimplemented CSP features. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24702 - [x] These changes do not require tests because we never enabled the CSP testsuite
| * Update content-security-policy.Josh Matthews2020-03-251-0/+1
| |
* | Add trait DomObjectWrap to provide WRAP functionYUAN LYU2020-03-201-2/+0
|/
* Upgrade to rustc 1.43.0-nightly (5d04ce67f 2020-02-13)Simon Sapin2020-02-141-1/+1
|
* Modify `script` to prevent further violations of snake_caseKunal Mohan2020-01-181-2/+2
|
* Implement nomodule attributeCYBAI2020-01-031-1/+9
|
* Support module script credentials modeCYBAI2020-01-031-2/+15
|
* Support `integrity` for module scriptCYBAI2020-01-031-0/+1
|
* Scaffold module scriptCYBAI2020-01-031-62/+180
|
* Issue warning to devtools when module scripts in use.Josh Matthews2019-12-121-0/+7
|
* Add simple implementation of content-security-policy on scripts / stylesMichael Howell2019-10-161-1/+11
| | | | | | | | This needs a lot more hooks before it'll actually be a good implementation, but for a start it can help get some feedback on if this is the right way to go about it. Part of servo/servo#4577
* Support CORS attributes for image elements.Josh Matthews2019-10-041-17/+3
|
* Prefetch img and scripts during parsingAlan Jeffrey2019-09-101-15/+40
|
* Show warning when the script is a moduleCYBAI2019-09-061-38/+60
| | | | The warning can be removed in #23545.
* Add `type_` for script origin to distinguish module or classicCYBAI2019-09-061-4/+12
|
* Rename ClassicScript to ScriptOriginCYBAI2019-09-061-13/+13
| | | | | This is basically revert 965370c0bf. After introducing module script, we can reuse this struct and add field to see the type of script.
* Rename ScriptContext to ClassicContextCYBAI2019-09-061-5/+5
|
* Recognize `module` as script typeCYBAI2019-09-061-34/+54
|
* Update spec step numberCYBAI2019-09-061-32/+39
|
* Upgrade to rustc 1.38.0-nightly (dddb7fca0 2019-07-30)Simon Sapin2019-07-311-1/+1
|
* Modify *::get_cx methods to return a safe JSContext instead of a raw onemarmeladema2019-07-241-1/+1
|
* Script: removed a few opts::get()oneturkmen2019-06-261-2/+1
|
* Fix some new warningsSimon Sapin2019-06-221-1/+1
|
* Introduce BindContext with in_doc and connected flagsFernando Jiménez Moreno2019-04-261-4/+4
| | | | Fix some is_in_doc -> is_connected mistakes
* Add is_connected flag to node and use it to replace most uses of is_in_docFernando Jiménez Moreno2019-04-261-3/+3
|
* Implement shadow-including root, set node as in doc when connected. Makes JS ↵Fernando Jiménez Moreno2019-04-261-3/+3
| | | | work in shadow trees
* set referrer in window.load_urlRussell Cousineau2019-04-191-2/+2
| | | | | | | | - this conforms to follow-hyperlinks spec step 13 - this conforms to window-open spec step 14.3 - replace uses of `referrer_url` with `referrer` - in Request class, change "no-referrer" to "" - set websocket fetch referrer to "no-referrer"
* Auto merge of #23187 - krk:nopanic-unminifyjs, r=jdmbors-servo2019-04-161-1/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not unwrap empty unminified_js_dir in HTMLScriptElement.unminify_js. Calling unwrap caused a panic when a directory could not be created. --- <!-- 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 #23031 <!-- 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/23187) <!-- Reviewable:end -->
| * Clarify warning.Josh Matthews2019-04-161-1/+1
| |
| * Do not unwrap empty unminified_js_dir in HTMLScriptElement.unminify_js.krk2019-04-101-1/+9
| |
* | Implementing the builder pattern for RequestInitLucas Fantacuci2019-04-101-15/+14
|/
* Remove most RootedReference usesAnthony Ramine2019-03-101-5/+5
| | | | We can replace all uses of RootedReference for Option<T> by Option::deref calls.
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-5/+5
|
* Auto merge of #22456 - dlrobertson:fix_src, r=ferjmbors-servo2018-12-221-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update src/href attributes to be a USVString The following IDLs have the src/href attributes typed as a `DOMString` while in the spec the attribute has been updated to be a `USVString`: - [HTMLIFrameElement] - [HTMLImageElement] - [HTMLInputElement] - [HTMLLinkElement] - [HTMLMediaElement] - [HTMLScriptElement] Fixes: #22454 [HTMLIFrameElement]: https://html.spec.whatwg.org/multipage/#htmliframeelement [HTMLImageElement]: https://html.spec.whatwg.org/multipage/#htmlimageelement [HTMLInputElement]: https://html.spec.whatwg.org/multipage/#htmlinputelement [HTMLLinkElement]: https://html.spec.whatwg.org/multipage/#htmllinkelement [HTMLMediaElement]: https://html.spec.whatwg.org/multipage/#htmlmediaelement [HTMLScriptElement]: https://html.spec.whatwg.org/multipage/#htmlscriptelement <!-- 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/22456) <!-- Reviewable:end -->
| * Update src/href attributes to be a USVStringDan Robertson2018-12-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The following IDLs have the src/href attributes typed as a DOMString while in the spec the attribute has been updated to be a USVString: - HTMLIFrameElement - HTMLImageElement - HTMLInputElement - HTMLLinkElement - HTMLMediaElement - HTMLScriptElement