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

4024 Коммитов

Автор SHA1 Сообщение Дата
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