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

880 Коммитов

Автор SHA1 Сообщение Дата
Sebastian Hengst 044775ad49 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-10-11 00:01:28 +02:00
Kris Maglione 00e91e08fb Bug 1407258: Dowgrade document loads with expanded principals to their last sub-principal. r=bz
There are currently some corner cases where channels that are eventually
loaded into documents (mainly <img src="data:image/svg+xml,") can inherit
expanded principals from a caller. Since documents aren't allowed to have
expanded principals, this causes crashes.

This patch is a short term workaround for the issue, until we have a longer
term solution that prevents the channels from inheriting the expanded
principals to begin with.

MozReview-Commit-ID: JwqqtVynLjj

--HG--
extra : rebase_source : 23199517414428924e9c78629ac794b54bd23c52
2017-10-10 14:08:47 -07:00
evilpies@gmail.com 06beef32ba Bug 1305237 LoadInfo changes to include all ancestors principals and window IDs, r=bz,mystor
MozReview-Commit-ID: 1IMi5MqTx7o

--HG--
extra : rebase_source : 373f1928987718fe3bc22306e0dd3ae13fc0cd9f
2017-10-10 09:54:00 -07:00
Ehsan Akhgari 7df8d7beeb Bug 1406493 - Remove the rest of the attribute deprecation warnings; r=baku f=annevk 2017-10-09 18:26:11 -04:00
Jeremy Chen db85457d66 Bug 1403077 - implement the stylo blocklist mechanism. r=heycam
In this patch, we read the stylo blocklist into nsLayoutUtils's global static
variable during nsLayoutUtils::Initialize(). So, we can decide if we should
fallback to use Gecko backend while updating style backend for a document.

We add "layout.css.stylo-blocklist.blocked_domains" and
"layout.css.stylo-blocklist.enabled" to ContentPrefs.cpp because they are read
very early (during nsLayoutUtils::Initialize).

MozReview-Commit-ID: 8c4n6m9dYD8

--HG--
extra : rebase_source : ca81cd57980d98b9b73f18bb03a8035b161d23ef
2017-09-27 20:35:21 +08: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
Olli Pettay 478b3b1343 Bug 1405821 - Move microtask handling to CycleCollectedJSContext, r=baku 2017-10-05 18:34:12 +03:00
bechen@mozilla.com b6e091b3ea Bug 1324883 - Shutdow the decoder when receiving nsIWebProgressListener with flag LOAD_RELOAD_BYPASS_PROXY_AND_CACHE in docshell. r=jwwang,smaug
We register the nsIWebProgressListener at the root docshell(GetSameTypeRootTreeItem) to handle video element embedded in iframe.

MozReview-Commit-ID: D4CavLDAnKD

--HG--
extra : rebase_source : 93032297272bbfc8570dce0c8c13ea9f0d45f7a8
2017-10-03 12:07:09 +08:00
Emilio Cobos Álvarez c3d21f55ab Bug 1404897: Allow storing Servo selector lists in the document's selector cache. r=heycam
MozReview-Commit-ID: GtIWGN2zEGT

--HG--
extra : rebase_source : 90d4a61bcc65995ca8a130cd24582e4f20d52276
2017-10-02 15:32:07 +02:00
Sebastian Hengst 635c45113c Backed out changeset 9a8f77f3dfe7 (bug 1404897) 2017-10-04 12:55:16 +02:00
Emilio Cobos Álvarez dd2d07a12c Bug 1404897: Allow storing Servo selector lists in the document's selector cache. r=heycam
MozReview-Commit-ID: GtIWGN2zEGT

--HG--
extra : rebase_source : 42de988406724fd3dbb11134cb454bbfc927e3a6
2017-10-02 15:32:07 +02:00
Sebastian Hengst 82e62e8f75 Backed out changeset 2a7dd15c8206 (bug 1404897) 2017-10-04 11:24:31 +02:00
Emilio Cobos Álvarez 8fea520510 Bug 1404897: Allow storing Servo selector lists in the document's selector cache. r=heycam
MozReview-Commit-ID: GtIWGN2zEGT
2017-10-04 11:01:37 +02: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
Andrew McCreight f31f7f7cc6 Bug 1403377 - Destroy hash table iterator before modifying hash table. r=smaug
nsDOMAttributeMap::BlastSubtreeToPieces() uses a hash table iterator
to get an arbitrary element from a hash table. This marks the hash
table as being in use. It then modifies the hash table before the
iterator is destroyed, triggering an assertion. The fix is to restrict
the scope of the iterator so that it is destroyed before the hashtable
is modified.

The existing code is safe because the iterator is never used after the
hash table has been modified.

MozReview-Commit-ID: DUjqewvwEe7

--HG--
extra : rebase_source : 698046af75890c8f52ba15331115b9ff119c689a
2017-09-27 14:49:35 -07:00
Xidorn Quan c7f99e3c21 Bug 1402094 - Blacklist about:reader from using stylo. r=bholley
MozReview-Commit-ID: 6cG1x1tcOwn

--HG--
extra : rebase_source : 02525628845d1fa757af5044b3a3f3ddcb7c86a0
2017-09-28 16:19:45 +10:00
Sebastian Hengst bb227d88e0 Backed out changeset 8ce27eeef766 (bug 1402094) for bustage on Android: dom/base/nsDocument.cpp:13613: 'bool ShouldUseGeckoBackend(nsIURI*)' defined but not used. r=backout 2017-09-28 09:36:12 +02:00
Xidorn Quan 9ce0474398 Bug 1402094 - Blacklist about:reader from using stylo. r=bholley
MozReview-Commit-ID: 6cG1x1tcOwn

--HG--
extra : rebase_source : dce6a0b1828f8388952e5ff1993424dff782d3d5
2017-09-28 16:19:45 +10:00
Xidorn Quan 418bc0853e Bug 1403024 part 2 - Add more diagnosis information before crashing for adopting element across style backend. r=francois,heycam
MozReview-Commit-ID: LN40EefYqVJ

--HG--
extra : rebase_source : 86324cc839ebb7e231f58844c05d8334bcad87e1
2017-09-26 10:31:36 +10: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
Wes Kocher 47b3660c80 Merge m-c to inbound, a=merge
MozReview-Commit-ID: 8wTTCUkrY2i
2017-09-25 16:43:51 -07:00
Wes Kocher 7bf1b49628 Merge inbound to central, a=merge
MozReview-Commit-ID: 7EzhCCVVn7n
2017-09-25 16:41:34 -07:00
Jessica Jong 60f43f2bbd Bug 1392970 - Part 1: Make CustomElementDefinition ref-counted and put it in CustomElementData. r=smaug
MozReview-Commit-ID: DIQN3JFxkT8
2017-09-25 02:46:00 -04:00
John Dai ba9593ab8d Bug 1301024 - Part 3: Make the constructor created by document.registerElement() also set CustomElementData and invoke created callback. r=smaug 2017-09-25 01:34:00 -04:00
John Dai ca4066029e Bug 1301024 - Part 1: Set CreateElement/CreateElementNS is attribute. r=smaug 2017-09-25 01:33:00 -04:00
Nicholas Nethercote 3aa25724fe Bug 1402255 - Change nsIBaseWindow::title from wstring to AString. r=janv.
Because nsAString is nicer to work with than char16_t*. The patch relatedly
changes nsIEmbeddingSiteWindow::title and nsIWindowMediator::updateWindowTitle
as well.

--HG--
extra : rebase_source : 0bf332dec3e09af6c39c676f8795b368768a6046
2017-09-25 13:10:51 +10: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
Kris Maglione f37317cad0 Bug 1369533: Return dead wrappers rather than null for dead CallbackObject values. r=bz
We don't have access to an appropriate context to create the dead wrapper in
when the callback is nuked, so instead, this patch creates a new dead wrapper
in the caller compartment each time the property is accessed. This is the same
behavior we'd get when trying to re-wrap a cross-compartment dead wrapper, so
it's consistent with the way we handle these situations elsewhere.

MozReview-Commit-ID: 3cMeR4z8EOe

--HG--
extra : rebase_source : 7e8cf4a195ef64deb7677ce4ac9818d342815667
2017-09-04 17:21:06 -07:00
Kris Maglione 0c3a1b9b7e Bug 1379148: Part 1 - Allow blocking only non-script-created parsers. r=hsivonen
MozReview-Commit-ID: 8cGxywiUzWj

--HG--
extra : rebase_source : b684a4a7d00c141a3def4f1cde9d7463c12baa4b
2017-09-20 16:12:27 -07:00
Kershaw Chang 53cf0a2a8e Bug 1247843 - Part 3: Set request context ID to the http channel created in imgLoader::LoadImage. r=baku
In order to let necko postpone the load of favicon, we have to set request context ID to the http channel that is created to load favicon.
This patch starts with passing a request context ID to nsContentUtils::LoadImage and makes other necessary changes to set the request context ID to the channel.
2017-09-20 20:09:00 -04:00
Xidorn Quan e040c67e4d Bug 1401792 - Release assert when adopting element with style data across style backend. r=bholley
MozReview-Commit-ID: 6D6bvSJHEcS

--HG--
extra : source : 04d359e0ef0552ab61987427147265c229d80069
2017-09-21 14:41:21 +10:00
Xidorn Quan 6905267b28 Bug 1400540 - Decide style backend type based on principal. r=bholley
MozReview-Commit-ID: A4y9Shdbr7g

--HG--
extra : source : cdfe5e5e059273a1c7fc6506d6e0fecb2bb7affb
2017-09-20 08:26:53 +10:00
Boris Zbarsky e3883c1255 Bug 1400501. Store a list of ancestor principals on docshell and document. r=mystor
Right now every document in a docshell makes a copy of the list.  In practice,
this list is usually pretty short (limited by depth of iframe nesting), so this
is probably not a problem.  We could add a bit of complexity and have a
refcounted struct that contains the list... I wish we had something as simple
as Rust's Arc that we could use here.

MozReview-Commit-ID: 8jGIlkhp1DU
2017-09-18 21:24:38 -04:00
Masatoshi Kimura f7995f942e Bug 1400207 - Remove nsIDocument::AddCharSetObserver. r=hsivonen
MozReview-Commit-ID: 7uWDQvyz4yC

--HG--
extra : rebase_source : c8955e6b090d9084938c290f096b41b9090ec71c
2017-09-14 23:19:22 +09:00
Bobby Holley 6b2dbc2b82 Bug 1398983 - Remove warning about assuming gecko style system. r=me
MozReview-Commit-ID: BCeG81uxLvS
2017-09-15 12:27:13 -07: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
Boris Zbarsky 5451f626bd Bug 1393806 part 2. Remove the XPCOM version of Document.adoptNode/importNode. r=peterv
These don't play nice with ErrorResult error propagation, and don't really have a reason to exist anyway.

MozReview-Commit-ID: DlEs19LA4dT
2017-09-13 13:34:55 -04:00
Boris Zbarsky f23f66c56c Bug 1393806 part 1. Change nsNodeUtils cloning/adopting stuff to use an ErrorResult for errors. r=peterv
This will allow us to propagate out more informative errors in some cases.

MozReview-Commit-ID: 9FbzV5VRMqN
2017-09-13 13:34:55 -04:00
Masayuki Nakano 4ce89d8f61 Bug 1369072 - part3: nsXBLPrototypeHandler::DispatchXBLCommand() should use controller of visible window r=smaug
With previous change, KeyboardEvent is dispatched even when invisible window
has focus.  However, nsRootWindow::GetControllerForCommand() returns controller
for focused window even when the window is invisible because it uses
nsFocusManager::GetFocusedDescendant() to retrieve focused window.

Perhaps, we can assume that users won't expect to do something with invisible
window when they type some keys.  Then, nsRootWindow::GetControllerForCommand()
should return controller for visible ancestor window if focused window is
invisible.

This patch makes nsFocusManager::GetFocusedDescendant() can return only visible
descendants.  However, it already has a bool argument.  Therefore, it should
have a flag instead of adding new flag.  Most changes of this patch is replacing
its callers.

Then, nsRootWindow::GetControllerForCommand() and nsRootWindow::GetControllers()
should have a bool flag if it should return controller(s) for visible window.
This patch adds a bool flag for it.  Fortunately, the interface isn't scriptable.

Finally, this patch makes nsXBLPrototypeHandler::DispatchXBLCommand() and
EventStateManager::DoContentCommandEvent() retrieve controller for visible
window since they are always handles user input.

MozReview-Commit-ID: GygttTHuKRm

--HG--
extra : rebase_source : 1341273c4606298cb9b890b9312d9f5c8a75d144
2017-09-07 22:54:49 +09:00
Christoph Kerschbaumer d43805d4f6 Bug 1396320: Fix CSP sandbox regression for allow-scripts. r=dveditz 2017-09-07 09:11:38 +02:00
Nicholas Nethercote 5bd03193bd Bug 1397579 - Report stylesheet memory usage under "layout/style-sheets". r=heycam.
Currently it's not under "layout/", for no clear reason.
2017-09-07 14:36:42 +10:00
Kris Maglione b3ba0520ee Bug 1396449: Part 1 - Use WebExtensionPolicy objects in extension content principals. r=krizsa
Going through the extension policy service rather than using
WebExtensionPolicy objects directly adds a lot of unnecessary overhead to
common operations on extension principals, and also makes the code more
complicated than it needs to be.

We also use weak references to policy objects here, since principals should
ideally lose as much of their elevated privileges as possible once the
extension instance that created them has been destroyed (which is something we
couldn't handle easily when we simply tracked ID strings).

MozReview-Commit-ID: KDNvVdvLkIt

--HG--
extra : rebase_source : 1b567919d2461bd0315d1a7d89f330cbd585f579
2017-09-05 11:04:43 -07:00
Tobias Schneider 176f75888a Bug 1394522 - Null check ref pointers when iterating over intersection observers. r=smaug
--HG--
extra : rebase_source : b6f8ea28c33edfe71e00caed520c2af6ef51cc82
2017-09-05 09:32:35 -07:00
Thomas Nguyen 1f57fdb85d Bug 1345058 - Asynchronously decide if a flash document should be blocked. r=baku
MozReview-Commit-ID: K91cSvIdOrb

--HG--
extra : rebase_source : 4d91ab3499c0124129e74a054c5cc78882ff351e
2017-08-14 14:05:23 +08:00
Sebastian Hengst 4d0bad92dd merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: Gsw48p934sI
2017-09-02 10:54:44 +02: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
Catalin Badea 516b5546f4 Bug 1395945 - Remove child array getter. r=ehsan 2017-09-01 22:13:49 +01:00
Honza Bambas 4263c50db2 Bug 1358060 - Allow postponing of unimportant resources opening during page load, class-of-service Tail flag. r=dragana
--HG--
extra : rebase_source : 1ab691fe066e641c948aa5f42827305411579708
2017-08-30 09:32:00 -04:00
Bobby Holley a4efa141db Bug 1390951 - Assert harder against stylesheet type mismatches. r=xidorn
MozReview-Commit-ID: 1oB7FDxAZFt
2017-08-29 16:27:28 -07:00
Bobby Holley 1ffe80adee Bug 1390951 - Use the same style backend when cloning documents. r=xidorn
MozReview-Commit-ID: F6HMAsSsNDa
2017-08-29 16:27:21 -07:00