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

4894 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky e379022658 Bug 1551282 and bug 1553436. Allow pages to override window.u2f but not the "sign" and "register" properties on the U2F object. r=jcj,smaug
There are two related problems this patch is trying to address.  The first, and
simpler, one is bug 1553436: there are websites that use existing variables and
functions named "u2f" and adding a non-replaceable readonly property with that
name on Window breaks them.  The fix for this is straightforward: mark the
property [Replaceable].

The second problem, covered by bug 1551282, involves sites that use the Google
U2F polyfill.  The relevant parts of that polyfill look like this:

  'use strict';
  var u2f = u2f || {};
  u2f.register = some_function_that_only_works_right_in_Chrome;
  u2f.sign = some_function_that_only_works_right_in_Chrome;

The failure mode for that code before this fix is that the assignment to "u2f"
throws because it's a readonly property and we're in strict mode, so any code
the page concatenates in the same file after the polyfill does not get run.
That's what bug 1551282 is about.  The [Replaceable] annotation fixes that
issue, because now the polyfill gets the value of window.u2f and then redefines
the property (via the [Replaceable] setter) to be a value property with that
value.  So far, so good.

But then we need to prevent the sets of u2f.register
and u2f.sign from taking effect, because if they are allowed to happen, the
actual sign/register functionality on the page will not work in Firefox.  We
can't just make the properties readonly, because then the sets will throw due
to being in strict mode, and we still have bug 1551282.  The proposed fix is to
make these accessor properties with a no-op setter, which is exactly what
[LenientSetter] gives us.

The rest of the patch is just setting up infrastructure for generating the
normal bits we would generate if "sign" and "register" were methods and using
that to create the JSFunctions at the point when the getter is called.  The
JSFunctions then get cached on the u2f instance object.

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

--HG--
extra : moz-landing-system : lando
2019-05-24 20:40:59 +00:00
shindli 54646b5a7c Backed out changeset 823ab2e5430a (bug 1551282) for Windows build bustages CLOSED TREE 2019-05-24 21:15:20 +03:00
Boris Zbarsky 943dde7841 Bug 1554195. Remove MSG_THIS_DOES_NOT_IMPLEMENT_INTERFACE. r=mccr8
I was clearly trying to do that in bug 882653 part 3 and failed to.  Our
current behavior of passing two args to this error message (which only takes
one arg) is silly, and the only thing that makes it at all sane is that we only
use it in class hooks, which can never have the wrong sort of object, so it's
unreached code.

The comment cleanup is just to make the role of CGAbstractBindingMethod. and
the validity of the changes to it, clearer.

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

--HG--
extra : moz-landing-system : lando
2019-05-24 17:31:42 +00:00
Boris Zbarsky cd062bb5d7 Bug 1551282 and bug 1553436. Allow pages to override window.u2f but not the "sign" and "register" properties on the U2F object. r=jcj,smaug
There are two related problems this patch is trying to address.  The first, and
simpler, one is bug 1553436: there are websites that use existing variables and
functions named "u2f" and adding a non-replaceable readonly property with that
name on Window breaks them.  The fix for this is straightforward: mark the
property [Replaceable].

The second problem, covered by bug 1551282, involves sites that use the Google
U2F polyfill.  The relevant parts of that polyfill look like this:

  'use strict';
  var u2f = u2f || {};
  u2f.register = some_function_that_only_works_right_in_Chrome;
  u2f.sign = some_function_that_only_works_right_in_Chrome;

The failure mode for that code before this fix is that the assignment to "u2f"
throws because it's a readonly property and we're in strict mode, so any code
the page concatenates in the same file after the polyfill does not get run.
That's what bug 1551282 is about.  The [Replaceable] annotation fixes that
issue, because now the polyfill gets the value of window.u2f and then redefines
the property (via the [Replaceable] setter) to be a value property with that
value.  So far, so good.

But then we need to prevent the sets of u2f.register
and u2f.sign from taking effect, because if they are allowed to happen, the
actual sign/register functionality on the page will not work in Firefox.  We
can't just make the properties readonly, because then the sets will throw due
to being in strict mode, and we still have bug 1551282.  The proposed fix is to
make these accessor properties with a no-op setter, which is exactly what
[LenientSetter] gives us.

The rest of the patch is just setting up infrastructure for generating the
normal bits we would generate if "sign" and "register" were methods and using
that to create the JSFunctions at the point when the getter is called.  The
JSFunctions then get cached on the u2f instance object.

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

--HG--
extra : moz-landing-system : lando
2019-05-24 17:19:23 +00:00
Boris Zbarsky 3d0e0bba72 Bug 1121623 part 10. Use a more-accurate default value for 'concrete' in Web IDL bindings. r=peterv
The idea is that we should only generate concreate-binding (wrap methods, etc)
machinery for an interface by default if we have reason to expect that the
interface is used as the primary interface for some objects.  Two clear signals
that would indicate that are the interface being a leaf interface (with no
descendants) and the interface having a constructor.  Other cases would require
a 'concrete' annotation in Bindings.conf.

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

--HG--
extra : moz-landing-system : lando
2019-05-24 10:43:37 +00:00
Boris Zbarsky 6f302d793c Bug 1121623 part 9. Change example codegen to not spit out WrapObject bits for non-concrete interfaces. r=peterv
This should keep people from marking things concrete unnecessarily just so
their example-generated WrapObject works.

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

--HG--
extra : moz-landing-system : lando
2019-05-24 07:34:33 +00:00
Boris Zbarsky 471d7a508d Bug 1121623 part 3. Switch WebrtcGlobalInformation to being a namespace. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D32201

--HG--
extra : moz-landing-system : lando
2019-05-24 07:22:22 +00:00
Boris Zbarsky d51859cb38 Bug 1121623 part 2. Switch AddonManagerPermissions to being a namespace. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D32200

--HG--
extra : moz-landing-system : lando
2019-05-24 07:19:58 +00:00
Boris Zbarsky 28c8e552a8 Bug 1121623 part 1. Switch PromiseDebugging to being a namespace, since that's how we use it. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D32199

--HG--
extra : moz-landing-system : lando
2019-05-24 07:13:16 +00:00
Jeff Gilbert 047e98938e Bug 1536672 - Implement WebGL OVR_multiview2 behind draft flag. r=lsalzman,qdot
Also disable clang-format for gfx/gl/GLConsts.h.

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

--HG--
extra : moz-landing-system : lando
2019-05-23 20:48:21 +00:00
Zibi Braniecki 2ee19983ae Bug 1546432 - Migrate DocumentL10n to use dom::l10n::Mutations. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D28981

--HG--
extra : moz-landing-system : lando
2019-05-21 19:46:32 +00:00
Mihai Alexandru Michis 354eec452c Backed out changeset a649f69f29df (bug 1536672) for failing crashtest at WebGLContextValidate.cpp. CLOSED TREE 2019-05-23 10:57:29 +03:00
Jeff Gilbert fb7050f9bf Bug 1536672 - Implement WebGL OVR_multiview2 behind draft flag. r=lsalzman,qdot
Also disable clang-format for gfx/gl/GLConsts.h.

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

--HG--
extra : moz-landing-system : lando
2019-05-23 02:43:11 +00:00
Boris Zbarsky 3022e3c3fb Bug 1553286. Mark legacycall hooks (and a few other binding hooks) as MOZ_CAN_RUN_SCRIPT. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D32053

--HG--
extra : moz-landing-system : lando
2019-05-22 02:50:55 +00:00
Tooru Fujisawa 66e25f6243 Bug 1549340 - Part 2: Use union instead of reinterpret_cast to initialize const char* with symbol for JSPropertySpec.name. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D30493

--HG--
extra : moz-landing-system : lando
2019-05-13 10:26:48 +00:00
Csoregi Natalia e3fa16f6f6 Backed out changeset 1760c6913c09 (bug 1549340) for rust bustage. CLOSED TREE
--HG--
extra : rebase_source : 19015aa11df57b8026881f6a86a4714887ec0244
2019-05-10 18:16:09 +03:00
Tooru Fujisawa 9fa8a62e9e Bug 1549340 - Part 2: Use union instead of reinterpret_cast to initialize const char* with symbol for JSPropertySpec.name. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D30493

--HG--
extra : moz-landing-system : lando
2019-05-10 14:08:07 +00:00
Boris Chiou 7ab6e6d017 Bug 1545239 - Update ResizeObserver and ResizeObserverEntry. r=smaug,dholbert
In this patch, we support
1. content-box (default)
2. border-box

And let ResizeObserverEntry expose these box sizes.

Besides, we store the mLastReportedSize as the logical size.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 20:54:36 +00:00
Brian Hackett ab337aa92c Bug 1392408 Part 3 - Report stacks to net monitor when loading worker scripts, r=bzbarsky.
--HG--
extra : rebase_source : c4b52354dc9c71bb86cd157f0f710d01b78659e5
2019-05-02 08:34:27 -10:00
Zibi Braniecki 28c31b907a Bug 1548798 - Switch SequenceRooter, RecordRooter and RootedUnion to use RootedContext. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D29810

--HG--
extra : moz-landing-system : lando
2019-05-03 16:07:21 +00:00
Boris Zbarsky 517a6ebdd7 Bug 1547923 part 6. Make nsIGlobalObject::GetGlobalJSObject always expose to active JS. r=mccr8
See callsite audit in https://bugzilla.mozilla.org/attachment.cgi?id=9061976
for details on why the remaining GetGlobalJSObject callers should switch to the
"always expose" behavior.

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

--HG--
extra : moz-landing-system : lando
2019-05-02 21:36:15 +00:00
Boris Zbarsky 356eb6dfd9 Bug 1547923 part 5. Start using nsIGlobalObject::GetGlobalJSObjectPreserveColor where possible. r=mccr8,jonco
Differential Revision: https://phabricator.services.mozilla.com/D29706

--HG--
extra : moz-landing-system : lando
2019-05-03 15:15:31 +00:00
Boris Zbarsky ff72e84ac1 Bug 1547923 part 4. Add nsIGlobalObject::HasJSGlobal(). r=mccr8
Consumers that just care about this boolean state should use this instead of
getting the JSObject* directly.

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

--HG--
extra : moz-landing-system : lando
2019-05-02 21:32:17 +00:00
Boris Zbarsky 5c1d789bfa Bug 1547923 part 3. Add nsIGlobalObject::GetGlobalJSObjectPreserveColor(). r=mccr8
This can be used in things like assertions or some other rare circumstances
where not exposing the object to active JS is OK.

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

--HG--
extra : moz-landing-system : lando
2019-05-02 21:23:35 +00:00
Coroiu Cristina 3b1ccb8045 Merge mozilla-central to inbound a=merge 2019-05-01 07:27:22 +03:00
Steve Fink 8484af2fa6 Bug 1547782 - Implement GCPolicy<T>::isValid for Gecko specializations r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D29302

--HG--
extra : moz-landing-system : lando
2019-04-30 21:48:32 +00:00
Fariskhi Vidyan b2514b847b Bug 1272409 - Part 2: Add ResizeObserver webidl and implementation. r=dholbert,smaug
This implements the first version of spec, so the webidl file doesn't
match the current spec and we will fix them in the follow-up bugs.

i.e.
1. The default observer box is content-box.
2. `ResizeObserverBoxOptions`, `ResizeObserverOptions`, and `ResizeObserverSize`
   are not included in `ResizeObserver.webidl`.
3. `ResizeObserverEntry` doesn't have `borderBoxSize` and `contentBoxSize`
   attributes.

Depends on D27615

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

--HG--
extra : moz-landing-system : lando
2019-04-26 20:29:14 +00:00
Boris Zbarsky 99bd4f897d Bug 1317658 part 2. Pass enough information to bindings' GetDesiredProto to allow it to return the prototype the spec says it should. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D28518

--HG--
extra : moz-landing-system : lando
2019-04-26 15:55:59 +00:00
Boris Zbarsky 5b875fd884 Bug 1317658 part 1. Remove unnecessary isConstructing check from GetDesiredProto, now that all callers ensure that we are in fact constructing. r=edgar
Binding constructors started doing that in bug 979591.

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

--HG--
extra : moz-landing-system : lando
2019-04-24 11:28:46 +00:00
Tooru Fujisawa 56585dc81e Bug 1543843 - Add constructors to JSPropertySpec and inner structs/unions. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D27277

--HG--
extra : moz-landing-system : lando
2019-04-26 01:01:15 +00:00
Daniel Varga 46db25d004 Backed out 5 changesets (bug 1272409) for build bustage at /builds/worker/workspace/build/src/dom/base/nsGlobalWindowCommands. On a CLOSED TREE
Backed out changeset 2ad8260489d6 (bug 1272409)
Backed out changeset 224dad4cbdc3 (bug 1272409)
Backed out changeset 72775dbf35c8 (bug 1272409)
Backed out changeset c331a4a8b343 (bug 1272409)
Backed out changeset d817fbfc52b6 (bug 1272409)
2019-04-26 02:41:43 +03:00
Fariskhi Vidyan 3d0af6e0c6 Bug 1272409 - Part 2: Add ResizeObserver webidl and implementation. r=dholbert,smaug
This implements the first version of spec, so the webidl file doesn't
match the current spec and we will fix them in the follow-up bugs.

i.e.
1. The default observer box is content-box.
2. `ResizeObserverBoxOptions`, `ResizeObserverOptions`, and `ResizeObserverSize`
   are not included in `ResizeObserver.webidl`.
3. `ResizeObserverEntry` doesn't have `borderBoxSize` and `contentBoxSize`
   attributes.

Depends on D27615

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

--HG--
extra : moz-landing-system : lando
2019-04-25 18:30:06 +00:00
Zibi Braniecki 0e59a5d8f4 Bug 1544118 - Move nsINode::localize to use DocumentL10n::TranslateFragment. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D28269

--HG--
extra : moz-landing-system : lando
2019-04-24 10:35:37 +00:00
Noemi Erli 7bb9457084 Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-04-24 12:57:59 +03:00
Zibi Braniecki 0890bbe4c2 Bug 1503657 - Implement Fluent DOMOverlays in C++. r=smaug,Pike
Differential Revision: https://phabricator.services.mozilla.com/D27200

--HG--
extra : moz-landing-system : lando
2019-04-24 05:05:11 +00:00
Emilio Cobos Álvarez 1b45496357 Bug 1546467 - Preserve reflectors of custom elements when they already have one. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D28542

--HG--
extra : moz-landing-system : lando
2019-04-23 21:01:39 +00:00
Ciure Andrei d753cf6b80 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2019-04-24 07:30:32 +03:00
Ryan Hunt 3675f2449b Bug 1534395 - Rename nsITabParent to nsIRemoteTab. r=nika,mconley
nsITabParent is exposed to frontend code and is generally used as a representation of a remote tab. We could just rename the interface to nsIBrowserParent and worry about it later, but I think it's better to rename the interface to nsIRemoteTab so that we can later work on splitting the interface away from the PBrowser protocol.

Note: Some frontend code refers to a TabParentId. This commit renames this to RemoteTabId. We need to figure out the purpose of TabId with fission.

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

--HG--
rename : dom/interfaces/base/nsITabParent.idl => dom/interfaces/base/nsIRemoteTab.idl
extra : rebase_source : 9d8a1790a7bb10195ad063644d1a93d63b2afb72
2019-04-09 15:59:37 -05:00
Olli Pettay 779ae5beb3 Bug 1544670, don't let one to reuse unlinked CallbackObjectHolder, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D27732

--HG--
extra : moz-landing-system : lando
2019-04-17 11:41:31 +00:00
Rob Wu 4a6f84f91d Bug 1544834 - Replace deprecated generics in test code r=evilpie
- `Array.map` becomes `Array.from`
- Array copying via `Array.slice` becomes `Array.from`.
- `Array.forEach` that did not rely on closures becomes `for`-`of` loops.
- Anything else: `Array.X` becomes `Array.prototype.X`.

Complex cases:

dom/bindings/test/TestInterfaceJS.js and
dom/bindings/test/test_exception_options_from_jsimplemented.html
use `Array.indexOf` to generate an error with a specific error message.
Switched to `Array.prototype.forEach` to generate the same error.

js/src/jit-test/tests/basic/exception-column-number.js
In this test `Array.indexOf()` is used to generate an error. Since the
exact message doesn't matter, I switched to `Array.from()`.

Intentionally not changed:

editor/libeditor/tests/browserscope/lib/richtext/richtext/js/range.js
Did not modify because this is 3rd-party code and the code uses
feature detection as a fall back when Array generics are not used.

testing/talos/talos/tests/dromaeo/lib/mootools.js
Did not modify because mootools adds the `Array.slice` method to the
`Array` object.

Not changed because they check the implementation of Array generics:
js/src/jit-test/tests/basic/arrayNatives.js
js/src/jit-test/tests/basic/bug563243.js
js/src/jit-test/tests/basic/bug618853.js
js/src/jit-test/tests/basic/bug830967.js
js/src/jit-test/tests/jaeger/recompile/bug656753.js
js/src/jit-test/tests/self-hosting/alternate-static-and-instance-array-extras.js
js/src/tests/non262/Array/generics.js
js/src/tests/non262/Array/regress-415540.js
js/src/tests/non262/extensions/regress-355497.js
js/src/tests/non262/extensions/typedarray-set-neutering.js

Depends on D27802

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

--HG--
extra : moz-landing-system : lando
2019-04-17 19:03:19 +00:00
Boris Zbarsky d31e7ee991 Bug 1534593 part 3. Initialize JSObject* entries in Record types. r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D27562

--HG--
extra : moz-landing-system : lando
2019-04-16 19:18:52 +00:00
Boris Zbarsky 97cd783174 Bug 1534593 part 2. Factor out the "determine the default initializer" code from dictionary member init and reuse it for sequence member init. r=qdot
The other option would be to implement nsTArrayElementTraits for JSObject* and
null-initialize there.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 19:18:09 +00:00
Boris Zbarsky c377e7f5ae Bug 1534593 part 1. Stop special-casing JS::Value initialization, since JS::Value now always initializes itself on construction. r=jwalden,qdot
Differential Revision: https://phabricator.services.mozilla.com/D27560

--HG--
extra : moz-landing-system : lando
2019-04-16 19:11:40 +00:00
Brian Grinstead 0d460e3432 Bug 1544322 - Part 2.2 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in dom/ r=bzbarsky
This is split from the previous changeset since if we include dom/ the file size is too
large for phabricator to handle.

This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 2` argument.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 03:53:28 +00:00
Brian Grinstead 6515f97bcb Bug 1544322 - Part 1 - Remove the [type] attribute for one-liner <script> tags loading files in chrome://mochikit/content/ r=bzbarsky
This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 1` argument.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 20:56:58 +00:00
Sylvestre Ledru 7f60810d86 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-12 13:14:25 +00:00
Karl Tomlinson 26e9ce40c3 bug 1542932 Add code generation for callback constructors r=bzbarsky
TreatNonObjectAsNull is rejected in the parser because / so that there is no
need to implement the equivalent of CallCallback.getCallGuard().

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

--HG--
extra : moz-landing-system : lando
2019-04-11 20:54:17 +00:00
Boris Zbarsky ext:(%2C%20Karl%20Tomlinson%20%3Ckarlt%2B%40karlt.net%3E) eb7c3dbdf6 Bug 1542932 part 1. Add support for callback constructors in the IDL parser. r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D26864

--HG--
extra : moz-landing-system : lando
2019-04-10 20:32:57 +00:00
Boris Zbarsky d0bcf72821 Bug 1543564 part 2. Get rid of pointless nsPIDOMWindowInner::AsInner methods. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D27027

--HG--
extra : moz-landing-system : lando
2019-04-11 14:12:43 +00:00
Boris Zbarsky 423697c891 Bug 1543461. Add the missing newline after a static assert in Web IDL codegen. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D26960

--HG--
extra : moz-landing-system : lando
2019-04-10 19:05:15 +00:00