Commit graph

211 commits

Author SHA1 Message Date
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Michael Wu
941f7dc04b Move EventTargetTypeId/NodeTypeId to DOMClass 2015-09-12 01:09:46 +02:00
Corey Farwell
3a1d140ab5 Enforce linking to spec for method implementations via macros 2015-08-31 21:02:23 -04:00
benshu
1e6a2f08fc Time distribution across script event categories. 2015-08-28 00:52:41 +02:00
Anthony Ramine
709d347872 Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
Anthony Ramine
c831c2c0a5 Remove helper traits
Now that JSRef<T> is gone, there is no need to have helper traits.

On components/script/*.rs:

    # Remove imports.
    /^ *use dom::[a-z]+::\{.*Helpers/ {
        s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/
        s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g
        s/\{([a-zA-Z]+)\}/\1/
        /\{\}/d
        s/::self;$/;/
    }
    /^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d

On components/script/dom/*.rs:

    # Ignore layout things.
    /^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; }

    # Delete helpers traits.
    /^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D

    # Patch private helpers.
    /^impl.*Private.*Helpers/,/^\}$/ {
        s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/
        /^ *(unsafe )?fn .*\(self.*[<&]'a/ {
            s/&'a /\&/g
            s/<'a, /</g
        }
        /^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/
    }

    # Patch public helpers.
    /^impl.*Helpers/,/^\}$/ {
        s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/
        /^ *(unsafe )?fn .*\(self.*[<&]'a/ {
            s/&'a /\&/g
            s/<'a, /</g
        }
        /^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/
        /^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/
    }

The few error cases were then fixed by hand.
2015-08-27 16:59:02 +02:00
João Oliveira
fd87c8cb3e make dom_struct derive HeapSizeOf,
closes #7357
2015-08-27 01:17:48 +01:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Manish Goregaokar
a53b86f107 Cleanup WebGLRenderingContext, Websocker, WorkerGlobalScope 2015-08-18 18:38:36 +05:30
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
bors-servo
7c63c7d7c1 Auto merge of #7214 - tomjakubowski:websocket-binaryType, r=Ms2ger
Implement WebSocket#binaryType

Closes #7098

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7214)
<!-- Reviewable:end -->
2015-08-15 19:57:58 -06:00
Tom Jakubowski
e92f4629db WebSocket: Implement WebSocket#binaryType 2015-08-15 12:44:22 -07:00
Ravi Shankar
89153116fb Splitting ScriptMsg into various enums; r=jdm 2015-08-15 02:00:48 +05:30
Bogdan Cuza
45145108da Measure heap memory usage for more types. Fixes #6951 2015-08-13 21:44:41 +03:00
Ms2ger
352229b6fa Implement WebSocket#onmessage. 2015-08-08 10:29:03 +02:00
Ms2ger
2a97ab36f7 Dispatch message events for WebSocket. 2015-08-07 10:58:33 +02:00
James Graham
f52276d2cc Use hosts-replaced URL only when loading resources 2015-08-05 10:34:20 +01:00
Bogdan Cuza
233a769c67 Add spec links 2015-07-28 13:28:41 +02:00
Ms2ger
6329dec31f Move the WebSocket constructor logic out of WebSocket::new. 2015-07-23 09:00:34 +02:00
Ms2ger
32ddd356b8 Spawn a thread for WebSocket messages. 2015-07-22 20:29:32 +02:00
Ms2ger
91849cb603 Set the WebSocket's Sender from the ConnectionEstablishedTask.
This needs to happen off a task because we won't be able to access the
WebSocket object directly once this code moves to a background thread.

There is no behaviour change, because we make sure that self.ready_state is
not Connecting in Send().
2015-07-22 20:28:17 +02:00
Ms2ger
78df6e8d3e Remove the receiver field from WebSocket.
The receiver will be used from another thread than the WebSocket object in
the future.
2015-07-22 20:28:15 +02:00
Ms2ger
56c660d4de Split up WebSocketTaskHandler.
There's no real reason to have internal dynamic dispatch inside a trait
object.
2015-07-22 20:28:13 +02:00
Josh Matthews
d385cb701b Reject websocket protocol requests that don't match https://tools.ietf.org/html/rfc6455#section-4.1 . 2015-07-22 09:35:07 -04:00
Ms2ger
b467f3e9d6 Don't try to send a message in WebSocket#close if the sender isn't present. 2015-07-16 14:29:04 +02:00
Ms2ger
072fdf695b Handle Send correctly if readyState is not Open. 2015-07-16 12:43:10 +02:00
Ms2ger
cd741e681d Remove WebSocket::sendCloseFrame.
It is a field that is used a function argument. Given that the control flow
is not quite the same, and we can't add an argument to Send, I opted for a
separate function.
2015-07-16 12:43:08 +02:00
Ms2ger
6a61a5dcf5 Remove parse_web_socket_url in favour of functions in rust-websocket. 2015-07-15 11:26:49 +02:00
Ms2ger
48b94ec02b Throw an InvalidStateError from WebSocket#send when it is called too early. 2015-07-14 17:27:10 +02:00
Ms2ger
86e94786ae Stop panicking while establishing a WebSocket connection. 2015-07-14 16:01:59 +02:00
Bogdan Cuza
35d5328271 Fix #6379 2015-07-13 12:03:19 -04:00
Ms2ger
f93f49490f Replace WebSocketTask::Open by ConnectionEstablished. 2015-07-13 16:03:02 +02:00
Ms2ger
17bd7e5ec3 Remove some dead code from WebSockets. 2015-07-13 16:02:55 +02:00
Ms2ger
4c0c60a4d6 Return the parsed URL from WebSocket#url. 2015-07-13 14:21:18 +02:00
David Winslow
4cf46bff2d Refactor #[jstraceable] to #[derive(JSTraceable)]
fixes #6524
2015-07-01 18:27:06 -04:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
Jinwoo Song
7781f331d3 WebSocket constructor should not panic
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.
2015-06-16 09:45:42 +02:00
Ms2ger
230c4201f3 Revert "WebSocket constructor should not panic"
This reverts commit 877c369e0b.
2015-06-12 09:40:57 +02:00
Jinwoo Song
877c369e0b WebSocket constructor should not panic
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.
2015-06-11 13:58:04 +02:00
bors-servo
542519ebfd Auto merge of #6174 - frewsxcv:cleanup-long-lines, r=SimonSapin
Part of https://github.com/servo/servo/issues/6041

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6174)
<!-- Reviewable:end -->
2015-05-24 18:27:26 -05:00
Corey Farwell
8e3f4bba85 Reduce max line length from 150 to 120 characters
Part of https://github.com/servo/servo/issues/6041
2015-05-24 00:01:49 -04:00
Alexander Putilin
4e440a0ebb fixes 6111: WebSocket close event shouldn't be Cancelable 2015-05-24 01:38:39 +03:00
Paul Faria
d4be93613b Adding in a missed algorithm step number in the comments. 2015-05-20 22:17:07 -04:00
bors-servo
d869a3c7a8 Auto merge of #6127 - Nashenas88:websockets-invalid-urls, r=Ms2ger
Fix #6061.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6127)
<!-- Reviewable:end -->
2015-05-20 01:13:57 -05:00
Paul Faria
66e9b33a52 Fixed definition of Close and Send in WebSocket.webidl and updated implementation in websocket.rs. 2015-05-19 23:59:22 -04:00
Paul Faria
51ae7334f5 Responded to more code review comments. Simplified code a lot. 2015-05-19 23:54:38 -04:00
Paul Faria
fe0b77d669 Responded to code review comments, general cleanup 2015-05-19 23:54:36 -04:00
Paul Faria
8e78564dc3 Fixing one missed trailing whitespace, and fixed url 2015-05-19 23:54:34 -04:00
Paul Faria
0362d254b8 Removing trailing whitespace 2015-05-19 23:54:31 -04:00
Paul Faria
31b709a7c2 Initial work on #6061. 2015-05-19 23:54:29 -04:00