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

906 Коммитов

Автор SHA1 Сообщение Дата
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
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
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
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
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
Andrew McCreight 78807d8776 Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1

--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
2017-08-29 16:02:48 -07:00
Chung-Sheng Fu e5b80e9a8f Bug 863246 - Move resources that need to be exposed to web content to locations that are marked as contentaccessible r=billm
MozReview-Commit-ID: ArhSHKPYOr8

--HG--
extra : rebase_source : 888f7ce8f9db809ad5abbe6340af74e9dfb1d73b
2017-06-08 17:52:46 +08:00
Michael Layzell eab07b465e Bug 1393581 - Name all IdleTaskRunner runnables, r=smaug 2017-08-25 11:24:27 -04:00
Yoshi Huang df6bad1c1e Bug 1373780 - Part 3: add isImgSet argument. r=jdm
Per mixed-content-blocked spec, [1], <img srcset> and <picture> should
be blocked. However we still fetch <img srcset> and <picture> in image
preload, because they are fetched with contentPolicyType
TYPE_INTERNAL_IMAGE_PRELOAD and won't be rejected by nsMixedContentBlocker.cpp.

So I updated the image preloading code, and use the type TYPE_IMAGESET
if the image request is for <picture> or <img srcset>, otherwise for
normal image load we still use TYPE_INTERNAL_IMAGE_PRELOAD.

[1]: https://w3c.github.io/webappsec-mixed-content/#should-block-fetch
  4. Return allowed if one or more of the following conditions are met:
     request’s type is "image", and initiator is not "imageset".
  5. Return blocked.
2017-08-24 18:10:54 +08:00
Nicholas Nethercote f582d96b98 Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm.
This is straightforward, with only two notable things.

- `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"`
  throughout, because all nsXPIDLString.h did was include nsString.h. The
  exception is for files which already include nsString.h, in which case the
  patch just removes the nsXPIDLString.h inclusion.

- The patch removes the |xpidl_string| gtest, but improves the |voided| test to
  cover some of its ground, e.g. testing Adopt(nullptr).

--HG--
extra : rebase_source : 452cc4a08046a1adb1a8099a7e85a1917de5add8
2017-08-17 15:29:03 +10:00
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Honza Bambas 2f9f6408e0 Bug 1053321 - Correctly pass info about 'defer' and 'async' attributes to HTML5 parser invoked script preload. r=bkelly 2017-08-19 05:35:00 -04:00
Sylvestre Ledru 214ff5252c Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for parser/html (exists from gcc 7) r=hsivonen
MozReview-Commit-ID: HTFgDFeG3xJ

--HG--
extra : rebase_source : f15a899ac7574f0370075d52030a3dce9b99021f
2017-08-06 18:40:55 +02:00
Phil Ringnalda 1ca83fd296 Backed out 5 changesets (bug 1387569) for Windows static build bustage
Backed out changeset eeda521ba0ad (bug 1387569)
Backed out changeset 8d23caf2ccc7 (bug 1387569)
Backed out changeset b5f969313f81 (bug 1387569)
Backed out changeset f642bc883aa5 (bug 1387569)
Backed out changeset 20151eabffea (bug 1387569)

MozReview-Commit-ID: IH0XXePvhiL
2017-08-19 12:20:26 -07:00
Sylvestre Ledru 51ed775ec3 Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for parser/html (exists from gcc 7) r=hsivonen
MozReview-Commit-ID: HTFgDFeG3xJ

--HG--
extra : rebase_source : a3743891f26ece5e9c90391bcd6e143c85fe8f69
2017-08-06 18:40:55 +02:00
Sebastian Hengst 929739ca73 Backed out changeset 8f191f6eec22 (bug 1387569) 2017-08-19 20:21:49 +02:00
Sylvestre Ledru 6a8a9960be Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for parser/html (exists from gcc 7) r=hsivonen
MozReview-Commit-ID: HTFgDFeG3xJ

--HG--
extra : rebase_source : 1b0b59dd1565caf42b54704558473ebb56668273
2017-08-06 18:40:55 +02:00
Josh Matthews bfdced6e8c Bug 1385907 - Combine exclusive fields of nsHtml5SpeculativeLoad. r=hsivonen 2017-08-16 19:33:00 -04:00
Thomas Nguyen 439e5137c2 Bug 1384493 - Speculative loading style should use correct referrer policy. r=wchen
When preloading style link in <head>, we used speculative referrer policy which is
delievered from meta tag and ignored the referrerpolicy attribute.
We should use referrerpolicy attribute with the higher priority

MozReview-Commit-ID: 1rQmBV01jvV
2017-08-15 00:05:00 -04:00
Bobby Holley d42f0733ac Bug 1389300 - Inherit style backend into NS_NewDOMDocument. r=smaug,r=heycam
Our current machinery for enabling stylo requires a docshell - if there isn't
one, we default to the Gecko style system.

When getComputedStyle operates on an element without a presshell, it uses the
caller's presshell instead. If the element has previously been styled with
one style system (but no longer has a presshell), and the caller uses a
different style backend, using the caller's style system can cause crashes when
we pull bits of cached data off the DOM (like cached style attributes).

So we want to throw when window.getComputedStyle(element) is called for a
(window, element) pair with different style backends (which is what the next
patch in this bug does).

However, that causes a few failures where stylo-backed documents try to do
getComputedStyle on an XHR document (which, without a docshell, will use the
gecko style system).

So this patch does some work to propagate the creator's style backend into
various docshell-less documents. This should allow both chrome (which uses gecko)
and content (which uses stylo) to use getComputedStyle on the response document
for XHRs they create.

Note that the second patch in this bug will make
chromeWin.getComputedStyle(contentObj) throw. If we discover code that does
that, we can just make it invoke the content's getComputedStyle method over Xrays.

MozReview-Commit-ID: 5OsmHJKq5Ui
2017-08-15 19:10:43 -07:00
Henri Sivonen 2607c163b1 Bug 1375701 - Atomize class attribute value in the parser in the innerHTML case. r=Ehsan
MozReview-Commit-ID: CKyGlzYS15e

--HG--
extra : rebase_source : 9ece88d9c85d98665413a7f9d730d7ff149d8486
2017-08-11 09:22:57 +03:00
Sebastian Hengst 14cf46a41a Backed out changeset fabf345eec6e (bug 1375701) for bustage at parser/html/nsHtml5String.h:143:3: bad implicit conversion constructor for 'nsHtml5String'. r=backout on a CLOSED TREE 2017-08-15 16:28:10 +02:00
Henri Sivonen 6815b2d2c7 Bug 1375701 - Atomize class attribute value in the parser in the innerHTML case. r=Ehsan
MozReview-Commit-ID: CKyGlzYS15e

--HG--
extra : rebase_source : a66d3d1659aec509c50f3ca641c0eb1d87151104
2017-08-11 09:22:57 +03:00
Henri Sivonen 3d387ac082 Bug 483155 - Put content creator function pointers onto nsHtml5ElementName. r=smaug
MozReview-Commit-ID: E2AAx7Zz2UF

--HG--
extra : rebase_source : 1b85ba3b1c699e71e6ecacf4d1dc4271f3416b08
2017-07-04 11:00:03 +03:00
Sebastian Hengst 56587adeab Backed out changeset 5b706cd241cb (bug 483155) for Valgrind failure on Linux x64 opt. r=backout 2017-08-11 10:48:10 +02:00
Henri Sivonen dacb0e05f1 Bug 483155 - Put content creator function pointers onto nsHtml5ElementName. r=smaug
MozReview-Commit-ID: E2AAx7Zz2UF

--HG--
extra : rebase_source : 989c11459e16076a043aa7311c95941686e86ef7
2017-07-04 11:00:03 +03:00
Emilio Cobos Álvarez 9f02c96781 Bug 1362338: Make nsIAtom::AddRef and nsIAtom::Release final. r=froydnj
MozReview-Commit-ID: CFWcSNocGIm

--HG--
extra : rebase_source : 6b8e28f76e2d4fff13f3a89ac68388a0b090bf74
2017-08-09 14:20:17 +02:00
Ryan VanderMeulen 64905fbd5a Backed out changesets 19b8d672b55d and 2980183d98fb (bug 1362338) for hazard analysis failures. 2017-08-09 21:12:28 -04:00
Emilio Cobos Álvarez 300ebe9ee1 Bug 1362338: Make nsIAtom::AddRef and nsIAtom::Release final. r=froydnj
MozReview-Commit-ID: CFWcSNocGIm
2017-08-09 14:20:17 +02:00
Emilio Cobos Álvarez e99fdbe52e Bug 1362338: Take a bit from the atom's length to store a tristate. r=froydnj
MozReview-Commit-ID: Elu9EioSDXk
2017-08-09 14:19:30 +02:00
Henry Chang 55356f4f83 Bug 1355746 - Part 2. Polish IdleTaskRunner and reuse it for background parsing. r=smaug
This patch is mainly to make IdleTaskRunner reusable by nsHtml5TreeOpExecutor.
The only necessary work to that purpose is to remove the dependency of
sShuttingDown, which was a static variable in nsJSEnvironment.cpp.
The idea is to have a "MayStopProcessing" as a callback for the consumer to
return sShuttingDown.

In addition to sShuttingDown, we use std::function<bool()> as the runner
main callback type.

MozReview-Commit-ID: FT2X1unSvPS

--HG--
extra : rebase_source : 3fe2d4f597f53e9a90f3dc8d5009df04240534ba
extra : intermediate-source : 41f6715c344ce26f7820cecb2544db8c50dca796
extra : source : 042f10937305e34245bdaf75dcb816db7738254e
2017-07-12 09:23:15 +08:00
Nicholas Nethercote f941156987 Bug 1386600 - Change nsIStringBundle methods to return |AString| instead of |wstring|. r=emk,sr=dbaron.
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.

The patch also removes a couple of unused declarations from
nsIStringBundle.idl.

Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.

--HG--
extra : rebase_source : ac40bc31c2a4997f2db0bd5069cc008757a2df6d
2017-08-04 14:40:52 +10:00
Phil Ringnalda c5ab89e934 Backed out changeset 548ed79f2337 (bug 1053321) for strange and terribly-reported failures in Android opt mochitest-15 and debug mochitest-36
CLOSED TREE

MozReview-Commit-ID: IigWQ1wnxhZ

--HG--
extra : source : 70bd3854b6d034b67419ba11044b6cbe82b713bc
2017-08-01 23:13:42 -07:00
Honza Bambas f33b5cb515 Bug 1053321 - Correctly pass info about 'defer' and 'async' attributes to HTML5 parser invoked script preload. r=bkelly
--HG--
extra : histedit_source : 1743f499ca20d75df7e957fab1c942c4f4e22df8
2017-08-01 21:21:09 +02:00
Ryan VanderMeulen 1b497ab253 Backed out changeset 20344f0dbff9 (bug 1053321) for ESLint failures. 2017-08-01 16:14:01 -04:00
Honza Bambas d8659dd692 Bug 1053321 - Correctly pass info about 'defer' and 'async' attributes to HTML5 parser invoked script preload. r=bkelly 2017-08-01 12:43:00 -04:00
Sebastian Hengst 915c63c332 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-07-31 11:28:37 +02:00
Nicholas Nethercote 72c884bf74 Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
--HG--
extra : rebase_source : d317b25be2ec21d1a60d25da3689e46cdce0b649
2017-07-31 14:28:48 +10:00
Kyle Machulis d812ac4e87 Bug 1279218 - Additional applet tag logic removal; r=bz
I've been having problems with interdiffs on mozreview lately, so for
ease of review, this patch is being submitted as a seperate patch for
review. Once it is r+'d, it will be folded into the first patch in
this set before landing.

MozReview-Commit-ID: CS9MngaXlBd

--HG--
extra : rebase_source : 6a86fd4f7a66e73497a756976a2562d183002a2a
2017-07-28 16:44:39 -07:00
Bevis Tseng a7505864a8 Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm
--HG--
extra : rebase_source : 11319e568a51d16754a6a9990f76c35c86c2bda7
2017-07-26 16:13:35 +08:00