Commit graph

176 commits

Author SHA1 Message Date
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
Michael Wu
d49fb75099 servo: Merge #6139 - Rustup fixes (from michaelwu:rustup-fixes); r=SimonSapin
Mutable transmutes and wrong transmutes fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: 64810583093dadfacbda942562853af1ae82e34e
2015-05-20 01:55:43 -05:00
Patrick Walton
5d9538d101 servo: Merge #6124 - layout: Support inline incremental reflow, and stop reconstructing all flows when mousing over the document (from pcwalton:inline-incremental-reflow); r=mbrubeck
r?

Source-Repo: https://github.com/servo/servo
Source-Revision: 16793d0e24ed49245e5777bc282839e4c157a091
2015-05-19 13:51:30 -05:00
Ms2ger
a13d7d197e servo: Merge #6044 - Various cleanup (from Ms2ger:cleanup); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 7bda431e61d06113306c3f12d9f4240a58a7d34d
2015-05-14 07:16:42 -05:00
Josh Matthews
204eaa3597 servo: Merge #5804 - Add simple document load tracking infrastructure (from jdm:docloader); r=Ms2ger
This implements a simple load-tracking system and tracks stylesheet loads as an example of how it fits together. This is a simplified and rebased version of #3714; I do not believe that the main thrust of hsivonen's comments (related to tracking navigation in browsing contexts) affect this part of the work.

r? @Ms2ger

Source-Repo: https://github.com/servo/servo
Source-Revision: 2baa69595e2d57213c34b7e168b60885948fa85b
2015-05-11 14:35:33 -05:00
James Graham
d39527f482 servo: Merge #5969 - Add WebDriver support for getting elements by selector (from jgraham:webdriver_select_css); r=jdm
Also adds example support for getting the name and text properties of the elements.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8df824998f108d8ef0472bcf6c006b3270e2800e
2015-05-11 09:57:02 -05:00
Anthony Ramine
8bcfe1b851 servo: Merge #5931 - Remove helpers that correspond to DOM methods (from nox:rm-helpers); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 16a7c792b564a6eab48391865a7060b8dba38284
2015-05-06 01:31:26 -05:00
Simon Sapin
95c8716656 servo: Merge #5935 - Upgrade Rust (from servo:rustup_2015-04-25); r=Ms2ger
r? everybody

Source-Repo: https://github.com/servo/servo
Source-Revision: 49aed6555dbc008c1a378c5cbb303f5467232b6b
2015-05-05 09:11:30 -05:00
Anthony Ramine
421aa02eae servo: Merge #5839 - Implement base machinery of Range (from nox:range); r=Manishearth
The actual boundary points are behind a Rc<_> value to let nodes be able to store weak references to them in the future.

Source-Repo: https://github.com/servo/servo
Source-Revision: 15c4372a8be9c2b73d9e09bd7684484e48d220e8
2015-04-30 05:59:55 -05:00
Jinwoo Song
689e86231d servo: Merge #5879 - Make NodeTypeId include CharacterData variant (from Jinwoo-Song:character_data); r=jdm
NodeTypeId is supposed to reflect the WebIDL inheritance hierarchy.
All of Text/ProcessingInstruction/Comment inherit from CharacterData,
which inherits from Node. There should be a CharacterDataTypeId value
that differentiates between those, instead.

r? @jdm
cc @yichoi

Source-Repo: https://github.com/servo/servo
Source-Revision: 5b0c6c9d31973aabdb820f16237e1a7c2a6524ad
2015-04-29 02:35:26 -05:00
Ms2ger
33e1b9c8ab servo: Merge #5888 - Prepare for the rustup (from Ms2ger:prepare-rustup); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: ab2d07db1fabd7ad9590aa7296038bbc91806c3f
2015-04-28 17:52:49 -05:00
Anthony Ramine
39e9571d13 servo: Merge #5871 - Cleanup JS traits and methods (from nox:rootable); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: b8ae33e510ea30e3200834fc2f7fbc426b86701e
2015-04-28 04:23:05 -05:00
Manish Goregaokar
e158f4fca9 servo: Merge #5855 - Add move protection to Root and friends (from Manishearth:nomove); r=kmc,munksgaard
fixes #5724, #5737


uses https://github.com/Manishearth/rust-tenacious (can be moved in-tree if needed)

I can make it `Deny` by default too (I'll add a cargo feature to tenacious), though we might want it on
`Warn` until we get some mileage on it.

Source-Repo: https://github.com/servo/servo
Source-Revision: d7987e43c944eb9b156bf3244c08fce4cb570db4
2015-04-27 23:14:25 -05:00
Peter
fdd263ff72 servo: Merge #5692 - Switched Element::Get_attributes to use a RootedVec (from pgonda:get_attributes-memory-safety); r=jdm
Changes Element::get_attributes to use a `&mut Rooted<JS<Attr>>` param instead of returning a `Vec<Temporary<Attr>>`, fixes  #5684.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8ecb9d681c385995b082d67874fdfa7f1e929e1f
2015-04-27 15:25:30 -05:00