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

16 Коммитов

Автор SHA1 Сообщение Дата
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
Boris Zbarsky e5497b955e Bug 1423562 part 3. Remove [PrimaryGlobal] and require explicit [Exposed] annotations on everything. r=edgar
For review purposes, the important changes are in dom/bindings/Configuration.py
and dom/bindings/parser.

The changes to the IDL files were done by running these in dom/webidl
and dom/bindings/test:

  perl -pi -e 's/^interface ([A-Za-z0-9_]+)($| [:{])/[Exposed=Window]\ninterface \1\2/' *.webidl

  perl -pi -e 'BEGIN { $/ = undef; } s/\[HTMLConstructor\]\n\[Exposed=Window\]/[HTMLConstructor,\n Exposed=Window]/g' *.webidl

  perl -pi -e 'BEGIN { $/ = undef; } s/\[NoInterfaceObject\]\n\[Exposed=Window\]/[NoInterfaceObject,\n Exposed=Window]/g' *.webidl

  perl -pi -e 'BEGIN { $/ = undef; } s/\[ChromeOnly\]\n\[Exposed=Window\]/[ChromeOnly,\n Exposed=Window]/g' *.webidl

And running this in dom/chrome-webidl:

  perl -pi -e 'BEGIN { $/ = undef; } s/\[ChromeOnly\]\ninterface/[ChromeOnly, Exposed=Window]\ninterface/g' *.webidl

and then fixing all the resulting parser failures.  I then verified that the
generated code is the same as before this change.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 15:26:14 +00:00
Boris Zbarsky e52521c921 Bug 1574195 part 4. Switch remaining users of IDL "implements" over to mixin syntax. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D46523

--HG--
extra : moz-landing-system : lando
2019-09-24 15:22:26 +00:00
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 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 5869bb7df1 Bug 1535384 part 9. Remove MOZ_CAN_RUN_SCRIPT_BOUNDARY for u2f callbacks. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D23780

--HG--
extra : moz-landing-system : lando
2019-03-19 20:53:55 +00:00
Boris Zbarsky a998830a71 Bug 1535124 part 2. Mark Web IDL callbacks MOZ_CAN_RUN_SCRIPT by default. r=qdot
We add a [MOZ_CAN_RUN_SCRIPT_BOUNDARY] opt-out for now to keep the tree
compiling.  The naming purposefully matches the C++ annotation that has a
similar effect, top make it easy to search for.

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

--HG--
extra : moz-landing-system : lando
2019-03-19 12:59:54 +00:00
Cosmin Sabou 679b5e2db1 Backed out 5 changesets (bug 1485040) for causing build bustages on test_mozwebidlcodegen. CLOSED TREE
Backed out changeset b417c2d937e8 (bug 1485040)
Backed out changeset c567c4c7438f (bug 1485040)
Backed out changeset 806c36cb2c4c (bug 1485040)
Backed out changeset 0fbb490ffc7f (bug 1485040)
Backed out changeset a9622e7761eb (bug 1485040)
2018-09-13 23:04:55 +03:00
Andrew McCreight 93b3b0138c Bug 1485040, part 5 - Automatically fix mode lines in WebIDL files r=qdot
This patch was generated by my modeline.py script.

MozReview-Commit-ID: EbVjPLwiUAT

Depends on D4159

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

--HG--
extra : moz-landing-system : lando
2018-09-13 19:30:51 +00:00
Andrew McCreight 0a60d2df38 Bug 1485040, part 2 - Fix indentation in some WebIDL files r=qdot
MozReview-Commit-ID: DYMdVo1tO6a

Depends on D4156

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

--HG--
extra : moz-landing-system : lando
2018-09-13 19:30:45 +00:00
J.C. Jones dccb7bcf7c Bug 1247124 - Limit FIDO U2F to Secure Contexts r=ttaubert,smaug
Use the [SecureContext] webidl notation to hide the powerful "window.u2f"
feature and its interface when not loaded in a secure context.

MozReview-Commit-ID: 7en8b5ieI85
2017-12-13 17:02:38 -06:00
J.C. Jones 9e3d3fcc01 Bug 1276968 - Update the U2F webIDL to point to U2F v1.1 r=qdot
We implemented v1.1 of the U2F specification, which wasn't publicly published
at the time. Bug 1276968 was to come back and fix those links, so here it is.

MozReview-Commit-ID: 8hprQncPwcO
2017-11-16 18:11:02 -07:00
J.C. Jones e6dd50ba10 Bug 1309284 - Implement W3C Web Authentication JS API [part 1] r=keeler,qdot
This patch implements the W3C Web Authentication API from
https://www.w3.org/TR/webauthn/, currently the 28 September 2016
working draft.

It utilizes a tentative binding of the U2F NSS Soft Token to provide
authentication services while waiting on Bug 1245527 to support USB HID-based
U2F tokens. This binding is not in the specification yet, so it should be
considered an experiment to help the specification move fowrard.

There are also a handful of deviations from the specification's WebIDL, which
are annotated with comments in WebAuthentication.webidl.

There are no tests in this commit; they are in Part 4 of this commit series.
There is a small script online at https://webauthn.bin.coffee/ to exercise this
code, but it doesn't do any automated checks.

There are also a handful of TODOS:
1) The algorithm to relax the same-origin restriction is in Part 3.
2) The use of AlgorithmIdentifier and having a way to coerce an object to a
   string is still missing.
3) Timeouts and deadlines aren't there, and are pending reworking how
   the nsIU2FToken interface works.

UPDATED:
- Address qdot, keeler review comments (thanks!)
- Address more qdot, keeler review comments (thanks!)

MozReview-Commit-ID: JITapI38iOh

--HG--
extra : rebase_source : 9a09e852dd0c8dc47f42dabbcf8b845a6828b225
2017-01-09 13:22:49 -07:00
J.C. Jones 6783b15aab Bug 1251856 - Disable U2F in all releases (fix for 1231681). r=baku
* Pref off the "U2F" interface to blank out the integer constants, and
* Disable U2F in all releases.

MozReview-Commit-ID: 8HlkaRbg4Qh

--HG--
extra : transplant_source : %91%C5%1E%E6%A9%82RS%98%E4%ED%0A%CDGAVb%2B%079
2016-02-29 09:06:40 -07:00
J.C. Jones 70bc936cba Bug 1231681 - "Implement window.u2f interface". r=baku, r=dkeeler 2016-02-09 16:43:00 +01:00