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

16936 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 2537e52ca0 Bug 1486728 - Report memory usage of Shadow DOM style data. r=njn
This is on top of bug 1486623.

While at it removed the 'stale computed styles' report, since it was unused
since I removed the undisplayed maps.

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

--HG--
extra : moz-landing-system : lando
2018-08-29 22:24:29 +00:00
Emilio Cobos Álvarez 75bea4ec60 Bug 1486623 - Skip less nodes when reporting memory, and report ShadowRoot's StyleSheets. r=bzbarsky
This moves all the node-specific reporting to nsIDocument.

OrphanReporter delegates all the reporting to that and then returns the sum of
all sizes, which is not ideal but was pre-existing.

Also, I moved the main mStyleSheets size reporting to DocumentOrShadowRoot for
it to be shared between document and ShadowRoot.

I'll add memory reporting for the computed stylesheet maps and such in the
ShadowRoot in a followup.

I went through all the XBL bindings, though it seems I could just use
GetBindingWithContent(), since according to:

  https://searchfox.org/mozilla-central/rev/55da592d85c2baf8d8818010c41d9738c97013d2/dom/xbl/nsXBLBinding.cpp#615

We don't allow multiple bindings to contribute anon content. Anyway it was the
same amount of code...

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

--HG--
extra : moz-landing-system : lando
2018-08-29 22:19:42 +00:00
Gabriele Svelto 6bddc0a55e Bug 1486772 - Refactor the screen-orientation types and headers r=smaug
This patch removes the 'ScreenOrientationInternal' type from
dom/base/ScreenOrientation.h and moves it into the
HalScreenConfiguration.h header, renaming it simply to 'ScreenOrientation'
in the process. This has several knock-off effects:

- It allows files that needed ScreenOrientationInternal to include a much
  smaller header than before

- It greatly reduces the number of headers pulled in when including Hal.h

- It clarifies the role of the type. The 'Internal' part in the name had
  nothing to do with it being part of the implementation. The type was public
  and called that way only to avoid clashing with the 'ScreenOrientation'
  class. Since we moved it into a different namespace it can be renamed
  safely.

- It allows a file that was manually re-declaring 'ScreenConfigurationInternal'
  type to use the original one

- Finally this fixes a few files which were missing headers they actually
  required but that would still build because unified compilation put them into
  units that already had those headers thanks to ScreenConfiguration.h

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

--HG--
extra : moz-landing-system : lando
2018-08-29 20:54:56 +00:00
Daniel Holbert ed94d8a8f4 Bug 1487168: Give ShouldShowFocusRingIfFocusedByMouse() an #ifndef guard to match its caller & to avoid -Wunused-function build warning. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D4583

--HG--
extra : moz-landing-system : lando
2018-08-29 18:01:12 +00:00
Cosmin Sabou 55bf096f3d Merge mozilla-inbound to mozilla-central. a=merge 2018-08-29 20:34:13 +03:00
Rob Wu 88ec13510d Bug 1465388 - Resume about:blank parser upon unblocking the document r=hsivonen
When `document.blockParsing()` is called, the nsIParser is suspended
until the document is unblocked. For about:blank documents, this is a
nsParser.

When a document is unblocked, nsParser::ContinueInterruptedParsingAsync
is invoked, which delegates its implementation to nsIContentSink, which
is a nsHTMLContentSink for about:blank documents. Due to a missing
implementation of nsHTMLContentSink::ContinueInterruptedParsingAsync,
the parser was never resumed, causing bug 1465388 and bug 1407501.

This patch fixes the problem, by implementing the required method (and
using a load blocker to ensure that the (about:blank) document does not
finish before the parser finishes).

This patch is tested through extension tests: Currently document_start
stylesheets always activate the parser blocker, and document_start
scripts trigger the parser blocker when the script has not been
preloaded yet (e.g. at the first run).
Before this patch, the test failed due to the assertion failure as
reported in the linked bugs. After this patch, the tests pass.

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

--HG--
extra : moz-landing-system : lando
2018-08-29 11:52:49 +00:00
Margareta Eliza Balazs 2fe43133db Merge inbound to mozilla-central. a=merge 2018-08-29 12:43:37 +03:00
Margareta Eliza Balazs 7bc4b7b684 Merge autoland to mozilla-central. a=merge 2018-08-29 12:42:34 +03:00
Andreea Pavel 65e947cc68 Backed out changeset 126368a5c3ec (bug 1465388) for causing topcrash bug 1487004 a=backout 2018-08-29 11:39:19 +03:00
Ciure Andrei d716a04e20 Merge inbound to mozilla-central. a=merge 2018-08-29 00:58:21 +03:00
Andreas Farre 82694e9ac3 Bug 1481238 - Create WebIDL interface for BrowsingContext. r=peterv
Expose Chrome only WebIDL to interface with BrowsingContext from
script. The API consists of parent, firstChild and nextSibling
attributes for BrowsingContext, and the browsingContext attribute for
Window.

--HG--
extra : rebase_source : 772d25e8b4e5526453545ddb2b1607845f3b65ea
2018-08-29 05:00:00 +03:00
Emilio Cobos Álvarez a1f03332c2 Bug 1486488 - Don't assume that SVGAnimationElement has a parent on bind. r=dholbert
This is a regression from bug 1450250, which removed a if (!GetCx()) early
return in this function.

That early return was wrong, both because it prevented elements that were in
shadow trees from targeting other elements, but also because that check was not
present in AfterSetAttr, which means that dynamic updates to the attribute would
work.

Pass the SVGAnimationElement itself to resolve references. That's what we do for
attribute mutations, and also it's the same behavior we have, since the ID
lookup IDTracker does only depends on containing shadow root and containing
document, and that's invariant between a kid and it's DOM parent.

Some other code has been updated to take references instead of pointers so the
null-safety of those methods is explicit.

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

--HG--
extra : moz-landing-system : lando
2018-08-28 09:06:08 +00:00
Rob Wu 618a64cb28 Bug 1465388 - Resume about:blank parser upon unblocking the document r=hsivonen
When `document.blockParsing()` is called, the nsIParser is suspended
until the document is unblocked. For about:blank documents, this is a
nsParser.

When a document is unblocked, nsParser::ContinueInterruptedParsingAsync
is invoked, which delegates its implementation to nsIContentSink, which
is a nsHTMLContentSink for about:blank documents. Due to a missing
implementation of nsHTMLContentSink::ContinueInterruptedParsingAsync,
the parser was never resumed, causing bug 1465388 and bug 1407501.

This patch fixes the problem, by implementing the required method (and
using a load blocker to ensure that the (about:blank) document does not
finish before the parser finishes).

This patch is tested through extension tests: Currently document_start
stylesheets always activate the parser blocker, and document_start
scripts trigger the parser blocker when the script has not been
preloaded yet (e.g. at the first run).
Before this patch, the test failed due to the assertion failure as
reported in the linked bugs. After this patch, the tests pass.

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

--HG--
extra : moz-landing-system : lando
2018-08-28 05:28:21 +00:00
Margareta Eliza Balazs 350c943d93 Backed out changeset 9dc25841ff4f (bug 1486480) for causing Assertion failure: extendedSlots, at /builds/worker/workspace/build/src/dom/base/FragmentOrElement.cpp CLOSED TREE 2018-08-28 15:33:55 +03:00
Boris Zbarsky bd5c20d12e Bug 1486480. Add memory reporting for custom element data. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D4350

--HG--
extra : moz-landing-system : lando
2018-08-27 19:20:53 +00:00
Ciure Andrei c7bd3f7ba5 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-08-29 01:06:58 +03:00
Daniel Holbert 8dbb3d97d6 Bug 1486633: Simplify the logic for updating mWatchID in IDTracker.cpp. r=smaug
Notes:
* NS_Atomize never returns null, so this patch removes a null check on its
  return value.
* There's no need for the |atom| local variable and for our swap() call on it.
  It's equivalent and simpler for us to just directly assign mWatchID, rather
  than to use this disposable local variable.

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

--HG--
extra : moz-landing-system : lando
2018-08-28 21:07:08 +00:00
Nicholas Nethercote 2fcd08a173 Bug 1486690 - Rename NS_str{,}dup and remove unnecessary checks after calls to them. r=glandium
The 'x' prefix makes it clearer that these are infallible.

A couple of nsJSID methods are now also infallible.

--HG--
extra : rebase_source : fcce44a00212d6d341afbf3827b31bd4f7355ad5
2018-08-28 15:58:54 +10:00
Nicholas Nethercote ac5efebb4b Bug 1486690 - Remove unnecessary checks after moz_xmalloc() calls. r=glandium
There are surprisingly many of them.

(Plus a couple of unnecessary checks after `new` calls that were nearby.)

--HG--
extra : rebase_source : 47b6d5d7c5c99b1b50b396daf7a3b67abfd74fc1
2018-08-28 15:56:01 +10:00
Jeff Walden 64fceacad0 Bug 1486577 - Don't #include "js/CompilationAndEvaluation.h" in jsapi.h, minimizing the scope of that header and reducing translation-unit size of anything that needs JSAPI but doesn't need to compile/evaluate JavaScript. r=jandem
--HG--
extra : rebase_source : cd9a8becc15477bc5e24408159d4f061ec81c8b2
2018-08-24 22:51:49 -05:00
Jeff Walden 4bdf4a3614 Bug 1486577 - Don't #include js/SourceBufferHolder.h in jsapi.h, and instead require users to do so -- a minor translation-unit size improvement for anyone who never has to use SourceBufferHolder other than by reference. r=jandem
--HG--
extra : rebase_source : df47aba0c7dac3fe80ab6ea1b9a34c7acc54850d
2018-08-24 21:01:58 -05:00
Kris Maglione 2dee0aae3c Bug 1484496: Part 4b - Add intrinsic type information to most nsSimpleEnumerators. r=froydnj
This allows JS callers to automatically get the correct types during
interation, without having to explicitly specify them.

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

--HG--
extra : rebase_source : b708f382d8ea571d199c669bfed5b5a7ca9ffac4
extra : histedit_source : 7df6feb82088c8a5ca45dc28fe4d2b852c177fee
2018-08-18 21:06:32 -07:00
Kris Maglione 5fc43565d7 Bug 1484373: Part 1 - Allow querying to ContentFrameMessageManager. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D3691

--HG--
extra : rebase_source : 65652ca62cf87293ec9cebaeda6da747ab5e2fa1
2018-08-17 16:14:43 -07:00
Boris Zbarsky bd242c33f1 Bug 1486480. Add memory reporting for custom element data. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D4350
2018-08-27 19:20:53 +00:00
Emilio Cobos Álvarez ab460a4f52 Bug 1425700 - Make the counters non-atomic counters and merge afterwards. r=bholley
This was consistently faster in the benchmark (even when counters were disabled,
which was slightly suspicious, but...).

Anyway, it's not really much code, most of it is FFI copy-pasta.

Differential Revision: https://phabricator.services.mozilla.com/D3874
2018-08-28 15:58:24 +02:00
Emilio Cobos Álvarez e2379f3921 Bug 1425700 - Add a test for the use counters. r=heycam
Mostly testing that they work, and that they record what we expect them to
record, that is, the actual property that was parsed, and not the properties
that it'd resolve or expand to.

That may be another tricky part for CSSOM, I think style setters would fail an
alias test if implemented with the current setup (we do the property lookup in
C++).

Differential Revision: https://phabricator.services.mozilla.com/D3829
2018-08-28 15:58:21 +02:00
Emilio Cobos Álvarez 7f1f4ab7f0 Bug 1425700 - Hook the use counters into StyleSheet parsing. r=heycam
Still not hooked into telemetry, I talked with :janerik and :gfritzsche about
that, but test incoming!

This intentionally doesn't handle CSSOM and such for now, will file followups
for those, though should be trivial.

I want to unify / clean up how we do the use counters and the error reporting
stuff for CSSOM, since the current function call still shows up in profiles,
but that should be a follow-up.

Differential Revision: https://phabricator.services.mozilla.com/D3828
2018-08-28 15:58:19 +02:00
Ehsan Akhgari 1022d7475b Bug 1485839 - Remove the obsolete privacy.restrict3rdpartystorage.ui.enabled pref; r=nika 2018-08-28 08:29:33 -04:00
Andrea Marchesini c80c929412 Bug 1476967 - Allow the adding of tracking-protection entries via prefs, r=francois 2018-08-27 21:01:14 +02:00
Ehsan Akhgari 363e542f6e Bug 1486092 - Part 2: Make the reject tracker cookie behavior also depend on the browser.contentblocking.enabled pref; r=baku
The semantics implemented are as follows: the feature requires this new
pref to also be set to true, otherwise cookies from trackers will be
accepted.
2018-08-27 09:22:01 -04:00
Brindusan Cristian 7ac19aed65 Merge inbound to mozilla-central. a=merge 2018-08-23 06:41:38 +03:00
Emilio Cobos Álvarez 353af6324b Bug 1485472 - Avoid a couple addref / release in ParseStyleAttribute. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D4008

--HG--
extra : moz-landing-system : lando
2018-08-22 22:27:12 +00:00
Nicholas Nethercote 8cb0711355 Bug 1485279 - Merge nsISHContainer into nsISHEntry. r=qdot
nsSHEntry is the only class that instantiates those two interfaces, so the
separation is not useful. This lets us remove numerous pointless QIs.

--HG--
extra : rebase_source : 570b7ade669fb89a789184198bec9da186c5f1d3
2018-08-22 19:20:56 +10:00
Anny Gakhokidze edf3cdbd07 Bug 1453153 - Initial removal of moz* APIs in DataTransfer, r=enndeakin,r=nika
In DataTransfer, change mozItemCount, mozTypesAt, mozClearDataAt, mozSetDataAt,
mozGetDataAt APIs to be ChromeOnly.

MozReview-Commit-ID: 9uJ9ncrcBL2
2018-08-22 15:10:31 -04:00
Brian Grinstead e858b8d083 Bug 1484759 - Update references to browser.xul in tests to use AppConstants.BROWSER_CHROME_URL;r=Gijs
This only includes functions that seem to be using it to reference a window.
There are other instances where it's used as a generic chrome URI, and those
are left unchanged.

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

--HG--
extra : moz-landing-system : lando
2018-08-21 15:33:26 +00:00
Dorel Luca 3fa761ade8 Merge mozilla-inbound to mozilla-central. a=merge 2018-08-21 19:01:08 +03:00
Dorel Luca d9bdf77969 Merge mozilla-central to autoland 2018-08-21 12:57:58 +03:00
Emilio Cobos Álvarez bd36609f59 Bug 1484773 - Containing shadow could be null after unlink. r=smaug
Bug 1483882 removed the line that used to remove the SHADOW_TREE bit during
unbind. I missed this caller which still assumed that `IsInShadowTree() ->
GetContainingShadow()`.

That means that before that patch it was going through
nsIDocument::RemoveStyleSheet, which looks pretty wrong to me.

Fix it so that we don't remove the stylesheet (we weren't doing it before
anyway), but we don't crash.

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

--HG--
extra : moz-landing-system : lando
2018-08-20 23:28:57 +00:00
Tom Tung d2cd03866d Bug 1484615 - Followup comment fix for bug 1409641; r=janv
This patch add comments to IndexedDBHelper.jsm to clarify how txn.result is set.
The comments should clear up any confusion caused by previous commit message
(fix for bug 1409641).

--HG--
extra : rebase_source : 57a6f3eb569224a9e432803ef67d80f57219f7ab
2018-08-20 11:46:24 +02:00
Emilio Cobos Álvarez c1a9351458 Bug 1480275: Handle nested use shadow trees properly when the ID target changes. r=heycam
We end up with three <svg:use> elements to update (lol), because the target (#c)
changes, since we create another element with that ID in the document via
outerHTML.

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

--HG--
extra : moz-landing-system : lando
2018-08-20 00:32:56 +00:00
Jeff Walden e4f79e2a19 Bug 1484421 - Move JSON-related functionality into js/public/JSON.h that isn't #include'd in jsapi.h. r=jandem 2018-08-20 07:54:45 -07:00
Jeff Walden ffd93ba761 Bug 1033916 - Move JSAutoByteString out of jsapi.h into js/public/AutoByteString.h, incidentally breaking the jsfriendapi.h -> jsapi.h dependency. r=jandem
--HG--
extra : rebase_source : d85baf9b28e632db5669aa3d056cc9744686f5c8
2018-08-20 07:46:08 -07:00
Jeff Walden 3e90595274 Bug 1484389 - Move various SavedFrame-related functions and data types into js/public/SavedFrameAPI.h so that users aren't forced to depend on jsapi.h or jsfriendapi.h for them. r=jandem
--HG--
extra : rebase_source : d891f81cb0827d3c03971f71ba95a014d1e35379
2018-08-20 07:45:44 -07:00
Jeff Walden cd10720691 Bug 1040316 - Move AutoStableStringChars out of friendapi into public API. r=jandem
--HG--
extra : rebase_source : 3f66710e9517aba203a3d5365f6c3f0102c7baf8
2018-08-20 07:44:44 -07:00
Masatoshi Kimura 66fa613043 Bug 1484191 - Suppress warning C4819 in TestMimeType.cpp. r=froydnj
--HG--
extra : source : f6814f368b90b9cf1c00df44fd4a62c423a1f8cc
2018-08-17 03:18:15 +09:00
Narcis Beleuzu 96343e8f1f Backed out 3 changesets (bug 1484184, bug 1484190, bug 1484191) for bustages on test_toolchain_configure.py. CLOSED TREE
Backed out changeset dca5444170e0 (bug 1484190)
Backed out changeset 1ef81d07bc5b (bug 1484184)
Backed out changeset 2a42fd4df1bb (bug 1484191)
2018-08-20 19:49:37 +03:00
shindli 1d3a8e90da Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-08-20 19:36:01 +03:00
Masatoshi Kimura 60b0d9635e Bug 1484191 - Suppress warning C4819 in TestMimeType.cpp. r=froydnj
--HG--
extra : rebase_source : 0c3e287a29cec81e24a22980f6ee2ea32de42283
extra : source : f6814f368b90b9cf1c00df44fd4a62c423a1f8cc
2018-08-17 03:18:15 +09:00
Emilio Cobos Álvarez 3b61137a4b Bug 1484478 - Use a node bit for connectedness. r=smaug
While trying to repro bug 1484293 I noticed that this assertion failed:

https://searchfox.org/mozilla-central/rev/ef8b3886cb173d5534b954b6fb7eb2d94a9473d0/dom/base/ShadowRoot.cpp#160

(during unlink, while unbinding the kids)

We rely on GetComposedDoc returning the right thing during unbind to cleanup
some stuff (see bug 1473637 for example), so it should probably be correct all
the time, regardless of whether something is unlinked or not.

Also this makes GetComposedDoc() much faster, which is nice too, since we call
it somewhat often.

I removed NodeHasRelevantHoverRules, since it's unused (was used by the old
style system).

I moved the SetIsConnected(false) call for the shadow root to before unbinding
the kids for consistency with what Element does with the uncomposed doc flag,
now that the children's connectedness doesn't depend on the shadow root's.

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

--HG--
extra : moz-landing-system : lando
2018-08-20 11:56:27 +00:00
shindli b158b60c25 Backed out changeset 39f61de4e7bb (bug 1484478) for bustages in /builds/worker/workspace/build/src/dom/base/ShadowRoot.cpp:526:20 2018-08-20 14:21:08 +03:00