Commit graph

30 commits

Author SHA1 Message Date
Josh Matthews
f4c1529f56 Forbid unconditionally-exposed interfaces that inherit from conditionally-exposed ones. 2016-05-02 14:32:53 -04:00
Josh Matthews
bb47f72f25 Support controlling the visibility of WebIDL interfaces via the Pref annotation. 2016-04-29 11:03:15 -04:00
Zbynek Winkler
b6dc34862a Use os.path.basename instead of split('/')[-1]
Fixes #10596.
2016-04-17 17:37:29 +02:00
Anthony Ramine
ca979e115b Cache legacy callback interface objects in proto_or_icache_array
We need them to be cached to not instantiate them multiple times with
lazy initialisation.
2016-02-25 15:15:44 +01:00
Prabhjyot Singh Sodhi
d6df844ae5 generate typedefs in CodegenRust 2016-01-26 21:56:44 +05:30
Anthony Ramine
d52948dfd5 Introduce Descriptor.prototypeDepth 2016-01-12 12:34:18 +01:00
bors-servo
8dc4b8dcb9 Auto merge of #8993 - nox:small-codegen-slimming, r=Ms2ger
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 -->
2015-12-18 06:35:15 +05:30
Anthony Ramine
372da02a42 Link [Abstract] to the existing concrete descriptor field
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.
2015-12-16 00:42:15 +01:00
Anthony Ramine
06947965b1 Remove all our local patches to the WebIDL parser
All the tweaks we need can just be made through Configuration.py, and
[Abstract] is being submitted upstream by Ms2ger.
2015-12-15 23:06:35 +01:00
Anthony Ramine
60976406cc Implement [Unforgeable]
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.
2015-12-02 22:15:11 +01:00
Anthony Ramine
72c67efe96 Introduce trait WeakReferenceable
This allows to take weak references of JS-managed DOM objects.
2015-11-12 12:51:50 +01:00
Anthony Ramine
acb13dc899 Support variadic interface arguments (fixes #8159)
We use a RootedVec value in codegen, of which we use the `r()` method to
pass `&[&T]` to the interface methods.
2015-11-11 14:52:21 +01:00
Anthony Ramine
aab2c40389 Generate the TypeId enums in codegen 2015-10-14 18:45:35 +02:00
Anthony Ramine
e24b8ab644 Don't generate useless InheritTypes interfaces
Interfaces with no descendant need neither a Base trait nor upcast functions,
and interfaces with no ancestors neither a Derived trait nor downcast functions.
2015-10-02 16:15:12 +02:00
Corey Farwell
d8da5c20f6 Remove deprecated 'creator' WebIDL attribute
According to @Ms2ger, the 'creator' attribute was merged into 'setter'
2015-09-21 07:12:17 -04:00
Michael Wu
941f7dc04b Move EventTargetTypeId/NodeTypeId to DOMClass 2015-09-12 01:09:46 +02:00
Josh Matthews
40806977b5 Add infrastructure for supporting dashed CSS property names on CSSStyleDeclaration. 2015-08-28 13:15:16 -04:00
Corey Farwell
a276bfa57c Remove dead Python code in binding generating code
Fixes #6956
2015-08-05 09:17:30 -04:00
Corey Farwell
0ec2375cab Remove tidy blacklist for 'script/dom/bindings/*'
Recently, I found myself reading through the Python codegen scripts that
live in 'components/script/dom/bindings/*' and noticed that there were
many tidy violations: unnecessary semicolons, weird spacing, unused
variables, lack of license headers, etc. Considering these files are now
living in our tree and mostly maintained directly by contributors of
Servo (as opposed to being from upstream), I feel these files should not
be excluded from our normal tidy process. This commit removes the
blacklist on these files and fixes all tidy violations.

I added these subdirectories to the blacklist because they appear to be
maintained upstream somewhere else:

* "components/script/dom/bindings/codegen/parser/*",
* "components/script/dom/bindings/codegen/ply/*",

Also, I added a '# noqa' comment which tells us to ignore the
flake8 errors for that line. I chose to ignore this (instead of fixing
it) to make the work for this commit simpler for me.
2015-07-09 19:42:31 +09:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
Anthony Ramine
2a2e8b176d Properly generate proxy stringifiers 2015-04-29 18:52:38 +02:00
Chris Paris
d2b0d5e040 Support callback interfaces with constants. 2015-04-11 09:34:44 -10:00
Chris Manchester
c81f1cc541 Add support for BinaryName attribute to servo's codegen (fixes #4435) r=jdm 2015-02-27 18:28:01 -08:00
Chris Manchester
00f863b4fe Add stringifier method support to CodegenRust.py (fixes #1986)
Add a stringifier to URLUtils (Location). (fixes #4605)

wpt metadata updates for #4605
2015-02-20 11:35:16 -08:00
Ms2ger
147dadce89 Implement an Unrooted smart pointer to replace JS when it is not traced. 2015-02-06 12:33:32 +01:00
Ms2ger
1290c18794 Remove the 'b lifetime from Root.
It does not add any safety, as the reference is constructed from a raw pointer
without limiting the lifetime in any way.
2015-01-01 20:36:43 +01:00
Ms2ger
95ec20bd97 Remove the 'a lifetime from Root.
It does not add any safety, as the reference is constructed from a raw pointer
without limiting the lifetime in any way.
2015-01-01 20:36:43 +01:00
Bruno de Oliveira Abinader
a9d68474c9 Remove warning from 'deleter' WebIDL codegen 2014-11-06 11:31:58 -08:00
Ms2ger
76ba40d5cb Remove support for {return,native,concrete}Type overrides in Bindings.conf.
We have no reason to support non-default type names, and this commit corrects
the computations for callbacks (which needed the override until now).
2014-10-10 13:13:43 +02:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/script/dom/bindings/codegen/Configuration.py (Browse further)