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

4424 Коммитов

Автор SHA1 Сообщение Дата
Daniel Varga 599bfc410a Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE
--HG--
rename : browser/components/pocket/locale/en-US/pocket.properties => browser/locales/en-US/chrome/browser/pocket.properties
rename : devtools/client/aboutdebugging-new/test/browser/head-addons-script.js => devtools/client/aboutdebugging-new/test/browser/helper-addons.js
rename : devtools/client/aboutdebugging-new/test/browser/debug-target-pane_collapsibilities_head.js => devtools/client/aboutdebugging-new/test/browser/helper-collapsibilities.js
rename : devtools/client/aboutdebugging-new/test/browser/head-mocks.js => devtools/client/aboutdebugging-new/test/browser/helper-mocks.js
rename : devtools/client/aboutdebugging-new/test/browser/head-serviceworker.js => devtools/client/aboutdebugging-new/test/browser/helper-serviceworker.js
rename : devtools/client/aboutdebugging-new/test/browser/mocks/head-client-wrapper-mock.js => devtools/client/aboutdebugging-new/test/browser/mocks/helper-client-wrapper-mock.js
rename : devtools/client/aboutdebugging-new/test/browser/mocks/head-runtime-client-factory-mock.js => devtools/client/aboutdebugging-new/test/browser/mocks/helper-runtime-client-factory-mock.js
rename : devtools/client/aboutdebugging-new/test/browser/mocks/head-usb-runtimes-mock.js => devtools/client/aboutdebugging-new/test/browser/mocks/helper-usb-runtimes-mock.js
rename : dom/base/nsIdentifierMapEntry.h => dom/base/IdentifierMapEntry.h
extra : rebase_source : 0d517ceff0f11aadfa88634e773b3436ad48a8e6
2019-01-08 18:35:10 +02:00
Henri Sivonen 7fdbc91b91 Bug 256180 parser part - Insert elements as siblings instead of children at the Blink-defined magic depth for compatibility. r=smaug.
MozReview-Commit-ID: K8fgv3rgklt
2019-01-08 18:08:37 +02:00
Henri Sivonen 063ff34a92 Bug 1447707 - Remove the XPIDL SAX interface to the XML parser. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D14724

--HG--
extra : moz-landing-system : lando
2018-12-19 16:49:31 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Emilio Cobos Álvarez f131713362 Bug 1516366 - Move base classes from nsDocument to nsIDocument. r=smaug
This is a big step in order to merge both.

Also allows to remove some very silly casts, though it causes us to add some
ToSupports around to deal with ambiguity of casts from nsIDocument to
nsISupports, and add a dummy nsISupports implementation that will go away later
in the series.

Differential Revision: https://phabricator.services.mozilla.com/D15352
2018-12-29 20:41:28 +01:00
Sylvestre Ledru cccdda3c2a Bug 1516555 - Reformat everything to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2018-12-28 15:48:06 +00:00
Peter Van der Beken eb86fefb02 Bug 1374012 - Update to Expat 2.2.1. Part 18: various miscellaneous changes. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14457

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:26 +00:00
Peter Van der Beken 7a603b28e7 Bug 1374012 - Update to Expat 2.2.1. Part 17: add/change APIs that are not used in Gecko. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14456

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:25 +00:00
Peter Van der Beken 0e027c70be Bug 1374012 - Update to Expat 2.2.1. Part 16: fix some issues with various compilers. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14455

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:24 +00:00
Peter Van der Beken cf5d21461b Bug 1374012 - Update to Expat 2.2.1. Part 15: ifdef some constants so they are only defined when used. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14454

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:23 +00:00
Peter Van der Beken e88d24ea11 Bug 1374012 - Update to Expat 2.2.1. Part 14: Annotate memory allocators for GCC. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14453

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:22 +00:00
Peter Van der Beken 18fcb94d9e Bug 1374012 - Update to Expat 2.2.1. Part 13: Tidy up attribute prefix bindings on error. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14452

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:21 +00:00
Peter Van der Beken 5793b635bc Bug 1374012 - Update to Expat 2.2.1. Part 12: Address warning "missing initializer for field". r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14451

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:20 +00:00
Peter Van der Beken a3204ff408 Bug 1374012 - Update to Expat 2.2.1. Part 11: Changes to defines for various compilers. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14450

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:19 +00:00
Peter Van der Beken f652ec9604 Bug 1374012 - Update to Expat 2.2.1. Part 10: Take into account that CHAR_MATCHES may read >1 bytes. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14449

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:18 +00:00
Peter Van der Beken e0c4b31e3c Bug 1374012 - Update to Expat 2.2.1. Part 9: Make XmlConvert return errors. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14448

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:17 +00:00
Peter Van der Beken 7afc61faae Bug 1374012 - Update to Expat 2.2.1. Part 8: Validate parser argument in various APIs. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14447

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:16 +00:00
Peter Van der Beken 90a42151df Bug 1374012 - Update to Expat 2.2.1. Part 7: Add __unused__ anotations. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14446

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:16 +00:00
Peter Van der Beken bebd150ad3 Bug 1374012 - Update to Expat 2.2.1. Part 6: Add XML_ATTR_INFO code which we don't enable. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14445

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:15 +00:00
Peter Van der Beken 6a0c98bfbf Bug 1374012 - Update to Expat 2.2.1. Part 5: Use ASCII_* instead of literal characters. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14444

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:14 +00:00
Peter Van der Beken cc52d0e9e6 Bug 1374012 - Update to Expat 2.2.1. Part 4: removing mainlined customisations and merge whitespace changes. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14443

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:13 +00:00
Peter Van der Beken 650f9e44c2 Bug 1374012 - Update to Expat 2.2.1. Part 3: Reject invalid DTD. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14442

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:12 +00:00
Peter Van der Beken 177f23f661 Bug 1374012 - Update to Expat 2.2.1. Part 2b: cherry-pick compilation fix from 2.2.2. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14441

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:11 +00:00
Peter Van der Beken 05221a9c4c Bug 1374012 - Update to Expat 2.2.1. Part 2a: Better hashing. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14440

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:11 +00:00
Peter Van der Beken f9a10464ec Bug 1374012 - Update to Expat 2.2.1. Part 1: More correct calculations. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14439

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:10 +00:00
Margareta Eliza Balazs 7ef930fffa Backed out changeset 2eab9d9bd89e (bug 1514655) for geckoview-junit perma failures NavigationDelegateTest.loadData_noMimeType CLOSED TREE 2018-12-21 15:34:27 +02:00
Emilio Cobos Álvarez 5a57093928 Bug 1514655 - Always wrap plain text documents. r=bzbarsky
This matches other UAs.

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

--HG--
extra : moz-landing-system : lando
2018-12-18 14:48:31 +00:00
Henri Sivonen feff447597 Bug 1515066 - Mark SVG script without an end tag malformed. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D15090

--HG--
extra : moz-landing-system : lando
2018-12-20 18:20:04 +00:00
Brindusan Cristian df66fd18a1 Merge inbound to mozilla-central. a=merge 2018-12-18 19:34:11 +02:00
Henri Sivonen 9405805403 Bug 1514728 - Fix bogus subspanning when sniffing a local file with more than 4 MB of ASCII. r=emk. 2018-12-18 08:45:29 +02:00
Henri Sivonen 64e1d8a0f5 Bug 1510114. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D13679

--HG--
extra : moz-landing-system : lando
2018-12-12 14:24:31 +00:00
Jonathan Kingston c5d29c382e Bug 903372 - Remove xml:base from parser. r=hsivonen 2018-12-13 15:47:01 +00:00
Mark Banner 8fc9eab7b3 Bug 1503674 - Remove now unused nsIScriptableUnescapeHTML.idl. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D14680

--HG--
extra : moz-landing-system : lando
2018-12-17 09:33:28 +00:00
Henri Sivonen acfba8e927 Bug 1469580 - Ignore charset= in <meta content> if followed by unmatched quote. r=mrbkap
Differential Revision: https://phabricator.services.mozilla.com/D14410

--HG--
extra : moz-landing-system : lando
2018-12-14 17:53:59 +00:00
Coroiu Cristina 3e33183ebf Backed out changeset a145a897c94c (bug 1469580) for lin failure at /builds/worker/checkouts/gecko/tools/lint/wpt.yml 2018-12-14 12:33:15 +02:00
Henri Sivonen 20f693b781 Bug 1469580 - Ignore charset= in <meta content> if followed by unmatched quote. r=mrbkap
Differential Revision: https://phabricator.services.mozilla.com/D14410

--HG--
extra : moz-landing-system : lando
2018-12-13 18:48:09 +00:00
Henri Sivonen f4bcccb098 Bug 1513513 - Drop the file: URL UTF-8 sniffing limit from 50 MB to 4 MB. r=emk. 2018-12-12 16:10:28 +02:00
Henri Sivonen 61285e86b3 Bug 977540 - Avoid running Japanese, Russian and Ukrainian detectors on domains associated with different encoding legacies. r=emk. 2018-12-12 09:51:52 +02:00
Henri Sivonen 69ad08c987 Bug 1071816 - Support loading unlabeled/BOMless UTF-8 text/html and text/plain files from file: URLs. r=emk. 2018-12-11 10:36:46 +02:00
Henri Sivonen c58ccc7e2b Bug 1512155 - Introduce a movable type that combines mozilla::UniquePtr<T[]> and its length. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D13795

--HG--
extra : moz-landing-system : lando
2018-12-07 08:28:08 +00:00
Henri Sivonen 236e52e49e Bug 1511972 - Clean up byte buffer representation in method signatures in nsHtml5StreamParser. r=mrbkap
Differential Revision: https://phabricator.services.mozilla.com/D13732

--HG--
extra : moz-landing-system : lando
2018-12-06 18:59:56 +00:00
reimu f4794a2bfb Bug 1501931 - Enable ESLint for parser/ (manual fixes) r=Standard8,mrbkap
Depends on D11920

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

--HG--
extra : moz-landing-system : lando
2018-12-06 20:30:32 +00:00
reimu 4819e4a0ee Bug 1501931 - Enable ESLint for parser/ (automatic fixes) r=Standard8,mrbkap
Differential Revision: https://phabricator.services.mozilla.com/D11920

--HG--
extra : moz-landing-system : lando
2018-12-06 20:34:29 +00: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
Andreea Pavel 0c29092e41 Backed out 2 changesets (bug 903372) for multiple failures on a CLOSED TREE
Backed out changeset bf919773f9d1 (bug 903372)
Backed out changeset 6562c2392ac9 (bug 903372)
2018-11-30 04:16:21 +02:00
Jonathan Kingston 7c7d460eaa Bug 903372 - Remove xml:base from parser. r=hsivonen 2018-10-21 12:55:44 +01:00
Ehsan Akhgari 490e611801 Bug 1508472 - Part 5: Fifth 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/D13371

--HG--
extra : moz-landing-system : lando
2018-11-29 10:30:46 +00:00
Gabriele Svelto 19e52bebd4 Bug 1510582 - Remove useless inclusions of Services.h r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D13240

--HG--
extra : moz-landing-system : lando
2018-11-28 17:25:23 +00:00
Thomas Nguyen 6d1ae50d62 Bug 1460920 - Part 1 - Speculative loading script should take referrerpolicy attribute in script element into account r=hsivonen
Referrerpolicy attribute should be taken with high priority order than
mSpeculationReferrerPolicy

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

--HG--
extra : moz-landing-system : lando
2018-11-19 09:39:16 +00: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
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
Brian Grinstead 35b0511c9a Bug 1425874 - Implement HTMLMarqueeElement r=bzbarsky
This adds a new class for the marquee tag, instead of overloading HTMLDivElement.
It removes some of the XBL that was used to expose properties to web content.

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

--HG--
extra : moz-landing-system : lando
2018-11-14 05:29:11 +00:00
Emilio Cobos Álvarez fe445c3367 Bug 1506133 - More HTML parser cleanup post bug 1392185. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D11480

--HG--
extra : moz-landing-system : lando
2018-11-12 14:37:09 +00:00
Emilio Cobos Álvarez 03ce7b0699 Bug 1392185 - Remove dynamic HTML5 atoms. r=njn,hsivonen
This is a rebase + manual refcounting on some places, + cleanup of the original
patch in the bug.

Co-authored-by: Nicholas Nethercote <nnethercote@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D11035
2018-11-09 14:45:30 +01:00
Emilio Cobos Álvarez ed9deed211 Bug 1392185 - Remove dead code from nsHtml5ArrayCopy.h. r=hsivonen
Drive-by cleanup while I audited atom usage from the parser.

Differential Revision: https://phabricator.services.mozilla.com/D11033
2018-11-09 14:45:29 +01:00
Jonathan Kingston 0d35be67e4 Bug 1466449 - Update Tokenizer.java and StackNode.java to initialize properties. r=hsivonen 2018-11-09 14:20:19 +01:00
Henri Sivonen 8c8503b03f Bug 1466449 addendum - Turn jArray from a struct to class and make it have a constructor from nullptr. r=smaug.
Simple adding a constructor from nullptr did not compile without turning
jArray all the way to a class instead of struct.
2018-11-09 14:20:18 +01:00
Henri Sivonen 3a3e5d3765 Bug 1364399 follow-up - Test cases and clarifying comment. r=smaug.
MozReview-Commit-ID: KoHMiyIVb8f
2018-11-07 12:54:42 +02:00
Ehsan Akhgari 6f7b03e600 Bug 1504574 - Remove the XPCOM registration for nsDocumentEncoder; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D10856
2018-11-05 23:16:04 -05:00
Mark Banner a26105ff45 Bug 1501662 - Add more .eslintrc.js files for test directories (dom, modules, netwerk and parser). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D9661

--HG--
extra : moz-landing-system : lando
2018-10-24 19:11:17 +00:00
Jonathan Kingston 580c9a51e4 Bug 1483458 - Change HTML parser to look at .py Atom files. r=hsivonen,heycam
--HG--
extra : amend_source : 9285251fc49d4f56b67557ef77e163d6acbc2b1e
2018-10-17 20:40:37 +01:00
Nathan Froyd 7d5d1b760a Bug 1499727 - make nsHtml5StreamParser timers slightly more efficient; r=hsivonen
Instead of creating a timer and then setting the timer's target, we can
determine the timer's target and pass it in directly when the timer is
created.  This reordering of steps is slightly more efficient, since
SetTarget() is both a virtual call and requires locking, both of which
can be skipped if we know the target at timer creation time.
2018-10-17 19:57:36 -04:00
Jeff Walden 73790f54e4 Bug 1493441 - Allow ScriptSource to store UTF-8 script data in addition to UTF-16 script data (but don't create any UTF-8-backed ScriptSources yet). r=tcampbell 2018-09-29 17:28:31 -04:00
Nathan Froyd e7b3b3140d Bug 1415980 - make hash keys movable and not copyable; r=erahm
Everything that goes in a PLDHashtable (and its derivatives, like
nsTHashtable) needs to inherit from PLDHashEntryHdr. But through a lack
of enforcement, copy constructors for these derived classes didn't
explicitly invoke the copy constructor for PLDHashEntryHdr (and the
compiler didn't invoke the copy constructor for us). Instead,
PLDHashTable explicitly copied around the bits that the copy constructor
would have.

The current setup has two problems:

1) Derived classes should be using move construction, not copy
   construction, since anything that's shuffling hash table keys/entries
   around will be using move construction.

2) Derived classes should take responsibility for transferring bits of
   superclass state around, and not rely on something else to handle that.

The second point is not a huge problem for PLDHashTable (PLDHashTable
only has to copy PLDHashEntryHdr's bits in a single place), but future
hash table implementations that might move entries around more
aggressively would have to insert compensation code all over the
place. Additionally, if moving entries is implemented via memcpy (which
is quite common), PLDHashTable copying around bits *again* is
inefficient.

Let's fix all these problems in one go, by:

1) Explicitly declaring the set of constructors that PLDHashEntryHdr
   implements (and does not implement). In particular, the copy
   constructor is deleted, so any derived classes that attempt to make
   themselves copyable will be detected at compile time: the compiler
   will complain that the superclass type is not copyable.

This change on its own will result in many compiler errors, so...

2) Change any derived classes to implement move constructors instead of
   copy constructors. Note that some of these move constructors are,
   strictly speaking, unnecessary, since the relevant classes are moved
   via memcpy in nsTHashtable and its derivatives.
2018-09-20 11:20:36 -04:00
Eric Rahm 2fb6934934 Bug 1492204 - Part 3: Remove references to char_iterator. r=froydnj
We can just use 'iterator' now that nsWritingIterator is gone.

--HG--
extra : rebase_source : 3f6fbafc9b57ce89afba581b224b3dc2295fa614
2018-09-18 12:05:23 -07:00
Eric Rahm 0c061732bd Bug 1492204 - Part 1: Stop using deprecated string writing iterators. r=froydnj
This switches over the few remaining usages of the deprecated
BeginWriting/EndWriting(iterator&) functions to the more standard
BeginWriting/EndWriting() functions.

--HG--
extra : rebase_source : 3c54621d4921eb45157ec4edce0b693bdd7f02d5
2018-09-18 09:44:57 -07:00
Henri Sivonen 89ca07c012 Bug 1487341 - Make Truncate(), SetLength() and Capacity() more efficient by keeping memcpying to the minimum. r=froydnj
MozReview-Commit-ID: 2LeRrWcN8vF

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

--HG--
extra : moz-landing-system : lando
2018-09-17 09:45:02 +00:00
Ehsan Akhgari 15fb2860c4 Bug 1488659 - Part 1: Remove the XPCOM registrations for character detector classes; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D5392
2018-09-10 07:59:42 -04:00
Mike Hommey 117e48720c Bug 1489363 - Replace some string.Assign* with AssignLiteral. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5224

--HG--
extra : moz-landing-system : lando
2018-09-07 22:12:01 +00:00
Dave Townsend fd8d6b1590 Bug 1480465: Infer the namespace for custom elements at definition time by following the class hierarchy. r=smaug
When a custom element is defined we can check whether its class is an instance
of XULElement or HTMLElement and tag the defintion with a namespace accordingly.
This allows us to know the correct namespace for the custom element when
created.

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

--HG--
extra : moz-landing-system : lando
2018-08-15 10:31:16 +00:00
Henri Sivonen 3edc601325 Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

MozReview-Commit-ID: JaJuExfILM9
2018-08-14 14:43:42 +03:00
Henri Sivonen beda4a1ea9 Bug 634541 - Make the HTML parser remove only one BOM when the input starts with multiple BOMs. r=bzbarsky
MozReview-Commit-ID: 1zoGFxx9MCm

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

--HG--
extra : moz-landing-system : lando
2018-08-13 08:01:56 +00:00
L. David Baron 1e88f0f003 Bug 1369941: Replace single integers N in fuzzy() and fuzzy-if() with 0-N ranges. r=dholbert
This patch was written entirely by the following script:

  #!/bin/bash

  if [ ! -d "./.hg" ]
  then
    echo "Not in a source tree." 1>&2
    exit 1
  fi

  find . -regex '.*\(ref\|crash\)test.*\.list' | while read FILENAME
  do
    echo "Processing ${FILENAME}."
    # The following has four substitutions:
    # * The first one replaces the *first* argument to fuzzy() when it doesn't
    #   have a - in it, by replacing it with an explicit 0-N range.
    # * The second one does the same for the *second* argument to fuzzy().
    # * The third does the same for the *second* argument to fuzzy-if().
    # * The fourth does the same for the *third* argument to fuzzy-if().
    #
    # Note that this is using perl rather than sed because perl doesn't
    # support non-greedy matching, which is needed for the first argument to
    # fuzzy-if.
    perl -pi -e 's/(fuzzy\()([^ ,()-]*)(,[^ ,()]*\))/${1}0-${2}${3}/g;s/(fuzzy\([^ ,()]*,)([^ ,()-]*)(\))/${1}0-${2}${3}/g;s/(fuzzy-if\([^ ]*?,)([^ ,()-]*)(,[^ ,()]*\))/${1}0-${2}${3}/g;s/(fuzzy-if\([^ ]*?,[^ ,()]*,)([^ ,()-]*)(\))/${1}0-${2}${3}/g' "${FILENAME}"
  done

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

--HG--
extra : moz-landing-system : lando
2018-08-09 20:10:21 +00:00
Kyle Machulis d920d54421 Bug 1480628 - Remove nsIWebShellServices; r=nika
Summary:
nsIWebShellServices is only implemented by nsDocShell, and only used
in one place in C++. Move definitions to nsIDocShell, and rename
functions to show they are only used as part of Charset changes.

MozReview-Commit-ID: DOSeE3Doc51

Test Plan: Try run

Reviewers: nika

Tags: #secure-revision

Bug #: 1480628

Differential Revision: https://phabricator.services.mozilla.com/D2692
2018-08-07 15:12:55 -07:00
Dave Townsend 7ea0473c02 Bug 1478823: Add a chrome DOM event signalling that the head element's children have been parsed. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D2612

--HG--
extra : moz-landing-system : lando
2018-08-03 21:16:04 +00:00
Brian Hackett f594284848 Bug 1470795 Part 5 - Update content parse users for API movement, r=froydnj.
--HG--
extra : rebase_source : 856eecd3568adc9873b899a38ad96bbf24ebe955
2018-07-23 21:45:33 +00:00
Brian Hackett e030fb5f6c Bug 1465292 Part 4 - Track parsed content from HTML files, r=hsivonen.
--HG--
extra : rebase_source : cc8c819bc31741e19a29c1d381c783cc6e1ad42e
2018-07-23 21:43:13 +00:00
Nicholas Nethercote fc1f4bb4ae Bug 1476820 - Convert some VarCache prefs in dom/security/ to use StaticPrefs. r=ckerschb
Specifically:
- "security.csp.enable"
- "security.csp.experimentalEnabled"
- "security.csp.enableStrictDynamic"
- "security.csp.reporting.script-sample.max-length"
- "security.csp.enable_violation_events"

MozReview-Commit-ID: G1ie4ut9QaK

--HG--
extra : rebase_source : d6b5a0e79eb7046a13a8b4fe957c82c11831c86c
2018-07-19 10:43:29 +10:00
Andrea Marchesini a053cf1c15 Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 1 - NullPrincipal, r=ckerschb 2018-07-17 21:37:48 +02:00
Andrea Marchesini 14d462eeb3 Bug 1418246 - Return valid columnNumber value in CSP violation events, r=ckerschb 2018-07-05 08:21:04 +02:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Nicholas Nethercote 60b1f563cb Bug 1447951 - Store nsDynamicAtom's chars after the end of the object. r=froydnj
This reduces memory usage because we only need one allocation instead of two
for the dynamic atom and its chars, and because we don't need to store a
refcount and a size. It precludes sharing of chars between dynamic atoms, but
we weren't benefiting much from that anyway.

This reduces per-process memory usage by up to several hundred KiB on my
Linux64 box.

One consequence of this change is that we need to allocate + copy in
DOMString::SetKnownLiveAtom(), which could make some things slower.

--HG--
extra : rebase_source : ba4065ea31e509dd985c003614199f73def0596c
2018-06-22 09:38:42 +10:00
Andi-Bogdan Postelnicu 0d7d76f23b Bug 1453795 - Parser/HTML - Initialize member fields in classes/ structures. r=hsivonen 2018-06-14 11:46:13 +03:00
Andi-Bogdan Postelnicu 1d049872c5 Bug 1453795 - Parser/HTML Parser - Initialize member fields in classes/ structures. r=mrbkap 2018-06-14 00:08:27 +03:00
Joel Maher 50b91c0a14 Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
Joel Maher 5cf551b940 Bug 1392106 - random-if more win7 tests for missing letters. r=RyanVM 2018-06-01 09:29:35 -04:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Boris Zbarsky 8b9400c98b Bug 1455676 part 19. Remove some remaining nsIDOMNode uses. r=qdot 2018-05-29 22:58:50 -04:00
Joel Maher bea2e0899f Bug 1392106 - random-if many more win7 tests. r=RyanVM 2018-05-29 13:50:33 -04:00
Joel Maher 29d83f200e Bug 1392106 - random-if many more tests on win7. r=RyanVM 2018-05-25 13:03:59 -04:00
Emilio Cobos Álvarez 11794a944d Bug 1461701: Remove nsUpdateType and UPDATE_CONTENT_MODEL. r=smaug
MozReview-Commit-ID: 33iBMZqnkAc
2018-05-15 18:47:16 +02:00
Adrian Wielgosik 074d88de5a Bug 1460940 - Convert nsIPrincipal to use nsIDocument. r=bz
MozReview-Commit-ID: z1TGWtS1KG

--HG--
extra : rebase_source : e5291c40eb017c1e3fd69333ac108dda852fb8cd
2018-05-11 19:46:15 +02:00
Adrian Wielgosik 4fca802957 Bug 1460940 - Convert NS_NewDOMDocument to use nsIDocument. r=bz
MozReview-Commit-ID: GoJ30YZGRhq

--HG--
extra : rebase_source : 0995705c2c31c1a779c22c8336482d4c7e89e319
2018-05-11 19:46:15 +02:00
Andrea Marchesini b5118e1ddf Bug 1302449 - Remove the "referrer" directive in CSP, r=ckerschb 2018-05-09 13:15:08 +02:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Boris Zbarsky 6bf97b61c0 Bug 1455674 part 13. Remove remaining xpidl uses of nsIDOMElement. r=qdot 2018-04-26 23:37:29 -04:00
Emilio Cobos Álvarez a00f507b72 Bug 1456435: Make UpdateStyleSheet less bool-happy. r=heycam
MozReview-Commit-ID: FlTD390lMhg
2018-04-26 16:43:52 +02:00
Adrian Wielgosik b3c501adc4 Bug 1447389 - Remove nsIDOMNodeList. r=bz
MozReview-Commit-ID: 11szZP6dS6V

--HG--
extra : rebase_source : 9acfb352750e53d3b36684fa945a18e817c9b82e
2018-04-25 23:01:30 +02:00
Emilio Cobos Álvarez d8e55e4596 Bug 1454236: Remove nsINode::eDOCUMENT_FRAGMENT. r=bz
MozReview-Commit-ID: D2F3LbQ1pvw
2018-04-20 01:30:12 +02:00
Boris Zbarsky a517e45add Bug 1452183 part 4. Remove nsIDOMDocumentFragment. r=mccr8 2018-04-17 21:13:03 -04:00
Boris Zbarsky 38ecaf4bb7 Bug 1452183 part 3. Stop using nsIDOMDocumentFragment in C++. r=mccr8 2018-04-17 21:13:03 -04:00
Boris Zbarsky d49151ed50 Bug 1452183 part 1. Stop using nsIDOMDocumentFragment in IDL files. r=mccr8 2018-04-17 21:13:03 -04:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Sylvestre Ledru 01abd7ce40 Bug 1447480 - Add a MOZ_ASSERT to make it clear that it can never fall through r=hsivonen
MozReview-Commit-ID: Hq9jG1CVwRK

--HG--
extra : rebase_source : 4c548c1ad0c74b2c810b435701b91bd4f7893cb1
2018-04-03 13:40:59 +02:00
Masatoshi Kimura c1aa340b7e Bug 1445541 - Enable the character encoding menu when the document is decoded as UTF-8 and an error is found, instead of disabling it when no errors are found. r=hsivonen
MozReview-Commit-ID: 1e6kQbAxcqm

--HG--
extra : rebase_source : 4c26e97255b4213b2f60855d8c9abc26fe812fa9
2018-04-06 06:20:28 +09:00
Tiberius Oros 1d7575065c Backed out 2 changesets (bug 1447480) for build bustages at dist/include/mozilla/Assertions.h:60 a=backout on a CLOSED TREE
Backed out changeset 5dfbd42ce515 (bug 1447480)
Backed out changeset a454ed4489f2 (bug 1447480)
2018-04-05 13:36:46 +03:00
Sylvestre Ledru 599ea080ac Bug 1447480 - Add a MOZ_ASSERT to make it clear that it can never fall through r=hsivonen
MozReview-Commit-ID: Hq9jG1CVwRK

--HG--
extra : rebase_source : 4c548c1ad0c74b2c810b435701b91bd4f7893cb1
2018-04-03 13:40:59 +02:00
Margareta Eliza Balazs a06f511cc5 Backed out changeset fa109105e4ea (bug 1447480) for B failures in /build/build/src/parser/html/nsHtml5TreeBuilder.cpp(402) on a CLOSED TREE 2018-04-04 16:05:06 +03:00
Sylvestre Ledru 40fe59d2a8 Bug 1447480 - Add a MOZ_ASSERT to make it clear that it can never fall through r=hsivonen
MozReview-Commit-ID: Hq9jG1CVwRK

--HG--
extra : rebase_source : 4c548c1ad0c74b2c810b435701b91bd4f7893cb1
2018-04-03 13:40:59 +02:00
Nicholas Nethercote 4b941e22d0 Bug 1449395 - Remove unnecessary nsStaticAtom.h includes. r=froydnj
For nsCSSAnonBoxes.cpp, nsCSSPseudoElements.cpp, nsDirectoryService.cpp, the
corresponding .h file includes nsStaticAtom.h. For the other files in this
patch, nsStaticAtom.h is not needed at all.

MozReview-Commit-ID: IpMmbXwZHhu

--HG--
extra : rebase_source : 46d0a6b40a41ee233adad7c205cf907fa27de34a
2018-03-29 09:08:54 +11:00
Nicholas Nethercote 1ab829482c Bug 1449064 (attempt 2) - Convert view_source.editor.external to a StaticPref. r=hsivonen
MozReview-Commit-ID: AxssCop2WH
2018-03-29 15:29:00 +11:00
Gurzau Raul 1eff9c341d Backed out changeset 614181fad27a (bug 1449064) for assertion failures on workspace/build/src/modules/libpref/Preferences.cpp 2018-03-29 05:59:44 +03:00
Nicholas Nethercote 941243b466 Bug 1449064 - Convert view_source.editor.external to a StaticPref. r=hsivonen
MozReview-Commit-ID: EKVI5KAtXdJ

--HG--
extra : rebase_source : 070d5651758c9173e3d9c3c4bfbbc3d797d16c3c
2018-03-27 12:04:02 +11:00
Nicholas Nethercote 085f110fa2 Bug 1449064 - Convert html.* prefs to StaticPrefs. r=hsivonen
MozReview-Commit-ID: 7sBOuzBJ1Pa

--HG--
extra : rebase_source : 5f2f64e889cae4be66e9c408b07385f68c972e9c
2018-03-27 11:59:48 +11:00
Boris Zbarsky cd4761ffdb Bug 1449404 part 2. Get rid of nsIContent::AppendText. r=mccr8 2018-03-28 18:01:46 -04:00
Boris Zbarsky 9bdcd1eca8 Bug 1444872. Remove support for the 'type' parameter to document.open. r=qdot 2018-03-28 18:01:46 -04:00
Tom Ritter 449237fc51 Bug 1378552 - Reduce the liklihood of inadvertently misusing NullPrincipal::Create(). r=ckerschb
NullPrincipal::Create() (will null OA) may cause an OriginAttributes bypass.
We change Create() so OriginAttributes is no longer optional, and rename
Create() with no arguments to make it more explicit about what the caller is doing.

MozReview-Commit-ID: 7DQGlgh1tgJ
2018-03-22 13:36:20 -05:00
Tom Ritter e5134dc41c Bug 1448010 Remove unused nsSAXXML IDL methods r=Gijs
MozReview-Commit-ID: GFdx6Sjuq36

--HG--
extra : rebase_source : fa1061c2df67e4eaa8e01bf18ac87fe38ef79dd3
2018-03-21 11:52:57 -05:00
Nicholas Nethercote bac452f9ad Bug 1411469 - Statically allocate static atoms. r=froydnj
Currently static atoms are stored on the heap, but their char buffers are
stored in read-only static memory.

This patch changes the representation of nsStaticAtom (thus making it a
non-trivial subclass of nsAtom). Instead of a pointer to the string, it now has
an mStringOffset field which is a 32-bit offset to the string. (This requires
placement of the string and the atom within the same object so that the offset
is known to be small. The docs and macros in nsStaticAtom.h handle that.)

Static and dynamic atoms now store their chars in different ways: nsStaticAtom
stores them inline, nsDynamicAtom has a pointer to separate storage. So
`mString` and GetStringBuffer() move from nsAtom to nsDynamicAtom.

The change to static atoms means they can be made constexpr and stored in
read-only memory instead of on the heap. On 64-bit this reduces the per-process
overhead by 16 bytes; on 32-bit the saving is 12 bytes. (Further reductions
will be possible in follow-up patches.)

The increased use of constexpr required multiple workarounds for MSVC.
- Multiple uses of MOZ_{PUSH,POP}_DISABLE_INTEGRAL_CONSTANT_OVERFLOW_WARNING to
  disable warnings about (well-defined!) overflow of unsigned integer
  arithmetic.
- The use of -Zc:externConstexpr on all files defining static atoms, to make
  MSVC follow the C++ standard(!) and let constexpr variables have external
  linkage.
- The use of -constexpr:steps300000 to increase the number of operations
  allowed in a constexpr value, in order to handle gGkAtoms, which requires
  hashing ~2,500 atom strings.

The patch also changes how HTML5 atoms are handled. They are now treated as
dynamic atoms, i.e. we have "dynamic normal" atoms and "dynamic HTML5 atoms",
and "dynamic atoms" covers both cases, and both are represented via
nsDynamicAtom. The main difference between the two kinds is that dynamic HTML5
atoms still aren't allowed to be used in various operations, most notably
AddRef()/Release(). All this also required moving nsDynamicAtom into the header
file.

There is a slight performance cost to all these changes: now that nsStaticAtom
and nsDynamicAtom store their chars in different ways, a conditional branch is
required in the following functions: Equals(), GetUTF16String(),
WeakAtom::as_slice().

Finally, in about:memory the "explicit/atoms/static/atom-objects" value is no
longer needed, because that memory is static instead of heap-allocated.

MozReview-Commit-ID: 4AxPv05ngZy
2018-03-26 11:18:31 +02:00
Boris Zbarsky 29d232e53f Bug 1447098 part 1. Rename FromContent on various DOM classes to FromNode. r=mystor
MozReview-Commit-ID: 202nkbmkwfR
2018-03-21 17:39:04 -04:00
Miko Mynttinen 65c6bee9d6 Bug 1445302 - Replace TArray.RemoveElementAt(TArray.Length() - 1) pattern with TArray.RemoveLastElement() or TArray.PopLastElement() r=froydnj
MozReview-Commit-ID: rGjabnP2iz

--HG--
extra : rebase_source : 1ef6c5ce028ac9ebd9f3176d57835c43fe46bada
2018-03-13 14:51:33 +01:00
Tooru Fujisawa 1adba8c1fc Bug 1442465 - Part 4.2: Stop unnecessarily awaiting on BrowserTestUtils.removeTab (simple part). r=dao 2018-03-19 11:16:45 +09:00
Boris Zbarsky 4e402f9b99 Bug 1445983. <bdi> should be an HTMLElement, not HTMLUnknownElement. r=hsivonen
MozReview-Commit-ID: 9eJ45uXRDfR
2018-03-16 11:26:09 -04:00
Boris Zbarsky 46fc331568 Bug 1446097. Switch to "set" as the canonical nsGkAtoms name of the string "set", so it matches the actual tag name "set" in SVG. r=hsivonen,njn
Most of the noise is from the fact that clang-format on parser/html/*.{h,cpp}
reformatted all sorts of stuff.  Not running it caused lots of format changes
from the generator... I guess we changed the format rules since the last time
this got run?

MozReview-Commit-ID: IA2G87zUIKN
2018-03-16 11:26:06 -04:00
Adrian Wielgosik 43a3ada8a9 Bug 1418077 - Remove nsIDOMHTMLFormElement. r=bz
MozReview-Commit-ID: 9eQxvfIMB22

--HG--
extra : rebase_source : f75e043da542b567e31d15db25791c738b275a09
2018-03-14 21:42:25 +01:00
Nicholas Nethercote 991955fad8 Bug 1445079 - Remove nsHTMLTags::sTagAtomTable[]. r=froydnj
The atoms in nsHTMLTags are a subset of nsGkAtoms, which means that
sTagAtomTable[] currently ends up holding duplicate pointers to the same static
atoms.

This patch removes sTagAtomTable[]. The only place that used sTagAtomTable[]
was nsHTMLTags::AddRefTable(). It now instead calls NS_GetStaticAtom() to get
the static atoms registered by nsGkAtoms.

The patch also moves some checking of sTagNames from RegisterAtoms() (which is
removed) to AddRefTable().

All this reduces the number of duplicate static atoms from 148 to 12.

MozReview-Commit-ID: 14qXYeoorFr
* * *
[mq]: foo

MozReview-Commit-ID: AgQbXlcvWrt
2018-03-14 09:56:14 +11:00
Nicholas Nethercote d967055f0b Bug 1445079 - Rename nsHTMLTags::sTagUnicodeTable[] as sTagNames[]. r=froydnj
It's just an array of names, not a hash table.

MozReview-Commit-ID: 3rWNNec64UJ
2018-03-14 09:54:43 +11:00
Boris Zbarsky 633cf0f02a Bug 1445140 part 1. Remove the XPCOM-ish version of NS_NewDOMDocumentType. r=mystor
MozReview-Commit-ID: 6sEFIfMgqet
2018-03-13 16:24:01 -04:00
Nicholas Nethercote 8ac9830be0 Bug 1444031 - Rename Is{Static,Dynamic,HTML5}Atom. r=froydnj
By removing the "Atom" suffix, which is redundant.

MozReview-Commit-ID: 4MCX9Icfjrw

--HG--
extra : rebase_source : c3c759a508a8938b59d36dbb20448d2964b98c91
2018-03-07 15:17:34 +11:00
Eric Rahm 916d8bacc7 Bug 1442760 - Switch nsHTMLTags hashtables to nsDataHashtable. r=hsivonen
This converts nsHTMLTags hashtables from PLHash to nsDataHashtable which
gives us both type safety and simpler code. Addtionally `gTagTable` now holds
a nsString instead of a raw char16_t pointer, this has the benefit of the
strings knowing their sizes allowing for more efficient comparisons. We avoid
heap allocations in the nsString by using `AssignLiteral` with the string from
the static string array.

--HG--
extra : rebase_source : 3ab6409de5e933beb868a0b371dff81e56df0810
2018-03-06 17:27:17 -08:00
Florian Quèze c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Emilio Cobos Álvarez 9f26540cc4 Bug 1441547: Make character data change notifications use a const reference for the info parameter. r=smaug
It's not intended to be mutated.

MozReview-Commit-ID: 5nkD1YkidlV

--HG--
extra : rebase_source : 810d429208fa3eaf30e220e77a7d27107cb77346
2018-02-27 15:30:27 +01:00
Emilio Cobos Álvarez c03ffd9c62 Bug 1425759: Simplify the style backend type setup. r=bholley
Now that what we use to decide whether a document is styled by Servo are only
prefs and the doc principal, we don't need to inherit the style backend type,
since unless the pref has changed, the result will be the same.

MozReview-Commit-ID: KBmeBn1cRne
2018-02-27 12:39:20 +01:00
Hiroyuki Ikezoe 1b0cba9367 Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
It would be convenient to get nsPresContext from nsIDocument.

MozReview-Commit-ID: Ei6V3UE8XGr

--HG--
extra : rebase_source : 8d2a917eb62cf341e4e1810451fd01c01dbc3bad
2018-02-21 07:00:10 +09:00
Gijs Kruitbosch bfee896494 Bug 1437147 - report warnings when the sanitizer removes stuff for chrome documents, r=bz
MozReview-Commit-ID: Lx1JjpYrLpD

--HG--
extra : rebase_source : fcd98b67a194a59e2d4e6d44a5442e359ce22255
2018-02-15 16:03:19 +00:00
Nathan Froyd 0f56acaf26 Bug 1437604 - remove NS_INTERFACE_MAP_END_THREADSAFE; r=mystor
This macro is identical to NS_INTERFACE_MAP_END and encourages the
reader to think that there's something extra-special threadsafe about QI
implementations that use the macro, when in reality there's nothing of
the sort.
2018-02-12 14:36:46 -05:00
Boris Zbarsky c61fc860fe Bug 1436508 part 14. Remove nsIDOMMutationEvent. r=masayuki
MozReview-Commit-ID: Gf59kFSIuaK
2018-02-09 11:17:10 -05:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Jan Henning 9c467e7e8d Bug 1392996 - Part 1 - Add meta viewport tag to view-source document. r=hsivonen
Adding <meta name="viewport" content="width=device-width"/> to the view-source
document achieves two things when used in a mobile browser, such as Fennec:
1. When word-wrapping is turned off, the page displays at a more readable
   initial zoom level.
2. As of now, font inflation (when enabled) kicks in on the document when word-
   wrapping is turned on, which leads to the line numbers appearing in a
   noticeably smaller font size than the rest of the page.
   Adding the above meta viewport header marks the document as "mobile-friendly"
   and suppresses font inflation, which means that line numbers will appear
   normally even with word-wrapping enabled.

getMathMLSelection() in browser-content.js isn't actually used in Fennec at the
moment, but for consistency we add the meta viewport tag there as well.

MozReview-Commit-ID: K9KVHh7g7TF

--HG--
extra : rebase_source : 1054f712f5420efcd89daeaa2c8c200129544b2a
2018-01-23 22:25:09 +01:00
Sylvestre Ledru 9e661550b7 Bug 1426997 - Add MOZ_FALLTHROUGH_ASSERT to make it clear that it can never fall through r=hsivonen
MozReview-Commit-ID: KZvVGnlJZtr

--HG--
extra : rebase_source : 0596528de97d4ae42c13f56d264099c7654d90f1
2018-01-29 09:11:08 +01:00
Edgar Chen 084a83413d Bug 1430951 - Avoid element name atomizing to improve performance of LookupCustomElementDefinition; r=smaug
Since we are dealing with the element (nodeInfo->LocalName() and NameAtom() are the same value),
we could use nodeInfo->NameAtom() instead.

MozReview-Commit-ID: 4vIBDEM1Nwv

--HG--
extra : rebase_source : 150d5ea982363eb2ef4c5039fae67be1e08884ba
2018-01-17 14:55:13 +08:00
Boris Zbarsky f60fd673d6 Bug 1432186 part 19. Remove the nsIDOMNode::*_NODE constants. r=mccr8
MozReview-Commit-ID: KvKjeKIOB9K
2018-01-29 23:10:53 -05:00
Boris Zbarsky 37aaea3c1f Bug 1432186 part 16. Remove nsIDOMNode's ownerDocument attribute. r=mccr8
MozReview-Commit-ID: JqfAFxPBz41
2018-01-29 23:10:52 -05:00
Andrea Marchesini 689d24ff90 Bug 1431000 - Replace the use of nsINode::InsertChildAt_Deprecated with nsINode::InsertChildBefore in nsHtml5TreeOperation, r=catalinb 2018-01-25 16:00:09 +01:00
Andrea Marchesini 85b163bc38 Bug 1430998 - Rename nsINode::InsertChildAt to InsertChildAt_Deprecated, r=catalinb 2018-01-23 14:30:18 +01:00
Andrea Marchesini b8bb98af8c Bug 1430997 - Rename nsINode::IndexOf to nsINode::ComputeIndexOf, r=catalinb 2018-01-23 14:30:18 +01:00
Jon Coppeard 3bdf7ef24a Bug 1382020 - Don't preload nomodule scripts when modules are enabled r=hsivonen 2018-01-23 13:07:37 +00:00
Andreea Pavel d6a9e2303f Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2018-01-16 18:00:21 +02:00
Andrea Marchesini 6250023d02 Bug 1425440 - Replace RemoveChildAt_Deprecated with RemoveChildNode in nsHtml5TreeOperation, r=catalinb 2018-01-16 14:17:10 +01:00
Henri Sivonen 71f07dccfb Bug 1424220 - Set mCurrentHtmlScriptIsAsyncOrDefer to false when restoring tree builder state. r=smaug
MozReview-Commit-ID: 9gsFme52mOG

--HG--
extra : rebase_source : d71040069ff4b3db476bf4cf3c08258def019f5a
2018-01-15 20:07:28 +02:00
Edgar Chen 629d03627c Bug 1420377 - Avoid atomizing 'is' value twice when the custom element is created from parser; r=smaug
MozReview-Commit-ID: JHw3di1Q9E9

--HG--
extra : rebase_source : a1f1ac6ddefc7d2ffb543eb30fc41c868f050288
2017-11-24 16:57:00 +08:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
John Dai d480d5e221 Bug 1419662 - Fix incorrect custom element type in CustomElementData. f=echen, r=smaug 2018-01-07 18:45:00 +02:00
Jon Coppeard bc9a97d964 Bug 1361369 - Allow async attribute on inline module scripts r=smaug 2018-01-08 15:17:34 +00:00
Andrea Marchesini 6ee7f4e6f3 Bug 1425321 - Renaming nsINode::RemoveChildAt to RemoveChildAt_Deprecated, r=catalinb 2018-01-03 14:01:03 +01:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Chris Peterson 894bf2c746 Bug 1424548 - Part 14: Regenerate HTML parser code with override specifiers. r=hsivonen
Overridden virtual functions without override specifiers will become errors after gcc -Wsuggest-override warnings are enabled.

--HG--
extra : rebase_source : a4752e3ec7bd41563bc9b1fdd1b1829666744273
2017-12-07 01:27:56 -08:00
Chris Peterson 5b8dabf526 Bug 1424548 - Part 11: Regenerate HTML parser code with MOZ_FALLTHROUGH annotations. r=hsivonen
And stop suppressing -Wimplicit-fallthrough warnings. We no longer need to suppress these clang warnings because the generated parser code now includes MOZ_FALLTHROUGH annotations.

--HG--
extra : rebase_source : d766c9b17de878138df6d949ee720dfaf0ed370a
2017-12-01 01:05:26 -08:00
Chris Peterson fcb45bc490 Bug 1424548 - Part 9b: Regenerate HTML parser code to remove always-zero offset from CPPONLY code. r=hsivonen
--HG--
extra : rebase_source : 448298e7e9b43a80a54a6b087a6a2bf731654264
2017-12-01 00:58:56 -08:00
Chris Peterson 946cc287a2 Bug 1424548 - Part 9a: clang-format generated HTML parser code. r=hsivonen
--HG--
extra : rebase_source : 67a0555475dbce49c689d27510dca252089a4a7b
2017-12-21 00:02:43 -08:00
Chris Peterson 16e0dd144e Bug 1424548 - Part 1: Fix non-unified build of HTML parser code. r=hsivonen
--HG--
extra : rebase_source : 78aa25eb45c0f7cd446ac7eab4f853c46590c7e7
2017-12-04 13:09:15 -08:00
Florian Quèze 032c961e0a Bug 1421992 - script-generated patch to replace do_check_* functions with their Assert.* equivalents, rs=Gijs. 2017-12-21 11:08:17 +01:00
Masatoshi Kimura 082293ce3e Bug 1424468 - Stop using Encoding::ForName in HTML parser. r=hsivonen
MozReview-Commit-ID: 1rONnEXLgPf

--HG--
extra : rebase_source : 081effdc2a3ee0292d73666abc7bda7b62d3a0a7
2017-12-07 23:21:42 +09:00
Sylvestre Ledru a9961096c0 Bug 1394734 - Simplify various corner cases r=glandium
MozReview-Commit-ID: 4s4JdXZPvmv

--HG--
extra : rebase_source : c8f663c99442d41db5f81ac5fe1aa1f47fd5ed82
2017-12-07 22:10:19 +01:00
Sylvestre Ledru 4591d82b23 Bug 1394734 - Replace CONFIG['CLANG*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: HbF5oT5HW6f

--HG--
extra : rebase_source : eca479b6ae4bff7f600d1cdb39e11ac2057e4e79
2017-12-07 22:09:38 +01:00
Sylvestre Ledru 9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Emilio Cobos Álvarez 74b31155f7 Bug 1423167: Move most attribute-related methods from nsIContent to Element. r=bz
MozReview-Commit-ID: 6WXqNiODttD
2017-12-06 16:05:59 +01:00
Jesse Ruderman 1519b89248 Bug 762726 - Add crashtest. 2017-12-05 11:02:58 -05:00
Jesse Ruderman 6cf039848c Bug 662185 - Add crashtest. 2017-12-05 11:02:58 -05:00
Jesse Ruderman 9098c723e2 Bug 616027 - Add crashtest. 2017-12-05 11:02:58 -05:00
Olli Pettay af3373dc1d Bug 1418002 - Remove HTMLContentElement, r=jessica 2017-11-30 10:57:15 +02:00
Alphan Chen 54f4537537 Bug 980904 - Disable the Character Encoding menu when document is decoded as UTF-8 without errors. r=hsivonen,emk,Gijs 2017-11-23 15:03:41 +08:00
Andrea Marchesini ad64933e5a Bug 1419382 - Moving ownership of nsIInputStream when using netUtil functions - part 2 - NS_NewInputStreamChannel, r=smaug 2017-11-22 11:18:36 +01:00
Coroiu Cristina d6a2b15dbc Merge inbound to mozilla-central r=merge a=merge 2017-11-22 01:32:34 +02:00
Henri Sivonen bfee08d7ad Bug 1418000 - Check mInsertionPointPermanentlyUndefined when checking for executor completion. r=smaug
MozReview-Commit-ID: 2qL822ep5g3
2017-11-21 10:36:31 -05:00
Edgar Chen bf0a0f5b38 Bug 1415761 - Catch the exception and rethrow it after invoking custom elements reactions; r=bz
The spec was unclear on how CEReactions interact with thrown exceptions; see https://github.com/whatwg/html/issues/3217.
The spec is now being clarified in https://github.com/whatwg/html/pull/3235.

MozReview-Commit-ID: 521HprTRS7k

--HG--
extra : rebase_source : 107d331203d0d16062fa061569e822d3c6d5f2c9
2017-11-17 17:44:18 +08:00
Nicholas Nethercote faa8efadfe Bug 1416980 - Remove nsIExtendedExpatSink. r=erahm.
Because none of the expat users need it.

--HG--
extra : rebase_source : 55a9338fe88073b9278f715e57eef926a638f31e
2017-11-14 17:22:49 +11:00
Henri Sivonen 044769e0f9 Bug 1417494 - Take iframe sandboxing into account for <noscript> parsing. r=bz
MozReview-Commit-ID: GTUCSQq5aDm

--HG--
extra : rebase_source : be20b48005643f7b6090a38f0ac4edcd702975c7
2017-11-16 11:49:50 +02:00
John Dai d1400ac8b1 Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0. f=echen, r=smaug 2017-11-14 19:23:00 +08:00
Andi-Bogdan Postelnicu 57f5ff88dd Bug 1417417 - use UniquePtr for bufferCopy to prevent memory leak when treeOp is null. r=hsivonen
MozReview-Commit-ID: HBI7CWjtS80

--HG--
extra : rebase_source : e27c5f7f81979179650b3e15a7c0116ee21bb155
2017-11-15 16:50:58 +02:00
Coroiu Cristina 6a04305b5d Merge mozilla-central to inbound. r=merge a=merge on a CLOSED TREE 2017-11-14 12:31:45 +02:00
Nicholas Nethercote 250e11fb3c Bug 1416038 (part 10) - nsSAXXMLReader.cpp doesn't need to be an nsIExtendedExpatSink. r=erahm
--HG--
extra : rebase_source : dd2e8b2b46aeeabaa9dfa14b3b2ab4e2eccdc275
2017-11-14 08:30:36 +11:00
Nicholas Nethercote c4d895d0d6 Bug 1416038 (part 9) - Add a comment about nsISAXXMLReader's lack of functionality. r=erahm
--HG--
extra : rebase_source : 0e4e8ac0ce98efb497a62b3abd70b5a7d6914ad8
2017-11-10 15:23:27 +11:00
Nicholas Nethercote e9e330e914 Bug 1416038 (part 8) - Remove nsISAXLocator. r=erahm
None of our nsISAXErrorHandler implementations use the locator arguments.

--HG--
extra : rebase_source : 20e7ce91dd4b9582db6cb9b4cdcc2c04dd8fa064
2017-11-10 15:22:26 +11:00
Nicholas Nethercote af2d7335b8 Bug 1416038 (part 7) - Remove nsISAXMutableAttributes. r=erahm
There is a single implementation, nsSAXAttributes, and all the methods are
unused... except for AddAttribute(), but that doesn't need to be declared in
XPIDL because it's only used within nsSAXAttributes.cpp.

--HG--
extra : rebase_source : 9bf10f76be0f9e6821e35885b96d125f76209c9b
2017-11-10 15:21:27 +11:00
Nicholas Nethercote c33420edb2 Bug 1416038 (part 6) - Slim down nsISAXContentHandler. r=erahm
This patch removes three methods that are no-ops (or missing) in all our
implementations.

--HG--
extra : rebase_source : e29b4cfbbc71d549744fcfd6481c449231316c1d
2017-11-10 15:19:44 +11:00
Nicholas Nethercote d8552a4ef9 Bug 1416038 (part 5) - Remove nsISAXXMLReader.[sg]etFeature. r=erahm
It's unused by any of our nsISAXXMLReader implementations.

The patch also removes nsSAXXMLReader::mEnableNamespacePrefixes, which is now
unused. And it removes test_namespace_support.js, which is all about testing
features.

--HG--
extra : rebase_source : 8da54379deedae9ef04fd1ab2169ab3760b13064
2017-11-10 15:19:16 +11:00
Nicholas Nethercote 02a6694346 Bug 1416038 (part 4) - Remove nsISAXXMLReader.[sg]etProperty. r=erahm
These are unused and also unimplemented.

--HG--
extra : rebase_source : d58e12d49cfc4dd1cb082bf1fd2a450f5d3b8eed
2017-11-10 15:18:52 +11:00
Nicholas Nethercote 8992c2afeb Bug 1416038 (part 3) - Remove nsIMozSAXXMLDeclarationHandler, nsISAXDTDHandler, and nsISAXLexicalHandler. r=erahm
Because none of our nsISAXXMLReader implementations set `dtdHandler`,
`declarationHandler`, or `lexicalHandler`.

The patch also removes test_xml_declaration.js, because that test is all about
testing nsIMozSAXXMLDeclarationHandler.

--HG--
extra : rebase_source : f0380364fbaa435dd0e415fe7ca78b5aa0180336
2017-11-10 15:18:26 +11:00
Nicholas Nethercote 801b0c166a Bug 1416038 (part 2) - Remove nsISAXXMLFilter. r=erahm
It's unused.

--HG--
extra : rebase_source : 6a49d0664dbf284ea595134a3ff348965b339f1c
2017-11-10 15:17:19 +11:00
Nicholas Nethercote 4e485ceed3 Bug 1416038 (part 1) - Remove nsISAXEntityResolver forward declaration. r=erahm
This interface no longer exists.

--HG--
extra : rebase_source : 422fe6fb6a412d9e092aa1964e5a51f1b73e1716
2017-11-10 15:16:56 +11:00
Joel Maher bda41cf05e Bug 1385288 - Disable parser/htmlparser/tests/reftest/bug582940-1.html on osx for frequent failures. r=me, a=testonly 2017-11-13 12:20:03 -05:00
Henri Sivonen 2069543e3c Bug 1414490 - Permanently undefine the insertion point at EOF. r=smaug.
MozReview-Commit-ID: Kijs3Rxhq0X
2017-11-13 16:59:11 +02:00
Henri Sivonen 974c22a515 Bug 1413467 - Make enqueueing tree ops use fallible allocation. r=bz
MozReview-Commit-ID: 9GI3btVYLqL

--HG--
extra : rebase_source : 63ccd9c2437e74b8809b74cc24e4795d1433c793
2017-11-10 12:19:45 +02:00
Joel Maher 0daa567ffa Bug 1385288 - Disable parser/htmlparser/tests/reftest/bug582940-1.html on osx for frequent failures. r=me, a=testonly 2017-11-02 13:15:06 -04:00
Olli Pettay 23193d01cc Bug 1412275, ensure we have still the executor before trying to continue parsing, r=hsivonen 2017-11-02 10:40:38 +02:00
Henri Sivonen f8aac134be Bug 1364399 - Call DidBuildModel() when not flushing. r=smaug.
MozReview-Commit-ID: CtYHqN8myb1
2017-11-01 13:16:44 +02:00
Henri Sivonen 24aae439f6 Bug 1410848 - Use RAII with nsHtml5TreeOpExecutor::mFlushState. r=smaug.
MozReview-Commit-ID: 3a1tyYGT8u5
2017-11-01 13:16:23 +02:00
Joel Maher c101ca4540 Bug 1385288 - Disable parser/htmlparser/tests/reftest/bug582940-1.html on osx debug for frequent failures. r=me, a=testonly 2017-10-31 08:45:45 -04:00
Nicholas Nethercote 8ad99dd7fa Bug 1411893 - Introduce nsStaticAtom. r=emilio,froydnj.
It's a sub-class of nsAtom, useful for cases where you know you are dealing
exclusively with static atoms. The nice thing about it is that you can use
raw nsStaticAtom pointers instead of RefPtr<>. (In fact, the AddRef/Release
implementations ensure that we'll crash if we use RefPtr<nsStaticAtom>.)

MozReview-Commit-ID: 4Q6QHX5h44V

--HG--
extra : rebase_source : e4237f85b4821b684db0ef84d1f9c5e17cdee428
2017-10-27 10:31:13 +11:00
Sebastian Hengst d10e26c913 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-10-27 00:00:25 +02:00
Andi-Bogdan Postelnicu 2a15cd5990 Bug 1411615 - make nsScannerIterator a trivial type in order to use memset. r=hsivonen
MozReview-Commit-ID: 2YpZE8Rryyl

--HG--
extra : rebase_source : 2f8beb81d40d73caaf70f935cbbcb1fbfb2da535
2017-10-26 17:50:26 +03:00
Alphan Chen 8e5cbb6713 Bug 500617 - Remove always-zero offsets from HTML5 parser. r=hsivonen
MozReview-Commit-ID: DT8oWxbbYNy
2017-10-23 14:42:21 +03:00
Nicholas Nethercote 21e7dce1a2 Bug 1410294 (part 3) - Overhaul static atom macros. r=froydnj.
There are four things that must be provided for every static atom, two of which
have a macro:
- the atom pointer declaration (no macro);
- the atom pointer definition (no macro);
- the atom char buffer (NS_STATIC_ATOM_BUFFER);
- the StaticAtomSetup struct (NS_STATIC_ATOM_SETUP).

This patch introduces new macros for the first two things: NS_STATIC_ATOM_DECL
and NS_STATIC_ATOM_DEFN, and changes the arguments of the existing two macros
to make them easier to use (e.g. all the '##' concatenation now happens within
the macros).

One consequence of the change is that all static atoms must be within a class,
so the patch adds a couple of classes where necessary (DefaultAtoms, TSAtoms).

The patch also adds a big comment explaining how the macros are used, and what
their expansion looks like. This makes it a lot easier to understand how static
atoms work. Correspondingly, the patch removes some small comments scattered
around the macro use points.

MozReview-Commit-ID: wpRyrEOTHE

--HG--
extra : rebase_source : 9f85d477b4d06c9a9e710c757de1f1476edb6efe
2017-10-22 08:50:25 +11:00
Nicholas Nethercote 074a872086 Bug 1410294 (part 1) - Rename nsStaticAtom as nsStaticAtomSetup. r=froydnj.
Because it's the type we use to set up static atoms at startup, not the static
atom itself.

The patch accordingly renames some parameters, variables, and NS_STATIC_ATOM,
for consistency.

MozReview-Commit-ID: 1a0KvhYNNw2

--HG--
extra : rebase_source : 5c66e5b2dfe053a368bf3584d957198aec4cce91
2017-10-20 14:04:47 +11:00
Jessica Jong f783bf3a95 Bug 1378079 - Part 3: Complete the steps related to custom elements in "create an element for a token". r=hsivonen,smaug
--HG--
extra : rebase_source : c393051fc6f025ff4c013b5349b53c8a5ba2c3c4
2017-10-26 14:55:41 +08:00
Jessica Jong 0ed394bfdf Bug 1378079 - Part 1: Gecko changes for adding attribute 'is' to parser. r=hsivonen
--HG--
extra : rebase_source : 413505a2aa4fe229da957906697f172527361b38
2017-10-26 14:08:10 +08:00
Andrea Marchesini 6626e900f9 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +02:00
Kris Maglione 4a767c7e6e Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn
MozReview-Commit-ID: LmGIgfmNSmk

--HG--
extra : rebase_source : bf34e852beb0c8f6eafd09184c2e0cda95f95f83
2017-09-24 19:57:48 -07:00
Nicholas Nethercote f2d1f3b005 Bug 1407117 - Simplify static atom representation. r=froydnj,bz.
Currently nsAtom::mString points to the interior of an nsStringBuffer. For
static atoms this requires the use of nsFakeStringBuffer, which is pretty
gross.

This patch changes things so that nsAtom::mString points to a static char
buffer for static atoms. This simplifies a number of things:

- nsFakeStringBuffer and CheckStaticAtomSizes are no longer needed.

- FakeBufferRefCountHelper is no longer needed.

- nsAtom's constructor for static atoms is simpler.

- RegisterStaticAtoms() is simpler.

On the flip-side, a couple of things get more complicated.

- nsAtom::ToString() treats static and dynamic atoms differently.

- nsAtom::GetStringBuffer() is now only valid for dynamic atoms. This
  function is only used in two places, both involving DOMString, so those
  locations are updated appropriately. This also requires updating some other
  code assigning nsStrings to DOMStrings, because we can't assume that
  nsStrings are shared.

On Linux64 this change reduces the size of the binary by 8752 B, and moves
81968 B from the .data to the .rodata section, where it can be shared between
processes.

--HG--
extra : rebase_source : 0f6fcdec1c525aa66222e208b66a9f9026f69bcb
2017-10-12 10:52:17 +11:00
Kyle Machulis 1cc8b01353 Bug 1406224 - Remove nsIDOMHTMLImageElement; r=bz
MozReview-Commit-ID: GCATWRt6qMo

--HG--
extra : rebase_source : 29854f1374c6ad318da0b5b68be23507667c3be4
2017-10-06 13:27:23 -07:00
Henri Sivonen 2061eb8fbe Bug 1405568 - Return false from nsHtml5String::LowerCaseStartsWithASCII when this string is shorter than the literal. r=smaug
MozReview-Commit-ID: AfPZ3nnOGQu

--HG--
extra : rebase_source : df5bd4fa2629dcc0433bdad68125b7c768a18744
2017-10-09 10:43:48 +03:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Henri Sivonen 1b5e2ee8f5 Bug 1406308 - MOZ_RELEASE_ASSERT on nsHtml5StreamParser::mStreamState. r=smaug
MozReview-Commit-ID: 8F7kJ7KKYEI

--HG--
extra : rebase_source : 5e17287a203ec600e6d4d72e22d00834059696a3
2017-10-06 10:42:21 +03:00
Catalin Badea f8162c4bfd Bug 651120 - Remove index argument from content removed/appended/inserted notifications. r=peterv 2017-10-03 11:09:08 +01:00
Olli Pettay 657d54de19 Bug 1402941 - Add HTMLSlotElement (disabled for now), r=hsivonen
--HG--
extra : rebase_source : ced3d844425bee6fddd22641646a7366ffd5d69e
2017-10-02 13:22:12 +03:00
Sebastian Hengst 5573e8270f Backed out changeset 0ce8d073a16e (bug 256180) 2017-09-28 11:30:33 +02:00
Henri Sivonen b245e01efe Bug 256180 parser part - Insert elements as siblings instead of children at the Blink-defined magic depth for compatibility. r=smaug
MozReview-Commit-ID: K8fgv3rgklt

--HG--
extra : rebase_source : 3ad91a01805afcd1aeac89a5f2d5ac38dac1797b
2017-09-12 16:57:05 +03:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Sylvestre Ledru f1576f5bdf Bug 1403150 - Ignore the formatting on gHTMLElements r=smaug
MozReview-Commit-ID: FKHbmNBJjia

--HG--
extra : rebase_source : ce90332472e52e3719936b9142eaa7dfbb4c8379
2017-09-26 14:40:06 +02:00
Nicholas Nethercote 1c520e8c6f Bug 1402769 - Remove unused stuff in and around nsParserModule.cpp. r=mrbkap.
None of these things are used in mozilla-central or comm-central.

--HG--
extra : rebase_source : 470eeca24dda8a3d475208d0c7dd22d5280bb904
2017-09-05 20:43:30 +10:00
Nicholas Nethercote 5018bb4f9b Bug 1401873 - Remove nsHtml5Atom. r=froydnj,hsivonen.
nsHtml5Atoms are very similar to dynamic nsAtoms. This patch removes the former
in favour of the latter, which leaves nsAtom as the only subclass of nsIAtom.

nsAtom::mKind is still used to distinguish dynamic atoms from HTML5 atoms, and
the HTML5 parser still uses manual memory management to handle its HTML5 atoms.

nsHtml5AtomEntry::mAtom had to be changed from an nsAutoPtr to a raw pointer
because nsAtom's destructor is private.

MozReview-Commit-ID: 1pBzwkog3ut

--HG--
extra : rebase_source : fbb819e527cb30606348da9ce3eede62e00fb936
2017-09-21 14:02:05 +10:00
Olli Pettay c80e124562 Bug 1396584 - Remove support for multiple ShadowRoots, r=mrbkap
--HG--
extra : rebase_source : 2bb600ed1ffd35c195617a7eb70d0ba847a46898
2017-09-25 18:09:26 +03:00
Alphan Chen 9e106f565a Bug 1398985 - Remove a warning message in nsHtml5TreeOpExecutor::ContinueInterruptedParsingAsync(). r=erahm 2017-09-25 13:45:04 +08:00
Nicholas Nethercote c07fbf3cf6 Bug 1401097 (part 1) - Simplify gHTMLElements. r=mrbkap.
The HTML group constants in nsElementTable.cpp are only used for
nsHTMLElement::IsBlock(). This patch removes them and replaces
HTMLElement::mParentBits with a bool, mIsBlock.

The patch also inverts the sense of HTMLElement::mLeaf and renames it
mIsContainer, to match the sense of IsContainer().

Finally, the patch uses the pre-processor to use '____' instead of 'false' in
gHTMLElements. This makes it easier to read.

Note that IsBlock() has numerous disagreements with
https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements about
what constitutes a block element, but I have preserved the existing behaviour.

--HG--
extra : rebase_source : ff5ab71fdb2665fda296c0fbb712641151a7b003
2017-09-22 08:14:03 +10:00
Chris Peterson 5698729243 Bug 870698 - Part 10: Replace Append(NS_LITERAL_STRING("")) with AppendLiteral(u""). r=erahm
The NS_LITERAL_STRING macro creates a temporary nsLiteralString to encapsulate the char16_t string literal and its length, but AssignLiteral() can determine the char16_t string literal's length at compile-time without nsLiteralString.

MozReview-Commit-ID: H9I6vNDMdIr

--HG--
extra : rebase_source : cf537a1f65af003c6c4f8919b925b0f305c1dd4d
extra : source : 13b89ce4e6a66c840f82a335c71f5a12938aba22
2017-09-07 18:32:54 -07:00
Nicholas Nethercote e3c9cbb969 Bug 1401813 - Rename Null[C]String() as Void[C]String(). r=erahm.
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.

--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
2017-09-22 14:35:46 +10:00
Nicholas Nethercote b1f7b4c0f3 Bug 1400777 (part 5) - Clean up nsElementTable.{cpp,h}. r=mrbkap.
This patch makes some style fixes and other minor improvements.

--HG--
extra : rebase_source : 72f7e07d8b661050cd90b4ef6758a95f7a1e60c3
2017-09-20 08:32:51 +10:00
Nicholas Nethercote e177354f97 Bug 1400777 (part 4) - Split nsHTMLElement. r=mrbkap.
This patch splits out most of nsHTMLElement into a new type HTMLElement within
nsElementTable.cpp. Only the static methods IsContainer() and IsBlock() need to
remain exposed via nsHTMLElement. The patch moves TestBits() into
nsElementTable.cpp as well.

--HG--
extra : rebase_source : ca19d9e3af1f4b1f352af82f985190744c4b715b
2017-09-19 11:11:24 +10:00
Nicholas Nethercote be426ece44 Bug 1400777 (part 3) - De-expose gHTMLElements[]. r=mrbkap.
--HG--
extra : rebase_source : 93925428f74e6178efb9635f256b0e28e18cb09e
2017-09-19 11:09:30 +10:00
Nicholas Nethercote dfca4325ac Bug 1400777 (part 2) - De-expose HTML group constants[]. r=mrbkap.
The patch also removes some low-value comments.

--HG--
extra : rebase_source : 7331510a00e5a1d0ca33b1be3b61e6b59b58062f
2017-09-19 11:08:39 +10:00
Nicholas Nethercote cea0a3af5d Bug 1400777 (part 1) - Remove eHTMLTags. r=mrbkap.
It's just a too-cute-by-half typedef for nsHTMLTag.

--HG--
extra : rebase_source : 142128de90c3bed06648db445ca0159c23ea6ff3
2017-09-19 11:07:49 +10:00
Nicholas Nethercote 2ef37710e7 Bug 1395828 (part 4) - Remove nsIParserService/nsParserService. r=mrbkap.
It a stateless wrapper around static methods in nsHTMLTags and nsHTMLElement,
and hence an unnecessary layer of indirection that just adds complexity and
slowness. This patch removes it, cutting almost 300 lines of code.

This requires making nsElementTable.h an exported header, to expose the
nsHTMLElement methods.

--HG--
extra : rebase_source : abbcb8e5001389affbf717092213b898673db07f
2017-09-05 20:19:06 +10:00
John Dai 084e79f16c Bug 1398401 - Add preference check for custom element setup. r=smaug 2017-09-12 00:40:00 -04:00
Sebastian Hengst 8eb249afcc merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: JSRVc5yW6Kx
2017-09-07 12:39:12 +02:00
Nicholas Nethercote 4a2bc82d4c Bug 1396694 (part 1) - Make nsIAtom non-scriptable. r=froydnj.
This also lets us remove a couple of IDL methods.

--HG--
extra : rebase_source : a62d3f340c77ae8028e35aa9f01f72c5eadf0ed1
2017-09-05 16:06:43 +10:00
Andrew McCreight 7f7f149167 Bug 1395636 - Convert code to use NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED. r=peterv
MozReview-Commit-ID: DivJPerL5SF

--HG--
extra : rebase_source : 890df75914906a5d34e8af67f9fc3a4be239d2d6
2017-08-31 16:29:22 -07:00
Sebastian Hengst 2f7f455fa1 Backed out changeset 9306866e8df0 (bug 1395636) for build bustage. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 20d028d6b971cf6a221dc2f1553687d6c074bdcb
2017-09-06 19:18:06 +02:00
Andrew McCreight 4d6e76dfcf Bug 1395636 - Convert code to use NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED. r=peterv
MozReview-Commit-ID: DivJPerL5SF

--HG--
extra : rebase_source : cb952cfc5600a163a5580438e5b0177595689dab
2017-08-31 16:29:22 -07:00
Olli Pettay 2e8b602108 Bug 1377131 - Try to trigger collector slices at times which disturb page js less (at least with iframes loaded after the top level page has been loaded), r=mccr8,bz
When triggering an iframe load or starting to parse a document for an iframe, the main thread may often have some time before the new page has been created. Try to trigger CC/GC slice at such point in order to avoid collector later when page is already executing its JS

--HG--
extra : rebase_source : 806df0af1dbaefb1761134eca0bb7c6ade6ac1a9
2017-09-06 18:18:11 +01:00
Nicholas Nethercote 1e3e28cf8e Bug 1395828 (part 2) - Rename nsHTMLTags methods. r=mrbkap.
The patch uses the nsParserService method names (minus the "HTML" prefix)
because they are more descriptive. This will make it easier to replace
nsParserService method calls with nsHTMLTags method calls.

The patch also adds nsHTMLTags::AtomTagToId(), to match up with
nsParserService::HTMLAtomTagToId().

--HG--
extra : rebase_source : 278c53a0787a928de9477dd30a5fd037791d7990
2017-09-01 19:42:42 +10:00
Nicholas Nethercote 5954b79cd8 Bug 1395828 (part 1) - Add nsHTMLElement::IsBlock(). r=mrbkap.
This mirrors the existing nsHTMLElement::IsContainer() function.

--HG--
extra : rebase_source : ae511983f799a971981b81ad4df8557a185d281b
2017-09-01 19:38:09 +10:00
Henri Sivonen 3c8567b60d Bug 1354989 - Avoid pivoting via UTF-16 when loading CSS in the Stylo mode. r=jdm,SimonSapin
MozReview-Commit-ID: Llt29dvB4Io

--HG--
extra : rebase_source : 3ae51dc8beff3fb19e9318a6c7c30c9ab08a5b57
2017-08-29 16:01:42 +03:00
Chung-Sheng Fu c978a96e84 Bug 1395486 - Move resource://gre-resource/plaintext.css to resource://content-accessible/plaintext.css. r=heycam
MozReview-Commit-ID: Efz2Z78W2ix

--HG--
extra : rebase_source : 0522f382acd14372c6fea0a695f1d09300810912
2017-08-31 17:06:22 +08:00