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

433 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione a1fde10261 Bug 1729005: Recursively block parsing for parser blocking scripts. r=hsivonen
Bug 1333990 added the ability to have multiple parser blockers at the same
time, so we no longer need to guard against recursively blocking. What's more,
if we do, and skip calling `BlockParser` while it's blocked for another reason,
we still call `UnblockParser` when we receive script data, at which point we
crash.

This patch moves the XHTML parser's behavior closer in line with the HTML
parser's.

The only way I've seen this manifest as a bug is when we have an XHTML
document with a top-level <script> element, and an extension with content
scripts that cause us to block parsing when we see that top-level element and
need to wait for them to compile.

Differential Revision: https://phabricator.services.mozilla.com/D145513
2022-05-11 22:15:14 +00:00
Marian-Vasile Laza 765a83f3f8 Backed out changeset ae4f4209538e (bug 1729005) for causing xpcshell failures on test_blockParsing.js. CLOSED TREE 2022-05-10 01:00:43 +03:00
Kagami Sascha Rosylight f08333eddf Bug 1768189 - Part 45: Apply modernize-concat-nested-namespaces to dom/xhr/XMLHttpRequest.cpp ... r=andi
Depends on D145780

Differential Revision: https://phabricator.services.mozilla.com/D145781
2022-05-09 20:41:21 +00:00
Kris Maglione 2506454b92 Bug 1729005: Recursively block parsing for parser blocking scripts. r=hsivonen
Bug 1333990 added the ability to have multiple parser blockers at the same
time, so we no longer need to guard against recursively blocking. What's more,
if we do, and skip calling `BlockParser` while it's blocked for another reason,
we still call `UnblockParser` when we receive script data, at which point we
crash.

This patch moves the XHTML parser's behavior closer in line with the HTML
parser's.

The only way I've seen this manifest as a bug is when we have an XHTML
document with a top-level <script> element, and an extension with content
scripts that cause us to block parsing when we see that top-level element and
need to wait for them to compile.

Differential Revision: https://phabricator.services.mozilla.com/D145513
2022-05-09 20:08:08 +00:00
Tom Ritter a2b46c99ea Bug 1758709: Add Telemetry for XSLT use r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D141240
2022-04-05 14:29:50 +00:00
Peter Van der Beken 15b814ccd7 Bug 1749935 - Create nsParser directly instead of with a CID. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135896
2022-02-14 13:03:51 +00:00
Peter Van der Beken c68cf34189 Bug 1749935 - Remove unused support for nested CParserContext. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135879
2022-02-14 13:03:47 +00:00
Peter Van der Beken 8573e064a2 Bug 1749935 - Mark nsIParser::WillResume(Impl) as infallible. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135836
2022-02-14 13:03:43 +00:00
Shane Hughes b2246aab47 Bug 1586529 - Make viewsource and XMLPrettyPrint adapt to preferred color scheme. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D136082
2022-01-23 00:02:22 +00:00
Henri Sivonen 93300ee850 Bug 1748608 - Remove unused aSink argument from Document::StartDocumentLoad. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D135111
2022-01-05 13:38:56 +00:00
Kagami Sascha Rosylight 593535bad1 Bug 1539884 - Part 19: Mark XMLDocument::EndLoad as CAN_RUN_SCRIPT_BOUNDARY r=masayuki
Depends on D134109

Differential Revision: https://phabricator.services.mozilla.com/D134110
2021-12-17 13:27:52 +00:00
Masayuki Nakano fb2940808f Bug 1741148 - part 2: Re-implement `nsINode::ComputeIndexOf` as returning `Maybe<uint32_t>` rather than `int32_t` r=smaug
Offset in a node is declared as "unsigned long" by the standards and we don't
limit node can have less than `INT32_MAX`.  So it should return `uint32_t`, but
it also needs to represent the case of "not found".  For consistency with some
other APIs like `nsContentUtils::ComparePoints`, using `Maybe` must be a good
style rather than `Result<uint32_t, bool>`.

This patch fixes the callers in assertions for example.

Differential Revision: https://phabricator.services.mozilla.com/D131335
2021-12-09 09:21:52 +00:00
Masayuki Nakano f2baf0d9ab Bug 1741148 - part 1: Rename `nsINode::ComputeIndexOf` to `ComputeIndexOf_Deprecated` r=smaug
It's hard to fix some callers.  Therefore, in this bug, we should fix only
simple cases.  Therefore, we should rename existing API first.

Differential Revision: https://phabricator.services.mozilla.com/D131334
2021-12-09 08:32:30 +00:00
Andrew McCreight 8c5d7e5ee8 Bug 1736707, part 1 - Get rid of nsContentUtils::NameSpaceManager(). r=peterv
Call nsNameSpaceManager::GetInstance() instead.

Differential Revision: https://phabricator.services.mozilla.com/D129033
2021-10-22 16:15:57 +00:00
Peter Van der Beken 37ab0970ed Bug 1721153 - Remove unused aListener and aMode arguments of nsIParser::Parse. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D120217
2021-08-12 14:11:38 +00:00
Kagami Sascha Rosylight 4356aa3361 Bug 1723050 - Part 35: Replace typedef by using in dom/xml/ r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D121333
2021-08-09 13:37:31 +00:00
Edgar Chen 1ebbd60592 Bug 1685421 - Part 2: Stop using NS_ERROR_DOM_HIERARCHY_REQUEST_ERR in nsINode; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113344
2021-06-02 13:43:39 +00:00
Sean Feng debfd025a0 Bug 1690905 - Report the DOM portion of memory usage for data documents in about:memory r=smaug
Depends on D111317

Differential Revision: https://phabricator.services.mozilla.com/D111318
2021-05-27 17:55:45 +00:00
Valentin Gosu 5b981d7705 Bug 1694662 - Remove appcache logic from content sink r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106440
2021-04-30 07:20:18 +00:00
Emilio Cobos Álvarez 2a1828662f Bug 1696507 - Remove support for NO_UNLINK version of cycle collector macros. r=smaug
And fix existing users of course.

The frame loader one is the only one slightly scary (but if it causes
trouble we could make nsObjectLoadingContent::Unlink a no-op).

Differential Revision: https://phabricator.services.mozilla.com/D107269
2021-03-10 19:50:40 +00:00
Emilio Cobos Álvarez 58408030f6 Bug 1639376 - Implement unlink for nsXMLContentSink. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D107234
2021-03-04 16:17:03 +00:00
Emilio Cobos Álvarez 078044d327 Bug 1639376 - nsXMLContentSink doesn't traverse mLastTextNode. r=smaug
No idea why we don't have an unlink implementation though.

Differential Revision: https://phabricator.services.mozilla.com/D107233
2021-03-04 16:16:10 +00:00
Emilio Cobos Álvarez e2592a6219 Bug 1651038 - nsXMLContentSink::DidBuildModel should flush pending tags. r=hsivonen
As it won't after that if something flushes (because
FlushPendingNotifications will just ignore the flush if the sink is no
longer a document observer).

Otherwise we might not notify of some document insertions, and that
might reasonably confuse layout if it has started before.

The reason we don't have more similar crashes seems to be two different
things:

 * That in the crashtest, the custom element triggers a partial parser
   flush via the innerHTML setter while the parser is creating the
   element. That causes the parser to flush the previous text node
   (which tells layout to go look under the <body> for children) but
   unless we FlushTags() once we're done we won't know about the
   custom-element child.

 * That there's no end tag for the <body> or <html> nodes, so we don't
 reach this code when we end them:

   https://searchfox.org/mozilla-central/rev/df23c6e58c6be1eb8399e475878f73d4867bef87/dom/xml/nsXMLContentSink.cpp#1041-1047

Differential Revision: https://phabricator.services.mozilla.com/D106421
2021-03-03 09:50:14 +00:00
Emilio Cobos Álvarez e2c6f319f3 Bug 1694393 - Make it easy to enable nsIContent::List() in opt builds. r=smaug
By using a separate define than DEBUG.

Differential Revision: https://phabricator.services.mozilla.com/D106137
2021-02-23 20:08:13 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Andi-Bogdan Postelnicu ce6a5ee2f7 Bug 1626555 - Add `dom/xml` to the list of non-unified-build-compatible directories. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D97191
2020-11-16 19:57:45 +00:00
Emilio Cobos Álvarez 38919a1a21 Bug 1673885 - Don't expose incomplete sheets in LinkStyle.sheet / Document.styleSheets. r=nordzilla
This matches other browsers, and common sense to some extent.

The code is a bit awkward because I want this behind a pref for now, as
it's not precisely a zero-risk change.

Differential Revision: https://phabricator.services.mozilla.com/D95065
2020-11-01 15:45:40 +00:00
Narcis Beleuzu 9e31b464f7 Backed out changeset 1ee5fddc1caf (bug 1673885) for wpt failures on ttwf-cssom-doc-ext-load-tree-order.html CLOSED TREE 2020-10-31 02:43:31 +02:00
Emilio Cobos Álvarez 2c6198ff82 Bug 1673885 - Don't expose incomplete sheets in LinkStyle.sheet / Document.styleSheets. r=nordzilla
This matches other browsers, and common sense to some extent.

The code is a bit awkward because I want this behind a pref for now, as
it's not precisely a zero-risk change.

Differential Revision: https://phabricator.services.mozilla.com/D95065
2020-10-30 23:30:14 +00:00
Narcis Beleuzu dc2519c7ca Backed out changeset 702857fa260e (bug 1673885) for wpt failures on ttwf-cssom-doc-ext-load-count.html CLOSED TREE 2020-10-30 23:08:37 +02:00
Emilio Cobos Álvarez f8d2ad7b26 Bug 1673885 - Don't expose incomplete sheets in LinkStyle.sheet / Document.styleSheets. r=nordzilla
This matches other browsers, and common sense to some extent.

The code is a bit awkward because I want this behind a pref for now, as
it's not precisely a zero-risk change.

Differential Revision: https://phabricator.services.mozilla.com/D95065
2020-10-30 19:24:22 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Cameron McCormack 623306a175 Bug 1656114 - Part 5: Report use counters in documents that come out of the bfcache. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93046
2020-10-11 22:15:06 +00:00
Cameron McCormack 18ffe7c642 Bug 1656114 - Part 4: Accumulate page use counters in the parent process. r=emilio,nika
This changes the way we deal with page use counters so that we can
handle out of process iframes.

Currently, when a parent document is being destroyed, we poke into all
of the sub-documents to merge their use counters into the parent's page
use counters, which we then report via Telemetry.  With Fission enabled,
the sub-documents may be out of process.  We can't simply turn these
into async IPC calls, since the parent document will be destroyed
shortly, as might the content processes holding the sub-documents.

So instead, each document during its initialization identifies which
ancestor document it will contribute its page use counters to, and
stores its WindowContext id to identify that ancestor.  A message is
sent to the parent process to notify it that page use counter data will
be sent at some later point.  That later point is when the document
loses its window.  It doesn't matter if the ancestor document has
already been destroyed at this point, since all we need is its
WindowContext id to uniquely identify it.  Once the parent process has
received all of the use counters it expects to accumulate to a given
WindowContext Id, it reports them via Telemetry.

Reporting of document use counters remains unchanged and is done by each
document in their content process.

While we're here, we also:

* Limit use counters to be reported for a pre-defined set of document
  URL schemes, rather than be based on the document principal.

* Add proper MOZ_LOG logging for use counters instead of printfs.

Differential Revision: https://phabricator.services.mozilla.com/D87188
2020-10-11 22:03:43 +00:00
Emilio Cobos Álvarez 0f14258fc2 Bug 1667510 - Make UA widgets in print documents more static. r=smaug
This ensures that styles from UA widgets apply. Turns out they look
pretty much right without them, but there's a bug in nsDateTimeBoxFrame
where we rely on the styles in order for the baseline to be sensible.

Differential Revision: https://phabricator.services.mozilla.com/D91616
2020-09-29 10:31:48 +00:00
Bogdan Tara ee2b75d56b Backed out changeset 482bd861c745 (bug 1667510) for causing mochitest leaks CLOSED TREE 2020-09-29 01:35:24 +03:00
Emilio Cobos Álvarez d2429334ba Bug 1667510 - Make UA widgets in print documents more static. r=smaug
This ensures that styles from UA widgets apply. Turns out they look
pretty much right without them, but there's a bug in nsDateTimeBoxFrame
where we rely on the styles in order for the baseline to be sensible.

Differential Revision: https://phabricator.services.mozilla.com/D91616
2020-09-28 18:29:28 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Emilio Cobos Álvarez 54b5a9f5f5 Bug 1659457 - Do clone xml-pretty-printer's UA widget. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D87714
2020-08-20 11:29:45 +00:00
Sean Feng 75047f597c Bug 1653474 - Process META elements when it's inserted r=smaug
Unlike other engine vendors, we process meta elements
at parser, instead of when they are inserted. This
leads some web compact issues.

This patch aligns us with other vendors.

Differential Revision: https://phabricator.services.mozilla.com/D84545
2020-08-05 16:32:57 +00:00
Emilio Cobos Álvarez 05bbb6ac23 Bug 1652618 - Ensure UA widgets are attached and detached synchronously. r=smaug
This changes the UA widget setup (again). What is going on in this
test-case is that we have a marquee inside a video, two things that have
their own UA widget. Given how the code is currently written, the
runnable to attach and set up the marquee's widget is posted before than
the video one (which is potentially reasonable).

However that means that the marquee one runs before and flushes layout,
and catches the video in an inconsistent state (in the composed doc, but
without a shadow root). That in turn messes up reflow because
nsVideoFrame assumes stuff.

Rather than putting the attach / detach logic in script runners, just
run that bit synchronously, and post only the event async. I audited the
consumers of those events and it seems fine to me, they either already
deal with the possibility of the shadow root being already detached or
they don't care.

For teardown, none of the destructors of the UA widgets rely on the
shadow root being still attached to the element.

Differential Revision: https://phabricator.services.mozilla.com/D84487
2020-07-24 15:43:20 +00:00
Narcis Beleuzu ce05a24710 Backed out changeset 8323b7bb5e1a (bug 1652618) for mochitest failures on test_audiocontrols_dimensions.html . CLOSED TREE 2020-07-23 00:49:31 +03:00
Emilio Cobos Álvarez 312039fb70 Bug 1652618 - Ensure UA widgets are attached and detached synchronously. r=smaug
This changes the UA widget setup (again). What is going on in this
test-case is that we have a marquee inside a video, two things that have
their own UA widget. Given how the code is currently written, the
runnable to attach and set up the marquee's widget is posted before than
the video one (which is potentially reasonable).

However that means that the marquee one runs before and flushes layout,
and catches the video in an inconsistent state (in the composed doc, but
without a shadow root). That in turn messes up reflow because
nsVideoFrame assumes stuff.

Rather than putting the attach / detach logic in script runners, just
run that bit synchronously, and post only the event async. I audited the
consumers of those events and it seems fine to me, they either already
deal with the possibility of the shadow root being already detached or
they don't care.

For teardown, none of the destructors of the UA widgets rely on the
shadow root being still attached to the element.

Differential Revision: https://phabricator.services.mozilla.com/D84487
2020-07-22 19:42:37 +00:00
Frederik Braun a7153982e8 Bug 1366973: Rename security flags to not contain DATA anymore r=geckoview-reviewers,ckerschb,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83490
2020-07-15 11:20:45 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00