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

4726 Коммитов

Автор SHA1 Сообщение Дата
longsonr a19c169444 Bug 1516206 - Part 1 Move DOM lengths and numbers into the mozilla::dom namespace r=dholbert 2018-12-28 13:42:46 +00:00
Boris Zbarsky d6876ebbfa Bug 1515999. Remove the unused JSContext argument from GetArrayIndexFromId. r=peterv 2018-12-26 13:45:15 -08:00
longsonr 1a3007051c Bug 1516076 - Part 2 Rename SVGAnimatedTransformList to DOMSVGAnimatedTransformList r=dholbert
--HG--
rename : dom/svg/SVGAnimatedTransformList.cpp => dom/svg/DOMSVGAnimatedTransformList.cpp
rename : dom/svg/SVGAnimatedTransformList.h => dom/svg/DOMSVGAnimatedTransformList.h
2018-12-23 11:08:14 +00:00
longsonr 3d04ba9c9e Bug 1515187 - Part 4 Rename nsSVGElement to SVGElement and put it in the mozilla:dom namespace r=dholbert
--HG--
rename : dom/svg/nsSVGElement.cpp => dom/svg/SVGElement.cpp
rename : dom/svg/nsSVGElement.h => dom/svg/SVGElement.h
2018-12-21 08:58:14 +00:00
Jan de Mooij 2104ae00bb Bug 1514672 part 1 - Move XPCWrappedNativeScope from RealmPrivate to CompartmentPrivate. r=bzbarsky
This needs to be on the compartment to prevent creating duplicate wrapped natives.
We now also allocate these objects in the compartment's first global for
consistency and to prevent leaks.

XPCWrappedNativeScope also stores the content XBL scope. I considered moving
this to RealmPrivate, but given the fate of in-content XBL I went with the
simpler option of keeping it on XPCWrappedNativeScope and release-asserting we
have a single realm in the XBL case.

Because XPCWrappedNativeScope no longer stores a global object, we no longer
need XPCWrappedNativeScope::TraceSelf, XPCWrappedNativeProto::TraceInside and
XPC_WN_Proto_Trace.

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

--HG--
extra : moz-landing-system : lando
2018-12-20 08:23:31 +00:00
Razvan Maries f658ebcbab Merge mozilla-inbound to mozilla-central a=merge 2018-12-20 07:04:06 +02:00
Andrew McCreight 0507792161 Bug 1471989 - Clear JSStackFrame's JS object pointer when the window goes away. r=bzbarsky
JSStackFrames are C++ objects that are exposed to chrome JS and keep
alive content JS. This means that if chrome JS leaks a stack frame
then a window can be leaked.

The basic idea of this patch is to think of JSStackFrames as
cross-compartment wrappers, and do a "hueyfix" on them by dropping the
content JS reference when the associated content window is closed.

To do that, this patch modifies the realm private to keep a list of
all live JSStackFrames that have been created with objects in that
realm. When we nuke that realm, we also clear out all of the JS
pointers from the registered stack frames on that realm.

This adds a hash table lookup to the JSStackFrame ctor and dtor, which
is hopefully not too much overhead.

The test works by intentionally leaking a JSStackFrame from chrome JS
and making sure that the window still goes away.

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

--HG--
extra : moz-landing-system : lando
2018-12-19 19:42:04 +00:00
Peter Van der Beken 9ae4291779 Bug 1515319 - Allow record<DOMString, object> member in dictionary. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D14968

--HG--
extra : moz-landing-system : lando
2018-12-19 19:29:48 +00:00
Andreea Pavel f9260c6914 Backed out changeset b1fe3750580d (bug 1471989) for build bustages on a CLOSED TREE 2018-12-19 20:48:10 +02:00
Andrew McCreight 09534362bf Bug 1471989 - Clear JSStackFrame's JS object pointer when the window goes away. r=bzbarsky
JSStackFrames are C++ objects that are exposed to chrome JS and keep
alive content JS. This means that if chrome JS leaks a stack frame
then a window can be leaked.

The basic idea of this patch is to think of JSStackFrames as
cross-compartment wrappers, and do a "hueyfix" on them by dropping the
content JS reference when the associated content window is closed.

To do that, this patch modifies the realm private to keep a list of
all live JSStackFrames that have been created with objects in that
realm. When we nuke that realm, we also clear out all of the JS
pointers from the registered stack frames on that realm.

This adds a hash table lookup to the JSStackFrame ctor and dtor, which
is hopefully not too much overhead.

The test works by intentionally leaking a JSStackFrame from chrome JS
and making sure that the window still goes away.

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

--HG--
extra : moz-landing-system : lando
2018-12-19 16:46:25 +00:00
Boris Zbarsky 829ee4b10c Bug 1514251 part 2. Update naming in ReparentWrapper to reflect reality. r=peterv
We're not changing parents; we're changing globals.  Let's be clear about that.
2018-12-19 11:52:31 -08:00
Boris Zbarsky 00a507f332 Bug 1514251 part 1. Stop relying on compartment-per-global in ReparentWrapper. r=peterv,jandem
This code dates back to when we had a concept of parent as distinct from the
concept of global.  It was comparing compartments back then because in the
same-compartment case it would just JS_SetParent and return.  When we got rid of
the concept of parents, the code was left as-is, even though at that point we
could just as easily compare the two globals.

I believe that in the same-compartment-different-globals case this is safe,
because in that case JS_TransplantObject will just keep using the original
object allocation but JSObject::swap it with the new object, so that it will
pick up the new global.
2018-12-19 11:50:36 -08:00
Cosmin Sabou b30ca1fd33 Merge mozilla-inbound to mozilla-central. a=merge 2018-12-15 04:47:12 +02:00
Sylvestre Ledru 6f45c666bc Bug 1513205 - Also update the tests to match the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2018-12-14 18:10:35 +00:00
Jan de Mooij b8a316aca4 Bug 1512260 - Make wrapper nuking work with a target realm instead of target compartment. r=kmag
For *incoming* wrappers this preserves behavior. We nuke *outgoing* wrappers
when all realms in the compartment have been nuked. To implement this I moved
the wasNuked flag from XPConnect to JS::Compartment as nukedOutgoingWrappers and
to JS::Realm as nukedIncomingWrappers.

The code to create a dead wrapper in the nuked compartment/realm case was also
moved into the JS engine. I added a shell test for it.

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

--HG--
extra : moz-landing-system : lando
2018-12-12 08:02:30 +00:00
Ciure Andrei 12adcc1edd Backed out changeset a8dd01db9f92 (bug 1512260) requsted by owner (missing test) CLOSED TREE 2018-12-12 09:14:53 +02:00
Jan de Mooij 89da963b10 Bug 1512260 - Make wrapper nuking work with a target realm instead of target compartment. r=kmag
For *incoming* wrappers this preserves behavior. We nuke *outgoing* wrappers
when all realms in the compartment have been nuked. To implement this I moved
the wasNuked flag from XPConnect to JS::Compartment as nukedOutgoingWrappers and
to JS::Realm as nukedIncomingWrappers.

The code to create a dead wrapper in the nuked compartment/realm case was also
moved into the JS engine. I added a shell test for it.

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

--HG--
extra : moz-landing-system : lando
2018-12-12 06:39:38 +00:00
Boris Zbarsky c734e83c48 Bug 1511401 part 4. Use CallArgs::requireAtLeast in the DOM. r=nbp,qdot 2018-12-10 14:13:06 -05:00
Diego Pino Garcia 114e1d1f03 Bug 1436329 - Parse WebIDL "partial dictionary" r=peterv 2018-11-29 01:11:00 +02:00
Andrea Marchesini ace9fa800a Bug 1508310 - Implement Report-to header support - part 4 - IPC to get endpoint from content process, r=smaug 2018-12-01 21:26:09 +01:00
Steve Fink 10953d54c2 Bug 1513108 - Remove the separate class extension hook for getting a weakmap key delegate, r=jonco
Replace with just unwrapping the key, since there are no users that return anything else for a delegate.

--HG--
extra : rebase_source : e72b825121ca3493364c9347f65e5dddd1ef53e0
2018-12-07 14:38:01 -08:00
Jon Coppeard 6f81506124 Bug 1463462 - Make gray marking assertions call a JSAPI function r=sfink 2018-12-06 16:28:10 -05:00
Tooru Fujisawa 7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Benjamin Bouvier a7f1d173a0 Bug 1511383: Update vim modelines after clang-format; r=sylvestre
- modify line wrap up to 80 chars; (tw=80)
- modify size of tab to 2 chars everywhere; (sts=2, sw=2)

--HG--
extra : rebase_source : 7eedce0311b340c9a5a1265dc42d3121cc0f32a0
extra : amend_source : 9cb4ffdd5005f5c4c14172390dd00b04b2066cd7
2018-11-30 16:39:55 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Diego Pino Garcia fb55ca75b7 Bug 1249606 - Automatically generate operator== for WebIDL dictionaries. r=bzbarsky 2018-11-29 17:07:30 -05:00
Boris Zbarsky 4297d8370d Bug 1491925. Remove the various instrumentation we added to pin down InnerSetNewDocument failures. r=mccr8.
This is a straight backout of (in that order) bug 1505468, bug 1503664, bug
1501479, bug 1499150, bug 1496805, and the second part of bug 1493849.  The
first part of bug 1493849 was a backout of earlier instrumentation, and that
should stay.

At this point we know we're hitting OOM inside the JS engine while trying to
define properties on Document.prototype, so all this MOZ_CRASH instrumentation
is no longer needed.
2018-11-28 18:24:53 -05:00
Jeff Walden 3093d025b8 Bug 1510012 - Move Symbol-related APIs out of jsapi.h into js/public/Symbol.h. r=sfink, r=mccr8 for the bindings change
--HG--
extra : rebase_source : 3a8d2d694052435fbc47b9131a521e31e9b0ea6f
2018-11-24 12:21:40 -08:00
Jeff Walden af9a670e28 Bug 1510007 - Move JSFreeOp's definition to js/public/MemoryFunctions.h, and make jsapi.h not #include that header. r=sfink
--HG--
extra : rebase_source : 4d6debefd66b89647df53c104b8560ba2de68abd
2018-11-21 18:11:15 -08:00
Ehsan Akhgari 6099c9f67b Bug 1508472 - Part 1: First batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal.  I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

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

--HG--
extra : moz-landing-system : lando
2018-11-27 10:08:58 +00:00
inspiro 9bd2a49d9a Bug 1320105 : Renamed jsid to PropertyKey and included in JS namespace. r=jandem
Renamed jsid to PropertyKey and included in JS namespace

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

--HG--
extra : moz-landing-system : lando
2018-11-20 12:01:42 +00:00
Nika Layzell d036b747e7 Bug 1477432 - Part 6: Stop using nsIJSID inside of WebIDL bindings, r=mccr8
Rather than adding a native type for nsID objects in WebIDL, this patch just
takes the approach of switching consumers over to using 'any' and calling the
APIs defined in Part 1.

Differential Revision: https://phabricator.services.mozilla.com/D2283
2018-11-16 17:27:39 -05:00
arthur.iakab c0b26c4076 Merge inbound to mozilla-central a=merge 2018-11-15 11:54:15 +02:00
Timothy Guan-tin Chien af2973ef61 Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

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

--HG--
extra : moz-landing-system : lando
2018-11-15 06:52:01 +00:00
Andreea Pavel d51566f085 Backed out 2 changesets (bug 1503019) for failing crashtests at dom/base/crashtests/1505811.html on a CLOSED TREE
Backed out changeset 06b12fd41ff1 (bug 1503019)
Backed out changeset 7b845eac9dd7 (bug 1503019)
2018-11-15 01:52:30 +02:00
Markus Stange 43b6fb5988 Bug 1500467 - Mark WebIDL profiler label frames as RELEVANT_FOR_JS. r=njn
Depends on D9300

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

--HG--
extra : moz-landing-system : lando
2018-11-14 18:54:59 +00:00
Timothy Guan-tin Chien c69315234b Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

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

--HG--
extra : moz-landing-system : lando
2018-11-14 19:37:42 +00:00
Andrea Marchesini d9e70a0be6 Bug 1492036 - Reporting API - part 4 - Reporting, r=smaug 2018-11-14 20:02:33 +01:00
Andrea Marchesini db43f2464c Bug 1492036 - Reporting API - part 3 - Deprecate reports, r=smaug 2018-11-14 20:02:33 +01:00
Boris Zbarsky ab67fedabb Bug 1505504. Improve the error message when two WebIDL callbacks are defined with the same name. r=qdot 2018-11-07 14:06:05 -05:00
Boris Zbarsky 39b5c78c43 Bug 1505468. Add more ClearDocumentDependentSlots instrumentation to see why Document.prototype creation fails. r=mccr8 2018-11-07 14:06:05 -05:00
Markus Stange b2c3ca5adb Bug 1499507 - Use AUTO_PROFILER_LABEL_DYNAMIC_FAST for WebIDL APIs. r=bzbarsky
This means that our binary does not need to include concatenated strings such
as "set CanvasRenderingContext2D.fillStyle". It only needs to contain the
individual strings "CanvasRenderingContext2D" and "fillStyle" which are most
likely already present in the binary.

This change reduces the binary size on macOS x64 by around 200KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build. This change makes us generate slightly more code, which is
very much offset by the reduction in the amount of strings we ship.

@@ -15,22 +15,23 @@

    movl       0x10(%rbx), %r12d
    cmpl       (%rbx), %r12d
    jae        loc_xxxxx

    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
-   leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
+   leaq       aAttr, %rdx                                 ; "Attr"
    movq       %rdx, (%rax,%rcx)
-   movq       $0x0, 0x8(%rax,%rcx)
+   leaq       aSpecified, %rdx                            ; "specified"
+   movq       %rdx, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x71, 0x1c(%rax,%rcx)
+   movl       $0x3a1, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx
    orq        %rax, %rcx

Depends on D9204

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

--HG--
extra : moz-landing-system : lando
2018-11-06 04:34:58 +00:00
Brindusan Cristian ab89743379 Backed out 9 changesets (bug 1499507) for build bustages on /profiler/core/platform.cpp. CLOSED TREE
Backed out changeset 4c79a5557d7b (bug 1499507)
Backed out changeset 35d05a53e0a9 (bug 1499507)
Backed out changeset 9254e6c721b3 (bug 1499507)
Backed out changeset cf40b044af3f (bug 1499507)
Backed out changeset 76dd85b9aaf7 (bug 1499507)
Backed out changeset 6256446f16c4 (bug 1499507)
Backed out changeset 41cede6bc7d2 (bug 1499507)
Backed out changeset 30476b824eb4 (bug 1499507)
Backed out changeset 24a9494155fe (bug 1499507)
2018-11-05 23:24:49 +02:00
Markus Stange 42d8bddb50 Bug 1499507 - Use AUTO_PROFILER_LABEL_DYNAMIC_FAST for WebIDL APIs. r=bzbarsky
This means that our binary does not need to include concatenated strings such
as "set CanvasRenderingContext2D.fillStyle". It only needs to contain the
individual strings "CanvasRenderingContext2D" and "fillStyle" which are most
likely already present in the binary.

This change reduces the binary size on macOS x64 by around 200KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build. This change makes us generate slightly more code, which is
very much offset by the reduction in the amount of strings we ship.

@@ -15,22 +15,23 @@

    movl       0x10(%rbx), %r12d
    cmpl       (%rbx), %r12d
    jae        loc_xxxxx

    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
-   leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
+   leaq       aAttr, %rdx                                 ; "Attr"
    movq       %rdx, (%rax,%rcx)
-   movq       $0x0, 0x8(%rax,%rcx)
+   leaq       aSpecified, %rdx                            ; "specified"
+   movq       %rdx, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x71, 0x1c(%rax,%rcx)
+   movl       $0x3a1, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx
    orq        %rax, %rcx

Depends on D9204

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

--HG--
extra : moz-landing-system : lando
2018-11-05 21:00:01 +00:00
Narcis Beleuzu 2c6edfdde8 Backed out 9 changesets (bug 1499507) for bustages on ProfileBuffer.cpp . CLOSED TREE
Backed out changeset 541186291b88 (bug 1499507)
Backed out changeset 8a3f4acbad3b (bug 1499507)
Backed out changeset f427afc392b0 (bug 1499507)
Backed out changeset 58dc19fb2b76 (bug 1499507)
Backed out changeset 9225e9aea377 (bug 1499507)
Backed out changeset ca23a517da63 (bug 1499507)
Backed out changeset 16d6c90333de (bug 1499507)
Backed out changeset bc134fe1722a (bug 1499507)
Backed out changeset 4a9c9a91182c (bug 1499507)
2018-11-05 21:48:11 +02:00
Markus Stange 5701f220f1 Bug 1499507 - Use AUTO_PROFILER_DYNAMIC_FAST for WebIDL APIs. r=bzbarsky
This means that our binary does not need to include concatenated strings such
as "set CanvasRenderingContext2D.fillStyle". It only needs to contain the
individual strings "CanvasRenderingContext2D" and "fillStyle" which are most
likely already present in the binary.

This change reduces the binary size on macOS x64 by around 200KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build. This change makes us generate slightly more code, which is
very much offset by the reduction in the amount of strings we ship.

@@ -15,22 +15,23 @@

    movl       0x10(%rbx), %r12d
    cmpl       (%rbx), %r12d
    jae        loc_xxxxx

    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
-   leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
+   leaq       aAttr, %rdx                                 ; "Attr"
    movq       %rdx, (%rax,%rcx)
-   movq       $0x0, 0x8(%rax,%rcx)
+   leaq       aSpecified, %rdx                            ; "specified"
+   movq       %rdx, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x71, 0x1c(%rax,%rcx)
+   movl       $0x3a1, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx
    orq        %rax, %rcx

Depends on D9204

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

--HG--
extra : moz-landing-system : lando
2018-11-05 19:11:46 +00:00
Kris Maglione 288ea557d8 Bug 1482091: Part 1 - Add native TelemetryStopwatch implementation. r=chutten,mccr8
This implementation is considerably more memory efficient than the existing JS
implementation. Migrating to it fully saves us about 28K per base content
process.

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

--HG--
extra : source : a19c6b3e0402d16a77185f82d9fedab83a7ca52e
extra : intermediate-source : 28a19b7290ab288a1cb2cbf6d49f905cecc9682b
2018-10-26 13:17:55 -07:00
arthur.iakab 0c81738411 Backed out 2 changesets (bug 1482091) for bc failures on browser_domFullscreen_fullscreenMode.js
Backed out changeset bc03f101937e (bug 1482091)
Backed out changeset 28a19b7290ab (bug 1482091)
2018-11-03 01:08:36 +02:00
Kris Maglione bee3f68fdc Bug 1482091: Part 1 - Add native TelemetryStopwatch implementation. r=chutten,mccr8
This implementation is considerably more memory efficient than the existing JS
implementation. Migrating to it fully saves us about 28K per base content
process.

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

--HG--
extra : source : a19c6b3e0402d16a77185f82d9fedab83a7ca52e
2018-10-26 13:17:55 -07:00
arthur.iakab cf2aa54f83 Backed out 2 changesets (bug 1482091)for failing browser chrome failures on browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
Backed out changeset afd0a13bcfff (bug 1482091)
Backed out changeset a19c6b3e0402 (bug 1482091)
2018-11-02 23:01:15 +02:00