Commit graph

3252 commits

Author SHA1 Message Date
Nicholas Nethercote
67e7436cb8 Ignore CollectReport messages when shutting down the LayoutTask.
Prior to this change, a panic would occur if a CollectReport message was
received while the LayoutTask was shutting down. Now it just gets
ignored.
2015-06-10 21:18:39 -07:00
bors-servo
fdeebf86a1 Auto merge of #6309 - nnethercote:instrument-freetype, r=glennw
This will allow reporting of memory usage by FreeType instances, which
are measured in the MiBs for LayoutWorker threads.

This change also makes FreeType allocations happen with jemalloc instead
of the system malloc, which is a good thing.

Finally, the change documents some dubiousness involving
FontContextHandle.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6309)
<!-- Reviewable:end -->
2015-06-10 16:53:55 -06:00
Nicholas Nethercote
1553fada53 Instrument FreeType allocations.
This will allow reporting of memory usage by FreeType instances, which
are measured in the MiBs for LayoutWorker threads.

This change also makes FreeType allocations happen with jemalloc instead
of the system malloc, which is a good thing.

Finally, the change documents some dubiousness involving
FontContextHandle.
2015-06-10 15:48:19 -07:00
Glenn Watson
899ab226de Updates for changes in rust-geom and rust-layers 2015-06-11 07:19:58 +10:00
Patrick Walton
e42011cd53 Revert "Updates for changes in rust-geom and rust-layers" 2015-06-10 14:14:51 -07:00
Patrick Walton
053296e131 Merge pull request #6329 from glennw/remove-generic
Updates for changes in rust-geom and rust-layers
2015-06-10 14:14:24 -07:00
Glenn Watson
8fb29c91e6 Updates for changes in rust-geom and rust-layers 2015-06-11 07:05:56 +10:00
Simon Sapin
ac3d78c309 Pick up memory safety fix in rust-smallvec 2015-06-10 17:21:07 +02:00
bors-servo
35000a9b85 Auto merge of #6317 - frewsxcv:rm-util-crate-reexports, r=Ms2ger
The util component specified fnv and smallvec as dependencies and publicly
reexported both of them. Several other components utilized these reexports,
presumably because fnv and smallvec used to live in the tree so reexporting
made the transition easier.

These indirect dependencies through the util component are unnecessary.

This commit removes the fnv & smallvec crate reexports in the util component.
It exchange, it adds fnv & smallvec as dependencies to non-util components
wherever needed. Finally, it removes the fnv dependency from util as it is not
utilized anywhere in the util component.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6317)
<!-- Reviewable:end -->
2015-06-10 08:23:11 -06:00
Corey Farwell
4f47b41fa7 Remove fnv & smallvec crate reexports from util
The util component specified fnv and smallvec as dependencies and publicly
reexported both of them. Several other components utilized these reexports,
presumably because fnv and smallvec used to live in the tree so reexporting
made the transition easier.

These indirect dependencies through the util component are unnecessary.

This commit removes the fnv & smallvec crate reexports in the util component.
It exchange, it adds fnv & smallvec as dependencies to non-util components
wherever needed. Finally, it removes the fnv dependency from util as it is not
utilized anywhere in the util component.
2015-06-10 07:14:55 -07:00
bors-servo
c86e461555 Auto merge of #6323 - Ms2ger:typo, r=SimonSapin
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6323)
<!-- Reviewable:end -->
2015-06-10 07:30:09 -06:00
bors-servo
9df13b9069 Auto merge of #6324 - mmatyas:arm_build, r=Ms2ger
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6324)
<!-- Reviewable:end -->
2015-06-10 06:46:13 -06:00
Mátyás Mustoha
53427f43ab Add ARM build support. 2015-06-10 14:24:57 +02:00
Ms2ger
9ef975d929 Fix a typo in the DOM documentation. 2015-06-10 13:45:05 +02:00
Ms2ger
5149f0e953 Remove null_str_as_empty and null_str_as_empty_ref functions.
With just one caller between the two functions, there doesn't seem to be
much point in having the abstraction.
2015-06-10 13:36:51 +02:00
bors-servo
3ece6bc166 Auto merge of #6318 - Ms2ger:optimize-lookup-prefix, r=nox
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6318)
<!-- Reviewable:end -->
2015-06-10 04:30:38 -06:00
bors-servo
b46ab0c60d Auto merge of #6319 - mukilan:overload-codegen, r=Ms2ger
The cause of the issue is that the index of the overload to be invoked was being derived from the wrong lists (that contain only a subset of the overloads)  - `possibleOverloads` and `interfaceSigs` rather than the `method.signatures()` (which contains all possible overloads).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6319)
<!-- Reviewable:end -->
2015-06-10 03:50:42 -06:00
Mukilan Thiyagarajan
e5b8e81bf8 Fix codegen for overload resolution. Fixes #6300 2015-06-10 14:14:31 +05:30
Ms2ger
749598f5a0 Optimize lookupPrefix. 2015-06-10 10:33:40 +02:00
Corey Farwell
a9b0607bf1 Utilize if let instead of match in a few places 2015-06-09 21:15:38 -07:00
bors-servo
44a4b7886d Auto merge of #6284 - fbau123:6242-testbinding-add-specialoperations, r=nox
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6284)
<!-- Reviewable:end -->
2015-06-09 17:12:43 -06:00
bors-servo
8236221acf Auto merge of #6280 - glennw:transform-transitions, r=nox
Also tidy up some of the ComputedMatrix code.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6280)
<!-- Reviewable:end -->
2015-06-09 16:32:54 -06:00
bors-servo
0dec64caf0 Auto merge of #6289 - nnethercote:unleak-LOCAL_CONTEXT_KEY, r=pcwalton
`LOCAL_CONTEXT_KEY` is currently a `Cell<*mut LocalLayoutContext>`. The use
of the raw pointer means that the `LocalLayoutContext` is not dropped when
the thread dies; this leaks FreeType instances and probably other
things. There are also some unsafe getter functions in `LayoutContext`
(`font_context`, `applicable_declarations_cache` and
`style_sharing_candidate_cache`) that @eddyb says involve undefined
behaviour.

This changeset changes `LOCAL_CONTEXT_KEY` to
`RefCell<Option<Rc<LocalLayoutContext>>>`. This fixes the leak and also
results in safe getters.

(Fixes #6282.)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6289)
<!-- Reviewable:end -->
2015-06-09 15:52:45 -06:00
Francesc Bautista
4ada1e9421 added TestBindingProxy.webidl and testbindingproxy.rs files
added testbindingproxy to dom/mod.rs and fixed unused variable warning of testingbindingproxy.rs

removed useless GlobalField, removed brackets use statements with only 1 element and changed the description of TestBindingProxy.webidl

renamed reflector to reflector_ and removed unused import in testbinding.rs
2015-06-09 23:14:05 +02:00
Glenn Watson
6dd082278d Partial implementation of transform animations spec.
Also tidy up some of the ComputedMatrix code.
2015-06-10 07:07:28 +10:00
Manish Goregaokar
8e4bfe39a2 Remove stray TLS gate 2015-06-10 01:52:08 +05:30
Manish Goregaokar
162ec5da5d Audit and reduce unstable usage in script
Reasons behind existing unstable features:

alloc / OIBIT : For deque (which was just copied from rust's source)

collections:

 - `[T].tail()`
 - `to_lowercase()`

core:

 - `FnBox`
 - `intrinsics::breakpoint()`

exit_status: for setting exit status

path_ext: for `is_dir` and `exists()` (can be done in other ways)

step_by/step_trait

std_misc:

 - Thunk
 - DefaultState and other hasher stuff

zero_one: `num::One`
2015-06-10 01:43:44 +05:30
Manish Goregaokar
1be7f565e4 Audit and reduce unstable usage in script
Reasons behind existing unstable features:

alloc:

 - `Rc.make_unique()` _everywhere_

core:

 - `intrinsics::discriminant_value` for a small optimization. Not sure what's happening here

hash:

 - `Hasher.write_u16` (recently redesigned)
2015-06-10 01:24:03 +05:30
Manish Goregaokar
968b335f9b Audit and reduce unstable usage in script
Reasons behind existing unstable features:

alloc:

 - `Rc.make_unique()`
 - `into_raw` / `from_raw` (naming). All over the bindings code.

collections:

 - `Vec.push_all()`
 - `from_str`
   - can be replaced by `.to_owned()`
 - `from_raw_buf`
   - could be done directly

core:

  - `nonzero`
  - `UnsafeCell` (`as_unsafe_cell`)
  - `Zeroable`
  - `Peekable.is_empty`

std_misc:

  - Handle stuff
2015-06-10 01:20:06 +05:30
Manish Goregaokar
af364a412e Audit and reduce unstable usage in layout
Reasons behind existing unstable features:

alloc:

 - `make_unique()`
 - direct calls into `heap::allocate()`, etc
 - `boxed::into_raw()` (naming)

collections:

 - `slice_chars()` (needs to prove its worth)

core:

 - lots and lots of pointer manip
 - `raw` stuff

std_misc:

 - Handle stuff
 - hasher stuff

str_char:

 - CharRange
2015-06-10 00:54:14 +05:30
Manish Goregaokar
89d4ee88f4 Audit and reduce unstable usage in profile
Reasons behind existing unstable features:

collections:

 - `[T].tail()` (naming)
   - Could use iterators instead
2015-06-10 00:20:12 +05:30
Manish Goregaokar
c73eaefc47 Audit and reduce unstable usage in net
Reasons behind existing unstable features:

std_misc:

 - `Handle` usage (API will be replaced and is perhaps broken)

path_ext:

 - Checking if a file exists. This is doable from the File directly, but slightly longer

core:

 - `FnBox`

alloc:

 - `boxed::into_raw()` (naming)
2015-06-10 00:15:09 +05:30
Manish Goregaokar
86add71b4c Audit and reduce unstable usage in devtools
Reasons behind existing unstable features:

core:

 - `Reflect` / `Any` stuff
2015-06-10 00:14:39 +05:30
Manish Goregaokar
ea9842723d Audit and reduce unstable usage in gfx
Reasons behind existing unstable features:

alloc:

 - weak pointers (may not belong)
 - boxed::into_raw and from_raw (naming)

collections:

 - `Vec.push_all()` (May be replaced)
   - Replace with loop

core:

 - `min_by` (#15311)
 - `PI_2` (naming)

rustc_private:

 - FnVHasher
   - Can be replaced by rust-fnv

std_misc:

 - Hash state stuff (no option here unless we want to stop using it)

str_char:

 - CharRange usage
   - Can be replaced by regular iterators (char_indices)
2015-06-09 23:24:18 +05:30
bors-servo
e09c555a41 Auto merge of #6293 - ecoal95:webgl-objects, r=nox
This commit implements:
* WebGLFramebuffer
* WebGLRenderbuffer
* WebGLTexture

And adds the following methods to `WebGLRenderingContext`:
* create{Texture,Framebuffer,Renderbuffer}
* bind{Texture,Framebuffer,Renderbuffer}
* destroy{Buffer,Texture,Framebuffer,Renderbuffer}

Fixes:
* WebGLUniform location shouldn't inherit from WebGLObject.

Known Issues:
* WebGL objects have to be destroyed on drop, we may want to keep a reference to the context, or maybe a clone of the renderer to achieve this

Also refactors a huge part of the current implementation, to allow
failing on creation of different WebGL objects.

Blocked on https://github.com/servo/gleam/pull/22

A reftest for most of the added functionality is not doable right now,
we need a few more functions in order to upload a texture, for example.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6293)
<!-- Reviewable:end -->
2015-06-09 10:06:37 -05:00
bors-servo
1c636dd2d0 Auto merge of #6310 - frewsxcv:rm-unused-file, r=Manishearth
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6310)
<!-- Reviewable:end -->
2015-06-08 23:29:47 -05:00
Corey Farwell
cf20c89224 Remove unused file: components/util/fnv.rs 2015-06-08 19:22:38 -07:00
Anthony Ramine
2fc4b9d4cd Update gleam to 98f889861aa1c8dee088ac751ab03ca639715bbe 2015-06-08 19:36:07 +02:00
bors-servo
ce30807be5 Auto merge of #6290 - hyowon:fill_or_stroke_style, r=nox
The fillStyle and strokeStyle attributes can be either strings(color), CanvasGradients, or CanvasPatterns.
The current implementation only considers strings(color).
r? @nox @jdm @pcwalton 
cc @yichoi

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6290)
<!-- Reviewable:end -->
2015-06-08 09:49:13 -05:00
bors-servo
96311aa9b7 Auto merge of #6295 - metajack:cargo-cleanup, r=frewsxcv
Overlaps a bunch with #6288. Putting this here so @frewsxcv can take a look and we can figure out how to merge our work together.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6295)
<!-- Reviewable:end -->
2015-06-07 13:15:20 -05:00
Jack Moffitt
b5ebbaefe3 Clean up dependencies. 2015-06-07 12:14:38 -06:00
bors-servo
ca6a34a1cd Auto merge of #6299 - GreenRecycleBin:#6271, r=Ms2ger
get_proto_or_iface_array now returns *mut ProtoOrIfaceArray

Fix #6271

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6299)
<!-- Reviewable:end -->
2015-06-07 10:47:14 -05:00
Eduard Burtescu
00e8e5f77d Use the correct log crate and setup env_logger in main. 2015-06-06 23:20:40 +03:00
bors-servo
78665336e6 Auto merge of #6297 - brson:inline, r=jdm
This results in a 14% compile time improvement.

See https://gist.github.com/brson/b48dd03b06c406be68e6

I'm not suggesting you merge this as-is, but you might consider whether removing some of these is worth pursuing.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6297)
<!-- Reviewable:end -->
2015-06-06 08:25:29 -05:00
bors-servo
493f96b9ab Auto merge of #6291 - Ms2ger:caption, r=nox
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6291)
<!-- Reviewable:end -->
2015-06-06 07:45:43 -05:00
Ms2ger
57f575b5ca Use if let in HTMLTableElement::SetCaption. 2015-06-06 13:19:00 +02:00
ecoal95
9f94d39c9e Implement new WebGL interfaces and methods
This commit implements:
* WebGLFramebuffer
* WebGLRenderbuffer
* WebGLTexture

And adds the following methods to `WebGLRenderingContext`:
* create{Texture,Framebuffer,Renderbuffer}
* bind{Texture,Framebuffer,Renderbuffer}
* destroy{Buffer,Texture,Framebuffer,Renderbuffer}

Fixes:
* WebGLUniform location shouldn't inherit from WebGLObject.

Known Issues:
* WebGL objects have to be destroyed on drop, we may want to keep a reference to the context, or maybe a clone of the renderer to achieve this

Also refactors a huge part of the current implementation, to allow
failing on creation of different WebGL objects.

Blocked on https://github.com/servo/gleam/pull/22

A reftest for most of the added functionality is not doable right now,
we need a few more functions in order to upload a texture, for example.
2015-06-06 12:14:01 +02:00
Hyowon Kim
5bbfb42e90 Replace fill_color and stroke_color with fill_style and stroke_style in CanvasContextState.
The fillStyle and strokeStyle attributes can be either
strings(color), CanvasGradients, or CanvasPatterns.
2015-06-06 16:15:11 +09:00
Daniel Le
15c4f7fe2d Avoid casting in the callers
get_proto_or_iface_array now returns *mut ProtoOrIfaceArray

Fix #6271
2015-06-06 12:22:18 +08:00
Brian Anderson
172fbcad27 Convert inline(always) to inline in CodegenRust and jstraceable.
This results in a 14% compile time improvement.

See https://gist.github.com/brson/b48dd03b06c406be68e6
2015-06-05 14:56:11 -07:00