Commit graph

12333 commits

Author SHA1 Message Date
Michael Howell
572616605a Use empty Vec instead of None. 2015-07-26 13:58:29 -07:00
Ms2ger
f57ed72d95 Remove unused method Window::handle_resize_inactive_msg. 2015-07-26 17:30:45 +02:00
Corey Farwell
9e5f31ce00 Cleanup lint special cases, refactor flake8 linting
Currently, there are a few linting functions that only run on certain
filetypes (determined by the file extension). Prior to this commit, the
special cases were handled in a parent function with a conditional. This
commit changes the system so each linting function gets passed a
filename so the function can determine whether it should run or not
based on the file extension.

I also refactored flake8 linting slightly. From what I've read so far of
the code, flake8 itself will only print the results directly to stdout
(though the linter would report the quantity of errors detected).
Prior to this commit, we would let flake8 print directly to stdout and
just determine if there were >0 errors reported. This commit (sort of
hackily) temporarily captures stdout when we call flake8 so we can do
what we want with the output, allowing us to `yield` the line number
and message like we do with the other linting functions.

In my opinion, both of these changes isolate specific behaviors/checks
into their respective linting functions instead of having them handled
at a more global level.

In addition to the changes above:

* The whitespace linter now runs on WebIDL and TOML files
* The license header linter now runs on WebIDL files
2015-07-26 22:12:20 +07:00
Corey Farwell
ee224bc3e5 Add/format license headers for WebIDLs 2015-07-26 22:12:18 +07:00
Corey Farwell
9415c92a5c Clean up whitespace, long lines for WebIDLs 2015-07-26 22:12:10 +07:00
Corey Farwell
d1acefa452 Prevent warning about redefining Python variable
'e' is also used later on in a list comprehension, and flake8 warns when
variables get redefined within a function
2015-07-26 22:07:23 +07:00
Corey Farwell
d71d2da81f Remove unused Python import 2015-07-26 22:07:22 +07:00
bors-servo
5a66b59f9b Auto merge of #6760 - dzbarsky:comment-fix, r=jdm
Remove outdated comment about cloning elements

The comment points to the "implement element prefix" issue, but we clone the element's prefix when we construct the element right above.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6760)
<!-- Reviewable:end -->
2015-07-26 08:01:56 -06:00
bors-servo
fd1bf1900d Auto merge of #6776 - notriddle:filereader-matches, r=jdm
Remove unnecessarily verbose matches.

Fixes #6766.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6776)
<!-- Reviewable:end -->
2015-07-26 00:18:10 -06:00
Michael Howell
20f78b4fcb Remove unnecessarily verbose matches.
Fixes #6766.
2015-07-25 23:00:40 -07:00
Michael Howell
337832fde4 Check if naturalWidth / naturalHeight works w/ DPR
$ ./mach run --device-pixel-ratio=1 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=2 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=.5 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254

It doesn't. Answers #6769.
2015-07-25 15:41:38 -07:00
David Zbarsky
632b7f3c58 Fix MouseEvent.which to not throw 2015-07-25 16:16:30 -04:00
bors-servo
3af6992151 Auto merge of #6761 - Wafflespeanut:filereader, r=jdm
Combining FileReaderEvent and Process into an enum; r=jdm

This one's for #6752. The build was successful for this change. I'll commit the next one for `perform_annotated_read_operation` in a moment...

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6761)
<!-- Reviewable:end -->
2015-07-25 13:58:34 -06:00
Ms2ger
09f0d8fac9 Remove unused allow(unrooted_must_root) attribute. 2015-07-25 21:29:55 +02:00
Ravi Shankar
af87687659 Combining FileReaderEvent and Process; r=jdm 2015-07-26 00:41:07 +05:30
David Zbarsky
3801cfdd35 Remove outdated comment about cloning elements 2015-07-25 13:40:29 -04:00
bors-servo
705c95dedb Auto merge of #6660 - nox:children-changed, r=jdm
Introduce VirtualMethods::children_changed()

This virtual method mimics the behaviour of mutation observers and make it more viable than the older child_inserted(), which didn't cover removed nodes and was called as many times as there were inserted nodes.

A few other shortcomings where remove_child() was called directly instead of Node::remove() were also fixed while at it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6660)
<!-- Reviewable:end -->
2015-07-25 11:39:20 -06:00
Anthony Ramine
7b40cc9fd7 Introduce VirtualMethods::children_changed()
This virtual method mimics the behaviour of mutation observers and make it more
viable than the older child_inserted(), which didn't cover removed nodes and
was called as many times as there were inserted nodes.

A few other shortcomings where remove_child() was called directly instead of
Node::remove() were also fixed while at it.
2015-07-25 19:09:40 +02:00
bors-servo
8edf1a5ecd Auto merge of #6749 - akiss77:bump-deps, r=jdm
Bump up dependencies past the point where both aarch64 fixes and x11 v2.0.0 bump-ups are landed

Affected dependencies are:
* azure,
* clipboard,
* glutin,
* js,
* layers,
* offscreen_gl_context,
* skia, and
* x11 (of course).

ipc-channel has already been bumped up in a previous commit.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6749)
<!-- Reviewable:end -->
2015-07-25 10:17:55 -06:00
bors-servo
c7f73ebc29 Auto merge of #6738 - mbrubeck:bootstrap, r=larsbergstrom
Perform argument validation before bootstrapping.

If there's an error in the command-line arguments for `mach build`, we should print it before starting a (potentially) long bootstrap process, not after.

r? @larsbergstrom or @frewsxcv

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6738)
<!-- Reviewable:end -->
2015-07-25 09:32:30 -06:00
Matt Brubeck
4c3a6b839b Perform argument validation before bootstrapping.
If there's an error in the command-line arguments for `mach build`, we should
print it before starting a (potentially) long bootstrap process, not after.
2015-07-25 07:53:53 -07:00
bors-servo
ee07e7110d Auto merge of #6742 - chotchki:accept_int32, r=jdm
Added support for int32 to webdriver.

Fix for issue #6729

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6742)
<!-- Reviewable:end -->
2015-07-25 07:50:26 -06:00
Akos Kiss
e0c55b2614 Bump up dependencies past the point where both aarch64 fixes and x11 v2.0.0 bump-ups are landed
Affected dependencies are:
* azure,
* clipboard,
* glutin,
* js,
* layers,
* offscreen_gl_context,
* skia, and
* x11 (of course).

ipc-channel has already been bumped up in a previous commit.
2015-07-25 14:27:32 +02:00
bors-servo
1764267379 Auto merge of #6616 - pcwalton:canvas-webgl-ipc, r=jdm
script: Make most of 2D canvas and WebGL run over IPC.

To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.

r? @jdm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6616)
<!-- Reviewable:end -->
2015-07-25 01:50:31 -06:00
Patrick Walton
bb99b2f3c8 script: Make most of 2D canvas and WebGL run over IPC.
To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.
2015-07-25 00:50:12 -07:00
bors-servo
886c08c393 Auto merge of #6712 - Ms2ger:traversal, r=pcwalton
Cleanup ParallelPostorderFlowTraversal.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6712)
<!-- Reviewable:end -->
2015-07-24 20:50:55 -06:00
bors-servo
f778e0eecf Auto merge of #6629 - pcwalton:profiler-ipc, r=jdm
profile: Make the time and memory profilers run over IPC.

Uses a couple of extra threads to work around the lack of cross-process
boxed trait objects.

r? @nnethercote

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6629)
<!-- Reviewable:end -->
2015-07-24 18:55:05 -06:00
Christopher Hotchkiss
469453787f Added support for int32 to webdriver. 2015-07-24 20:23:15 -04:00
Patrick Walton
f10c076180 profile: Make the time and memory profilers run over IPC.
Uses the `Router` abstraction inside `ipc-channel` to avoid spawning new
threads.
2015-07-24 17:02:17 -07:00
bors-servo
590cb33bb7 Auto merge of #6679 - mrobinson:surface-cache, r=pcwalton
Have BufferMap store NativeSurfaces and rename to SurfaceMap

We currently store LayerBuffers, because previously NativeSurfaces did
not record their own size. Now we can store NativeSurfaces directly,
which saves a bit of space in the surface cache and allows us to create
LayerBuffers only in the PaintTask.

This also means that instead of sending cached LayerBuffers, the
compositor can just send cached NativeSurfaces to the PaintTask.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6679)
<!-- Reviewable:end -->
2015-07-24 17:59:45 -06:00
bors-servo
ed1b6a3513 Auto merge of #6705 - pcwalton:image-cache-shmem, r=jdm
canvas: Move to shared memory for images and canvas backing stores.

The idea here is to land this before making images and canvas IPC-safe,
because this will shake out bugs relating to the shared memory. There
are currently test timeouts that are preventing multiprocess images and
canvas from landing, and I believe those are due to the inefficiency of
sending large amounts of data in the unoptimized builds we test with. By
moving to shared memory, this should drastically reduce the number of
copies and `serde` serialization.

Under the hood, this uses Mach OOL messages on Mac and temporary
memory-mapped files on Linux.

r? @jdm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6705)
<!-- Reviewable:end -->
2015-07-24 17:14:59 -06:00
Patrick Walton
626974994a canvas: Move to shared memory for images and canvas backing stores.
The idea here is to land this before making images and canvas IPC-safe,
because this will shake out bugs relating to the shared memory. There
are currently test timeouts that are preventing multiprocess images and
canvas from landing, and I believe those are due to the inefficiency of
sending large amounts of data in the unoptimized builds we test with. By
moving to shared memory, this should drastically reduce the number of
copies and `serde` serialization.

Under the hood, this uses Mach OOL messages on Mac and temporary
memory-mapped files on Linux.
2015-07-24 16:14:24 -07:00
bors-servo
135ef35f6d Auto merge of #6736 - jdm:wptexpectrelease, r=jdm
Disable a test that intermittently crashes in release builds. Update …

…expectations for relevant-mutations.html to account for differences in release builds.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6736)
<!-- Reviewable:end -->
2015-07-24 16:29:05 -06:00
Josh Matthews
65785e2c44 Disable two tests that do not yield reliable output in release builds. 2015-07-24 18:28:43 -04:00
Simon Sapin
a3c0366bd6 Fix deprecation warnings 2015-07-24 22:16:35 +02:00
Simon Sapin
903a608c6a Upgrade to rustc 1.3.0-dev (e4e93196e 2015-07-14) 2015-07-24 22:11:03 +02:00
Martin Robinson
1aedead955 Have BufferMap store NativeSurfaces and rename to SurfaceMap
We currently store LayerBuffers, because previously NativeSurfaces did
not record their own size. Now we can store NativeSurfaces directly,
which saves a bit of space in the surface cache and allows us to create
LayerBuffers only in the PaintTask.

This also means that instead of sending cached LayerBuffers, the
compositor can just send cached NativeSurfaces to the PaintTask.
2015-07-24 11:12:39 -07:00
bors-servo
cdcecaef04 Auto merge of #6726 - samfoo:int32-panic, r=Ms2ger
Eval'ing int32's in devtools panic'd

Eval'ing int32 in devconsole panics. Resolves #6725

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6726)
<!-- Reviewable:end -->
2015-07-24 04:10:50 -06:00
Sam Gibson
17e6b08265 Eval'ing int32's in devtools panic'd 2015-07-24 19:52:19 +10:00
bors-servo
3c88d3418c Auto merge of #6720 - mbrubeck:wpt-release, r=pcwalton
Update WPT test expectations for --release builds

r? @pcwalton or @larsbergstrom

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6720)
<!-- Reviewable:end -->
2015-07-24 01:11:48 -06:00
Matt Brubeck
859f99d5e8 Update WPT test expectations for --release builds 2015-07-23 22:57:54 -07:00
bors-servo
d3a36fafd9 Auto merge of #6471 - mbrubeck:bidi, r=pcwalton
Basic support for bidirectional text

This re-orders text according to the Unicode bidirectional layout algorithm, using the [unicode-bidi](https://github.com/mbrubeck/unicode-bidi) crate.  It uses the natural order of the text based on Unicode character properties and the CSS `direction` property.

This does not yet support the CSS `unicode-bidi` property or the HTML `dir` attribute, but these should be straightforward to add.

r? @pcwalton.  Also depends on servo/unicode-bidi#4.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6471)
<!-- Reviewable:end -->
2015-07-23 21:20:49 -06:00
Matt Brubeck
dfac8ce4a1 Basic support for bidirectional text 2015-07-23 20:05:55 -07:00
bors-servo
b386d7ae44 Auto merge of #6718 - akiss77:aarch64-support, r=jdm
Add aarch64-unknown-linux-gnu support

* Adding dependencies
* Replacing `i8` with `libc::c_char` to build properly on platforms
  where char is unsigned.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6718)
<!-- Reviewable:end -->
2015-07-23 17:17:18 -06:00
Akos Kiss
fa86ea4f6f Add aarch64-unknown-linux-gnu support
* Adding dependencies
* Replacing `i8` with `libc::c_char` to build properly on platforms
  where char is unsigned.
2015-07-23 22:52:17 +00:00
bors-servo
e32068d17b Auto merge of #6716 - farodin91:filereader, r=jdm
Implement FileReader.{readAsText,readAsDataUrl}. Fixes #6172



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6716)
<!-- Reviewable:end -->
2015-07-23 14:37:00 -06:00
farodin91
27e760e28d Implement FileReader.{readAsText,readAsDataUrl}. Fixes #6172 2015-07-23 22:33:51 +02:00
Anthony Ramine
389a9ff643 Introduce RootedVec<JS<T>>::r() 2015-07-23 20:56:27 +02:00
bors-servo
f44d75e5b2 Auto merge of #6715 - Ms2ger:layoutelement, r=jdm
Implement more methods on LayoutJS.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6715)
<!-- Reviewable:end -->
2015-07-23 12:40:52 -06:00
Ms2ger
487eef88e3 Move the state getters to LayoutElementHelpers. 2015-07-23 20:30:59 +02:00