Commit graph

1626 commits

Author SHA1 Message Date
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
Ms2ger
2e89228cd5 Remove HTMLAnchorElement::handle_event.
It is equivalent to the default implementation.
2015-07-03 13:27:23 +02:00
bors-servo
be9d60664d Auto merge of #6510 - mintern:fix-worker-redirect-location, r=Ms2ger
Update Worker location for redirects

Fixes #4146

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6510)
<!-- Reviewable:end -->
2015-07-02 03:28:29 -06:00
Brandon Mintern
0a3981cdc9 Update Worker location for redirects
Fixes #4146
2015-07-02 11:25:33 -04:00
bors-servo
bbb39082e0 Auto merge of #6529 - dwins:master, r=Manishearth
Refactor #[jstraceable] to #[derive(JSTraceable)]

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.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6529)
<!-- Reviewable:end -->
2015-07-01 18:27:40 -06:00
David Winslow
4cf46bff2d Refactor #[jstraceable] to #[derive(JSTraceable)]
fixes #6524
2015-07-01 18:27:06 -04:00
Matt Brubeck
13072c7b0c Remove string_cache dependency from util.
Move `namespace::from_domstring` from util to script::dom, because it is used
only in that crate.
2015-07-01 10:04:53 -07:00
bors-servo
9897125b34 Auto merge of #6434 - yoava333:mouseover, r=nox
Added support for mouseover and mouseout events

fixes issue https://github.com/servo/servo/issues/6404

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6434)
<!-- Reviewable:end -->
2015-06-30 20:05:06 -06:00
Michael Wu
de788e0529 Auto-derive JSTraceable and Reflectable for ServoHTMLParser 2015-06-30 15:53:04 -04:00
Yoav Alon
3a44e143bc add support for mouseover and mouseout events 2015-06-30 14:42:38 +03:00
Michael Wu
728ecc72b6 Add JSAutoRequest/JSAutoCompartment to HTMLIFrameElement 2015-06-29 18:59:50 -04:00
Corey Farwell
109e3219a4 Prefer HTTPS when linking to GitHub Pages
This commit was generated using the following commands:

```
find . -iname "*.webidl" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)github.io/https:\1github.io/g'
```

```
find . -iname "*.rs" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)github.io/https:\1github.io/g'
```
2015-06-28 23:16:47 -07:00
bors-servo
6f25ecea3f Auto merge of #6507 - Ms2ger:node-insert, r=Manishearth
Fix a bug in Node::pre_insert.

It was accidentally broken in 3ce368fa28.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6507)
<!-- Reviewable:end -->
2015-06-28 14:01:47 -06:00
Ms2ger
0b680dc9bd Fix a bug in Node::pre_insert.
It was accidentally broken in 3ce368fa28.
2015-06-28 15:59:01 +02:00
bors-servo
46709edaf8 Auto merge of #6499 - Ms2ger:slice_position_elem, r=nox
Stop using position_elem.

It is unstable and not really better than the stable alternative.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6499)
<!-- Reviewable:end -->
2015-06-27 15:51:35 -06:00
Ms2ger
c9f50f41b5 Stop using position_elem.
It is unstable and not really better than the stable alternative.
2015-06-27 23:39:21 +02:00
Ms2ger
108c9b161c Remove unused imports. 2015-06-27 19:37:12 +02:00
Mukilan Thiyagarajan
8f5265c131 CGImports must consider special operations to generate required 'use' items 2015-06-27 19:01:17 +05:30
Michael Wu
0cd855379d Don't use MutNullableHeap in InputActivationState
No internal mutability required here.
2015-06-26 19:32:12 -04:00
Michael Wu
58d28ca0c8 Don't use MutHeap in BoundaryPoint
BoundaryPoint only requires external mutability, so MutHeap isn't necessary.
2015-06-26 19:32:12 -04:00
bors-servo
aed11dc22c Auto merge of #6477 - Ms2ger:vec_from_raw_buf, r=metajack
Stop using Vec::from_raw_buf.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6477)
<!-- Reviewable:end -->
2015-06-26 16:01:23 -06:00
bors-servo
c331db1623 Auto merge of #6468 - servo:update-selectors, r=Ms2ger
Update rust-selectors

r? @Ms2ger

https://github.com/servo/rust-selectors/pull/33

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6468)
<!-- Reviewable:end -->
2015-06-26 14:50:01 -06:00
Simon Sapin
9e1a674b16 Update rust-selectors 2015-06-26 12:35:08 -07:00
Ms2ger
a72c6ec8b6 Stop using Vec::from_raw_buf. 2015-06-26 21:20:13 +02:00
Ms2ger
932aa06694 Use Rc::get_mut rather than deprecated rc::get_mut. 2015-06-26 17:17:18 +02:00
bors-servo
9eb3cc2a24 Auto merge of #6464 - Ms2ger:into_raw, r=saneyuki
Use Box::into_raw rather than boxed::into_raw.

The latter is deprecated.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6464)
<!-- Reviewable:end -->
2015-06-26 04:50:54 -06:00