Commit graph

872 commits

Author SHA1 Message Date
Alan Jeffrey
ca9cee084e Fix document.write check for activity. 2017-01-27 17:25:40 -06:00
Alan Jeffrey
a43c842099 The constellation notifies the script thread about documents becoming inactive, active and fully active. 2017-01-27 12:39:43 -06:00
bors-servo
a1187c12ee Auto merge of #15262 - alon:master, r=Ms2ger
dom/document: scripting_enabled can be a bool. #15260

Fix #15260 - scripting_enabled can be a bool

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15260

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because - there were no tests previously (not a real good excuse :)

<!-- 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/15262)
<!-- Reviewable:end -->
2017-01-27 08:57:38 -08:00
Anthony Ramine
d8238646a0 Kill ServoParser::pipeline 2017-01-27 12:12:21 +01:00
Alon Levy
d966f1fae2 dom/document: scripting_enabled can be a bool. #15260 2017-01-27 12:01:27 +02:00
Anthony Ramine
7dd5945237 Inline dom::eventdispatcher into dom::event 2017-01-22 15:31:47 +01:00
Anthony Ramine
03d79185ff Support document.createElement("beforeunloadevent") 2017-01-21 15:16:19 +01:00
Anthony Ramine
1f8106a1dc Expose PopStateEvent only in Window 2017-01-21 15:16:14 +01:00
Anthony Ramine
bd5ffd2833 Expose PageTransitionEvent only in Window 2017-01-21 15:16:02 +01:00
Anthony Ramine
2221203359 Expose HashChangeEvent only in Window 2017-01-21 15:15:50 +01:00
Anthony Ramine
ee1ff1d385 Make FocusEvent::new_uninitialized take a &Window 2017-01-21 14:32:37 +01:00
Anthony Ramine
969e6e5ac3 Add some comments for the end 2017-01-20 23:55:32 +01:00
Anthony Ramine
6c788feaf7 Process pending parsing blocking script before deferred scripts
Processing the blocking script beforehand may allow the parser to finish parsing,
in which case deferred scripts have the opportunity to get executed.
2017-01-20 23:54:42 +01: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
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
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
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
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
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
Anthony Ramine
30f0553ac7 Introduce PendingScript
This moves scripts' loading results in Document, instead of maintaining them
behind a DOMRefCell in each HTMLScriptElement.
2017-01-11 17:37:19 +01:00
Anthony Ramine
438182a7de Introduce Document::has_pending_parsing_blocking_script 2017-01-11 14:52:40 +01:00
Anthony Ramine
749ac42854 Do not pass an Option to Document::set_pending_parsing_blocking_script 2017-01-10 21:57:02 +01:00
Alan Jeffrey
7c2de62124 Implement browsing context discarding. 2017-01-05 21:12:57 +00:00
bors-servo
2fe914e2fa Auto merge of #14845 - jdm:restyle-ood, r=emilio
Avoid restyling elements that aren't in a document

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14480
- [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/14845)
<!-- Reviewable:end -->
2017-01-04 12:19:00 -08:00
bors-servo
6f9ff7b8bf Auto merge of #14738 - Wafflespeanut:keypress, r=jdm
Properly dispatch keypress event

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

This was an attempt to fix #14659. It turned out that the problem wasn't what I thought it was. So, I didn't fix that. On the brighter side, this fixes two related issues.

- Previously, we were unable to launch `keypress` events from `input` and `textarea` elements, because [we'd been cancelling](1327ebd52f/components/script/dom/htmlinputelement.rs (L1120-L1124)) the key events, so that they don't trigger window navigation - #8400). I've introduced an enum to represent an additional state to an event's cancellation.
- [According to the spec](https://w3c.github.io/uievents/#keypress-event-order), `keypress` (if available) should be dispatched immediately after `keydown`, and it should be followed by `input`. Canceling `keypress` should also cancel `input`. But, we'd been dispatching `input` before `keypress`. We now dispatch `input` once the `keypress` event is on the respective elements.

---
<!-- 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

<!-- Either: -->
- [x] These changes do not require tests because it's a refactor?

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

r? @jdm or anyone interested

<!-- 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/14738)
<!-- Reviewable:end -->
2017-01-04 10:52:06 -08:00
Josh Matthews
9a264c8173 Only pass nodes to layout for restyling that are actually in the document. 2017-01-04 12:42:12 -05:00
Ravi Shankar
5f0b3bd53c Fire 'input' event after 'keypress' in input and textarea elements 2016-12-27 15:57:34 +05:30
Ravi Shankar
08662cc64e Allow 'keypress' event to emerge from input and textarea elements 2016-12-27 15:57:23 +05:30
Ms2ger
ec5d08c887 Pass the Document's origin to its constructor.
CC #10963.
2016-12-23 11:15:46 +01:00
Julien Wajsberg
d024787188 Expose Quirks Mode information in the style shared context r=emilio 2016-12-17 11:15:32 -08:00
bors-servo
7fecaa3e84 Auto merge of #14549 - frewsxcv:child-text-content, r=Ms2ger
Implement "child text content" concept; use it where appropriate.

<!-- 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/14549)
<!-- Reviewable:end -->
2016-12-15 16:54:38 -08:00
Corey Farwell
9073a2f4c6 Implement "child text content" concept; use it where appropriate. 2016-12-15 17:24:13 -05:00
Corey Farwell
77d2f9de36 Refactor and simplify 'set cookies' operations on resource thread. 2016-12-15 15:34:04 -05:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Anthony Ramine
26ab0f82a8 Properly root the running animation list in a RootedVec 2016-12-12 10:47:55 -10:00
Anthony Ramine
1327ebd52f Remove HeapGCValue
It could be used to have mutable JSVal fields without GC barriers.
With the removal of that trait, MutHeap and MutNullableHeap can respectively
be replaced by MutJS and MutNullableJS.
2016-12-12 10:47:54 -10:00
Corey Farwell
17295dc566 Alphabetize document.createEvent match list.
Makes it easier to see what hasn't been implemented with regards to the
spec.
2016-12-09 09:24:18 -10:00
Jansen Jan
55f0e56224 Add support for fullscreen #10102 2016-12-09 11:45:50 +01:00
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00
bors-servo
0fe94a6724 Auto merge of #12862 - servo:layout-new, r=emilio
added dom obj counting to decide sequential/parallel layout (#10110)

This is a rebased version of #11713

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #10110 (github issue number if applicable).
- [X] There are no tests for these changes because it's an optimization with no visible behavioral 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/12862)

<!-- Reviewable:end -->
2016-12-07 14:32:20 -08:00
bors-servo
32c121b6ff Auto merge of #14473 - nox:raf-safety, r=Ms2ger
Clean up JSTraceable and how we use it

<!-- 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/14473)
<!-- Reviewable:end -->
2016-12-06 18:31:46 -08:00
Anthony Ramine
e8c9c12b6e Remove usage of FnBox for animation frame callbacks (fixes #14416) 2016-12-06 13:15:09 -10:00
bors-servo
a0619688a6 Auto merge of #14367 - mrobinson:scroll-fragment-point, r=pcwalton
Reimplement scrolling to fragments

<!-- 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
- [x] These changes fix #13736, #10753 (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. -->

This reimplemntation of the feature uses ScrollRootIds to scroll
particular scrollable areas of the page.

Fixes #13736.
Fixes #10753.

<!-- 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/14367)
<!-- Reviewable:end -->
2016-12-06 14:42:00 -08:00
ddh
479a2c1217 added dom obj counting to decide sequential/parallel layout (#10110) 2016-12-05 17:42:17 +00:00
Anthony Ramine
c1bdd3d5ce Properly mark application/xhtml+xml documents as XML
For this to work, we must remove the unimplemented!() call
in Element::parse_fragment because all the tests rely on
setting innerHTML.
2016-12-01 11:55:16 +01:00