Commit graph

64 commits

Author SHA1 Message Date
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
3890fca29d servo: Merge #8428 - Update js (from Ms2ger:conversions); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: b40882093a306032d38ad02e30f0095e0a49ec21
2015-11-13 00:44:52 +05:01
Roman Klauke
41eff4e488 servo: Merge #8408 - rename WebSocket::Send_Impl (from romankl:websocket-rename-impl); r=jdm
Previos: `Send_Impl`, now: `send_impl`.

Closes: #8345
Source-Repo: https://github.com/servo/servo
Source-Revision: 9bcae9a866b85a90b75b9cbfcb9058287c1c0871
2015-11-08 20:02:35 +05:01
Ms2ger
f931de9eb9 servo: Merge #8346 - Cleanup WebSocket::Send_Impl (from Ms2ger:send_impl); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: e3484315ddb2c6f4efeec50ef5b5abc2b411601c
2015-11-05 16:52:09 +05:01
Nikki
ebed337ece servo: Merge #8218 - #8213: Implement Blob variant of WebSocket.send (from nikkisquared:master); r=eefriedman
I'm working on resolving https://github.com/servo/servo/issues/8213 as per the spec online and feedback in the servo channel. Note that currently I cannot build (and thus test) my code, so this is a bit of a rough first draft. I'd still like feedback on my progress, and I hope that there is another way for my code to be tested.

Source-Repo: https://github.com/servo/servo
Source-Revision: 021f441d24893861d45fec0cef7ed88dc9e6543a
2015-11-05 09:55:27 +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
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
Jim Berlage
eddf779c4f servo: Merge #7947 - Adds bufferedAmount to Websocket (fixes #7856) (from jimberlage:7856/buffered-amount); r=jdm
This adds a readonly bufferedAmount attribute to Servo's websocket implementation.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0e4abddd37b1808033ad8811552575713fe7fa5a
2015-10-16 12:56:44 -06:00
Prabhjyot Singh Sodhi
13eee003f0 servo: Merge #7871 - Send reason in the Websocket close handshake (from psdh:sendReason); r=jdm
Fixes #7862

Source-Repo: https://github.com/servo/servo
Source-Revision: 26902a9a9b9266d7ffe13e9e1eb2c70fb0b70ae9
2015-10-13 17:25:27 -06:00
Jim Berlage
f76cf699aa servo: Merge #7885 - Creates empty string when passed null (from jimberlage:7858/null-message); r=Ms2ger
This should fix #7858.  An empty `USVString` is now used when `data` is `None`.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8c81d9ab28132cff1d792b5c99e98bea6f7870bd
2015-10-09 09:02:45 -06:00
vectorijk
35670c2eb3 servo: Merge #7889 - Fix #7855 Implement port blocking For WebSocket connection algorithm (from vectorijk:port-blocking-7855); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: e4b02cc981ed095c2cf3816d26ad32353357e64e
2015-10-06 14:07:08 -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
Roman Klauke
78f3bda91c servo: Merge #7880 - remove data field from websockets (from romankl:websockets-data-field); r=jdm
The data field is currently not used (no reads/ writes). This commit
removes this temp. field.

Ref.-Issue: #7859

Source-Repo: https://github.com/servo/servo
Source-Revision: 94816bb3b42e50127db56e64086843b14614ca88
2015-10-05 13:26:30 -06:00
Ravi Shankar
2af24572c9 servo: Merge #7741 - fixed the deprecated as_slice warning (from Wafflespeanut:warning_fix); r=jdm
I've put its original implementation from [`core/option.rs`](http://doc.servo.org/src/core/option.rs.html#692) instead of the dear departed `as_slice`

Source-Repo: https://github.com/servo/servo
Source-Revision: b7c003f1584375ba37006fedd773141a3d32d99c
2015-09-25 13:47:37 -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
Anthony Ramine
6953aa403a servo: Merge #7606 - Move the type_id fields to DOMClass (from nox:move-typeid); r=jdm
Cc @michaelwu.

Source-Repo: https://github.com/servo/servo
Source-Revision: d5ee58caf269779e86b2efc50ddf37d3e4eba9b9
2015-09-13 11:53:42 -06:00
Corey Farwell
de4ce06ffa servo: Merge #7483 - Enforce linking to spec for method implementations via macros (from frewsxcv:macro-spec-links); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 4984aaf8bfca0698a132e10e9f48cef42d1b8302
2015-08-31 21:17:54 -06:00
benshu
0d2fab2fb7 servo: Merge #7341 - Add profiling to the script event loop (#5331) (from benschulz:script-profiling); r=Manishearth
I fear the category names are unimaginative; in some cases they may even be misleading or downright incorrect. Requests to rename categories as well as any other feedback are highly appreciated.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6431e8da43817e8a6b1e4757afbcf45c1a629707
2015-08-27 17:00:15 -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
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
Manish Goregaokar
d4e45231ec servo: Merge #7224 - Integrate clippy into Servo; cleanup some of script (from Manishearth:clippy); r=Ms2ger
The integration is off by default for now. You can try it out with `./mach build --features "script/plugins/clippy"`.

We're using a branch of clippy with some of the lints changed to Allow, either because they don't apply to us, or because they're noisy and dwarf other warnings (but still should be fixed)

After going through the rest of Servo's warnings I'll figure out which lints we should be keeping.

There's a cargo bug with optional deps that makes it hard for this to work with Cargo.lock -- so this PR contains no changes to lockfiles (and running the build with clippy on may dirty the lockfile, though it gets fixed later)

Source-Repo: https://github.com/servo/servo
Source-Revision: 50e1c967e4299c1515575f73d407f5f6b977d818
2015-08-18 08:15:51 -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
Tom Jakubowski
b5d4709aa6 servo: Merge #7214 - Implement WebSocket#binaryType (from tomjakubowski:websocket-binaryType); r=Ms2ger
Closes #7098

Source-Repo: https://github.com/servo/servo
Source-Revision: 7c63c7d7c109165b9584da5b31658ff89af21ef9
2015-08-15 19:57:58 -06:00
Ravi Shankar
35668fd5a5 servo: Merge #7006 - Splitting ScriptMsg into various enums (from Wafflespeanut:script_cleanup); r=jdm
... for #3734, which is also one of the oldest issues. (/cc @jdm)

Source-Repo: https://github.com/servo/servo
Source-Revision: 6a52ec94840fbaf43a29d76879e2b59542a9963d
2015-08-15 03:48:47 -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
Ms2ger
099b2bd2fe servo: Merge #7066 - Dispatch message events for WebSocket (from Ms2ger:ws-event); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: d8b4611a79fbb8c4675d9de763280ada34e63b13
2015-08-08 03:00:50 -06:00
James Graham
a77654c4c2 servo: Merge #6416 - Use hosts-replaced URL only when loading resources (from jgraham:hosts_replaced); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 8602d01af2b2081ea1e9d600abdb1ea609a65038
2015-08-05 08:01:03 -06:00
Bogdan Cuza
e9c4da1e57 servo: Merge #6699 - Tidy check for FooMethods in components/script/dom/*.rs and color for tidy (from boghison:tidyspec); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 14ccb22e679722ed3374c8facec21adcf0f2b247
2015-07-28 08:56:39 -06:00
Ms2ger
21d6151f37 servo: Merge #6706 - Move the WebSocket constructor logic out of WebSocket::new (from Ms2ger:ctor); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: c24d37dfccc0a57fa37efc56d08de2679db963e1
2015-07-23 01:44:20 -06:00
Ms2ger
486816229b servo: Merge #6635 - Spawn a thread for WebSocket messages (from Ms2ger:ws-task); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 6fd31867baabd36a7a6fee5541c0d9816d877138
2015-07-22 14:26:21 -06:00
Josh Matthews
0c8cda2cbb servo: Merge #6694 - Reject websocket protocol requests that don't match https://tools.iet… (from jdm:websocketprotocol); r=Ms2ger
…f.org/html/rfc6455#section-4.1 .

Source-Repo: https://github.com/servo/servo
Source-Revision: 6b4f1a42f08f66519af310b7c7777d77cc3d0834
2015-07-22 09:44:34 -06:00
Ms2ger
cd719fa849 servo: Merge #6647 - Don't try to send a message in WebSocket#close if the sender isn't present (from Ms2ger:ws-send-closing-closed); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 7e91577d0ad6ba539ef70ff74cde100c16655d35
2015-07-16 02:27:13 -06:00
Ms2ger
a871d28906 servo: Merge #6634 - Remove parse_web_socket_url in favour of functions in rust-websocket (from Ms2ger:ws-parse); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: 8fa6e0abdc7a346101ebf6f4b6983a096675bb7c
2015-07-14 23:37:57 -06:00
Ms2ger
a3f8c64cfa servo: Merge #6622 - Throw an InvalidStateError from WebSocket#send when it is called too early (from Ms2ger:send-invalid-state); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: a2903091e4ff06a1de8792bb6b09cf888c1edbfc
2015-07-14 03:34:47 -06:00
Ms2ger
8985822b47 servo: Merge #6620 - Stop panicking while establishing a WebSocket connection (from Ms2ger:ws-crash); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: d91a6f3834aa7fbf47148480e16d06d9e3891340
2015-07-14 02:06:17 -06:00
Josh Matthews
98484aa7c5 servo: Merge #6611 - Add Origin header to WebSocket connections (from jdm:websocketorigin); r=jdm
Closes #6532.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0fb9f22ff7622940669faf4ec25e9bb9856c5def
2015-07-13 23:39:16 -06:00
Ms2ger
63ad015327 servo: Merge #6610 - Replace WebSocketTask::Open by ConnectionEstablished (from Ms2ger:task-readystate); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 12195a5c4ac08f1e6eeaf8888c279fea8e5be48a
2015-07-13 02:47:16 -06:00
Ms2ger
e2555f39eb servo: Merge #6609 - Return the parsed URL from WebSocket#url (from Ms2ger:ws-url); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: c2dbc4587f70a15f0acefcff214c649d009c2f76
2015-07-13 00:24:35 -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
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
Jinwoo Song
787247886d servo: Merge #6397 - WebSocket constructor should not panic (from servo:ws-connect); r=Ms2ger
Make an early return when the WebSocket connection fails in the constructor.
Also let the WebSocket connection to be closed when the connection could
not be established.

Fixes #6082.

Source-Repo: https://github.com/servo/servo
Source-Revision: a5d76e4b2c6ae8e2db82fc5156ad1bebf7961f80
2015-06-16 01:47:10 -06:00
Ms2ger
3e4e83073b servo: Merge #6353 - Revert "WebSocket constructor should not panic" (from servo:revert); r=Ms2ger
This reverts commit 877c369e0bc5db4286457be36d015eeb1f0ae2f2.

Source-Repo: https://github.com/servo/servo
Source-Revision: 85d839fb5c6ff023897828b0873caa8972842969
2015-06-12 02:44:37 -06:00
Jinwoo Song
fb5908901f servo: Merge #6338 - WebSocket constructor should not panic (from servo:ws-connect); r=Ms2ger
Make an early return when the WebSocket connection fails in the constructor.
Also let the WebSockect connection to be closed when the connection could
not be established.

Fixes #6082.
Fixes #6086.

Source-Repo: https://github.com/servo/servo
Source-Revision: a3eb253bdce7ed4ad5bcc2c2e7af9cfe01826d99
2015-06-11 05:58:56 -06:00
Corey Farwell
333cc6c59d servo: Merge #6174 - Reduce max line length from 150 to 120 characters (from frewsxcv:cleanup-long-lines); r=SimonSapin
Part of https://github.com/servo/servo/issues/6041

Source-Repo: https://github.com/servo/servo
Source-Revision: 542519ebfd073662bc9421ac5fa0aa01ebc0d6fe
2015-05-24 18:27:26 -05:00