Commit Graph

46 Commits

Author SHA1 Message Date
Boris Zbarsky
90a34fb045 Bug 816421. Make Document.visibilityState a WebIDL enum. r=peterv
A lot of the changes here are just so I can actually build after including DocumentBinding.h in nsIDocument.h
2012-12-25 14:00:15 -08:00
Boris Zbarsky
20a6d96dc4 Bug 804631. Add the WebIDL API for Document. r=peterv
I'm not entirely happy with the XPath bits.  If we had an
nsXPathEvaluator member, or if the WebIDL API were on
nsIDOMXPathEvaluator or something, all that stuff would need a lot
less code...
2012-12-22 00:27:27 -08:00
Boris Zbarsky
0f31ea33da Bug 816380. Convert XPathEvaluator to WebIDL. r=peterv 2012-12-14 14:10:49 -05:00
Boris Zbarsky
721e804d9a Bug 807224. Implement native-to-JS conversion for WebIDL unions. r=peterv 2012-11-09 07:59:33 -08:00
Boris Zbarsky
7399600c6f Bug 779048 part 1. Implement a parent class for C++ reflections of callback functions in WebIDL. r=bholley,smaug 2012-11-09 07:43:57 -08:00
Boris Zbarsky
ac7e3e09f9 Bug 796983 part 2. Add a way to generate an example class declaration for a given WebIDL interface. r=jst
We mark constructors as static in the parser because they are.  This
allows us to just use the isStatic() for the IDLMember to mark our
declarations static.

To generate an example interface implementation, just "make
interfacename-example" in $objdir/dom/bindings.  This will place files
called interfacename-example.h and interfacename-example.cpp in that
directory.  For example, "make XMLHttpRequest-example" will get you
$objdir/dom/bindings/XMLHttpRequest-example.h and
$objdir/dom/bindings/XMLHttpRequest-example.cpp.

Attribute getters currently default to const methods, while setters
and operations default to non-const methods.

--HG--
rename : dom/bindings/BindingGen.py => dom/bindings/ExampleGen.py
2012-10-17 17:01:55 -04:00
Ed Morley
25701792b7 Merge mozilla-central to mozilla-inbound 2012-10-15 16:09:10 +01:00
Ms2ger
95bc3a5347 Bug 793244 - Part b: Convert Screen to WebIDL; r=bz 2012-10-14 09:40:11 +02:00
Peter Van der Beken
1735393652 Fix for bug 711628 (Implement PeerConnection.localStreams/remoteStreams). r=bz.
--HG--
extra : rebase_source : e21a429d85fc60a972752a2a7deb88a7cb648f3c
2012-09-13 18:04:31 +02:00
Peter Van der Beken
931a931c83 Fix for bug 791347 (Support non-nsISupports refcounted natives and non-refcounted natives in new DOM bindings). r=bz/smaug.
--HG--
extra : rebase_source : cd6d98461d7fa3a07fa1361b4d840448122b6655
2012-09-19 15:02:37 +02:00
Kyle Huey
e5eb83ac5a Bug 760331: Coalesce data for inline style across nodes. r=bz
This patch enables sharing of an nsAttrValue's MiscContainer between nodes for style rules.  MiscContainers of type eCSSStyleRule are now refcounted (with some clever struct packing to ensure that the amount of memory allocated for MiscContainer remains unchanged on 32 and 64 bit).  This infrastructure can be used to share most MiscContainer types in the future if we find advantages to sharing other types than just eCSSStyleRuley.  A cache mapping strings to MiscContainers has been added to nsHTMLCSSStyleSheet.  MiscContainers can be shared between nsAttrValues when one nsAttrValue is SetTo another nsAttrValue or when there is a cache hit in this cache.  This patch also adds the ability to tell a style rule that it belongs to an nsHTMLCSSStyleSheet, with appropriate accessor functions to separate that from the existing case of belonging to an nsCSSStyleSheet.

The primary use case is to reduce memory use for pages that have lots of inline style attributes with the same value.  This can happen easily with large pages that are automatically generated.  An (admittedly pathological) testcase in Bug 686975 sees over 250 MB of memory savings with this change.  Reusing the same MiscContainer for multiple nodes saves the overhead of maintaining separate copies of the string containing the serialized value of the style attribute and of creating separate style rules for each node.  Eliminating duplicate style rules enables further savings in layout through style context sharing.  The testcase sees the amount of memory used by style contexts go from over 250 MB to 10 KB.

Because the cache is based on the text value of the style attribute, it will not handle attributes that have different text values but are parsed into identical style rules.  We also do not attempt to share MiscContainers when the node's base URI differs from the document URI.  The effect of these limitations is expected to be low.
2012-09-30 09:40:24 -07:00
Daniel Holbert
a7a2a0d2a9 Bug 785981: Pass global #defines to the process that generates the Paris bindings CSS2Properties.webidl file. r=khuey 2012-08-28 11:14:53 -07:00
Boris Zbarsky
31276eb444 Bug 753517 part 4. Set up auto-generation of CSS2Properties.webidl from nsCSSPropList.h and enable Paris bindings for CSSStyleDeclaration and CSS2Properties. r=khuey,peterv,dbaron 2012-08-23 21:08:09 -07:00
Peter Van der Beken
13f425b97c Fix for bug 768692 (Move DOM list binding generation to the new DOM binding codegen). r=bzbarsky.
--HG--
extra : rebase_source : 651a0fac4c9a87ef1c0a9cd91588c6421fd050c4
2012-05-22 15:46:20 +02:00
Eric Faust
96d7ea57ce Bug 775289 - Remove generateNativeAccessors branching from Paris binding codegen. (r=peterv) 2012-08-07 22:26:19 -07:00
Ms2ger
a45a0051cf Bug 743573 - Fix a number of build warnings in dom/; r=mounir 2012-08-07 09:06:29 +02:00
Ms2ger
d5a7d83516 Bug 780111 - Share code with new DOM bindings for primitive conversions in XPCConvert::JSData2Native; r=bholley 2012-08-04 09:29:18 +02:00
Mike Hommey
6173fa297f Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
Ed Morley
bba173e66e Revert inbound to 3d5d1daa2505 to stop OS X M5 failures (backout not clean/could have been a bad merge) on a CLOSED TREE 2012-08-04 18:05:15 +01:00
Ms2ger
395040a131 Bug 780111 - Share code with new DOM bindings for primitive conversions in XPCConvert::JSData2Native; r=bholley 2012-08-04 09:29:18 +02:00
Ms2ger
2be7de56d2 Bug 765464 - Part c: Throw some TypeErrors; r=khuey 2012-07-18 12:36:08 +02:00
Peter Van der Beken
2d6a797659 Fix for bug 762652 (Add the new DOM bindings API to CanvasRenderingContext2D). r=bz. 2012-06-13 17:14:15 +02:00
Matt Brubeck
ae0a175ce7 Back out 438c192e561b and d6f341e77b68 (bug 762652, bug 762654) on suspicion of breaking Windows PGO tests 2012-06-27 16:24:53 -07:00
Peter Van der Beken
74a0543703 Fix for bug 762652 (Add the new DOM bindings API to CanvasRenderingContext2D). r=bz.
--HG--
extra : rebase_source : 8e7a2722aa1fb089baa6c1aa8604dcd0e91c1ff2
2012-06-13 17:14:15 +02:00
Peter Van der Beken
7efab19797 Fix for bug 756258 (Support union types in new DOM bindings). r=bz.
--HG--
extra : rebase_source : 5352801a4eb5085f73a5b6e78aa238c5c9d44179
2012-05-18 23:25:47 +02:00
Boris Zbarsky
cc973eeeb9 Bug 742153 part 3. Implement codegen for dictionary arguments. r=peterv
Another implementation option would be to put all the dictionaries in a single
file and have a static global set of ids which works across all dictionaries
and is initialized once at startup or so.  That would also handle cross-file
dictionary inheritance better.

One problem that remains is the fake descriptor business.  At the moment this
does not allow interface types inside dictionaries.  We could probably work
around this by either refactoring code to make it possible to get the declType
independently of the actual conversion template (whether because it lives in a
separate function or because the conversion template generator knows to just
return an empty string when the fake descriptor provirder is passed) or by
figuring out a way to pass an actual descriptor provider to dictionary codegen.
2012-06-12 10:22:05 -04:00
Ed Morley
11c73f1659 Merge last PGO-green changeset of mozilla-inbound to mozilla-central 2012-06-12 10:36:42 +01:00
Kyle Huey
5c863e56f1 Bug 763573: Don't export PrimitiveConversions.h. r=bz 2012-06-11 13:04:34 -07:00
Kyle Huey
17efd870cb Bug 763212: Don't try to use native commands here. r=me 2012-06-10 16:03:23 -07:00
Boris Zbarsky
9921d8eb44 Bug 761772. Add support for 'implements' in WebIDL. r=khuey 2012-06-11 18:21:35 -04:00
Boris Zbarsky
c124f95e06 Bug 761882. Run the WebIDL parser tests during make check. r=khuey 2012-06-08 17:41:16 -04:00
Boris Zbarsky
3f887fdbe1 Bug 748266. Switch the WebGL canvas context to new DOM bindings. r=peterv 2012-05-31 14:16:48 -04:00
Boris Zbarsky
fddc56821d Backed out changeset f96e0f078b49 (bug 748266) because the test suite is bogus and we're failing a crashtest too. 2012-05-31 16:20:49 -04:00
Boris Zbarsky
c46a9a1068 Bug 748266. Switch the WebGL canvas context to new DOM bindings. r=peterv 2012-05-31 14:16:48 -04:00
Boris Zbarsky
e773b80a28 Bug 755080 part 1. Add infrastructure for binding codegen tests. r=khuey,peterv 2012-05-23 12:44:48 -04:00
Boris Zbarsky
90b5c814e8 Bug 749485. Switch new DOM bindings to using a struct for keeping track of failures for fallible methods. r=peterv,bent
ErrorResult is in a separate header file so it can be included from all over the
place without having to pull in mozilla/dom/Utils.h and all the xpconnect gunk
that needs.
2012-05-05 21:15:11 -04:00
Phil Ringnalda
ce8665a6aa Back out 1907bf7e6d7c (bug 749485) for build bustage 2012-05-05 20:33:59 -07:00
Boris Zbarsky
1833a29c14 Bug 749485. Switch new DOM bindings to using a struct for keeping track of failures for fallible methods. r=peterv,bent
ErrorResult is in a separate header file so it can be included from all over the
place without having to pull in mozilla/dom/Utils.h and all the xpconnect gunk
that needs.
2012-05-05 21:15:11 -04:00
Boris Zbarsky
2bed717c4f Bug 748637. Refactor argument conversion to primitive values to make it easier to extend in the future. r=peterv 2012-05-04 12:38:48 -04:00
Boris Zbarsky
25cfe62d86 Bug 747827. Add some structs that can be used to represent typed arrays in DOM bindings. r=peterv 2012-05-04 12:36:56 -04:00
Boris Zbarsky
32c7f6e634 Bug 742217. Reduce the use of nested namespaces in our binding code. r=peterv,bent
In the new setup, all per-interface DOM binding files are exported into
mozilla/dom.  General files not specific to an interface are also exported into
mozilla/dom.

In terms of namespaces, most things now live in mozilla::dom.  Each interface
Foo that has generated code has a mozilla::dom::FooBinding namespace for said
generated code (and possibly a mozilla::bindings::FooBinding_workers if there's
separate codegen for workers).

IDL enums are a bit weird: since the name of the enum and the names of its
entries all end up in the same namespace, we still generate a C++ namespace
with the name of the IDL enum type with "Values" appended to it, with a
::valuelist inside for the actual C++ enum.  We then typedef
EnumFooValues::valuelist to EnumFoo.  That makes it a bit more difficult to
refer to the values, but means that values from different enums don't collide
with each other.

The enums with the proto and constructor IDs in them now live under the
mozilla::dom::prototypes and mozilla::dom::constructors namespaces respectively.
Again, this lets us deal sanely with the whole "enum value names are flattened
into the namespace the enum is in" deal.

The main benefit of this setup (and the reason "Binding" got appended to the
per-interface namespaces) is that this way "using mozilla::dom" should Just
Work for consumers and still allow C++ code to sanely use the IDL interface
names for concrete classes, which is fairly desirable.

--HG--
rename : dom/bindings/Utils.cpp => dom/bindings/BindingUtils.cpp
rename : dom/bindings/Utils.h => dom/bindings/BindingUtils.h
2012-05-03 00:35:38 -04:00
Kyle Huey
4c09299fd0 Bug 741125: Update WebIDL parser. 2012-04-12 15:14:10 -07:00
Kyle Huey
14ec5a7315 Refix bug 741248. r=me 2012-04-09 13:48:44 -07:00
Takanori MATSUURA
6ba21f9576 Bug 737006 - Use internal ply only if needed. r=khuey 2012-04-06 14:06:52 -04:00
Kyle Huey
1b361b0c81 Bug 741248: Attempt a fix by twiddling the makefile a bit. r=me 2012-04-04 19:11:30 -07:00
Peter Van der Beken
c2e642fbcc Fix for bug 740069 (Generate JS bindings in C++ with a python script for DOM objects on the main thread and in workers. Infrastructure and new bindings for XMLHttpRequest). Patch by bent/bz/bholley/jst/khuey/peterv, r=bent/bz/bholley/jlebar/khuey/peterv/sicking/smaug.
--HG--
rename : js/xpconnect/tests/mochitest/test_bug462428.html => dom/bindings/test/test_lookupGetter.html
2012-03-30 21:42:20 -07:00