Commit Graph

1272 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
4eb7125f65 Bug 1404897: Allow storing Servo selector lists in the document's selector cache. r=heycam
MozReview-Commit-ID: GtIWGN2zEGT
2017-10-02 15:32:07 +02:00
Sebastian Hengst
beaa0bcc04 Backed out changeset 9a8f77f3dfe7 (bug 1404897) 2017-10-04 12:55:16 +02:00
Emilio Cobos Álvarez
d20cef0457 Bug 1404897: Allow storing Servo selector lists in the document's selector cache. r=heycam
MozReview-Commit-ID: GtIWGN2zEGT
2017-10-02 15:32:07 +02:00
Sebastian Hengst
9666d869f0 Backed out changeset 2a7dd15c8206 (bug 1404897) 2017-10-04 11:24:31 +02:00
Emilio Cobos Álvarez
76cb832917 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
fc6ab5f0ea Bug 651120 - Remove index argument from content removed/appended/inserted notifications. r=peterv 2017-10-03 11:09:08 +01:00
Andrew McCreight
5db26cbc05 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
2017-09-27 14:49:35 -07:00
Xidorn Quan
227f82df4e Bug 1402094 - Blacklist about:reader from using stylo. r=bholley
MozReview-Commit-ID: 6cG1x1tcOwn
2017-09-28 16:19:45 +10:00
Sebastian Hengst
fc6be8dbb0 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
521e986263 Bug 1402094 - Blacklist about:reader from using stylo. r=bholley
MozReview-Commit-ID: 6cG1x1tcOwn
2017-09-28 16:19:45 +10:00
Xidorn Quan
a8d278f314 Bug 1403024 part 2 - Add more diagnosis information before crashing for adopting element across style backend. r=francois,heycam
MozReview-Commit-ID: LN40EefYqVJ
2017-09-26 10:31:36 +10:00
Nicholas Nethercote
9fda5528d2 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
2017-09-26 08:33:21 +10:00
Wes Kocher
9fa37a57e3 Merge m-c to inbound, a=merge
MozReview-Commit-ID: 8wTTCUkrY2i
2017-09-25 16:43:51 -07:00
Wes Kocher
8d855f04ce Merge inbound to central, a=merge
MozReview-Commit-ID: 7EzhCCVVn7n
2017-09-25 16:41:34 -07:00
Jessica Jong
f9802d797f 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
413a0296f6 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
243ff04fb6 Bug 1301024 - Part 1: Set CreateElement/CreateElementNS is attribute. r=smaug 2017-09-25 01:33:00 -04:00
Nicholas Nethercote
d161939aec 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.
2017-09-25 13:10:51 +10:00
Nicholas Nethercote
e8236888ee 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.
2017-09-22 14:35:46 +10:00
Kris Maglione
1721ba5bed 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
2017-09-04 17:21:06 -07:00
Kris Maglione
2d8a9e2f4d Bug 1379148: Part 1 - Allow blocking only non-script-created parsers. r=hsivonen
MozReview-Commit-ID: 8cGxywiUzWj
2017-09-20 16:12:27 -07:00
Kershaw Chang
c4c64cf6ee 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
d14bc1465f Bug 1401792 - Release assert when adopting element with style data across style backend. r=bholley
MozReview-Commit-ID: 6D6bvSJHEcS
2017-09-21 14:41:21 +10:00
Xidorn Quan
741a218966 Bug 1400540 - Decide style backend type based on principal. r=bholley
MozReview-Commit-ID: A4y9Shdbr7g
2017-09-20 08:26:53 +10:00
Boris Zbarsky
ee1cd9b875 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
a4c148bf75 Bug 1400207 - Remove nsIDocument::AddCharSetObserver. r=hsivonen
MozReview-Commit-ID: 7uWDQvyz4yC
2017-09-14 23:19:22 +09:00
Bobby Holley
62368dbfd5 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
038eda3f17 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.
2017-09-05 20:19:06 +10:00
Boris Zbarsky
96a4710bc1 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
945af2d388 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
87466056af 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
2017-09-07 22:54:49 +09:00
Christoph Kerschbaumer
0d41a554cd Bug 1396320: Fix CSP sandbox regression for allow-scripts. r=dveditz 2017-09-07 09:11:38 +02:00
Nicholas Nethercote
231e7604e6 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
23f86a0885 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
2017-09-05 11:04:43 -07:00
Tobias Schneider
8150f3c5c2 Bug 1394522 - Null check ref pointers when iterating over intersection observers. r=smaug 2017-09-05 09:32:35 -07:00
Thomas Nguyen
25da99d8f4 Bug 1345058 - Asynchronously decide if a flash document should be blocked. r=baku
MozReview-Commit-ID: K91cSvIdOrb
2017-08-14 14:05:23 +08:00
Sebastian Hengst
150f2fb7bc merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: Gsw48p934sI
2017-09-02 10:54:44 +02:00
Henri Sivonen
e1503a6db8 Bug 1354989 - Avoid pivoting via UTF-16 when loading CSS in the Stylo mode. r=jdm,SimonSapin
MozReview-Commit-ID: Llt29dvB4Io
2017-08-29 16:01:42 +03:00
Catalin Badea
f8860e73dc Bug 1395945 - Remove child array getter. r=ehsan 2017-09-01 22:13:49 +01:00
Honza Bambas
559460ce73 Bug 1358060 - Allow postponing of unimportant resources opening during page load, class-of-service Tail flag. r=dragana 2017-08-30 09:32:00 -04:00
Bobby Holley
2f47b35bfa Bug 1390951 - Assert harder against stylesheet type mismatches. r=xidorn
MozReview-Commit-ID: 1oB7FDxAZFt
2017-08-29 16:27:28 -07:00
Bobby Holley
e42ecf85be Bug 1390951 - Use the same style backend when cloning documents. r=xidorn
MozReview-Commit-ID: F6HMAsSsNDa
2017-08-29 16:27:21 -07:00
Ehsan Akhgari
2caa573021 Bug 1392892 - Avoid creating a live nsContentList in nsDocument::GetTitleElement(); r=smaug 2017-08-29 07:33:21 -04:00
Alphan Chen
52631dd654 Bug 1380323 - Revise the behavior of scrolling to fragments. r=ehsan 2017-08-22 16:14:51 +08:00
Wes Kocher
7d6cb9f00c Merge inbound to central, a=merge
MozReview-Commit-ID: 3N9jinnrmjb
2017-08-25 16:21:57 -07:00
Wei-Cheng Pan
6562261154 Bug 1387625 - Fix TIME_TO_DOM_LOADING_MS record timing. r=smaug
nsDocument::mTiming can be nullptr when the document is still loading, so we
should not record ready state probes in nsDOMNavigationTiming.

Also stops recording probes from parent process because we only need data from
real web contents.

MozReview-Commit-ID: 8XUHC8yKobO
2017-08-23 11:09:24 +08:00
Nicholas Nethercote
39c39dd5f2 Bug 1393636 (part 3) - Pass nsWindowSizes to more AddSizeOf*() functions. r=heycam.
This is a purely non-functional plumbing change. Instead of passing a
SizeOfState and an nsStyleSizes a bunch of places, we pass an nsWindowSizes,
which contains both of them.

This is a necessary precursor for the next patch.

MozReview-Commit-ID: Ek03wDM50rB
2017-08-25 14:47:54 +10:00
Yoshi Huang
24a09e3edd 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
Yoshi Huang
49ea89631a Bug 1373780 - Part 2: remove calling nsContentUtils::CanLoadImage(). r=jdm
As we already do security check in asyncOpen2 in bug 1206961, also
we've removed calling nsContentUtils::CanLoadImage() in bug 1267075, so
here we do the same thing for nsDocument.
2017-08-24 18:10:47 +08:00
Bobby Holley
cb7ab9b1ae Bug 1383332 - Track the restyle root and use it to do less work during the traversal. r=emilio
MozReview-Commit-ID: A8O3JOpsv4E
2017-08-22 21:19:24 -07:00