aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
Commit message (Collapse)AuthorAgeFilesLines
* Auto merge of #9419 - psdh:includeTypedef, r=noxbors-servo2016-01-261-0/+12
|\ | | | | | | | | | | | | | | | | | | generate typedefs in CodegenRust. fixes #9384 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9419) <!-- Reviewable:end -->
| * generate typedefs in CodegenRustPrabhjyot Singh Sodhi2016-01-261-0/+12
| |
* | For WebIDL interfaces without constant members, do not generate a 'Constant' ↵Michael Rosenberg2016-01-261-3/+6
| | | | | | | | module
* | Move ConstantSpec, NonNullJSNative and define_constants from utils to interfacenxnfufunezn2016-01-241-3/+4
|/
* webidl: Refactor isSequence in getJSToNativeConversionInfoEmilio Cobos Álvarez2016-01-151-2/+5
| | | | | | | | That way it does not depend on the return value for the same type. This hopefully makes the code more clear, and avoids errors if something changes in the future (for example, we could want to pass slices as sequence arguments).
* webidl: Implement sequences in unionsEmilio Cobos Álvarez2016-01-151-20/+30
| | | | Unblocks #9053
* codegen: Implement WebIDL sequence argumentsEmilio Cobos Álvarez2016-01-121-1/+10
|
* codegen: Move conversion behaviour to a common functionEmilio Cobos Álvarez2016-01-121-24/+32
|
* Fix prototypes of interface objects (fixes #2665)Anthony Ramine2016-01-121-54/+65
|
* Describe non-callback interface objects with JSClass structuresAnthony Ramine2016-01-121-30/+66
| | | | JS_NewFunction doesn't allow us to set the prototype of the interface objects.
* Bump rust-mozjs to 4d384eb830d8d53c1268e8ce37135ace21e41721Anthony Ramine2016-01-121-1/+2
|
* Introduce Descriptor.prototypeDepthAnthony Ramine2016-01-121-2/+2
|
* Use the object prototype for callback interface objectsAnthony Ramine2016-01-121-1/+1
| | | | window.NodeFilter's prototype should be the object prototype.
* Refactor prototype initialisationAnthony Ramine2016-01-121-110/+93
| | | | | | | | | | | | | The function do_create_interface_objects is removed in favour of 4 functions: create_callback_interface_object, create_interface_prototype_object, create_noncallback_interface_object and create_named_constructors. While this increases the amount of codegen'd code, this greatly improves the readability of the code involved in this part of DOM, instead of having one function doing 4 different things. We can always find a more adequate abstraction later. NativeProperties and everything related to the interface objects have been removed from the utils module.
* Remove NativePropertyHooksAnthony Ramine2016-01-121-32/+2
|
* Remove unneeded dict sorting functions in CodegenRust.pyCorey Farwell2016-01-101-18/+4
|
* Generate PartialEq automaticallyGuillaume Gomez2016-01-031-0/+6
|
* Auto merge of #8993 - nox:small-codegen-slimming, r=Ms2gerbors-servo2015-12-181-3/+4
|\ | | | | | | | | | | | | | | | | | | Slightly reduce the output of codegen Interfaces which we know are never instantiated can generate less code. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8993) <!-- Reviewable:end -->
| * Link [Abstract] to the existing concrete descriptor fieldAnthony Ramine2015-12-161-1/+2
| | | | | | | | | | | | This makes codegen not emit anything strictly related to the interface which are never used in the case of abstract interfaces, such as the Wrap method or the DOMJSClass.
| * Do not export GetProtoObject if the interface has no descendantsAnthony Ramine2015-12-161-2/+2
| |
* | Auto merge of #8996 - nox:rm-empty-modules, r=frewsxcvbors-servo2015-12-161-8/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not create modules from files with nothing to codegen (fixes #8711) Fixes #8711. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8996) <!-- Reviewable:end -->
| * | Do not create modules from files with nothing to codegen (fixes #8711)Anthony Ramine2015-12-161-8/+12
| |/
* | Auto merge of #8055 - nox:rm-webidl-patches, r=Ms2gerbors-servo2015-12-161-5/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all our patches to the WebIDL parser All the tweaks we need can just be made through Configuration.py. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8055) <!-- Reviewable:end -->
| * | Remove all our local patches to the WebIDL parserAnthony Ramine2015-12-151-5/+6
| |/ | | | | | | | | All the tweaks we need can just be made through Configuration.py, and [Abstract] is being submitted upstream by Ms2ger.
* / Merge CGClassConstructHook and CGClassNameConstructHook (fixes #8934)Anthony Ramine2015-12-151-37/+14
|/
* Fix invalid returned value for dictionary typesGuillaume Gomez2015-12-151-2/+2
|
* Fix invalid dictionary inheritanceGuillaume Gomez2015-12-141-1/+2
|
* Treat undefined arguments in JS as missingKeith Yeung2015-12-121-5/+5
|
* Avoid a null-dereference using debug mozjs builds. This matches the ↵Josh Matthews2015-12-071-22/+9
| | | | equivalent code upstream in Gecko.
* Implement [Unforgeable]Anthony Ramine2015-12-021-78/+225
| | | | | | | | | | | | | | | | | | | | | | This is mostly stolen from Gecko. As there, we define the unforgeable members on an object stored in the slots of the prototype object. They are then copied onto instance objects when they are instantiated. It should be noted that proxy objects see their unforgeable memebers defined on their expando object. Unforgeable attributes aren't properly inherited in codegen (in a similar fashion as getters and setters as filed in #5875) and require to be redefined in derived interfaces. Fortunately, there are currently no such interfaces. No unforgeable members can be included into the TestBinding interfaces for good measure because they are not compatible with setters. Given the unforgeable holder object has the same prototype as actual instances of the interface, the finalize hook needs to check its slot pointer for nullity before dropping it. The new failing test isn't related to Unforgeable attributes, but to the fact that all Document instances currently have a Location, even if their window isn't in a browsing context.
* Remove unused slot in prototype object (fixes #8588)Anthony Ramine2015-11-301-11/+2
|
* Auto merge of #8477 - asajeffrey:opaque-domstring, r=asajeffreybors-servo2015-11-131-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opaque DOMString 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. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8477) <!-- Reviewable:end -->
| * Code generation uses DOMString::from("...") rather than ↵Alan Jeffrey2015-11-121-1/+1
| | | | | | | | DOMString("...".to_owned()).
* | Auto merge of #8147 - nox:weakref, r=Ms2gerbors-servo2015-11-131-4/+42
|\ \ | |/ |/| | | | | | | | | | | Implement weak-referenceable JS-managed objects <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8147) <!-- Reviewable:end -->
| * Introduce trait WeakReferenceableAnthony Ramine2015-11-121-4/+42
| | | | | | | | This allows to take weak references of JS-managed DOM objects.
* | Auto merge of #8498 - nox:fix-variadic-and-default-arguments, r=jdmbors-servo2015-11-131-9/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Properly handle variadic arguments preceded by default values I broke that in #8197. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8498) <!-- Reviewable:end -->
| * | Properly handle variadic arguments preceded by default valuesAnthony Ramine2015-11-121-9/+10
| |/ | | | | | | I broke that in #8197.
* | Use the conversion traits from js.Ms2ger2015-11-121-23/+21
| |
* | Use throw_type_error and throw_range_error from js.Ms2ger2015-11-121-10/+5
|/
* Implement WebIDL sequence return valuesEmilio Cobos Álvarez2015-11-111-1/+6
|
* Support variadic interface arguments (fixes #8159)Anthony Ramine2015-11-111-53/+50
| | | | | We use a RootedVec value in codegen, of which we use the `r()` method to pass `&[&T]` to the interface methods.
* Remove unused parameter in instantiateJSToNativeConversionTemplate()Anthony Ramine2015-11-111-16/+7
|
* Clean up the conversion routinesAnthony Ramine2015-11-111-16/+14
| | | | | | | | Functions returning `Root<T>` are prefixed by "root_" and the ones returning `*const T` by "native_". Functions taking `*mut JSObject` are now suffixed by "_from_object" and the ones taking `&T` by "_from_reflector".
* Auto merge of #8286 - eefriedman:no-move, r=noxbors-servo2015-11-081-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary uses of #[no_move] The patch makes RootCollection a bit safer by making the StackRootTLS hold it in place. RootedVec was doing an extremely delicate dance and just hoping nobody messed it up; switch to a Box to be safe. CodeGenRust seemed to be using no_move for no particularly good reason. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8286) <!-- Reviewable:end -->
| * Clean up some code related to #[no_move].Eli Friedman2015-11-071-1/+0
| | | | | | | | | | | | | | | | The patch makes RootCollection a bit safer by making the StackRootTLS hold it in place. The use of no_move in CodeGenRust was leftover from when roots couldn't be moved.
* | Make DOMString a newtype around String, rather than a typedef.Ms2ger2015-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | This should make it somewhat easier to experiment with alternative representations in the future. To reduce churn, this commit leaves the String field public, though. Also, this will allow us to use the default String type to represent the IDL USVString type, which explicitly forbids unpaired surrogates, ans as such is a better match to the Rust String type.
* | make test-tidy happy + fix some merge errorsrohan.prinja2015-11-031-3/+3
| |
* | merge from masterrohan.prinja2015-11-031-0/+4
|\|
| * Support unions that contain USVStrings.Ms2ger2015-10-301-0/+4
| |
* | more refactoringrohan.prinja2015-10-301-3/+4
|/