Commit graph

2204 commits

Author SHA1 Message Date
bors-servo
7326df044c auto merge of #2203 : mbrubeck/servo/back-crash, r=jdm
This fixes two `RefCell<T> is already borrowed` failures when reloading an
existing pipeline, both caused by functions trying to modify `Pipeline::url`
or `ScriptTask::url` while a reference to a previous borrow is still in scope.

Note: After applying this patch, there are some painting issues after navigating back.
2014-04-23 14:10:21 -04:00
bors-servo
00f4340a8d auto merge of #2208 : mbrubeck/servo/dead-invalidate-rect, r=metajack
This is dead code; should we remove it, or are there plans to use it sometime soon?

r? @pcwalton
2014-04-23 12:31:49 -04:00
bors-servo
3fc2c11910 auto merge of #2209 : lpy/servo/issue2188, r=Ms2ger
see #2188
2014-04-23 03:19:23 -04:00
lpy
dfe5215b88 Implement Element.localName.(fixes #2188) 2014-04-23 11:00:03 +08:00
Matt Brubeck
46e5d5379f Remove unused invalidate_rect code 2014-04-22 18:25:44 -07:00
bors-servo
b35d830999 auto merge of #2192 : evilpie/servo/children, r=Ms2ger
Fixes #2186
2014-04-22 16:52:17 -04:00
Tom Schuster
4c057deaf9 Implement ParentNode.children for Document and Element
Also implement it for DocumentFragment
2014-04-22 22:19:52 +02:00
bors-servo
bdcd8dd0c2 auto merge of #2111 : jdm/servo/browsercontext, r=Ms2ger 2014-04-22 11:01:18 -04:00
Josh Matthews
94dffca1e1 Remove all traces of WindowProxy. Implement basic browser context concept and outerizing of inner windows. 2014-04-22 10:57:25 -04:00
Tetsuharu OHZEKI
cdbe179acb Make Attr handles all setting value. 2014-04-22 16:15:15 +09:00
Tetsuharu OHZEKI
b2fa6fa221 Make Attr::SetValue to reflect attribute change. 2014-04-22 16:15:15 +09:00
Tetsuharu OHZEKI
a74397432e Make Attr::SetValue uses the internal setter. 2014-04-22 16:15:15 +09:00
Matt Brubeck
b38f7d26d1 Make sure RefCell borrows are temporary.
This fixes two `RefCell<T> is already borrowed` failures when reloading an
existing pipeline, both caused by functions trying to modify `Pipeline::url`
or `ScriptTask::url` while a reference to a previous borrow is still in scope.
2014-04-21 16:06:01 -07:00
bors-servo
c6bdc7b7f2 auto merge of #2202 : jdm/servo/scriptleak, r=Ms2ger
....
2014-04-21 17:13:22 -04:00
bors-servo
3c175c7ac0 auto merge of #2195 : lpy/servo/issue2190, r=Ms2ger
see #2190
2014-04-21 16:49:28 -04:00
bors-servo
73a0658b8a auto merge of #2196 : hazz/servo/initevent, r=Ms2ger
Should fix #2189

This is my first PR for servo (and first time using Rust), so apologies if anything is horribly wrong.
2014-04-21 16:22:25 -04:00
Josh Matthews
3078f58055 Ensure JS-owned memory is not leaked if a script task fails. Fixes #2201. 2014-04-21 16:10:28 -04:00
bors-servo
f864d21212 auto merge of #2072 : brunoabinader/servo/domimpl-createdocument, r=Ms2ger
Spec:
http://dom.spec.whatwg.org/#dom-domimplementation-createdocument

Closes #1509.
2014-04-21 15:58:27 -04:00
bors-servo
c760577aee auto merge of #2199 : sankha93/servo/prefix-impl, r=Ms2ger
See #1737.

r? @ms2ger
2014-04-21 15:31:36 -04:00
Sankha Narayan Guria
36bf23de20 Implement Element.prefix (Fixes #1737) 2014-04-22 00:27:06 +05:30
Bruno de Oliveira Abinader
41898f0a76 Implement DOMImplementation::createDocument
Spec:
http://dom.spec.whatwg.org/#dom-domimplementation-createdocument

Closes #1509.
2014-04-21 09:30:36 -03:00
Ms2ger
4f9e119334 Remove JSPageInfo::js_compartment.
A js::rust::Compartment is little more than a glorified pointer to the
reflector of a window, so there's no good reason to use it. Instead, this
commit passes a JS<Window> directly when it's necessary.

This also means that we now have to use JS_DefineFunctions rather than
Compartment::define_functions; I believe the former is clearer to the reader
than the extra indirection involved in the latter calling through three
reopsitories.

This commit also simplifies ScriptTask::load to reuse the 'cx' local that is
in scope already, rather than refetching it through js_info.
2014-04-21 13:43:18 +02:00
Harry Maclean
7dbf69c223 set the right flags and attrs for InitEvent 2014-04-20 19:23:55 +01:00
lpy
fd9541357f Implement CharacterData.{deleteData, insertData, replaceData} 2014-04-21 00:53:16 +08:00
Ms2ger
a04d4e63eb Remove not-yet-implemented methods from CharacterData.
This speeds up a web-platform-tests run by about 45 seconds (of 11-12 minutes)
by avoiding three timeouts.
2014-04-19 17:39:13 +02:00
bors-servo
ba9177b7cc auto merge of #2178 : Ms2ger/servo/enum-position, r=jdm
This is a shorter and probably slightly more efficient to write the loop.
2014-04-19 11:01:15 -04:00
bors-servo
5c20ed3023 auto merge of #2179 : Manishearth/servo/refactor-canceled, r=Ms2ger
See #2177
2014-04-19 07:25:15 -04:00
Manish Goregaokar
a748e48f48 Rename Event::default_prevented -> Event::canceled to better match spec (#2177) 2014-04-19 16:02:14 +05:30
bors-servo
4331fad53d auto merge of #2175 : Manishearth/servo/domtests-createevent, r=Ms2ger
#2172

All subtests of `dom/events/Event-defaultPrevented.html` pass now.

CustomEvent has yet to be implemented.(#2173)
2014-04-19 06:22:07 -04:00
Ms2ger
48b8c066f9 Use position in FindEnumStringIndex.
This is a shorter and probably slightly more efficient to write the loop.
2014-04-19 12:20:50 +02:00
Manish Goregaokar
fa7bc7a686 Fix most defaultPrevented test failures (#2172) 2014-04-19 15:46:18 +05:30
bors-servo
7d9fa35671 auto merge of #2166 : campadrenalin/servo/https-dont-panic, r=jdm
This is a stab at #2401 - I think this was what @jdm had in mind for a fix.

I've also included a test. There's no "i tried" star, I'm too much of a newb for that, but hopefully the test at least confirms that servo doesn't crash on HTTPS requests.
2014-04-18 21:55:13 -04:00
Philip Horger
c63ae6f11d Don't panic on https #2104 2014-04-18 11:32:46 -07:00
Ms2ger
65ed97bab8 Introduce a get_dictionary_property function to reduce duplicated code in the dictionary conversion codegen.
This also explicitly disallows dictionary members without a default value, as
the code for those doesn't currently compile.

This is the second step of my planned rewrite of the dictionary initialization
that will remove the default values we currently use to initialize the
dictionary struct in the 'new' function.
2014-04-18 20:10:55 +02:00
Ms2ger
88c5e733b5 Merge the 'new' and 'Init' functions for dictionaries.
This moves the code in callers more in line with conversions for other types
and ensures the default values given to the dictionary fields (as defined by
the defaultValue function in CGDictionary.impl) do not escape the 'new'
method. The new code is also more in line with the code used by the
FromJSValConvertible trait.

This is the first step of my planned rewrite of the dictionary initialization
that will remove the default values entirely and reduce the code
duplication in the 'Init' (now 'new') function.
2014-04-18 17:12:20 +02:00
Ms2ger
8e596d142e Use 'exceptionCode' when converting to DOMString.
This change allows us to use the code even in cases where we return a
Result type rather than a JSBool. Interface, primitive and union types
already get this right.
2014-04-18 17:12:20 +02:00
bors-servo
58efe0bf75 auto merge of #2156 : Ms2ger/servo/codegen-deadcode, r=jdm 2014-04-18 10:28:11 -04:00
Ms2ger
857eb87bb6 Remove unused references to jsids in the generated code for dictionaries. 2014-04-18 15:52:40 +02:00
Ms2ger
9d7478ab8a Remove some dead code from codegen as found by pyflakes. 2014-04-18 15:52:40 +02:00
bors-servo
099815683d auto merge of #2155 : Ms2ger/servo/dictionary-codegen, r=jdm 2014-04-18 09:40:11 -04:00
bors-servo
15e0b48728 auto merge of #2154 : Ms2ger/servo/enumerated-codegen, r=jdm 2014-04-18 09:16:16 -04:00
lpy
94d3c4739a Remove resource_task argument from css_link_listener.(fixes #2153) 2014-04-18 19:58:10 +08:00
Ms2ger
5ac5ba2468 Support nullable strings in dictionaries.
We copy the string in all cases, so there's no need to handle the isMember
case differently.
2014-04-18 11:37:56 +02:00
Ms2ger
b31fdf12ef Add a few tests for dictionary codegen. 2014-04-18 11:30:16 +02:00
Ms2ger
4d20d1716d Implement support for default values for enumeration arguments. 2014-04-18 11:08:21 +02:00
Ms2ger
d53841b016 Handle exceptions from FindEnumStringIndex correctly.
The previous code would return success from the JSNative with a pending
exception, potentially leading to assertion failures inside the JS engine
later.
2014-04-18 10:18:24 +02:00
Ms2ger
baa3845362 Rewrite FindEnumStringIndex to distinguish 'value not found' and 'exception raised'.
This is in preparation for handling those cases differently.
2014-04-18 10:18:17 +02:00
Ms2ger
fa653a5984 Introduce some (commented-out) tests for enumeration codegen. 2014-04-18 10:18:11 +02:00
James Sanders
8bfb5f8b6f Associate ResourceTask with UrlProvenance 2014-04-17 19:52:42 -06:00
bors-servo
0b1c8bf8d6 auto merge of #2147 : jdm/servo/untraceable, r=Ms2ger
...actices, and replace ad-hoc Untraceable structs with empty Encodable implementations.
2014-04-17 18:04:10 -04:00