Commit graph

189 commits

Author SHA1 Message Date
Anthony Ramine
a6ba5f48c0 servo: Merge #7466 - Implement FromIterator<Root<A>> for RootedVec<JS<A>> (fixes #5117) (from nox:rootedvec-from-iter); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: fea36ceb9a2d5114e41ce9067911b01f8e4fa5fd
2015-08-31 03:02:05 -06:00
Anthony Ramine
c327bc7867 servo: Merge #7416 - Make the traits for the IDL interfaces take &self (from nox:methods-ref); r=frewsxcv
Source-Repo: https://github.com/servo/servo
Source-Revision: 71b277d5675556e61a82ae9dbf3105449c3a8275
2015-08-27 15:08:41 -06:00
Anthony Ramine
d2ee701ee9 servo: Merge #7401 - Remove helper traits (from nox:rm-helpers); r=Manishearth
Now that `JSRef<T>` is gone, there is no need to have helper traits.

Source-Repo: https://github.com/servo/servo
Source-Revision: 909429702972d53bf02dfe9a4aa93ea0cb588cf4
2015-08-27 09:38:48 -06:00
João Oliveira
d39bd47b08 servo: Merge #7361 - make dom_struct derive HeapSizeOf (from jxs:master); r=Ms2ger
closes #7357

Source-Repo: https://github.com/servo/servo
Source-Revision: 532fd19d69fd11d06bca7539c722a46fab2c4419
2015-08-27 02:35:45 -06:00
Manish Goregaokar
8c0333b4f1 servo: Merge #7397 - Remove doublepointer in VirtualMethods, and from_borrowed_ref (from Manishearth:doublepointer-meet-fire); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 48945b0fc1b1f1bee77f6cb30ac10e17614ef283
2015-08-26 15:01:12 -06:00
Simon Sapin
358afcbc30 servo: Merge #7334 - Parse :active pseudo-class selector (from servo:active); r=SimonSapin
This is #7258 with a spec link added in doc-comment.

The pseudo-class is never matched, but this can still help with stylesheets like `a:hover, a:active { color: something }` where failing to parse one pseudo-class makes the entire selector list invalid.

I filed #7333 about actually making it match.

Source-Repo: https://github.com/servo/servo
Source-Revision: fa06a96f8a880a051ad4cad2489042547dd7f455
2015-08-24 04:23:13 -06:00
Johann Tuffe
5c3a5a67f5 servo: Merge #7265 - Add alphabetical order check for use statements (from tafia:tidy-use); r=Ms2ger
close #7112

Source-Repo: https://github.com/servo/servo
Source-Revision: a5fbb2f2a6fa79755f975feff2435abb6a5dd0e9
2015-08-20 07:43:56 -06:00
Manish Goregaokar
d4e45231ec servo: Merge #7224 - Integrate clippy into Servo; cleanup some of script (from Manishearth:clippy); r=Ms2ger
The integration is off by default for now. You can try it out with `./mach build --features "script/plugins/clippy"`.

We're using a branch of clippy with some of the lints changed to Allow, either because they don't apply to us, or because they're noisy and dwarf other warnings (but still should be fixed)

After going through the rest of Servo's warnings I'll figure out which lints we should be keeping.

There's a cargo bug with optional deps that makes it hard for this to work with Cargo.lock -- so this PR contains no changes to lockfiles (and running the build with clippy on may dirty the lockfile, though it gets fixed later)

Source-Repo: https://github.com/servo/servo
Source-Revision: 50e1c967e4299c1515575f73d407f5f6b977d818
2015-08-18 08:15:51 -06:00
João Oliveira
3436fe7092 servo: Merge #7257 - Replace uses of for foo in bar.iter(), (from jxs:master); r=Ms2ger
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)

Source-Repo: https://github.com/servo/servo
Source-Revision: 0d6d6a05009606dfbbfc9765d7dc2c745c18f6a5
2015-08-18 02:46:46 -06:00
Josh Matthews
6a81d499fc servo: Merge #7203 - Add automated style nit checks to test-tidy (from jdm:style); r=Ms2ger
Expands on the work by @wilmoz and cleans up the existing errors. Closes #7180. Closes #7111.

Source-Repo: https://github.com/servo/servo
Source-Revision: e74825f9fde8e222f4ba9bb24b2c2a3864c73e5f
2015-08-16 08:37:40 -06:00
João Oliveira
f0a3f70810 servo: Merge #7208 - replace .len() == 0 with is_empty() (from jxs:master); r=Ms2ger
closes #7198

Source-Repo: https://github.com/servo/servo
Source-Revision: 85022a4c347dca3f5d28cec3010f7e9410217df4
2015-08-14 00:51:59 -06:00
Bogdan Cuza
b3e4dcef5f servo: Merge #7097 - Measure heap memory usage for more types. Fixes #6951 (from boghison:memtypes); r=jdm
Also adds HeapSizeOf implementations/derive for some types. I've used "Cannot calculate Heap size" as a reason everywhere, because my imagination is rather limited. If you'd like me to change this message for specific types, please write something like this: "Trusted - Cannot calculate Heap size for Trusted" so that it would be easier for me to replace them through a script :)

Source-Repo: https://github.com/servo/servo
Source-Revision: a03616f379c255cc6c9b6e1d04dd7d98bd9926ce
2015-08-13 13:16:14 -06:00
Anthony Ramine
6660f5b499 servo: Merge #6778 - Optimise Node.childNodes (from nox:childnodes); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 2b9590c5a53f273c13c6fb36f95fbf593bbffd8b
2015-08-10 14:05:02 -06:00
Josh Matthews
2f1aaef81d servo: Merge #6874 - Start reporting memory usage for Window and all nodes in all DOM tree… (from jdm:domreporting); r=njn
…s for frame treese in script tasks.

This underreports by a significant amount, since only Document, Window and CharacterData (ie. text) nodes are fully represented. That being said, every HTML element in the tree is measured, but only counted as a Node. It's easy to improve this, it just requires adding the appropriate HeapSizeOf derives and increasing the granularity of `measure_memory_for_eventtarget`. google.com shows a dom-tree value of 0.24 MB for me at the moment.

r? @nnethercote

Source-Repo: https://github.com/servo/servo
Source-Revision: 84e25befdd97cf74fb00707dbe150d59d980e977
2015-08-03 21:24:41 -06:00
Corey Farwell
30a3893160 servo: Merge #6800 - Implement ChildNode::before & ChildNode::after (from frewsxcv:childnode-before-childnode-after); r=Ms2ger
Continued from #6536

The current implementations of `ChildNode::before` and
`ChildNode::after` do not match the WHATWG spec. This commit updates the
implementations to match the spec.

Our current implementation of `ChildNode::after` passes all the WPT
tests. So I made sure to add a regression test that failed with the
current implementation. There are a few other unit tests I added
to exhaust other corner cases I encountered.

Source-Repo: https://github.com/servo/servo
Source-Revision: 5873a5cf20b3db0fce59980b2a6b0b7b9da1e737
2015-07-30 04:13:39 -06:00
David Zbarsky
cd7cafe51e servo: Merge #6783 - Clean up Node::ReplaceChild (from dzbarsky:replacechild); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 9e8d231196693a660a1e70d535d1c3ab290ddf39
2015-07-30 02:11:57 -06:00
Nick Thompson
7aec9852b5 servo: Merge #6815 - Dispose layout data for every node removed from the tree (from nick-thompson:dispose_layout_data); r=jdm
Fix for #6754.

cc @jdm – I believe this is all that's required for the fix, but until I get a better sense of #6813, I'm unsure of the best way to test this.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8b7120012a5f5eed71236fcf5d546ae76837ea11
2015-07-29 16:24:46 -06:00
Till Schneidereit
372ef0fcd0 servo: Merge #6662 - Implement Element.client{Top,Left,Width,Height} (from tschneidereit:client-geometry); r=glennw,pcwatson
This isn't done, but contains a working implementation of at least `clientTop`. Feedback would be much appreciated: it's probably far from ideal.

Implementing `clientLeft` is straight-forward, I think, but `clientWidth` and `clientHeight` require accessing the `border_box` - and I don't know how that works, yet.

Source-Repo: https://github.com/servo/servo
Source-Revision: e0bd80f80715bdbdf30de1de9c79a99a41cfd99e
2015-07-27 20:45:05 -06:00
David Zbarsky
7f67f0a645 servo: Merge #6760 - Remove outdated comment about cloning elements (from dzbarsky:comment-fix); r=jdm
The comment points to the "implement element prefix" issue, but we clone the element's prefix when we construct the element right above.

Source-Repo: https://github.com/servo/servo
Source-Revision: 5a66b59f9bfece8944d9766872cc95cdce7705e6
2015-07-26 08:01:56 -06:00
Anthony Ramine
23bb14e6aa servo: Merge #6660 - Introduce VirtualMethods::children_changed() (from nox:children-changed); r=jdm
This virtual method mimics the behaviour of mutation observers and make it more viable than the older child_inserted(), which didn't cover removed nodes and was called as many times as there were inserted nodes.

A few other shortcomings where remove_child() was called directly instead of Node::remove() were also fixed while at it.

Source-Repo: https://github.com/servo/servo
Source-Revision: 705c95dedbbaa60ffd08e70579915e228d5b6ee0
2015-07-25 11:39:20 -06:00
Ms2ger
7b2abc03ca servo: Merge #6715 - Implement more methods on LayoutJS (from Ms2ger:layoutelement); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: f44d75e5b2e4229728d97b6a70de3babd3496eb1
2015-07-23 12:40:52 -06:00
Simon Sapin
7b6c4c937e servo: Merge #6700 - Update rust-selectors (from servo:selectors); r=Ms2ger
Update for https://github.com/servo/rust-selectors/pull/37

Source-Repo: https://github.com/servo/servo
Source-Revision: 5d857c5d0cac67337ea01895b7cf309359c89cce
2015-07-23 10:55:37 -06:00
Michael Howell
69e51fc14a servo: Merge #6667 - Optimize Node.normalize() (from notriddle:master); r=Ms2ger
Do not copy the discarded node's text data, borrow it.

Closes #6658.

p.s. What's the `let text_node = text_node.clone();` for? I removed it because it doesn't seem to be necessary, but I'd like to be sure.

Source-Repo: https://github.com/servo/servo
Source-Revision: 5dba6d5b010e0d40ef282b6e43925ad0a7c44315
2015-07-22 15:13:43 -06:00
Manish Goregaokar
d990887177 servo: Merge #6688 - Handle type parameters in unused_must_root (from Manishearth:smarter-root-lint); r=jdm
fixes #6651

Source-Repo: https://github.com/servo/servo
Source-Revision: 8a6681ba70c4e8dc524aff7b8fbc3c71167e8745
2015-07-22 07:05:31 -06:00
Corey Farwell
5a555b5600 servo: Merge #6607 - Upgrade rust-selectors, pass ':empty' tests (from frewsxcv:bump-selectors); r=Ms2ger
https://github.com/servo/rust-selectors/pull/36

Source-Repo: https://github.com/servo/servo
Source-Revision: 488f3b65a1bce549bcda718ab745aa47528cd160
2015-07-22 05:33:06 -06:00
David Zbarsky
fb3700b6c0 servo: Merge #6568 - Implement Range#insertNode (from dzbarsky:delete_range); r=jdm
Gecko doesn't really follow the spec but it seems to throw a HierarchyRequest error when parent is null.
Any ideas who I should talk to about fixing the spec to account for the null checks?

Source-Repo: https://github.com/servo/servo
Source-Revision: acf47a02cf38b5c82e7c78cc1f6660a7daa9969a
2015-07-16 10:56:17 -06:00
Michael Wu
12233307ae servo: Merge #6641 - Directly append children to output node in parse_html_fragment (from michaelwu:direct-output); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 9534e8143f52ef091595c18caeb82cfc46cc20a4
2015-07-16 07:21:06 -06:00
Corey Farwell
a2a4f810b8 servo: Merge #6617 - Complete FIXMEs related to UFCS (from frewsxcv:fixme-ufcs); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: 6a728712f9c9cbe667c1bca2465cefef6f6f657a
2015-07-14 01:30:12 -06:00
David Zbarsky
23a2b99ba5 servo: Merge #6554 - Test namespace prefix for element equality (from dzbarsky:master); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 91ce002241c32d4d6f0c4814f93ae693672485be
2015-07-13 22:24:22 -06:00
David Zbarsky
2f5b1d3dd7 servo: Merge #6561 - Implement Node#isDefaultNamespace and Node#lookupNamespaceURI (fixes #1826) (from dzbarsky:namespace); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 52e857dd7b9b083d691efab088aeba80888c61ff
2015-07-10 06:44:25 -06:00
Kevin Ball
9fe943b645 servo: Merge #6559 - Implement Node.baseURI (from kball:IS1824-implement-Node.baseURI); r=Ms2ger
Addresses Issue #1824.  Implements Node.baseURI based on https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976#c32

Source-Repo: https://github.com/servo/servo
Source-Revision: 1e1604784675bf378cf0feea48bd22a668285f84
2015-07-06 11:04:45 -06:00
Michael Wu
fac8c79199 servo: Merge #6546 - Remove LayoutChan from LayoutDataWrapper (from michaelwu:slim-layoutdatawrapper); r=Ms2ger
Saves 32 bytes in Node.

Source-Repo: https://github.com/servo/servo
Source-Revision: cc73aad447f0455606a5a6005d31aa55334668a8
2015-07-05 21:39:12 -06:00
David Zbarsky
0a2c0b81b7 servo: Merge #6552 - Remove some redundant let bindings (from dzbarsky:master); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 236250c3fc7313346e490ce249083bb94d0dad74
2015-07-04 07:34:29 -06:00
David Winslow
b9c1f245a1 servo: Merge #6529 - Refactor #[jstraceable] to #[derive(JSTraceable)] (from dwins:master); r=Manishearth
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: bbb39082e0f640400546d2084a450a8675820a82
2015-07-01 18:27:40 -06:00
Matt Brubeck
3cc1840e9f servo: Merge #6528 - Reduce dependencies of the util crate (from mbrubeck:util_deps); r=Ms2ger
Because almost all our main crates depend on util, we should keep its dependencies minimal to increase parallelism and reduce the amount of stuff rebuilt when upstream crates are changed.

Source-Repo: https://github.com/servo/servo
Source-Revision: fc1e427ff9bb0e9891053ec1eba292530ebbe91a
2015-07-01 07:54:15 -06:00
Ms2ger
d6126e9cf5 servo: Merge #6507 - Fix a bug in Node::pre_insert (from Ms2ger:node-insert); r=Manishearth
It was accidentally broken in 3ce368fa289bc4c6d09b23357350a37b861013f9.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6f25ecea3f3c1fc86c188447df18645ae6ea26f9
2015-06-28 14:01:47 -06:00
Ms2ger
ab33a0f760 servo: Merge #6500 - Remove unused imports (from Ms2ger:warnings); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: dab4e73ee73a21e07ad73ec211b919a746a45624
2015-06-27 11:38:34 -06:00
Simon Sapin
112f9f7675 servo: Merge #6468 - Update rust-selectors (from servo:update-selectors); r=Ms2ger
r? @Ms2ger

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

Source-Repo: https://github.com/servo/servo
Source-Revision: c331db1623719774c3ead554bcdca0b9c02d90fe
2015-06-26 14:50:01 -06:00
Ms2ger
e448407e4d servo: Merge #6443 - Various layout cleanup (from Ms2ger:cleanup-layout); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 469b9550f6feec56d87ea5c772cb76453c13036a
2015-06-24 03:00:32 -06:00
Simon Sapin
2e3cf397c7 servo: Merge #6427 - Update rust-selectors (from servo:selector-traits-refactor); r=Ms2ger
https://github.com/servo/rust-selectors/pull/30

r? @Ms2ger

This conflicts with the SpiderMonkey upgrade #6150. I’m happy to wait until that lands and rebase.

Source-Repo: https://github.com/servo/servo
Source-Revision: c119b59e82269a84925673236dd896101f27a6f3
2015-06-21 11:12:07 -06:00
Michael Wu
6a46bbff4b servo: Merge #6433 - Fix some warnings caused by the SM upgrade (from michaelwu:fix-smup-warnings); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: 72ead882c08fbd66d59457efd1ebf86ee4ee97f2
2015-06-19 20:56:29 -06:00
Michael Wu
7512d04e93 servo: Merge #6150 - Upgrade to Spidermonkey 39 (from servo:smupgrade3); r=mbrubeck
> Here it is.
>
> ~~There's two major things that are unfinished here:~~
> - ~~Dealing with the unroot_must_root lint. I'm not sure about the value of this lint with the new rooting API.~~ Done.
> - ~~Updating the Cargo.locks to point to the new SM and SM binding.~~ Done.
>
> I also included my fixes for the rust update, but these will disappear in a rebase. A rust update is necessary to support calling `Drop` on `Heap<T>` correctly when `Heap<T>` is inside a `Rc<T>`. Otherwise `&self` points to the wrong location.
>
> Incremental GC is disabled here. I'm not sure how to deal with the incremental barriers so that's left for later.
>
> Generational GC works. SM doesn't work without it.
>
> The biggest change here is to the rooting API. `Root` was made movable, and `Temporary` and `JSRef` was removed. Movable `Root`s means there's no need for `Temporary`, and `JSRef`s aren't needed generally since it can be assumed that being able to obtain a reference to a dom object means it's already rooted. References have their lifetime bound to the Roots that provided them. DOM objects that haven't passed through `reflect_dom_object` don't need to be rooted, and DOM objects that have passed through `reflect_dom_object` can't be obtained without being rooted through `native_from_reflector_jsmanaged` or `JS::<T>::root()`.
>
> Support for `Heap<T>` ended up messier than I expected. It's split into two commits, but only because it's a bit difficult to fold them together. Supporting `Heap<T>` properly requires that that `Heap::<T>::set()` be called on something that won't move. I removed the Copy and Clone trait from `Heap<T>` so `Cell` can't hold `Heap<T>` - only `UnsafeCell` can hold it.
>
> `CallbackObject` is a bit tricky - I moved all callbacks into `Rc<T>` in order to make sure that the pointer inside to a `*mut JSObject` doesn't move. This is necessary for supporting `Heap<T>`.
>
> `RootedCollectionSet` is very general purpose now. Anything with `JSTraceable` can be rooted by `RootedCollectionSet`/`RootedTraceable`. Right now, `RootedTraceable` is only used to hold down dom objects before they're fully attached to their reflector. I had to make a custom mechanism to dispatch the trace call - couldn't figure out how to get trait objects working for this case.
>
> This has been tested with the following zeal settings:
>
> GC after every allocation
> JS_GC_ZEAL=2,1
>
> GC after every 100 allocations (important for catching use-after-free bugs)
> JS_GC_ZEAL=2,100
>
> Verify pre barriers
> JS_GC_ZEAL=4,1
>
> Verify post barriers
> JS_GC_ZEAL=11,1

Source-Repo: https://github.com/servo/servo
Source-Revision: e7808c526c348fea5e3b48af70b7f1a066652097
2015-06-19 16:46:55 -06:00
ecoal95
b32a9cd993 servo: Merge #6423 - Use euclid from crates.io (from emilio:euclid); r=glennw
Sorry for not doing it yesterday, I couldn't.

cc @metajack @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 4ebb95ccd8e034007eacb447a054919ef4af2bf7
2015-06-18 20:50:22 -06:00
Ms2ger
19c2399332 servo: Merge #6320 - Remove null_str_as_empty and null_str_as_empty_ref functions (from Ms2ger:as-empty); r=nox
With just one caller between the two functions, there doesn't seem to be
much point in having the abstraction.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6bd798a69f0ae0fe19f6385a8c1bb3204185da68
2015-06-10 05:40:26 -06:00
Ms2ger
199e8eedb1 servo: Merge #6318 - Optimize lookupPrefix (from Ms2ger:optimize-lookup-prefix); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 3ece6bc166c06b1b63f417742cb30dde0e34e63e
2015-06-10 04:30:38 -06:00
Peter
fe672294d7 servo: Merge #5972 - Makes Node::remove recursively remove all descendants of removed node from the doc (from pgonda:remove-children-from-doc); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: bf4fc6f388676cdc31cebc742a52e9d8896575f5
2015-05-29 12:03:28 -05:00
Jinwoo Song
6a080bd126 servo: Merge #5981 - Implement NodeIterator (from Jinwoo-Song:nodeiterator); r=Manishearth
Implement NodeIterator's basic functionality. (Fixes #1235)  But the cases for node removals are not implemented yet.

r? @jdm
cc @yichoi

Source-Repo: https://github.com/servo/servo
Source-Revision: 2b52006b1c503a24d5e832934d3265d45e425f40
2015-05-28 05:14:08 -05:00
Anthony Ramine
9512a913c9 servo: Merge #6140 - Cleanup some gratuitous or inefficient uses of RootedVec (from nox:cleanup-rootedvec); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: 7d0409b8421e1b0c055507acc7d784cac890f47e
2015-05-26 08:36:29 -05:00
Corey Farwell
333cc6c59d servo: Merge #6174 - Reduce max line length from 150 to 120 characters (from frewsxcv:cleanup-long-lines); r=SimonSapin
Part of https://github.com/servo/servo/issues/6041

Source-Repo: https://github.com/servo/servo
Source-Revision: 542519ebfd073662bc9421ac5fa0aa01ebc0d6fe
2015-05-24 18:27:26 -05:00
Peter
a1a04609a4 servo: Merge #5858 - fixes #5603, added support for tabindex field (from pgonda:tabindex-focus-flag); r=jdm
Added support for the tabindex field, also added its correct defaults (-2 TODOs for things not supported in Servo yet).  Also added tabindex logic into Element::is_focusable_area.

Source-Repo: https://github.com/servo/servo
Source-Revision: fada39164cbaba3a9885f08fad6f10a2353a4838
2015-05-20 14:34:31 -05:00