Commit graph

1855 commits

Author SHA1 Message Date
Ms2ger
48b94ec02b Throw an InvalidStateError from WebSocket#send when it is called too early. 2015-07-14 17:27:10 +02:00
bors-servo
556c0e1509 Auto merge of #6621 - Ms2ger:repeat, r=SimonSapin
Move away from the repeat().take().collect() pattern.

This was the preferred pattern between the deprecation of Vec::from_elem and
the addition of the count argument to the vec![] macro.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6621)
<!-- Reviewable:end -->
2015-07-14 02:42:26 -06:00
Ms2ger
ce4d442941 Move away from the repeat().take().collect() pattern.
This was the preferred pattern between the deprecation of Vec::from_elem and
the addition of the count argument to the vec![] macro.
2015-07-14 16:19:30 +02:00
bors-servo
d91a6f3834 Auto merge of #6620 - Ms2ger:ws-crash, r=jdm
Stop panicking while establishing a WebSocket connection.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6620)
<!-- Reviewable:end -->
2015-07-14 02:06:17 -06:00
Ms2ger
86e94786ae Stop panicking while establishing a WebSocket connection. 2015-07-14 16:01:59 +02:00
bors-servo
6a728712f9 Auto merge of #6617 - frewsxcv:fixme-ufcs, r=metajack
Complete FIXMEs related to UFCS



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6617)
<!-- Reviewable:end -->
2015-07-14 01:30:12 -06:00
bors-servo
0fb9f22ff7 Auto merge of #6611 - jdm:websocketorigin, r=jdm
Add Origin header to WebSocket connections.

Closes #6532.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6611)
<!-- Reviewable:end -->
2015-07-13 23:39:16 -06:00
bors-servo
91ce002241 Auto merge of #6554 - dzbarsky:master, r=Ms2ger
Test namespace prefix for element equality



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6554)
<!-- Reviewable:end -->
2015-07-13 22:24:22 -06:00
Corey Farwell
78d2fe6e9b Complete FIXMEs related to UFCS 2015-07-14 09:24:53 +09:00
Simon Sapin
a5b6cb6b43 Unpaired surrogates: Document the -Z flag in the panic message. 2015-07-13 20:58:21 +02:00
Simon Sapin
e4dc608c0a Use error! instead of warn! to get console output by default. 2015-07-13 20:52:21 +02:00
Simon Sapin
90dbd86ed7 Add a -Z replace-surrogates command-line option.
See #6564.
2015-07-13 20:41:57 +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
Ms2ger
da3c654f69 Add debug logging to register_named_element and unregister_named_element.
I found them helpful; I imagine others might as well.
2015-07-11 22:02:44 +02:00
Ms2ger
8b45f9f51c Implement Window#top. 2015-07-11 18:00:59 +02:00
David Zbarsky
0fa8e51432 Test element prefix for element equality 2015-07-11 02:50:39 -04:00
Corey Farwell
10296e77dc Use NotImplementedError for Python base class methods
From the Python docs:

https://docs.python.org/2/library/exceptions.html#exceptions.NotImplementedError

"In user defined base classes, abstract methods should raise this
exception when they require derived classes to override the method."
2015-07-11 07:41:44 +09:00
bors-servo
52e857dd7b Auto merge of #6561 - dzbarsky:namespace, r=Ms2ger
Implement Node#isDefaultNamespace and Node#lookupNamespaceURI (fixes #1826)



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6561)
<!-- Reviewable:end -->
2015-07-10 06:44:25 -06:00
David Zbarsky
326b2a7161 Test element prefix for element equality 2015-07-10 14:41:37 -04:00
Corey Farwell
a2c34b318e Remove unused files in 'script/dom/bindings/'
Similar to https://github.com/servo/servo/pull/6581, but I didn't get
everything in that pull request
2015-07-10 08:53:24 +09:00
Corey Farwell
0ec2375cab Remove tidy blacklist for 'script/dom/bindings/*'
Recently, I found myself reading through the Python codegen scripts that
live in 'components/script/dom/bindings/*' and noticed that there were
many tidy violations: unnecessary semicolons, weird spacing, unused
variables, lack of license headers, etc. Considering these files are now
living in our tree and mostly maintained directly by contributors of
Servo (as opposed to being from upstream), I feel these files should not
be excluded from our normal tidy process. This commit removes the
blacklist on these files and fixes all tidy violations.

I added these subdirectories to the blacklist because they appear to be
maintained upstream somewhere else:

* "components/script/dom/bindings/codegen/parser/*",
* "components/script/dom/bindings/codegen/ply/*",

Also, I added a '# noqa' comment which tells us to ignore the
flake8 errors for that line. I chose to ignore this (instead of fixing
it) to make the work for this commit simpler for me.
2015-07-09 19:42:31 +09:00
Corey Farwell
1ce089abf4 Remove unused files in 'script/dom/bindings/'
As per this conversation:

https://github.com/servo/servo/pull/6580
2015-07-09 07:25:14 +09:00
Corey Farwell
7159fe749f Create and utilize utility for joining strs 2015-07-08 05:18:07 +09:00
Corey Farwell
91b0671e1d Join tokens when stringifying DOMTokenList
Previous, it would return the original String straight from the
AttrValue, which might contain extraaneous whitespace. The spec
specifies to just join the tokens together with \x20

https://dom.spec.whatwg.org/#stringification-behavior
2015-07-08 04:42:50 +09:00
Corey Farwell
9b2ba3d713 Join Atoms without requiring intermediate Vec
Related to: https://github.com/servo/string-cache/pull/89
2015-07-08 04:42:49 +09:00
bors-servo
1618a9e73d Auto merge of #6543 - Ms2ger:a-href-activate, r=jdm
Only make a elements activatable when they have an href attribute.

I've tested this manually, by clicking on the "baz" in code like

```js
var a = document.body.appendChild(document.createElement("a"));
a.textContent = "bar ";
a.setAttribute("href", "http://www.yahoo.com");
var b = a.appendChild(document.createElement("a"));
b.textContent = "baz";
```

but I've not found a way to write an automated test.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6543)
<!-- Reviewable:end -->
2015-07-06 23:17:05 -06:00
Ms2ger
52e336e5a8 Only make a elements activatable when they have an href attribute.
I've tested this manually, by clicking on the "baz" in code like

```js
var a = document.body.appendChild(document.createElement("a"));
a.textContent = "bar ";
a.setAttribute("href", "http://www.yahoo.com");
var b = a.appendChild(document.createElement("a"));
b.textContent = "baz";
```

Before this change, the click is trapped by `b` and ignored there; after this
change, the click passes through `b` to `a`, where it is handled.

Unfortunately, I haven't found a way to write an automated test.
2015-07-07 13:14:59 +02:00
bors-servo
3a3ac2281b Auto merge of #6566 - glennw:image-deps, r=pcwalton
Add servo Image type. Remove rust-png dependency from script, gfx, layout.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6566)
<!-- Reviewable:end -->
2015-07-06 13:45:04 -06:00
Glenn Watson
83301ebb75 Add servo Image type. Remove rust-png dependency from script, gfx, layout. 2015-07-07 08:45:01 +10:00
bors-servo
1e16047846 Auto merge of #6559 - kball:IS1824-implement-Node.baseURI, r=Ms2ger
Implement Node.baseURI

Addresses Issue #1824.  Implements Node.baseURI based on https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976#c32

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6559)
<!-- Reviewable:end -->
2015-07-06 11:04:45 -06:00
ecoal95
8438db89e1 address review comments 2015-07-06 23:02:51 +02:00
ecoal95
9b306aced6 webgl: implement getError 2015-07-06 19:55:48 +02:00
ecoal95
42bd43a696 webgl: Make bind* calls more spec-compliant 2015-07-06 19:54:06 +02:00
ecoal95
b1765c6882 webgl: Refactor implementation to move logic inside the DOM interfaces
This improves the encapsulation and consistency in our WebGL
implementation.

Also allows to implement new methods such as `getShaderSource()`.

It will also allow us to use `delete()` in the destructors of them (note
that we will want to keep track of them from the context).
2015-07-06 19:54:05 +02:00
bors-servo
c022262826 Auto merge of #6505 - ttaubert:issue/4666-crypto-getRandomValues, r=Ms2ger
Implement crypto.getRandomValues()

Didn't touch mozjs or rust-mozjs because implementing that in the code generator didn't seem too easy. I'm using the same workaround that the TextDecoder does.

Using the OsRng should be the right choice here? As the OS keeps state for us we wouldn't need to have a global rng instance to keep around.

Fixes #4666.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6505)
<!-- Reviewable:end -->
2015-07-05 22:16:19 -06:00
bors-servo
cc73aad447 Auto merge of #6546 - michaelwu:slim-layoutdatawrapper, r=Ms2ger
Remove LayoutChan from LayoutDataWrapper

Saves 32 bytes in Node.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6546)
<!-- Reviewable:end -->
2015-07-05 21:39:12 -06:00
Kevin Ball
dbbab3b113 Implement Node.baseURI 2015-07-05 15:29:04 -07:00
Corey Farwell
a985ee4f19 Utilize iterators for AttrValue::from_serialized_tokenlist 2015-07-04 21:54:45 -07:00
David Zbarsky
861ddedaef Remove some redundant let bindings 2015-07-04 13:12:49 -04:00
Michael Wu
1a014beb08 Remove LayoutChan from LayoutDataWrapper 2015-07-04 03:54:40 -04:00
bors-servo
0298c92670 Auto merge of #6549 - Ms2ger:from_actual, r=nox
Remove *Cast::from_actual.

Since JSRef was removed, from_actual duplicates from_ref.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6549)
<!-- Reviewable:end -->
2015-07-03 22:56:17 -06:00
Ms2ger
2f88b84e07 Remove *Cast::from_actual.
Since JSRef was removed, from_actual duplicates from_ref.
2015-07-04 12:55:01 +02:00
Simon Sapin
75e3e787f6 Upgrade to rustc 1.3.0-dev (f3b97a74a 2015-07-03) 2015-07-04 11:32:41 +02:00
David Zbarsky
c55a06cb64 Factor out common forward/back navigation code in HTMLIFrameElementMethods 2015-07-03 23:05:58 -04:00
Tim Taubert
92874a89d2 Implement window.crypto.getRandomValues() 2015-07-03 18:34:00 +02:00
Ms2ger
9f52ab11aa Simplify the string handling in HTMLAnchorElement::activation_behavior. 2015-07-03 13:31:00 +02:00
Ms2ger
59ea4dbd21 Remove an avoidable null-check from HTMLAnchorElement::activation_behavior. 2015-07-03 13:30:31 +02:00