Commit graph

12333 commits

Author SHA1 Message Date
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
bors-servo
0f36eeab61 Auto merge of #6595 - servo:replace-surrogates, r=pcwalton
Replace surrogates in JS strings with U+FFFD instead of panicking.

Fix #6519.
See #6564.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6595)
<!-- Reviewable:end -->
2015-07-10 13:14:38 -06: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
bors-servo
314483a97f Auto merge of #6585 - frewsxcv:rm-unused-codegen-files, r=jdm
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

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6585)
<!-- Reviewable:end -->
2015-07-09 17:51:30 -06: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
bors-servo
2d2a340633 Auto merge of #6580 - frewsxcv:lint-codegen, r=Ms2ger
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 few '# noqa' comments which tells us to ignore the
flake8 errors for that line; they are mostly for unused/undefined
variables. I chose to ignore these (instead of fixing them) to make the
work for this commit simpler for me.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6580)
<!-- Reviewable:end -->
2015-07-09 07:55:27 -06: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
bors-servo
fe17067d6a Auto merge of #6581 - frewsxcv:rm-unused-codegen-files, r=Ms2ger
Remove unused files in 'script/dom/bindings/'

As per this conversation:

https://github.com/servo/servo/pull/6580

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6581)
<!-- Reviewable:end -->
2015-07-08 10:38:38 -06: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
bors-servo
453b826fb8 Auto merge of #6577 - Ms2ger:disallow-unrooted-layout, r=jdm
Remove the unused unrooted_must_root permission from layout.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6577)
<!-- Reviewable:end -->
2015-07-07 23:57:44 -06: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
54b9aa2cb4 Update WPT expectations 2015-07-07 15:01:18 -07: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
bors-servo
d64f91863a Auto merge of #6555 - frewsxcv:stringify-tokenlist, r=Ms2ger
Join tokens when stringifying DOMTokenList



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6555)
<!-- Reviewable:end -->
2015-07-07 08:58:35 -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
David Winslow
b665c7b9df Correct expectations for newly passing tests 2015-07-07 13:23:24 -04: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
bors-servo
8b9f7d7764 Auto merge of #6571 - Ms2ger:warnings, r=SimonSapin
Silence unused variable warnings in properties.rs.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6571)
<!-- Reviewable:end -->
2015-07-07 00:50:17 -06: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
bors-servo
a0db2cf1bb Auto merge of #6567 - mt2d2:remove_unused_imports, r=glennw
Remove unused import.

Remove an unused import. This prevents a compiler warning in ```util```.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6567)
<!-- Reviewable:end -->
2015-07-06 16:37:05 -06:00