Commit graph

114 commits

Author SHA1 Message Date
Tomas Cernaj
18632570cd servo: Merge #8909 - Move ScriptMsg to script_traits crate, Fixes #8833 (from cnaj:msg_refactoring); r=jdm
Review of documentation that was missing needed.

Fixes #8833.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7438bc0425749989b8aab084a34ff3fff2ea6679
2015-12-10 10:55:44 +05:01
David Zbarsky
dcbe691e75 servo: Merge #8740 - Implement IsPointInPath for Canvas (from dzbarsky:ispointinpath); r=frewsxcv
Source-Repo: https://github.com/servo/servo
Source-Revision: 98972d04342602610a7465de7b0639e2b9c1dcf3
2015-12-06 06:50:23 +05:01
David Zbarsky
68a759bf6a servo: Merge #8728 - Reset canvas state when changing bitmap dimensions (from dzbarsky:reset_bitmpa); r=dzbarsky
Ran http://mxr.mozilla.org/servo/source/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html?force=1#88 to confirm that this code is being executed, but the test still fails because the font isn't implemented and the expando doesn't get reset.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2bb34feb3ec8ba7aa3161ebc52f2ae9595192238
2015-12-04 11:28:55 +05:01
David Zbarsky
d244eb7ce6 servo: Merge #8729 - Update Canvas webIDL to spec (from dzbarsky:canvas_webidl); r=dzbarsky
Source-Repo: https://github.com/servo/servo
Source-Revision: 2d164f2bebb63aa35269a4c3355beea3bbdcff01
2015-11-29 09:03:28 +05:01
Simon Sapin
22d57945e8 servo: Merge #8656 - Implement currentColor for Canvas colors (from servo:canvas-currentcolor); r=SimonSapin
Fixes #7120.

This is #7120 by @dzbarsky, with one tidy error fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6ef6d664aab9368e69f0c9bc9c4c37ad22d79897
2015-11-23 22:40:57 +05:01
Keith Yeung
5b3f4b220a servo: Merge #8530 - Split ConstellationMsg into ScriptMsg and CompositorMsg (from KiChjang:split-constellation-msg); r=jdm
Fixes #8356.

Source-Repo: https://github.com/servo/servo
Source-Revision: acbe41305230a926458596444ca955eff063d9dd
2015-11-19 04:10:20 +05:01
Ms2ger
f0af48c824 servo: Merge #8569 - Rustfmt some of script (from Ms2ger:fmt-script); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: 7a87312121a69b590b364f9b5095f3145554e24b
2015-11-18 15:15:30 +05:01
Alan Jeffrey
f8093754b7 servo: Merge #8477 - Opaque DOMString (from asajeffrey:opaque-domstring); r=asajeffrey
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 62acdd303b78951885c2c90747b31f318907d6c9
2015-11-13 06:48:30 +05:01
Ms2ger
7cb2a13f43 servo: Merge #8312 - Make DOMString a newtype around String, rather than a typedef (from Ms2ger:DOMString); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: abfd1fb1bf071961bc8a581927eaa96a2d3e2cba
2015-11-04 16:18:41 +05:01
David Zbarsky
ed7fd17b12 servo: Merge #8305 - Get rid of a bunch of explicit derefs (from dzbarsky:roots); r=Ms2ger,
Source-Repo: https://github.com/servo/servo
Source-Revision: 4b9fa13f2f6a1aa38d180367426498f01f6414c9
2015-11-04 10:34:54 +05:01
rohan.prinja
e8b504412b servo: Merge #8221 - move modules around (from ajnirp:8130-reorganise); r=jdm
for #8130

Source-Repo: https://github.com/servo/servo
Source-Revision: daad09d44245228fba9118316937add71bec7c58
2015-11-04 02:27:02 +05:01
Eli Friedman
3d84958c1f servo: Merge #8056 - Fix the implementation of JSTraceable for RefCell (from eefriedman:trace-refcell); r=jdm
The existing implementation could panic; make sure that doesn't
happen by requiring that the contents of a RefCell are trivially
traceable (i.e. the value don't contain any traceable objects).

I'm not sure whether the TriviallyJSTraceable trait is actually
worthwhile; maybe we should just never use RefCell in the DOM.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4f51710ed387baa1ad0a6e4cdb0fc5eee44093d5
2015-11-03 06:38:40 +05:01
nxnfufunezn
cba28409a5 servo: Merge #8262 - Removed JS::root #8251 (from nxnfufunezn:Remove_JS_root); r=Ms2ger
Fixes #8251

r? @Ms2ger

Source-Repo: https://github.com/servo/servo
Source-Revision: 37c03c78165fbb77eb024f2c3376d5e33cd7e446
2015-10-31 17:55:23 +05:01
Eli Friedman
362ec775db servo: Merge #8073 - Make unrooted_must_root a bit more aggressive (from eefriedman:root-lint); r=Manishearth
Basically, instead of trying to check for specific kinds of statements,
just check the types of all local variables.

Also included are some commented-out proposals for some slightly more
aggressive lints which might be useful (but trigger a little too
frequently at the moment).

Source-Repo: https://github.com/servo/servo
Source-Revision: bb88832c078fbb14fa03c413fac1252b2b755015
2015-10-24 20:20:04 -05:00
Nathan Froyd
f9be87f294 servo: Merge #8086 - add (un)premultiply tables for canvas {Get,Put}ImageData operations (from froydnj:premultiply-tables); r=jdm
Pretty straightforward use of lookup tables to replace a bunch of expensive float operations.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9a34decec295563d3b4050bc53daad142450e0d5
2015-10-21 17:48:49 -06:00
Brandon Fairchild
c830d87e38 servo: Merge #8115 - Don't require the CanvasFillOrStrokeStyle enum to be public (from nerith:canvas); r=jdm
CanvasFillOrStrokeStyle is only used in a single file,
so it does not need to be a public enum.

Fixes #8105.

Source-Repo: https://github.com/servo/servo
Source-Revision: 252e73ff9b43abdeee4eac37702ef2e3adef0062
2015-10-21 08:32:36 -06:00
Anthony Ramine
bb8125a3da servo: Merge #8041 - Introduce trait Castable (from nox:castable); r=jdm
Removes all those messy FooCast structures in InheritTypes.rs.

Source-Repo: https://github.com/servo/servo
Source-Revision: 674589c370d978f543e71f995d58c5b28e6e9842
2015-10-21 07:57:32 -06:00
Eli Friedman
7cf10cb041 servo: Merge #8026 - Fix uses of JS<T> as a type on the stack (from eefriedman:js-rooting); r=nox
`JS<T>` belongs on the heap, and only on the heap.  This is a collection of fixes so that code uses either `Root<T>` or `&T` to pass around garbage-collected pointers.

Ideally, we could completely ban constructing a `JS<T>` outside of constructor functions, but we aren't quite there yet.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7c7dbde0f4372037aac3635b8d81531ca9cdced3
2015-10-16 08:05:59 -06:00
Eli Friedman
9485a11014 servo: Merge #7997 - Link to the HTML multipage spec, not the single-page one (from eefriedman:html-spec-multipage); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 9fca41c7a7498cb6e27b914c45290dc4639d6f8b
2015-10-13 12:54:10 -06:00
Anthony Urena
1481b17cee servo: Merge #7882 - Refactor Error enum usage to consistently be qualified (from anthgur:consistent-enum-use); r=Ms2ger
Closes #7869

Source-Repo: https://github.com/servo/servo
Source-Revision: f5cd90805ec67fb52f73ec4cef9cef881a67522d
2015-10-06 04:58:17 -06:00
Emilio Cobos Álvarez
c4b09b9cb7 servo: Merge #7682 - webgl: Support texImage2D with a canvas as an argument (from emilio:webgl-texture2d); r=jdm
This involved some refactoring of the 2d context code, which lead to some more test passed there.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0f8c1b460100f226df954a3924598434f3dda9b2
2015-09-25 10:52:52 -06:00
Ravi Shankar
7d512d50d1 servo: Merge #7698 - sorted the declarations in various files (from Wafflespeanut:sorting); r=frewsxcv
This is a direct extract from my abandoned PR for a lint (#7546), along with some rather clumsy modifications (only on `components/script/dom/mod.rs` and `components/style/lib.rs`), because I had to sort some of the files again to make peace with tidy, which hasn't been educated about sorting yet!

Source-Repo: https://github.com/servo/servo
Source-Revision: a7208869f2903e36f9b2f540b55b50283d7df466
2015-09-23 15:02:56 -06:00
Brandon Fairchild
f7fb1e4b4a servo: Merge #7662 - Check for multiple import blocks separated by whitespace (from nerith:import); r=frewsxcv
Fixes #7381.

Source-Repo: https://github.com/servo/servo
Source-Revision: a0d3c9223f09757124b1520c4f17e94fa8bbe249
2015-09-19 13:34:51 -06:00
Thiago Pontes
cfdc5c2426 servo: Merge #7522 - Make use of FromStr and Default traits in lib canvas (from thiagopnts:from-str-canvas); r=Manishearth
fixes #7517

Source-Repo: https://github.com/servo/servo
Source-Revision: d3efcb707c6dc26b171ffada2e1ca48d5abbb4b6
2015-09-03 12:36:23 -06:00
Brandon Fairchild
506a0fb2e2 servo: Merge #7499 - Improve style nit check for space after a comma (from nerith:style); r=metajack
Fixes #7345.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3424e234c8c86e787edfce6dc63ed155617e0e85
2015-09-02 12:05:58 -06:00
Corey Farwell
bd3049eecd servo: Merge #7431 - Merge adjacent identical impl sections (from frewsxcv:dom-methods-cleanup); r=Ms2ger
Prior to #7416 and #7401, many of these `impl` sections were not
identical

Source-Repo: https://github.com/servo/servo
Source-Revision: 2f227a034a12158e2592b645c061d92c87c8eba6
2015-08-28 08:49:00 -06:00
Anthony Ramine
c327bc7867 servo: Merge #7416 - Make the traits for the IDL interfaces take &self (from nox:methods-ref); r=frewsxcv
Source-Repo: https://github.com/servo/servo
Source-Revision: 71b277d5675556e61a82ae9dbf3105449c3a8275
2015-08-27 15:08:41 -06:00
Anthony Ramine
d2ee701ee9 servo: Merge #7401 - Remove helper traits (from nox:rm-helpers); r=Manishearth
Now that `JSRef<T>` is gone, there is no need to have helper traits.

Source-Repo: https://github.com/servo/servo
Source-Revision: 909429702972d53bf02dfe9a4aa93ea0cb588cf4
2015-08-27 09:38:48 -06:00
João Oliveira
d39bd47b08 servo: Merge #7361 - make dom_struct derive HeapSizeOf (from jxs:master); r=Ms2ger
closes #7357

Source-Repo: https://github.com/servo/servo
Source-Revision: 532fd19d69fd11d06bca7539c722a46fab2c4419
2015-08-27 02:35:45 -06:00
ecoal95
d21c34c8ad servo: Merge #6770 - Add multiple WebGL calls and improve error detection (from emilio:webgl-again); r=jdm
Since it probably won't merge until multiprocess lands, I plan to use this PR to keep improving WebGL support until it can land.

Main TODOs are integration of tests, since it seems https://github.com/KhronosGroup/WebGL/issues/1105 is going nowhere, adding missing calls and proper painting via native surfaces instead of readback.

I can't resolve conflicts right now because of time but I will do it soon.

Source-Repo: https://github.com/servo/servo
Source-Revision: a109a333f1f95d4fc677b29e3613b2615514c080
2015-08-25 09:23:00 -06:00
Johann Tuffe
5c3a5a67f5 servo: Merge #7265 - Add alphabetical order check for use statements (from tafia:tidy-use); r=Ms2ger
close #7112

Source-Repo: https://github.com/servo/servo
Source-Revision: a5fbb2f2a6fa79755f975feff2435abb6a5dd0e9
2015-08-20 07:43:56 -06:00
Josh Matthews
6a81d499fc servo: Merge #7203 - Add automated style nit checks to test-tidy (from jdm:style); r=Ms2ger
Expands on the work by @wilmoz and cleans up the existing errors. Closes #7180. Closes #7111.

Source-Repo: https://github.com/servo/servo
Source-Revision: e74825f9fde8e222f4ba9bb24b2c2a3864c73e5f
2015-08-16 08:37:40 -06:00
Bogdan Cuza
b3e4dcef5f servo: Merge #7097 - Measure heap memory usage for more types. Fixes #6951 (from boghison:memtypes); r=jdm
Also adds HeapSizeOf implementations/derive for some types. I've used "Cannot calculate Heap size" as a reason everywhere, because my imagination is rather limited. If you'd like me to change this message for specific types, please write something like this: "Trusted - Cannot calculate Heap size for Trusted" so that it would be easier for me to replace them through a script :)

Source-Repo: https://github.com/servo/servo
Source-Revision: a03616f379c255cc6c9b6e1d04dd7d98bd9926ce
2015-08-13 13:16:14 -06:00
David Zbarsky
4db3b420d2 servo: Merge #7092 - Clean up and fix PutImageData (from dzbarsky:putimagedata); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 6a8bc8528498c0cbb2e50567d765a989cde2d115
2015-08-09 07:00:56 -06:00
David Zbarsky
68cd6176d8 servo: Merge #6975 - Fix getImageData with sizes < 1 pixel (from dzbarsky:get-tiny); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: dbce4c5bd8ec005ba78ac8c2f8754bd137c87f25
2015-08-09 06:32:30 -06:00
David Zbarsky
406ae48819 servo: Merge #6970 - GetImageData should return un-premultiplied alpha values (from dzbarsky:getimagedata); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 4726f58d15a6bfed9614b7ceaaab7765a5c01d03
2015-08-06 04:34:20 -06:00
David Zbarsky
1aa0c42fef servo: Merge #6985 - Refactor DrawImage implementations to avoid code duplication (from dzbarsky:drawimage_refactor); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 1b54e9c30c12b42d2a6eaf5b81b88a0f4e02ebb9
2015-08-06 00:24:02 -06:00
David Zbarsky
37af7f07c4 servo: Merge #6974 - Fix createImageData with sizes < 1 pixel (from dzbarsky:tiny-create); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: debd7d87d61e6e6d772181a1076ee29519e479c7
2015-08-05 11:40:20 -06:00
David Zbarsky
868cce00b8 servo: Merge #6971 - Make createRadialGradient throw for negative radii (from dzbarsky:negative-radius); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 95269bba39313e7a221947a6b20fecc92e87a201
2015-08-05 10:42:57 -06:00
David Zbarsky
8b5d35a4ff servo: Merge #6943 - Clean up some methods in CanvasRendeingContext2D (from dzbarsky:context); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 447c991ebb8cca1601d7c5ecde5dffb14199ddca
2015-08-04 00:46:09 -06:00
Patrick Walton
6d44729f83 servo: Merge #6597 - script: Make the ImageCacheTask use IPC (from pcwalton:image-cache-ipc); r=jdm
This necessitated getting rid of the boxed trait object that was being
be passed between the script task and the image cache task.

r? @jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: e13ebf712de444132a6cc90f394c121d8d751c4c
2015-07-27 00:08:15 -06:00
Patrick Walton
d4fd20dc7c servo: Merge #6616 - script: Make most of 2D canvas and WebGL run over IPC (from pcwalton:canvas-webgl-ipc); r=jdm
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

Source-Repo: https://github.com/servo/servo
Source-Revision: 1764267379a00b96a1df89f3917299a0c6fd325c
2015-07-25 01:50:31 -06:00
Glenn Watson
0686325db5 servo: Merge #6566 - Add servo Image type. Remove rust-png dependency from script, gfx, layout (from glennw:image-deps); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 3a3ac2281b2d137ba620194e037ec671b746530c
2015-07-06 13:45:04 -06:00
David Winslow
b9c1f245a1 servo: Merge #6529 - Refactor #[jstraceable] to #[derive(JSTraceable)] (from dwins:master); r=Manishearth
fixes #6524.  I had to make an additional change not mentioned in the ticket - adding the `#[feature]` to enable deriving custom traits but I assume that's expected at this time.

Source-Repo: https://github.com/servo/servo
Source-Revision: bbb39082e0f640400546d2084a450a8675820a82
2015-07-01 18:27:40 -06:00
Hyowon Kim
423cdb8c21 servo: Merge #6410 - Create pattern from HTMLCanvasElement or CanvasRenderingContext2D (from hyowon:create_pattern); r=pcwalton
r? @nox @pcwalton
cc @yichoi

Source-Repo: https://github.com/servo/servo
Source-Revision: 95d643c995a271fac11ab3d9aac97f2d0aac8934
2015-06-24 00:39:48 -06:00
Hyowon Kim
afce9d1b30 servo: Merge #6413 - Check invalid values for the shadow attributes (from hyowon:invalid_shadow_attrs); r=Ms2ger
I left out checking invalid values when setting the shadows attributes.
r? @nox @pcwalton
cc @yichoi

Source-Repo: https://github.com/servo/servo
Source-Revision: 02303941bef5f5bbdbec750ab0dfa0b77f32345a
2015-06-20 06:44:08 -06:00
Michael Wu
7512d04e93 servo: Merge #6150 - Upgrade to Spidermonkey 39 (from servo:smupgrade3); r=mbrubeck
> Here it is.
>
> ~~There's two major things that are unfinished here:~~
> - ~~Dealing with the unroot_must_root lint. I'm not sure about the value of this lint with the new rooting API.~~ Done.
> - ~~Updating the Cargo.locks to point to the new SM and SM binding.~~ Done.
>
> I also included my fixes for the rust update, but these will disappear in a rebase. A rust update is necessary to support calling `Drop` on `Heap<T>` correctly when `Heap<T>` is inside a `Rc<T>`. Otherwise `&self` points to the wrong location.
>
> Incremental GC is disabled here. I'm not sure how to deal with the incremental barriers so that's left for later.
>
> Generational GC works. SM doesn't work without it.
>
> The biggest change here is to the rooting API. `Root` was made movable, and `Temporary` and `JSRef` was removed. Movable `Root`s means there's no need for `Temporary`, and `JSRef`s aren't needed generally since it can be assumed that being able to obtain a reference to a dom object means it's already rooted. References have their lifetime bound to the Roots that provided them. DOM objects that haven't passed through `reflect_dom_object` don't need to be rooted, and DOM objects that have passed through `reflect_dom_object` can't be obtained without being rooted through `native_from_reflector_jsmanaged` or `JS::<T>::root()`.
>
> Support for `Heap<T>` ended up messier than I expected. It's split into two commits, but only because it's a bit difficult to fold them together. Supporting `Heap<T>` properly requires that that `Heap::<T>::set()` be called on something that won't move. I removed the Copy and Clone trait from `Heap<T>` so `Cell` can't hold `Heap<T>` - only `UnsafeCell` can hold it.
>
> `CallbackObject` is a bit tricky - I moved all callbacks into `Rc<T>` in order to make sure that the pointer inside to a `*mut JSObject` doesn't move. This is necessary for supporting `Heap<T>`.
>
> `RootedCollectionSet` is very general purpose now. Anything with `JSTraceable` can be rooted by `RootedCollectionSet`/`RootedTraceable`. Right now, `RootedTraceable` is only used to hold down dom objects before they're fully attached to their reflector. I had to make a custom mechanism to dispatch the trace call - couldn't figure out how to get trait objects working for this case.
>
> This has been tested with the following zeal settings:
>
> GC after every allocation
> JS_GC_ZEAL=2,1
>
> GC after every 100 allocations (important for catching use-after-free bugs)
> JS_GC_ZEAL=2,100
>
> Verify pre barriers
> JS_GC_ZEAL=4,1
>
> Verify post barriers
> JS_GC_ZEAL=11,1

Source-Repo: https://github.com/servo/servo
Source-Revision: e7808c526c348fea5e3b48af70b7f1a066652097
2015-06-19 16:46:55 -06:00
ecoal95
b32a9cd993 servo: Merge #6423 - Use euclid from crates.io (from emilio:euclid); r=glennw
Sorry for not doing it yesterday, I couldn't.

cc @metajack @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 4ebb95ccd8e034007eacb447a054919ef4af2bf7
2015-06-18 20:50:22 -06:00
Corey Farwell
711c6ca962 servo: Merge #6349 - rust-geom API changes (from frewsxcv:geom-api-changes); r=pcwalton
Shouldn't be merged until these have merged:

https://github.com/servo/rust-geom/pull/81

https://github.com/ecoal95/rust-offscreen-rendering-context/pull/13

https://github.com/servo/rust-layers/pull/178

~~I'll also need to update the Cargo lock files once they merge~~

Source-Repo: https://github.com/servo/servo
Source-Revision: cfcd8589d06935f83b903f76477ea03e4d4652d0
2015-06-13 13:52:07 -06:00
Hyowon Kim
97b64f7e8d servo: Merge #6157 - Implement pattern fill style for canvas (from hyowon:canvas_pattern_fill); r=nox
Issue #6056
Depends on servo/rust-azure#160

Source-Repo: https://github.com/servo/servo
Source-Revision: 9474e62d38f61f2b3a385ca32d64cab975b014ce
2015-06-13 01:49:50 -06:00