Commit Graph

1806 Commits

Author SHA1 Message Date
Mike Hommey
d33d08e09e Bug 1596025 - Fix non-determinism with WebIDL aliases. r=bzbarsky
`sorted(aliasedMembers)` looks like it is sorting by `__repr__`, which
contains the address of the object, like `<WebIDL.IDLMethod object at
0x7f83be5d8b50>`.

Differential Revision: https://phabricator.services.mozilla.com/D52821

--HG--
extra : moz-landing-system : lando
2019-11-13 22:11:20 +00:00
Edgar Chen
9a7e35c0ce Bug 1594614 - Remove isExposedOnMainThread from IDLExposureMixins; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D52118

--HG--
extra : moz-landing-system : lando
2019-11-07 02:01:18 +00:00
Boris Zbarsky
168fcede40 Bug 1591514 part 1. Change bindings to use actual literal strings for string constants. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D50692

--HG--
extra : moz-landing-system : lando
2019-10-29 00:26:28 +00:00
Boris Zbarsky
40d45356a8 Bug 1591481 part 1. Make NormalizeUSVString fallible. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D50691

--HG--
extra : moz-landing-system : lando
2019-10-29 00:24:10 +00:00
Boris Zbarsky
89b4cac9a3 Bug 1588194 part 1. Factor out the missing property use counter code into helper functions. r=peterv
This incidentally reduces the codesize, while allowing us to call those
functions from elsewhere.  The performance impact of the extra out-of-line call
is not measurable (that is, is within the noise level) on the testcase at
<https://bugzilla.mozilla.org/attachment.cgi?id=9096814>.

Differential Revision: https://phabricator.services.mozilla.com/D49044

--HG--
extra : moz-landing-system : lando
2019-10-29 16:18:44 +00:00
Boris Zbarsky
d36e5a4ea5 Bug 1214364 part 4. Only output full-featured Init methods for dictionaries that need them. r=peterv
Dictionaries that we never initialize with JS values don't need a full-featured
Init() method.  Instead, we output a cut-down Init() method that doesn't even
take a JSContext and Value as argument, and skips as much work as it can.  It
uses constant-false for "is the value present?", but also, to avoid compilation
errors due to use of `cx` and `val` in now-dead conversion code, it tells the
native-to-JS conversion machinery that the value is always missing, which lets
it skip most of the the work it would normally try to do and just output
initialization to the default value.  We only need to do this for members that
have default values; the others either remain no-passed or are required members
with no default-initialization behavior.

This saves about 330KB of codesize on Linux64 without PGO and 285KB with PGO.

Differential Revision: https://phabricator.services.mozilla.com/D48007

--HG--
extra : moz-landing-system : lando
2019-10-28 20:24:31 +00:00
Boris Zbarsky
0d2e9ff1f1 Bug 1214364 part 3. Only output ToObjectInternal methods for dictionaries that need it. r=peterv
This saves about 270KB of codesize on Linux64 without LTO, or 20KB with LTO.

The basic idea is that we can flag dictionaries that need to-JS conversion
(hence ToObjectInternal) based on various IDL uses (return value in normal
interface, argument in callback, etc) and then annotate the ones that are
converted to JS manually in C++ code.

The mozwebidlcodegen changes are needed because non-local changes (e.g. whether
a dictionary is used as a return value somewhere) can now affect the code
generation for a dictionary and hence whether the relevant binding file should
be regenerated.  Since these changes can happen in any .webidl file, we need to
check for them.  We can't track this via the dependency set on the dictionary
itself, because that would not notice new uses being added.

Differential Revision: https://phabricator.services.mozilla.com/D48006

--HG--
extra : moz-landing-system : lando
2019-10-28 23:20:11 +00:00
Boris Zbarsky
bbc03b9834 Bug 1214364 part 2. Remove the dead code around MethodNotNewObjectError. r=peterv
I don't know when we stopped raising them, but we did at some point.

I am leaving the capability to not generate a union's ToJSVal method, because I will need it soon.

Differential Revision: https://phabricator.services.mozilla.com/D48554

--HG--
extra : moz-landing-system : lando
2019-10-23 18:04:30 +00:00
Boris Zbarsky
3a2aa6f9b1 Bug 1214364 part 1. Only output conversions to/from JSON for dictionaries that need it. r=peterv
This saves about 200KB of codesize on Linux64 without LTO.  No effect with LTO,
but is needed for the following patches to work.

Very few dictionaries need these conversions, so explicit opt-in is fine.

Differential Revision: https://phabricator.services.mozilla.com/D48005

--HG--
extra : moz-landing-system : lando
2019-10-23 15:58:29 +00:00
Kagami Sascha Rosylight
e30a6dbb4a Bug 824857: Support IDL stringifier attributes r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D48355

--HG--
extra : moz-landing-system : lando
2019-10-23 04:55:54 +00:00
Boris Zbarsky
a0b4a1fee2 Bug 1582892. Expose the number of strings in a Web IDL enum in a nice way. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D49536

--HG--
extra : moz-landing-system : lando
2019-10-23 03:54:39 +00:00
Daniel Varga
ae5334abca Backed out changeset f9a4c8d67be3 (bug 1582892) for build bustage at build/src/dom/console/ConsoleInstance. On a CLOSED TREE 2019-10-23 06:13:54 +03:00
Boris Zbarsky
e09da7b0c7 Bug 1582892. Expose the number of strings in a Web IDL enum in a nice way. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D49536

--HG--
extra : moz-landing-system : lando
2019-10-18 03:26:43 +00:00
Boris Zbarsky
6b4b1eb4fb Bug 1589285 part 1. Expose a nicer way to get strings given a Web IDL enum value. r=edgar
Returning a span ensures that consumers don't try to use this without a length,
but does hide the fact that our string is always null-terminated, at least for
the moment...

Differential Revision: https://phabricator.services.mozilla.com/D49531

--HG--
extra : moz-landing-system : lando
2019-10-17 23:20:48 +00:00
Boris Zbarsky
e7ff63c252 Bug 1582592. Improve the default return type for example codegen's GetParentObject. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D49467

--HG--
extra : moz-landing-system : lando
2019-10-17 22:08:54 +00:00
Boris Zbarsky
dd7b61f437 Bug 1568249. Remove all the LegacyQueryInterface machinery from Web IDL. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D48250

--HG--
extra : moz-landing-system : lando
2019-10-11 21:15:57 +00:00
Jan de Mooij
6febd292ea Bug 1586683 - Remove flat strings from JSAPI. r=jwalden,bzbarsky
We want to remove flat strings (JSFlatString). With this patch we only expose
linear strings (JSLinearString) to API consumers.

This is very mechanical for the most part, because code typically only cares
about linear strings and not the null-termination aspect.

CTypes's Library.cpp has some Windows-specific code where we relied on null-terminated
strings. This patch adds JS_CopyStringCharsZ for that use case.

Differential Revision: https://phabricator.services.mozilla.com/D48314

--HG--
extra : moz-landing-system : lando
2019-10-14 09:32:07 +00:00
shindli
e7b5981fa2 Backed out 2 changesets (bug 1568883, bug 1568249) for causing c1 failures in dom/base/test/chrome/test_cpows.xul CLOSED TREE
Backed out changeset b1a2422a6fa0 (bug 1568249)
Backed out changeset d3f5f69f38a8 (bug 1568883)
2019-10-12 00:07:48 +03:00
Boris Zbarsky
9c62fd6061 Bug 1585684. Fix error message for permission failures when passing a union member. r=peterv
The new error message is still not great, but it's a lot better than having %s
as the description of what's going on.

Differential Revision: https://phabricator.services.mozilla.com/D47915

--HG--
extra : moz-landing-system : lando
2019-10-09 09:22:05 +00:00
Boris Zbarsky
092c3345a8 Bug 1568249. Remove all the LegacyQueryInterface machinery from Web IDL. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D48250

--HG--
extra : moz-landing-system : lando
2019-10-07 13:12:55 +00:00
Boris Zbarsky
5f2a4a2274 Bug 1584630. Implement missing property use counters for HTMLDocument. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D47504

--HG--
extra : moz-landing-system : lando
2019-10-11 16:56:36 +00:00
Boris Zbarsky
a1e9012980 Bug 1584009 part 1. Loosen up the check for dictionary-containing-union-containing-dictionary. r=peterv
Since unions can now end up a in binding header, it's only a problem when the
two dictionaries are in one header and the union is in a different one.  If all
three are in the same header, for example, there is no issue.

Differential Revision: https://phabricator.services.mozilla.com/D47195

--HG--
extra : moz-landing-system : lando
2019-10-02 14:16:34 +00:00
Gurzau Raul
1a47fa0d8f Backed out 2 changesets (bug 1584009) for build bustages at MediaTrackConstraints.h on a CLOSED TREE.
Backed out changeset 1693187dbddf (bug 1584009)
Backed out changeset 0932a7fdb46b (bug 1584009)
2019-10-02 17:12:33 +03:00
Boris Zbarsky
860640c3fc Bug 1584009 part 1. Loosen up the check for dictionary-containing-union-containing-dictionary. r=peterv
Since unions can now end up a in binding header, it's only a problem when the
two dictionaries are in one header and the union is in a different one.  If all
three are in the same header, for example, there is no issue.

Differential Revision: https://phabricator.services.mozilla.com/D47195

--HG--
extra : moz-landing-system : lando
2019-10-02 13:10:34 +00:00
Boris Zbarsky
44c015a4b0 Bug 1584431 part 4. Use the new length-aware versions of JS_StringEqualsAscii and JS_FlatStringEqualsAscii where possible. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D47393

--HG--
extra : moz-landing-system : lando
2019-09-27 21:25:23 +00:00
Boris Zbarsky
3b969978f5 Bug 1423562 part 1. Change Configuration.getDescriptors to never return external interface descriptors. r=edgar
There are no callers who want this.  They all filter out external interfaces in various ways; we might as well do it up front.

Differential Revision: https://phabricator.services.mozilla.com/D46695

--HG--
extra : moz-landing-system : lando
2019-09-26 14:30:52 +00:00
Boris Zbarsky
7ccdf0a53c Bug 1574201. Remove support for IDL "implements" statements. r=edgar
A bunch of loop-detection, etc, complexity goes away because mixins are not
interfaces and the mixin syntax does not allow various things we had to guard
against in terms of maplikes and whatnot.

Differential Revision: https://phabricator.services.mozilla.com/D46524

--HG--
extra : moz-landing-system : lando
2019-09-25 19:59:00 +00:00
Boris Zbarsky
89dd3cf285 Bug 1582857. Fix security checks around this-unwrapping. r=peterv,bholley
Differential Revision: https://phabricator.services.mozilla.com/D46692

--HG--
extra : moz-landing-system : lando
2019-09-24 01:02:25 +00:00
Boris Zbarsky
fa0ce4b209 Bug 1581315 part 1. Adjust MOZ_MUST_RETURN_FROM_CALLER to only apply to method calls on arguments. r=nika
It doesn't really make sense to enforce this behavior for calls on stack
variables (which presumably we then want to do something with) and doesn't
necessarily make sense to enforce it for member variables either.

Differential Revision: https://phabricator.services.mozilla.com/D46105

--HG--
extra : moz-landing-system : lando
2019-09-20 02:17:01 +00:00
Boris Zbarsky
5bc8266c20 Bug 1582567. Stop emitting 'virtual' in codegen if we're already emitting 'override'. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D46527

--HG--
extra : moz-landing-system : lando
2019-09-20 11:05:57 +00:00
Boris Zbarsky
14c30e58d6 Bug 1578173 part 4. Switch event subclasses to constructor operations. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D45391

--HG--
extra : moz-landing-system : lando
2019-09-11 14:35:28 +00:00
Henri Sivonen
b9752dabba Bug 1561564 - Introduce a JSString WebIDL type. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D42297

--HG--
extra : moz-landing-system : lando
2019-09-12 10:27:20 +00:00
Dzmitry Malyshau
6c2bf0f5ad Bug 1575663 - Improve WebIDL bindgen of enum variants starting with a digit r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D42980

--HG--
extra : moz-landing-system : lando
2019-09-11 16:10:45 +00:00
Emilio Cobos Álvarez
7df79853f9 Bug 1578700 - Change use counter setup to propagate the page use counters together. r=smaug
This is so that SetUseCounter is as cheap as possible.

This is in preparation for hooking the CSS use counters to telemetry. We want
CSS use counters to be fast and be propagated at once to the parent page. This
will make sure to use the same setup as everywhere else.

Differential Revision: https://phabricator.services.mozilla.com/D44645

--HG--
extra : moz-landing-system : lando
2019-09-04 23:36:21 +00:00
Boris Zbarsky
7d2bac0334 Bug 921496 part 2. Remove NavigatorProperty. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D40111

--HG--
extra : moz-landing-system : lando
2019-08-26 19:00:04 +00:00
Jon Coppeard
d23ec38129 Bug 1573508 - Replace external references to js::ClassOps with JSClassOps r=mccr8
Depends on D41759

Differential Revision: https://phabricator.services.mozilla.com/D41760

--HG--
extra : moz-landing-system : lando
2019-08-14 09:45:31 +00:00
Nathan Froyd
b0b2a5088c Bug 1573537 - add parentheses for property info count static_assert; r=bzbarsky
Otherwise we're computing (1ull << CHAR_BIT) * sizeof(...), which is not
quite what we wanted.

Differential Revision: https://phabricator.services.mozilla.com/D41773

--HG--
extra : moz-landing-system : lando
2019-08-13 17:47:04 +00:00
Jon Coppeard
4f45eff7cc Bug 1572782 - Remove external references to js::FreeOp r=mccr8?
Replace external use of js::FreeOp with JSFreeOp.

Differential Revision: https://phabricator.services.mozilla.com/D41411

--HG--
extra : moz-landing-system : lando
2019-08-12 10:43:32 +00:00
Jon Coppeard
a00726d223 Bug 1572782 - Remove js::FreeOp and make JSFreeOp opaque in public API r=tcampbell?
Merge js::FreeOp and JSFreeOp, but alias the former to the latter while we fix uses.

Differential Revision: https://phabricator.services.mozilla.com/D41410

--HG--
extra : moz-landing-system : lando
2019-08-12 10:43:32 +00:00
Oana Pop Rus
44aafcc0d0 Backed out 4 changesets (bug 1572782) for build bustages at build/src/obj-firefox/dist/include/nsIXPCScriptable.h on a CLOSED TREE
Backed out changeset ec9d15c69bc8 (bug 1572782)
Backed out changeset 8239e4baa0f4 (bug 1572782)
Backed out changeset 9fd7bea2b512 (bug 1572782)
Backed out changeset 11d750555fe1 (bug 1572782)
2019-08-12 13:37:03 +03:00
Jon Coppeard
68fef4ffb0 Bug 1572782 - Remove external references to js::FreeOp r=mccr8?
Replace external use of js::FreeOp with JSFreeOp.

Differential Revision: https://phabricator.services.mozilla.com/D41411

--HG--
extra : moz-landing-system : lando
2019-08-12 10:16:00 +00:00
Jon Coppeard
9d51a35e93 Bug 1572782 - Remove js::FreeOp and make JSFreeOp opaque in public API r=tcampbell?
Merge js::FreeOp and JSFreeOp, but alias the former to the latter while we fix uses.

Differential Revision: https://phabricator.services.mozilla.com/D41410

--HG--
extra : moz-landing-system : lando
2019-08-12 10:15:57 +00:00
Edwin Gao
1eb2f0f7be Bug 1559975 - convert dom/bindings to python3 r=ahal,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D36634

--HG--
extra : moz-landing-system : lando
2019-08-02 19:45:12 +00:00
Boris Zbarsky
4694cad683 Bug 1570350. Refactor ConstructJSImplementation to make consumers a bit simpler. r=mccr8
We could get rid of the need to specify the impl class at the callsite by
taking a T** instead of returning an already_AddRefed<T>, but I'm not sure
which is uglier...

The change from `globalHolder->GetGlobalJSObject()` to `global.Get()` is OK,
because `globalHolder` was coming from the nsISupports attached to
`global.Get()` anyway, so those are the same global JS object.

Differential Revision: https://phabricator.services.mozilla.com/D40060

--HG--
extra : moz-landing-system : lando
2019-07-31 21:38:00 +00:00
Boris Zbarsky
3581c41939 Bug 1568729. Only include the static pref headers we really need in binding code. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D39528

--HG--
extra : moz-landing-system : lando
2019-07-28 11:08:00 +00:00
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Gurzau Raul
9866332964 Backed out 3 changesets (bug 1559975) for linting failure at WebIDL.py on a CLOSED TREE.
Backed out changeset a7154744a5d7 (bug 1559975)
Backed out changeset 4005ac274170 (bug 1559975)
Backed out changeset 68ed1ccb5921 (bug 1559975)
2019-07-19 18:25:10 +03:00
Edwin Gao
805e1d99d2 Bug 1559975 - convert dom/bindings to python3 r=ahal,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D36634

--HG--
extra : moz-landing-system : lando
2019-07-19 14:15:00 +00:00
Boris Zbarsky
19251f27ce Bug 1562680. Implement the new syntax for Web IDL dictionary defaulting. r=peterv
`= {}` can now be used to indicate that an optional dictionary should have the
default value of 'default-initialized dictionary'

Differential Revision: https://phabricator.services.mozilla.com/D36504

--HG--
extra : moz-landing-system : lando
2019-07-03 07:52:35 +00:00
Kagami Sascha Rosylight
509d2d30b6 Bug 1366738: Implement [LegacyWindowAlias] r=bzbarsky
Add [LegacyWindowAlias] extended attribute support for WebKitCSSMatrix and webkitURL.

Differential Revision: https://phabricator.services.mozilla.com/D35601

--HG--
extra : moz-landing-system : lando
2019-07-03 08:37:01 +00:00