Commit graph

5752 commits

Author SHA1 Message Date
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
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
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
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
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
Ms2ger
a1d478fbb7 Update regex. 2017-01-16 13:11:16 +01: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
bors-servo
2fb9a345d6 Auto merge of #15016 - prampey:doc-deactivate, r=cbrewster
Documents now fully deactivate when a freeze message is sent

<!-- Please describe your changes on the following line: -->
Documents now fully deactivate when a freeze message is sent

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because minimal 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/15016)
<!-- Reviewable:end -->
2017-01-13 14:15:44 -08:00
Prudhvi Rampey
584f72d63b Documents now fully deactivate when a freeze message is sent 2017-01-14 01:12:21 +05:30
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
Ms2ger
e57b478710 Remove unused needsRooting field from JSToNativeConversionInfo. 2017-01-12 16:57:44 +01:00
bors-servo
eb72c0ec7b Auto merge of #14963 - jdm:script_current_line, r=asajeffrey
Report meaningful line numbers for inline script errors

Rebased from #14661.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12744 and partially #9604
- [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/14963)
<!-- Reviewable:end -->
2017-01-11 18:11:52 -08:00
karenher
db2082bc6e Store parser's current line when script elements are created.
Use the newly stored line as the starting line number when
evaluating JS. This ensures that inline scripts will report
errors with meaningful line numbers.
2017-01-11 21:11:00 -05:00
bors-servo
68a8e1bf2b Auto merge of #14291 - fiji-flo:text-input-select, r=pcwalton
Position insertion point in input field with mouse

<!-- Please describe your changes on the following line: -->
Implements cursor positioning in input elements (text/password) via mouse. The related issue is #10083 but is only covered partly.
This PR does **not** cover:
* positioning in textarea elements via mouse
* text selection in input/textarea elements via mouse

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because I can't think of a way to test mouse interaction in the current test pipeline.

<!-- 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/14291)
<!-- Reviewable:end -->
2017-01-11 14:19:10 -08:00
bors-servo
783829eccc Auto merge of #14924 - ioctaptceb:webgl-blendFunc-tests, r=jdm
Webgl blend func tests

<!-- Please describe your changes on the following line: -->
Add a function that validates the conditions for [Constant Color Blend](https://www.khronos.org/registry/webgl/specs/latest/1.0/#CONSTANT_COLOR_BLEND) in the WebGL specs. ./mach run -r tests/wpt/web-platform-tests/webgl/conformance-1.0.3/conformance/misc/webgl-specific.html

---
<!-- 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: -->
- [x] 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/14924)
<!-- Reviewable:end -->
2017-01-11 13:23:08 -08:00
bors-servo
f6940f686c Auto merge of #13972 - shravan-achar:master, r=Manishearth,emilio,jdm
ImageMaps: Implemented support for parsing coord attribute to a shape…

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

Image Maps: (Part 1) Implemented support for parsing coord attribute to a shape object.
                       Implemented a hit_test method to see if a point is within the area. Tests for constructors                      and hit_test included

---

<!-- 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
- [ ] 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. -->

… object in HTMLAreaElement

<!-- 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/13972)

<!-- Reviewable:end -->
2017-01-11 12:25:46 -08:00
Manish Goregaokar
d3be70b4de Make area structs accessible from area tests 2017-01-11 12:22:11 -08:00
ioctaptceb
f3d65505e9 Add a check to BlendFunc for invalid constant
combinations
2017-01-11 20:59:03 +01:00