Commit graph

4270 commits

Author SHA1 Message Date
Will Huxtable
58a31b07b4 Remove url field from Page 2015-07-11 17:06:12 +01:00
Ms2ger
8b45f9f51c Implement Window#top. 2015-07-11 18:00:59 +02:00
Ms2ger
243446eff3 Revert "Replace surrogates in JS strings with U+FFFD instead of panicking."
This reverts commit 3f07f8e866.
2015-07-11 09:32:32 +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
Simon Sapin
3f07f8e866 Replace surrogates in JS strings with U+FFFD instead of panicking.
Fix #6519.
See #6564.
2015-07-11 03:12:46 +02:00
Ms2ger
928f843392 Remove unused has_children method. 2015-07-10 19:34:04 +02: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
bors-servo
805232a85e Auto merge of #6574 - Ms2ger:for_node, r=pcwalton
Remove ReplacedImageFragmentInfo::for_node and unsafe code it required.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6574)
<!-- Reviewable:end -->
2015-07-08 08:02:30 -06:00
bors-servo
ce81745a8e Auto merge of #6576 - Ms2ger:scope-unsafe-context, r=pcwalton
Reduce the scope of the allowed unsafe code in context.rs.

Since I made unsafe code opt-in in layout, the unsafe code in this module has
been reduced to a single unsafe impl, so there is no reason to allow it in
the entire module.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6576)
<!-- Reviewable:end -->
2015-07-08 05:59:00 -06:00
Ms2ger
270f0aafed Reduce the scope of the allowed unsafe code in context.rs.
Since I made unsafe code opt-in in layout, the unsafe code in this module has
been reduced to a single unsafe impl, so there is no reason to allow it in
the entire module.
2015-07-08 11:28:59 +02:00
bors-servo
10b0d8c537 Auto merge of #6530 - mrobinson:move-cache, r=pcwalton
Move LayerBuffer cache to the compositor

Now that NativeDisplay can be shared between the compositor and the
paint task, we can move the LayerBuffer cache to the compositor. This
allows surfaces to be potentially reused between different paint tasks
and will eventually allow OpenGL contexts to be preserved between
instances of GL rasterization.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6530)
<!-- Reviewable:end -->
2015-07-08 03:14:21 -06:00
Martin Robinson
e115c3d3c4 Move LayerBuffer cache to the compositor
Now that NativeDisplay can be shared between the compositor and the
paint task, we can move the LayerBuffer cache to the compositor. This
allows surfaces to be potentially reused between different paint tasks
and will eventually allow OpenGL contexts to be preserved between
instances of GL rasterization.
2015-07-08 08:05:11 -07:00
Ms2ger
fd944f7765 Remove the manual Send/Sync implementations for Fragment.
It was Send already, and ReplacedImageFragmentInfo::for_node was the only
member that wasn't Sync.
2015-07-08 10:52:34 +02:00
Ms2ger
7ca3dfb43f Remove ReplacedImageFragmentInfo::for_node.
It became unused in d8aef7208e.
2015-07-08 10:50:24 +02:00
bors-servo
5386b0122c Auto merge of #6575 - Ms2ger:script-traits-docs, r=jdm
Really require documentation in the script_traits crate.

My previous attempt (1303dd6e2e) was foiled by
a typo that made the requirement only apply to the next item.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6575)
<!-- Reviewable:end -->
2015-07-08 01:20:28 -06:00
Ms2ger
417305d719 Really require documentation in the script_traits crate.
My previous attempt (1303dd6e2e) was foiled by
a typo that made the requirement only apply to the next item.
2015-07-08 11:21:09 +02:00
bors-servo
effe569e32 Auto merge of #6573 - Ms2ger:warnings, r=jdm
Don't lose a possible error in <SpecificFragmentInfo as fmt::Debug>::fmt.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6573)
<!-- Reviewable:end -->
2015-07-08 00:35:38 -06:00
Ms2ger
f71ca62522 Don't lose a possible error in <SpecificFragmentInfo as fmt::Debug>::fmt. 2015-07-08 10:23:55 +02:00
Ms2ger
0302244709 Remove the unused unrooted_must_root permission from layout. 2015-07-08 11:36:52 +02:00
bors-servo
c76720d67c Auto merge of #6570 - Ms2ger:workqueue-sync, r=pcwalton
Require that WorkQueue's QueueData is Sync rather than Send.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6570)
<!-- Reviewable:end -->
2015-07-07 13:07:31 -06:00
bors-servo
bbcd427733 Auto merge of #6492 - pcwalton:even-more-jumpiness, r=mbrubeck
layout: Modify styles for replaced content as appropriate during incremental flow construction.

Fixes jumpiness on lots of Web sites.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6492)
<!-- Reviewable:end -->
2015-07-07 10:28:04 -06:00
Patrick Walton
c84368b703 layout: Make the output of flow tree dumping easier to read when there
are many fragments.
2015-07-07 15:01:18 -07:00
Patrick Walton
352ad53775 gfx: Round out when snapping rects to the nearest pixel.
Fixes `insert-inline-in-blocks-n-inlines-end-001` in the WPT tests.
2015-07-07 15:01:17 -07:00
Patrick Walton
24f10df436 layout: Modify styles for replaced content as appropriate during
incremental flow construction.

Fixes jumpiness on lots of Web sites.
2015-07-07 15:00:52 -07:00
bors-servo
c04b7bbf6e Auto merge of #6540 - jdm:devtoolsfix, r=glennw
Make devtools usable once more.

This fixes the panic by rebasing #6189, and also makes cached messages appear once more.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6540)
<!-- Reviewable:end -->
2015-07-07 09:43:36 -06:00
Corey Farwell
7159fe749f Create and utilize utility for joining strs 2015-07-08 05:18:07 +09:00
Corey Farwell
c77b5aa8e2 Update string_cache: 0.1.4 -> 0.1.5 2015-07-08 04:44:13 +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
0688488a7f Auto merge of #6565 - dwins:issue_6452_image_padding, r=pcwalton
Fix for #6542 - <img> top-padding adds margin

I wrote this patch that makes the test from #6542 render as expected but I am not confident it is actually the right fix.  Should the padding be included in the 'ascent' metric for images, or am I just introducing a bug that happens to offset the one I'm trying to fix?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6565)
<!-- Reviewable:end -->
2015-07-07 06:27:13 -06:00
bors-servo
ae01e97efa Auto merge of #6487 - pcwalton:background-tiling, r=glennw
gfx: Use a pattern instead of tiling images manually.

r? @SimonSapin

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6487)
<!-- Reviewable:end -->
2015-07-07 05:42:07 -06:00
Patrick Walton
3500af37d0 gfx: Use a pattern instead of tiling images manually. 2015-07-07 10:41:47 -07:00
Ms2ger
028484526d Require that WorkQueue's QueueData is Sync rather than Send. 2015-07-07 11:11:46 +02:00
Ms2ger
a666d5faed Silence unused variable warnings in properties.rs. 2015-07-07 14:34:25 +02: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
Michael Tremel
0833c16b00 Remove unused import. 2015-07-06 21:31:03 -07: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
David Winslow
261711d51a Include padding in ascent reported for <img>
fixes #6452
2015-07-06 15:28:13 -04: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
bors-servo
0f8095b950 Auto merge of #6380 - ecoal95:webgl-refactoring, r=jdm
Refactor WebGL 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 probably want to keep track of them from the context before).

Some concerns:

**Trait method repetition**:
I'm aware that the traits `WebGL{Buffer,Renderbuffer,Framebuffer,Texture}Helpers` are basically the same, but `delete()` and `id()` methods are everywhere. I've thought something like:

```rust
pub trait WebGLIdentifiable {
    type WebGLId; // id is sometimes i32 (see WebGLUniformLocation)
    fn id(&self) -> Self::WebGLId;
}

pub trait WebGLBindable {
    fn bind(&self);
}

pub trait WebGLDeletable {
    fn delete(&self);
}
```

But I'd want to know your opinion first.

**`renderer` repetition**:
Thought of moving the field: `renderer: Sender<CanvasMsg>` to `WebGLObject`, but I think it makes it way more complicated to read, and also a bit unnecessary, at least IMO (`WebGLObject` will never interact with the field directly). It would also mean that all `WebGLObject`s should have one, which is true at this moment, but maybe not with WebGL 2, for example.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6380)
<!-- Reviewable:end -->
2015-07-06 09:12:59 -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