Commit graph

282 commits

Author SHA1 Message Date
benshu
0785d91ae4 Completed implementation of devtools' getLayout. 2016-02-24 13:51:47 -05:00
Ms2ger
0e35931152 Stop returning an Option from Window::browsing_context.
A Window always has a WindowProxy; the only reason it's wrapped in a nullable
field is the order in which those objects are created.
2016-02-23 16:08:28 +01:00
benshu
f2d4a7bbca Clean up of script timer code.
The code was split into the following two abstractions.
 - OneshotTimers can be used to schedule arbitrary oneshot timers, such
   as XHR-Timeouts.
 - JsTimers (`setTimeout` and `setInterval`) which use OneshotTimers to
   schedule individual callbacks.

With this change the implementation (of JsTimers in particular) is in
much closer alignment with the specification.
2016-02-20 22:43:16 +01:00
bors-servo
ee158cc65f Auto merge of #9603 - Ms2ger:document-bc, r=jdm
Store a pointer to the browsing context in the Document.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9603)
<!-- Reviewable:end -->
2016-02-19 12:49:35 +05:30
Kamil Muszyński
076cc409e6 Issue #9561 Renamed *_thread_source to *_task_source and ThreadSource to TaskSource 2016-02-14 15:29:44 +01:00
Josh Matthews
e6d906dbbf Report CSS errors to script task for further processing. 2016-02-11 14:48:47 -05:00
Ms2ger
152cec69eb Store a pointer to the browsing context in the Document. 2016-02-11 13:08:11 +01:00
Emilio Cobos Álvarez
a1c830f1c1 Update rust-selectors
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00
Josh Matthews
7eca462c5a Make iframe's load event trigger a reflow of the enclosing window. Add a catch-all reflow for all same-origin pages sharing an event loop.a 2016-01-26 16:37:23 -05:00
Patrick Walton
e5a1af5b7a compositing: Fix a couple of bugs that prevented iframes from painting
after navigation.

The first bug was that iframes were not reflowed in their parent DOM
when the child page navigated. This is fixed by simply having the
constellation notify the appropriate script thread when navigation
occurs.

The second bug was that the compositor was unable to adjust the pipeline
for existing iframe layers, only new ones. This patch adds logic to do
that.

Closes #8081.
2016-01-26 16:37:23 -05:00
Corey Farwell
f6dc6ad463 Fix broken spec link on Window::Document 2016-01-14 21:13:14 -05:00
apopiak
4b773cefe9 move MozBrowserEvent to script_traits (+ documentation) 2016-01-13 17:48:50 +01:00
Brandon Fairchild
d1186eda7a Move DocumentState to script_traits
Fixes #9224.
2016-01-12 13:30:33 -05:00
bors-servo
53c4a782a0 Auto merge of #9255 - ckimes89:remove-globalfield, r=nox
Remove global fields from DOM objects

Fixes #9227

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9255)
<!-- Reviewable:end -->
2016-01-12 18:32:37 +05:30
Bobby Holley
384cdfcfff Hoist ParseErrorReporter into style and remove the dependency on msg.
The pipeline id stuff is currently unused. If someone needs it, they can add
an additional trait bound on their css error reporter to get the pipeline id.
2016-01-11 18:01:48 -08:00
Chad Kimes
ce6075825d Add global default method for Reflectable trait 2016-01-11 20:23:47 -05:00
bors-servo
a5a7a8318c Auto merge of #8972 - GauriGNaik:expose-css-errors-1, r=jdm
M1501: CSS Error Reporting: Final Steps Last Part

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8972)
<!-- Reviewable:end -->
2016-01-12 03:47:50 +05:30
GauriGNaik
907322c666 Final steps 2016-01-11 18:48:54 +05:30
Ms2ger
9dc85e0d40 Stop reexporting ReflowGoal from layout_interface. 2016-01-11 10:00:17 +01:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
bors-servo
b8e7cd71d6 Auto merge of #8871 - KiChjang:task-source-channels, r=KiChjang
Add 5 different task source channels

This is **not** complete. I really need feedback right away since I felt that the direction I'm heading is very wrong.

Partial #7959.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8871)
<!-- Reviewable:end -->
2016-01-01 14:31:51 +05:30
Brandon Fairchild
637afecec9 Move LayerKind and ScrollPolicy enums to gfx_traits
This also moves LayerId and LayerProperties to gfx_traits.

Fixes #8836.
2015-12-20 20:43:31 -05:00
bors-servo
9a4d82c314 Auto merge of #8863 - simartin:issue_8352, r=jdm
Issue #8352: Dispatch mozbrowsershowmodalprompt event for alert().

Fixes https://github.com/servo/servo/issues/8352

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8863)
<!-- Reviewable:end -->
2015-12-21 02:28:32 +05:30
Beomjin Kim
2637d30c2a Moved ScriptToCompositorMsg enum and EventResult enum to script_traits
Moved ScriptToCompositorMsg enum and EventResult enum to script_traits
resolving issue #8835.
2015-12-20 00:31:33 +09:00
Simon Martin
0d910bb934 Issue #8352: Dispatch mozbrowsershowmodalprompt event for alert(). 2015-12-19 12:51:33 +01:00
Glenn Watson
b670430cb2 Add test to constellation to avoid writing reftest image if there are pending frames.
Also change when pipelines become active.

This makes the constellation activate a pipeline as the current frame
when it is ready to do initial reflow, rather than when it is ready
to paint.

This fixes a number of intermittent failures that could previously occur
if an iframe was not visible - which would mean it was never moved from
a pending frame in the constellation to an active frame.

(It happens that webrender exposes these intermittents as permanent failures).
2015-12-17 12:30:19 +10:00
GauriGNaik
fc81276c8e Add pipeline information to CSS error reporting. 2015-12-14 11:18:30 -05:00
Ms2ger
b7b5c79787 Rename the browsercontext module. 2015-12-11 15:27:27 -05:00
Keith Yeung
f478194736 Split script_chan into 5 different task queue channels 2015-12-09 22:49:08 -08:00
Tomas Cernaj
5507be2653 Move ScriptMsg from msg crate into script_traits 2015-12-09 20:50:11 +01:00
bors-servo
02f4be9c9f Auto merge of #8862 - fstr:move_workerid, r=Ms2ger
Moved WorkerId type to devtools_traits

Fixes #8846.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8862)
<!-- Reviewable:end -->
2015-12-08 00:53:40 +05:30
Florian Strübe
b81f712ce1 Moved WorkerId type to devtools_traits 2015-12-07 20:11:26 +01:00
Keith Yeung
8d90034d29 Split fn script_chan into 5 different task channel fn 2015-12-06 12:12:14 -08:00
GauriGNaik
996e9e06b2 Defined new trait ParseErrorReporter and added error_reporter member to ParserContext 2015-11-25 18:28:30 -05:00
Eli Friedman
31c013858f Make the needs_reflow method actually work correctly.
The document node is always dirty because layout never clears the bit;
instead, check the dirty bit of the root element.
2015-11-21 15:49:58 -08:00
Keith Yeung
19294db6e5 Split ConstellationMsg into ScriptMsg and CompositorMsg 2015-11-16 23:10:53 -08:00
bors-servo
62acdd303b Auto merge of #8477 - asajeffrey:opaque-domstring, r=asajeffrey
Opaque DOMString

This patch makes DOMString an opaque wrapper round String (currently it's a transparent wrapper).

The changes are:

* Replacing DOMString(foo) by DOMString::from(foo).
* Replacing foo.0 by String::from(foo).
* Adding functions clear, push_str and extend for in-place mutation of DOMStrings.
* Replacing DOMString by String in other threads (devtools, storage and filereader).
* Making DOMString implement !Send.
* Removing the pub attribute from the contents of DOMString.

This enables experimenting with other string representations in the DOM.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8477)
<!-- Reviewable:end -->
2015-11-13 07:17:30 +05:30
Alan Jeffrey
84bde75b42 Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
2015-11-12 17:52:59 -06:00
bors-servo
9eaa8e7b1f Auto merge of #8492 - jdm:e10s-timer-events, r=jdm
script: Make timer events e10s-safe.

Closes #8235.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8492)
<!-- Reviewable:end -->
2015-11-13 05:19:48 +05:30
Josh Matthews
2340583e56 Differentiate between error and non-error event handlers per the spec. 2015-11-12 16:21:24 -05:00
Patrick Walton
1dc0d61c3c script: Make timer events e10s-safe.
Closes #8235.
2015-11-12 14:30:25 -05:00
Ms2ger
6d2ae85c1f Use the conversion traits from js. 2015-11-12 10:48:58 +01:00
Anthony Ramine
b290a3161d Clean up the conversion routines
Functions returning `Root<T>` are prefixed by "root_" and the ones returning
`*const T` by "native_".

Functions taking `*mut JSObject` are now suffixed by "_from_object" and the ones
taking `&T` by "_from_reflector".
2015-11-11 14:19:30 +01:00
benshu
d27a3244f2 XHR timeouts use same abstraction as scripts timers. (fixes #3396) 2015-11-11 00:52:34 +01:00
Till Schneidereit
543703e3d8 Move Stylesheet loading and ownership from the layout task into HTML elements
Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.
2015-11-07 18:11:29 +01:00
bors-servo
69e6eb4d91 Auto merge of #8304 - dzbarsky:borrowck, r=Ms2ger
Cleanup some unneeded let bindings

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8304)
<!-- Reviewable:end -->
2015-11-07 01:31:40 +05:30
Josh Matthews
989e80036e Implement cancellable runnables.
Additionally, make image load events cancellable. Resolves #7731.
2015-11-06 10:41:38 -05:00
David Zbarsky
dfc90db1d7 Cleanup some unneeded let bindings 2015-11-06 00:22:31 -08:00
bors-servo
1dc144d168 Auto merge of #8332 - Ms2ger:8209-comment, r=frewsxcv
Remove obsolete comment (fixes #8209).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8332)
<!-- Reviewable:end -->
2015-11-05 06:25:54 +05:30