Граф коммитов

48 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky c7d98d9134 Bug 822470 part 2. Create a CallbackInterface helper class. r=peterv
--HG--
rename : dom/bindings/CallbackFunction.h => dom/bindings/CallbackInterface.h
2013-01-28 08:34:30 -05:00
Boris Zbarsky 4d02c18a08 Bug 822470 part 1. Factor out the code that callback functions and callback interfaces will be able to share into a CallbackObject class. r=peterv
--HG--
rename : dom/bindings/CallbackFunction.cpp => dom/bindings/CallbackObject.cpp
rename : dom/bindings/CallbackFunction.h => dom/bindings/CallbackObject.h
2013-01-28 08:34:29 -05:00
Boris Zbarsky a3b4bd9774 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 53a5112fb0 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 4c6b53a57f Bug 816380. Convert XPathEvaluator to WebIDL. r=peterv 2012-12-14 14:10:49 -05:00
Boris Zbarsky 529460c9c6 Bug 807224. Implement native-to-JS conversion for WebIDL unions. r=peterv 2012-11-09 07:59:33 -08:00
Boris Zbarsky 05e4e3b75a 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 dd82a0d964 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 057bdb3632 Merge mozilla-central to mozilla-inbound 2012-10-15 16:09:10 +01:00
Ms2ger b86e67f2b2 Bug 793244 - Part b: Convert Screen to WebIDL; r=bz 2012-10-14 09:40:11 +02:00
Peter Van der Beken 767c08f204 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 96b3ddd3e3 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 43e58e33c8 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 792e972052 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 052e7b0c56 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 ee9eae3141 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 c0dee00d6e Bug 775289 - Remove generateNativeAccessors branching from Paris binding codegen. (r=peterv) 2012-08-07 22:26:19 -07:00
Ms2ger 94bf1722ed Bug 743573 - Fix a number of build warnings in dom/; r=mounir 2012-08-07 09:06:29 +02:00
Ms2ger fc144f32b1 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 70d7c821af Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
Ed Morley f4181983a1 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 f2a97792fa 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 23b178ab1f Bug 765464 - Part c: Throw some TypeErrors; r=khuey 2012-07-18 12:36:08 +02:00
Peter Van der Beken 209dc3f233 Fix for bug 762652 (Add the new DOM bindings API to CanvasRenderingContext2D). r=bz. 2012-06-13 17:14:15 +02:00
Matt Brubeck aa0f6555db 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 be3b0761b1 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 356f838036 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 6c6503abf1 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 4c9a59e40a Merge last PGO-green changeset of mozilla-inbound to mozilla-central 2012-06-12 10:36:42 +01:00
Kyle Huey c8d931afa8 Bug 763573: Don't export PrimitiveConversions.h. r=bz 2012-06-11 13:04:34 -07:00
Kyle Huey 64dd923eed Bug 763212: Don't try to use native commands here. r=me 2012-06-10 16:03:23 -07:00
Boris Zbarsky 898e465bbb Bug 761772. Add support for 'implements' in WebIDL. r=khuey 2012-06-11 18:21:35 -04:00
Boris Zbarsky 3f47caaa36 Bug 761882. Run the WebIDL parser tests during make check. r=khuey 2012-06-08 17:41:16 -04:00
Boris Zbarsky ac1bfb338d Bug 748266. Switch the WebGL canvas context to new DOM bindings. r=peterv 2012-05-31 14:16:48 -04:00
Boris Zbarsky 464164e820 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 6af95f383e Bug 748266. Switch the WebGL canvas context to new DOM bindings. r=peterv 2012-05-31 14:16:48 -04:00
Boris Zbarsky 1c6835bea3 Bug 755080 part 1. Add infrastructure for binding codegen tests. r=khuey,peterv 2012-05-23 12:44:48 -04:00
Boris Zbarsky 73485dea64 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 15ea61df18 Back out 1907bf7e6d7c (bug 749485) for build bustage 2012-05-05 20:33:59 -07:00
Boris Zbarsky d6697e4410 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 c248872f5e 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 0a950894a0 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 2299a42041 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 33342929eb Bug 741125: Update WebIDL parser. 2012-04-12 15:14:10 -07:00
Kyle Huey a56bec8769 Refix bug 741248. r=me 2012-04-09 13:48:44 -07:00
Takanori MATSUURA bd9ba0040a Bug 737006 - Use internal ply only if needed. r=khuey 2012-04-06 14:06:52 -04:00
Kyle Huey af8d505179 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 ed510d3506 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