Commit graph

5044 commits

Author SHA1 Message Date
bors-servo
830fe189ad Auto merge of #15128 - nox:load-fixes, r=Ms2ger
Simplify how we handle script scheduling and delaying the load event

<!-- 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/15128)
<!-- Reviewable:end -->
2017-01-20 13:41:32 -08:00
bors-servo
15c542d3a1 Auto merge of #14646 - canaltinova:origin-clean, r=jdm
Support origins in CSSOM stylesheets

<!-- Please describe your changes on the following line: -->
I still need to pass the origin clean flag to constructors. `style::stylesheets::Stylesheet` has an origin field but I don't think that's relevant.
I can get href in htmllinkelement.rs like this:
```rust
let element = self.upcast::<Element>();
let href = element.get_string_attribute(&local_name!("href"));
```
But I'm not sure how to proceed after here.
@Manishearth any opinions?

---
<!-- 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 #14327 (github issue number if applicable).

<!-- Either: -->
- [X] 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/14646)
<!-- Reviewable:end -->
2017-01-20 11:12:59 -08:00
Nazım Can Altınova
fd950a7309 Support origins in CSSOM stylesheets 2017-01-20 22:00:49 +03:00
bors-servo
5cd0425933 Auto merge of #15127 - servo:RootedTraceableSet, r=jdm
Privatize RootedTraceableSet.

<!-- 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/15127)
<!-- Reviewable:end -->
2017-01-20 10:17:38 -08:00
bors-servo
eade32ed16 Auto merge of #15099 - servo:phf-no-macros, r=jdm
Remove usage of phf_macros.

It’s a compiler plugin that uses unstable compiler APIs that are not on a path to stabilization.

With this changes, there is one less thing that might break when we update the compiler. For example: https://github.com/sfackler/rust-phf/pull/101

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

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/15099)
<!-- Reviewable:end -->
2017-01-20 08:59:26 -08:00
bors-servo
e6f661c984 Auto merge of #15117 - servo:fileapi, r=nox
Fix and annotate some FileAPI test failures.

<!-- 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/15117)
<!-- Reviewable:end -->
2017-01-20 08:03:41 -08:00
Anthony Ramine
e9feb20775 Simplify processing of deferred scripts
It is now done on-demand when a deferred script finished loading, and when
the page source finished loading.
2017-01-20 16:41:49 +01:00
Anthony Ramine
abdb390da8 Simplify processing of pending parsing-blocking scripts
This is done outside of finish_load in a more straightforward way now.
2017-01-20 16:30:34 +01:00
Ms2ger
eccf0a2932 Privatize RootedTraceableSet. 2017-01-20 16:09:35 +01:00
Anthony Ramine
1bf0db5537 Process deferred scripts less often
Only do it from finish_load when a stylesheet finished loading, and from
deferred_script_loaded directly.
2017-01-20 16:08:59 +01:00
Ms2ger
6a6f339b29 Support dictionaries in unions.
Fixes #11612.
2017-01-20 16:06:33 +01:00
Anthony Ramine
9912721f06 Simplify processing of asap scripts in order 2017-01-20 15:35:22 +01:00
Anthony Ramine
f7df804630 Simplify the processing of asap scripts 2017-01-20 15:25:24 +01:00
bors-servo
29d4f7d467 Auto merge of #15083 - potocpav:issue-14497, r=KiChjang
Fix #14497: WeakMediaQueryListVec assumes its contents are still alive

<!-- Please describe your changes on the following line: -->
First time contributor here. Noticed this issue is easily solved, so I did it. I am very unsure about how things work here: Is a test needed? What should it look like? Should the "unwrap" be avoided (making bigger changes to the code)?

---
<!-- 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 #14497  (github issue number if applicable).

- [X] 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/15083)
<!-- Reviewable:end -->
2017-01-19 14:10:33 -08:00
Simon Sapin
0b9ff576e0 script codegen: Avoid modifying in-place a generated file. 2017-01-19 17:13:35 +01:00
bors-servo
6272cb5a51 Auto merge of #15098 - nox:load-fixes, r=jdm
Mark the page source as loaded only after parsing is done

<!-- 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/15098)
<!-- Reviewable:end -->
2017-01-19 07:32:45 -08:00
Anthony Ramine
0f244d6948 Mark the page source as loaded only after parsing is done 2017-01-19 16:17:14 +01:00
Ms2ger
2c7c8fd2be Use an ArrayBuffer to implement readAsArrayBuffer. 2017-01-19 15:41:16 +01:00
Ms2ger
2071e41e64 Don't try to get the global of an object while it's being destroyed.
Fixes #15070.
Fixes #15097.
2017-01-19 10:08:48 +01:00
Dexter Haslem
94f0ceb4aa squash: convert less interesting debug! logs to traces 2017-01-18 22:21:41 -07:00
bors-servo
5e888b5504 Auto merge of #15089 - Manishearth:less-vec, r=SimonSapin
Reduce allocator churn when parsing property declaration blocks

fixes #15060

cc @emilio

r? @SimonSapin

<!-- 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/15089)
<!-- Reviewable:end -->
2017-01-18 17:41:05 -08:00
Manish Goregaokar
b5cb401aef Reduce allocator churn when parsing property declaration blocks (fixes #15060) 2017-01-18 16:31:46 -08:00
bors-servo
ba59ee6627 Auto merge of #15053 - emilio:image-width, r=jdm
Return the intrinsic image dimension when the image is not rendered

See individual commits for details.

r? @jdm

<!-- 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/15053)
<!-- Reviewable:end -->
2017-01-18 08:43:19 -08:00
Emilio Cobos Álvarez
728ce16b9d
script: Properly implement the image width and height getter.
Per https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-width:

    The IDL attributes width and height must return the rendered width and
    height of the image, in CSS pixels, if the image is being rendered, and is
    being rendered to a visual medium; or else the density-corrected intrinsic
    width and height of the image, in CSS pixels, if the image has intrinsic
    dimensions and is available but not being rendered to a visual medium; or
    else 0, if the image is not available or does not have intrinsic dimensions.
2017-01-18 16:49:53 +01:00
Emilio Cobos Álvarez
bdd7cb9753
script: Rename bounding_content_box to bounding_content_box_or_zero.
And make bounding_content_box preserve whether the element is rendered.
2017-01-18 16:49:52 +01:00
bors-servo
80c6383140 Auto merge of #15072 - nox:load-fixes, r=jdm
Refactor some things related to script loading

<!-- 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/15072)
<!-- Reviewable:end -->
2017-01-18 02:17:17 -08:00
bors-servo
f010fb58fd Auto merge of #15065 - Manishearth:box-calclop, r=heycam
Use Box<CalcLengthOrPercentage> in specified values to avoid bloating inline sizes

For #15061

CalcLOP is a large struct, and gets used quite often. While #15063 reduces its size a bit,
it will still be much larger than any of the other variants in the `specified::Length*` types,
so it will still bloat sizes, especially for specified values that contain many lengths.

This change boxes it in the length types, so that it just takes one word.

r? @heycam

<!-- 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/15065)
<!-- Reviewable:end -->
2017-01-17 11:49:52 -08:00
Pavel Potocek
0d9b4e858c Fix #14497: WeakMediaQueryListVec assumes its contents are still alive 2017-01-17 18:35:49 +01:00
Manish Goregaokar
f59557d2f2 Box CalcLengthOrPercentage to reduce inline size of PropertyDeclaration(s) 2017-01-17 08:09:54 -08:00
Anthony Ramine
44fd53fd48 Reorder some steps in ServoParser::finish 2017-01-17 14:25:23 +01:00
Anthony Ramine
70ed3e7006 Remove ScriptThread::parsing_complete 2017-01-17 14:24:37 +01:00
Emilio Cobos Álvarez
485fe874e8
layout: Expose whether the element was rendered in content_box_query to script.
But don't change the API yet.
2017-01-17 13:55:08 +01:00
Emilio Cobos Álvarez
8159dac506
dom: Refactor htmlanchorelement.rs layout query for an existing helper. 2017-01-17 13:55:08 +01:00
Anthony Ramine
d29726971a Remove an obsolete reflow 2017-01-17 13:15:00 +01:00
Anthony Ramine
a60bbc81b8 Reorder some Document methods to put them together 2017-01-17 13:14:59 +01:00
Ms2ger
51df04d93e Implement the incumbent global.
Fixes #10963.
2017-01-17 12:57:02 +01:00
Anthony Ramine
5756f2ff4d Kill HTMLScriptElement::ready_to_be_parser_executed 2017-01-17 12:16:43 +01:00
Ms2ger
933b74781b Use usize for AutoEntryScript::global. 2017-01-17 11:38:32 +01:00
bors-servo
ecd1d2dbc9 Auto merge of #15020 - jdm:external_script_line, r=Ms2ger
Do not use the script element's line number for external scripts.

This was yielding incorrect line numbers when looking at JS backtraces in gdb.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- 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/15020)
<!-- Reviewable:end -->
2017-01-16 11:11:46 -08:00
bors-servo
e891277dd5 Auto merge of #14994 - jdm:callback_rooting, r=Manishearth,Ms2ger
Make WebIDL callbacks permanently rooted

This replicates the same model that Promise uses right now, because it requires less thinking than coming up with something else.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14447
- [ ] There are tests for these changes

<!-- 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/14994)
<!-- Reviewable:end -->
2017-01-16 10:16:44 -08:00
Anthony Ramine
9c87cb7e26 Kill beforescriptexecute and afterscriptexecute (fixes #12446) 2017-01-14 16:16:53 +01:00
bors-servo
c2d2c38b0f Auto merge of #15011 - nox:load-fixes, r=jdm
Various script loading fixes

<!-- 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/15011)
<!-- Reviewable:end -->
2017-01-14 06:18:31 -08:00
Anthony Ramine
91717ab17c Implement HTMLScriptElement async attribute 2017-01-14 14:53:04 +01:00
Josh Matthews
6f19b0cd82 Do not use the script element's line number for external scripts. 2017-01-13 17:50:54 -05:00
mrnayak
3d9e44a8c4 Handle crossorigin in link and refactor crossorigin handling
Implemented Step three and handled step four of obtain the resource part
of 4.2.4 The link element.
Link to spec : https://html.spec.whatwg.org/multipage/semantics.html#concept-link-obtain

Refactored crossOrigin handling in HTMLScriptElement, HTMLImageElement
2017-01-13 23:35:00 +05:30
Josh Matthews
3f35c3eee2 Add a permanent root to WebIDL callbacks, ensuring they are always safe to store. 2017-01-13 09:59:57 -05:00
Anthony Ramine
3e19b37c83 Don't fire a load event on inline scripts
https://github.com/whatwg/html/issues/1757
2017-01-13 13:50:31 +01:00
bors-servo
38fccce3ba Auto merge of #14992 - servo:rustup, r=jdm
Upgrade to rustc 1.16.0-nightly (2782e8f8f 2017-01-12)

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

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/14992)
<!-- Reviewable:end -->
2017-01-12 16:07:54 -08:00
Simon Sapin
5cf10622bb Upgrade to rustc 1.16.0-nightly (2782e8f8f 2017-01-12) 2017-01-12 23:43:02 +01:00
Alan Jeffrey
611f3b38a1 Remove reflow status from browsing context. 2017-01-12 15:06:31 -06:00