Commit graph

257 commits

Author SHA1 Message Date
Tomas Cernaj
18632570cd servo: Merge #8909 - Move ScriptMsg to script_traits crate, Fixes #8833 (from cnaj:msg_refactoring); r=jdm
Review of documentation that was missing needed.

Fixes #8833.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7438bc0425749989b8aab084a34ff3fff2ea6679
2015-12-10 10:55:44 +05:01
Roman Klauke
2609215b43 servo: Merge #8855 - move FocusType enum to the script crate (from romankl:move-focus-enum); r=Ms2ger
This commit moves the FocusType enum to the script crate and replaces all usages with the new `usage`.

Fixes #8840

Source-Repo: https://github.com/servo/servo
Source-Revision: e16c930f36582f40da4736f88675f559e7e47098
2015-12-06 19:47:23 +05:01
ronak
e047c6ff80 servo: Merge #8829 - M1503 : Integrate XML Parser : First 2 of 4 Subsequent Steps (from jdm:xmlparser2); r=jdm
Rebase of #8746. Introduce and use an XML parser for text/xml network responses when loading web pages.

Source-Repo: https://github.com/servo/servo
Source-Revision: 368dd1dc53cd595bbbcf6f9fb139e9ac573a351b
2015-12-05 02:39:40 +05:01
Ms2ger
d83aa1b67c servo: Merge #8805 - Simplify drain_modified_elements a bit (from Ms2ger:drain_modified_elements); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 9c2690347232ee6a2b16e28021e494ed17a0f274
2015-12-04 19:53:54 +05:01
Ms2ger
6ce36f8878 servo: Merge #8820 - Fix warnings (from Ms2ger:warnings); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: bb117abcd3fee0c3435cefd3d4f196345770ca69
2015-12-04 14:40:00 +05:01
Matt Brubeck
90c5caf1aa servo: Merge #8785 - Add slow path for hit testing of iframe behind positioned content layer (from mbrubeck:fixed-hit-test); r=pcwalton
Fixes browser.html blocker #8759. r? @pcwalton

This adds a slow path for cases where the compositor's layer-based hit testing is incorrect.  If the script task discovers that a mouse event should have been dispatched to an iframe, it bounces the event back to the constellation to be forwarded to the correct pipeline.

This isn't terribly slow (on the slow path, it adds one extra round-trip message between script and constellation), but if we want to optimize this better we could instead replace the compositor's layer hit testing with display list hit testing in the paint task.  This would be a more complicated change that I think we should save for a follow-up.

This only fixes mouse input for now.  A basically-identical change will be needed for touch-screen input, whether we stick with this approach or switch to the paint task.

Source-Repo: https://github.com/servo/servo
Source-Revision: bc62b5aadb62267582fbd65daa28438ce6c6ac9c
2015-12-04 02:25:22 +05:01
Corey Farwell
cec8d31e5c servo: Merge #8714 - Implement attribute 'fgColor' on 'document' (from frewsxcv:body-fgcolor); r=Ms2ger
The 'text' attribute was implemented on `<body>` in #7841

Source-Repo: https://github.com/servo/servo
Source-Revision: 65108348aa543774ade163b25836018fa8f6c00f
2015-12-01 21:11:58 +05:01
Josh Matthews
602578f515 servo: Merge #8558 - Dispatch load events for cross origin iframes. Resolves #6672 (from jdm:crossoriginiframeload); r=glennw
Splitting it out from #6677.

Source-Repo: https://github.com/servo/servo
Source-Revision: 51c19fd733a863f2fae05e693795dbecce69f2ed
2015-12-01 03:40:11 +05:01
Guillaume Gomez
e2ebe34e9f servo: Merge #8675 - Add XMLDocument object (from GuillaumeGomez:master); r=nox
Fixes #8000

(Still working on it)

Source-Repo: https://github.com/servo/servo
Source-Revision: 99223656fbf6cade8c41d161a9e61a39f58ec796
2015-11-27 19:00:04 +05:01
Manish Goregaokar
693578b06a servo: Merge #8446 - Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08) (from servo:rustup_20151110); r=SimonSapin+Ms2ger+jdm+Manishearth
<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (https://github.com/rust-lang/rust/issues/29740) and can crash the OS. Probably will set our CI on fire. </s>

Source-Repo: https://github.com/servo/servo
Source-Revision: f13c72d68e1e7f49e241938bfd6e8a588c68e86b
2015-11-27 10:18:00 +05:01
Matt Brubeck
41c7bd5bed servo: Merge #8671 - Fix clip rect for iframes in hit testing code (from paulrouget:iframe-hit-test); r=pcwalton
Fixes #8080 r? @mrobinson

Source-Repo: https://github.com/servo/servo
Source-Revision: 8efc954531d2c7491ea01b6e22c89e35c5cf434a
2015-11-26 00:10:36 +05:01
Alan Jeffrey
f4ab2bfdb5 servo: Merge #8667 - Update string cache (from asajeffrey:update-string-cache); r=SimonSapin
Updated string_cache to 0.2, and updated the dependencies that depend on string_cache.
Removed references to string_cache_plugin.
Import atom! and ns! from string_cache.
Replaced ns!("") by ns!().
Replaced ns!(XML) and co by ns!(xml) and co.
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 188fa9378c103093f1f8dac24bff0d9d237fd2bc
2015-11-25 23:41:39 +05:01
Tom Schuster
c52768cb81 servo: Merge #8655 - Implement document.domain getter (from jdm:domain); r=jdm
Rebased from #6840 + test fixes.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0905088e83819ada426ee6124f8c7e2d8978ea8b
2015-11-24 05:32:13 +05:01
Eli Friedman
007efab7d2 servo: Merge #8441 - Make the needs_reflow method actually work correctly (from eefriedman:needs-reflow); r=bholley
The document node is always dirty because layout never clears the bit;
instead, check the dirty bit of the root element.

Source-Repo: https://github.com/servo/servo
Source-Revision: a2be34365ae3b3e9a4f7da7a0fb5ed2dbf8426eb
2015-11-22 05:15:08 +05:01
Corey Farwell
142c7b7efe servo: Merge #8622 - Implement 'url!(..)' macro (from frewsxcv:url-plugin); r=SimonSapin
https://github.com/servo/rust-url/issues/136

https://github.com/servo/rust-url/pull/137

Source-Repo: https://github.com/servo/servo
Source-Revision: ea690a2dff64d1cb4eb668473d62f1bbcb19f7c8
2015-11-21 20:41:52 +05:01
Keith Yeung
5b3f4b220a servo: Merge #8530 - Split ConstellationMsg into ScriptMsg and CompositorMsg (from KiChjang:split-constellation-msg); r=jdm
Fixes #8356.

Source-Repo: https://github.com/servo/servo
Source-Revision: acbe41305230a926458596444ca955eff063d9dd
2015-11-19 04:10:20 +05:01
Ms2ger
f0af48c824 servo: Merge #8569 - Rustfmt some of script (from Ms2ger:fmt-script); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: 7a87312121a69b590b364f9b5095f3145554e24b
2015-11-18 15:15:30 +05:01
Ms2ger
e0b4ad2928 servo: Merge #8548 - Remove the unused arguments to hit_test and mouse_over (from Ms2ger:unused-tna); r=pcwalton
I don't think this code is called when there is no document element, but I
added assertions to make sure we notice in case I was wrong.

Source-Repo: https://github.com/servo/servo
Source-Revision: 20d26853e145e275695463662b6cee334cd27085
2015-11-17 01:36:52 +05:01
Greg Guthe
c64559414c servo: Merge #7242 - Perf timing dom props (from g-k:perf-timing-dom-props); r=jdm
I think this is closer to what https://github.com/servo/servo/issues/7045 describes, but it panics trying to load a page (trace: https://gist.github.com/g-k/a9911467889cdb6fdbf9) and all reftests fail.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7de8b0a7ff2038f9fb643141d8759f40fb6ef093
2015-11-14 10:57:23 +05:01
Alan Jeffrey
f8093754b7 servo: Merge #8477 - Opaque DOMString (from asajeffrey:opaque-domstring); r=asajeffrey
This patch makes DOMString an opaque wrapper round String (currently it's a transparent wrapper).

The changes are:

* Replacing DOMString(foo) by DOMString::from(foo).
* Replacing foo.0 by String::from(foo).
* Adding functions clear, push_str and extend for in-place mutation of DOMStrings.
* Replacing DOMString by String in other threads (devtools, storage and filereader).
* Making DOMString implement !Send.
* Removing the pub attribute from the contents of DOMString.

This enables experimenting with other string representations in the DOM.

Source-Repo: https://github.com/servo/servo
Source-Revision: 62acdd303b78951885c2c90747b31f318907d6c9
2015-11-13 06:48:30 +05:01
Josh Matthews
e29664aa5b servo: Merge #8430 - Invoke specialized callback behaviour for OnErrorEventHandler (from jdm:errorhandler); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: fafc280179ddafab878dd261121cee17ba3b921c
2015-11-13 03:25:00 +05:01
Bobby Holley
6c48a45939 servo: Merge #8381 - Implement attribute restyle hints (from bholley:attr_restyle_hints); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 13226f847234cd0130820338d5a272277780d278
2015-11-11 00:58:45 +05:01
Alan Jeffrey
5b61974f7a servo: Merge #8227 - Versioned dom (from asajeffrey:versioned_dom); r=eefriedman
This PR adds versioning to the DOM. There are now node.get_version and node.get_descendent_version methods that return a counter that is bumped when the node is dirtied. This is used to implement cache invalidation for caching HTMLCollection state. Caching HTMCollections gets a 1000x speedup in the Dromaeo DOM query tests.

Addresses https://github.com/servo/servo/issues/6901, https://github.com/servo/servo/issues/3381 and https://github.com/servo/servo/issues/1916.

Replaces PR https://github.com/servo/servo/pull/6927.

Source-Repo: https://github.com/servo/servo
Source-Revision: f39faaf99471f5419710e1a3d434e5d5fab0d221
2015-11-10 00:42:23 +05:01
Eli Friedman
d1d6ecbdd2 servo: Merge #8404 - Misc cleanup for DOM attributes (from eefriedman:misc-attributes); r=nox
No functional change; just cleanups related to parsing attributes.

Source-Repo: https://github.com/servo/servo
Source-Revision: d8df028197505ca439363cdb05bed58fe9b4b726
2015-11-10 00:03:24 +05:01
Corey Farwell
ad2721d49c servo: Merge #8403 - Minor 'node_from_nodes_and_strings' cleanup (from frewsxcv:node-from-nodes-and-strings); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: fc98b8e126b9f14229d677ea49b3afa819aa6910
2015-11-08 17:04:46 +05:01
Till Schneidereit
6b102412c1 servo: Merge #8039 - Move Stylesheet loading and ownership from the layout task into HTML elements (from tschneidereit:script-owns-stylesheets); r=jdm
Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.

Depends on #7979 because without that loading stylesheets asynchronously breaks lots of content.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7ff3a17524e0e703e3ac279441729c185444be24
2015-11-08 00:42:54 +05:01
Michael Howell
42386325c6 servo: Merge #8296 - Prepend, rather than append, SVG title elements (from notriddle:svg_title_prepend); r=nox
Fixes #8164

Source-Repo: https://github.com/servo/servo
Source-Revision: 3c794d0076d9f68754865c1fdaa7d2e6055bc777
2015-11-07 13:44:42 +05:01
Bobby Holley
577687c224 servo: Merge #8341 - Fix restyle hints to handle non-last psuedo-selectors, and track pristine state values rather than changesets (from bholley:state_hint_selector_ordering); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 65c3185b202b8dd57a39e1d84872d7528723b191
2015-11-07 09:24:19 +05:01
Josh Matthews
6413df2894 servo: Merge #8326 - Send mouse move events to the the previous layer when directing event… (from jdm:iframehover); r=glennw
…s to a new one for the first time. Resolves #7865.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4067960ba5d309ec6c4c6aef6e7aa231aca0e5d5
2015-11-06 05:55:59 +05:01
Ms2ger
7cb2a13f43 servo: Merge #8312 - Make DOMString a newtype around String, rather than a typedef (from Ms2ger:DOMString); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: abfd1fb1bf071961bc8a581927eaa96a2d3e2cba
2015-11-04 16:18:41 +05:01
David Zbarsky
ed7fd17b12 servo: Merge #8305 - Get rid of a bunch of explicit derefs (from dzbarsky:roots); r=Ms2ger,
Source-Repo: https://github.com/servo/servo
Source-Revision: 4b9fa13f2f6a1aa38d180367426498f01f6414c9
2015-11-04 10:34:54 +05:01
rohan.prinja
e8b504412b servo: Merge #8221 - move modules around (from ajnirp:8130-reorganise); r=jdm
for #8130

Source-Repo: https://github.com/servo/servo
Source-Revision: daad09d44245228fba9118316937add71bec7c58
2015-11-04 02:27:02 +05:01
Matt Brubeck
4b6e081f7b servo: Merge #8232 - Correct event dispatching for multiple simultaneous touch points (from mbrubeck:glutin-touch); r=glennw
Instead of just converting the mouse into a single "touch" input, Servo can now listen for multi-touch events from Glutin, maintain a list of active touch points, and dispatch events for all of them.

r? @glennw (for the compositor changes) and @jdm (for the DOM changes)

Source-Repo: https://github.com/servo/servo
Source-Revision: 3fdaa6e3f32f6996c416e75119177b98d404adb2
2015-11-03 22:16:21 +05:01
Alan Jeffrey
690f25f37c servo: Merge #8087 - Removced unncessary call to dirty() in Document::node_and_heritage_ch… (from asajeffrey:dont_dirty_twice); r=pcwalton
Removed unncessary call to dirty() in Document::node_and_heritage_change, since the node is aready dirtied by force_dirty_ancestors().

Source-Repo: https://github.com/servo/servo
Source-Revision: 23efa0a36f22bc1ba06023892d7cb292f5899275
2015-11-03 20:35:39 +05:01
Eli Friedman
3d84958c1f servo: Merge #8056 - Fix the implementation of JSTraceable for RefCell (from eefriedman:trace-refcell); r=jdm
The existing implementation could panic; make sure that doesn't
happen by requiring that the contents of a RefCell are trivially
traceable (i.e. the value don't contain any traceable objects).

I'm not sure whether the TriviallyJSTraceable trait is actually
worthwhile; maybe we should just never use RefCell in the DOM.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4f51710ed387baa1ad0a6e4cdb0fc5eee44093d5
2015-11-03 06:38:40 +05:01
Ms2ger
22148e83d8 servo: Merge #8282 - Cleanup Document::handle_mouse_move_event a bit (from Ms2ger:handle_mouse_move_event); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: 912359fcbd74ddfdfa7aaf11f28cc8c2cfbd0eac
2015-10-31 18:28:31 +05:01
nxnfufunezn
cba28409a5 servo: Merge #8262 - Removed JS::root #8251 (from nxnfufunezn:Remove_JS_root); r=Ms2ger
Fixes #8251

r? @Ms2ger

Source-Repo: https://github.com/servo/servo
Source-Revision: 37c03c78165fbb77eb024f2c3376d5e33cd7e446
2015-10-31 17:55:23 +05:01
Bobby Holley
5db6816cd0 servo: Merge #8162 - Centralize event states in rust-selectors (from bholley:centralize_event_states); r=pcwalton
This still needs a rev bump on rust-selectors once https://github.com/servo/rust-selectors/pull/55 gets merged.

Source-Repo: https://github.com/servo/servo
Source-Revision: 521a87180a85709f8f704df33537f79bd131bf71
2015-10-31 09:36:45 +05:01
rohan.prinja
258086b9fa servo: Merge #8250 - remove get_rooted() and replace all references to it with references … (from ajnirp:8246-remove-get-rooted); r=Ms2ger
…to get()

for #8246

Source-Repo: https://github.com/servo/servo
Source-Revision: 00b60b93860d32e1c5aaf0f9b4a2ce5110880652
2015-10-30 06:08:44 +05:01
Bobby Holley
b3fb877c87 servo: Merge #8098 - Track event state changes on Document and do the dirtying from layout (from bholley:dirty_from_layout); r=jdm
This is a first step in fixing #6942.

Source-Repo: https://github.com/servo/servo
Source-Revision: 285e29c06637f31a8b8a27c2e454468717924ebd
2015-10-28 23:55:53 +05:01
Axel Solis Trompler
64b55b1241 servo: Merge #8169 - Implement document.createEvent(TouchEvent) (from ax3lst:master); r=eefriedman
This solves #8160

Source-Repo: https://github.com/servo/servo
Source-Revision: 7c9f4644f3f5849a68a0575c755d9cb5619c86dc
2015-10-28 05:26:03 +05:01
Rohan Prinja
83a9340c66 servo: Merge #8217 - remove DocumentProgressTask enum (from ajnirp:8211-remove-documentprogresstask); r=Manishearth
for #8211

Source-Repo: https://github.com/servo/servo
Source-Revision: a6e2c138db156a7b817107b22c482010ebcdcf2a
2015-10-27 00:12:02 -05:00
Till Schneidereit
f0ce107fb5 servo: Merge #7979 - Improve spec-compliance of script loading and execution during document startup (from tschneidereit:script-loading-fixes); r=jdm
Including proper support for async and deferred scripts.

r? @jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: 704c5ef25a846ac4321cd136d9747dee9513f98b
2015-10-26 15:48:23 -05:00
Corey Farwell
a62d22ef7f servo: Merge #8178 - Implement a couple attributes for <label> elements (from frewsxcv:label); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: af8a1cb8a03e661f27c738512254a8f31915f3ba
2015-10-26 09:51:56 -05:00
Corey Farwell
809309e229 servo: Merge #8181 - Remove unnecessary allocation with getElementById (from frewsxcv:no-alloc-get-element-by-id); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 3b50f219631ee8b8746199ef2bc1d60c716295ea
2015-10-24 17:25:09 -05:00
Matt Brubeck
a4f7ce3218 servo: Merge #7204 - Very basic touch events and touch scrolling (from mbrubeck:touchevent); r=jdm
This implements just enough of [Touch Events](http://w3c.github.io/touch-events/) to enable scrolling on Android without regressing basic single-touch interaction like clicking on links.

Dragging a page will scroll it, unless the page calls `preventDefault` on the "touchstart" event.

Does **not** yet support pinch zooming or other multi-touch gestures or events.

Includes a `-Z convert-mouse-to-touch` command line flag for testing on non-touch platforms.  This is also enabled by default on Android because Glutin currently translates touch input to mouse events on Android.

Source-Repo: https://github.com/servo/servo
Source-Revision: dcd207f9bf15c9ecf5d043385ba93277e69201f6
2015-10-22 15:54:01 -06:00
Anthony Ramine
bb8125a3da servo: Merge #8041 - Introduce trait Castable (from nox:castable); r=jdm
Removes all those messy FooCast structures in InheritTypes.rs.

Source-Repo: https://github.com/servo/servo
Source-Revision: 674589c370d978f543e71f995d58c5b28e6e9842
2015-10-21 07:57:32 -06:00
Adam Szopa
7ecd87862f servo: Merge #8099 - Remove explicit lifetimes which can be elided (from Darktori:master); r=mbrubeck
Fixes https://github.com/servo/servo/issues/8069

Source-Repo: https://github.com/servo/servo
Source-Revision: 941c06eb99533c6c1d55b4ad3b51804badf48a23
2015-10-20 17:30:57 -06:00
Anthony Ramine
1c1210fbba servo: Merge #8060 - Implement Deref<Target=T> for JS<T> where T: Reflectable (from nox:deref-js); r=Ms2ger
We can only borrow `JS<T>` from rooted things, so it's safe to deref it.
The only types that provide mutable `JS<T>` things are `MutHeap<JS<T>>` and
`MutNullableHeap<JS<T>>`, which don't actually expose that they contain
`JS<T>` values.

Source-Repo: https://github.com/servo/servo
Source-Revision: 1a376aa75d5de8781b17a673850860f8afd2c28f
2015-10-19 06:32:05 -06:00
Bobby Holley
ad33b14737 servo: Merge #7935 - Move event state from Node to Element (from bholley:eventstate_element); r=nox
Just getting my feet wet with Rust here. Please feel free to nit the hell out of it stylistically and idiomatically. :-)

Source-Repo: https://github.com/servo/servo
Source-Revision: ff2151b8bbc62fa29c90a429b7a4f12520420b6e
2015-10-19 02:47:21 -06:00