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

13655 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione 13e61f79f9 Bug 1391405: Part 5 - Add helper for retrieving the enumerable value properties of a cross-compartment object. r=gabor,qdot
As part of the normalization process for WebExtension API calls, we need to
extract and validate the full set of value properties (including properties
X-rays would normally deny access to) from cross-compartment objects. This
currently involves waiving X-rays, enumerating property descriptors, and
unwaiving X-rays - all through X-ray wrappers and waivers - and generating a
lot of expensive and short-lived wrappers in-between.

This helper reads out the list of safe properties from within the object's
compartment, and then copies them over to an object in the target compartment,
without any X-ray overhead, or any unnecessary intermediate wrappers or
compartment switches. It cuts about 40% off the overhead of our normalization
code.

MozReview-Commit-ID: H582oAYocaX

--HG--
extra : rebase_source : 7f7d5df605bc6544cb7f1c0c7e224d81b211e09c
extra : histedit_source : f980a03413b5e65fc6fa272c012a769d2764d89b
2017-08-24 13:33:40 -07:00
Kris Maglione 85754fb12a Bug 1391405: Part 1 - Add WebIDL versions of much used Components.utils helpers. r=gabor,qdot
In the code that I'm profiling, the XPC WrappedNative overhead of calling
these functions adds up to about a quarter of the time spent executing the
code. The overhead of the WebIDL versions is negligible.

MozReview-Commit-ID: 30qJy5RtP9d

--HG--
extra : rebase_source : 4fe73f4b9bde052a0eadf7d5634f792e16ca1c94
extra : histedit_source : ec61152a0181f3b0e28023c951e7181c43216d2f
2017-08-18 11:10:10 -07:00
Olli Pettay 045eeefaaa Bug 1390402, add a faster variant of TextEditor::GetDocumentIsEmpty(), r=masayuki
--HG--
extra : rebase_source : 3238aec96be5b0393c395ce8cce9a0489d2e671d
2017-08-24 13:53:34 +03: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
Yoshi Huang e63d45332e 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
Benjamin Bouvier e8f41447d2 Bug 1391633: Integrate use counters in the JavaScript engine; r=jonco, r=froydnj, data-review=francois
MozReview-Commit-ID: 1KOo0Zz0ccG

--HG--
extra : rebase_source : 1bdd89205a3d96f6d8314fc0cf08423b5c141cb6
extra : histedit_source : a000151b02c6423c967a72054b22679b08e25df9
2017-08-18 15:48:49 +02:00
Andreas Farre c38df01a71 Bug 1391602 - Clamp execution budget to a minimum value. r=bkelly 2017-08-24 10:35:45 +02:00
Kris Maglione 90f1e3558c Bug 1391110: Part 3 - Add nsIWebBrowserPersistable to FrameLoader bindings. r=smaug
MozReview-Commit-ID: 8mBNbgmrXBV

--HG--
extra : rebase_source : d553bca30c3fa4affc9e6ee9e65e5b4000e0cac2
2017-08-19 14:16:16 -07:00
Kris Maglione 68a883f00b Bug 1391110: Part 2 - Reparent FrameLoader wrapper when owner content changes. r=smaug
We allow swapping frameloaders between unrelated documents, so we need to
reparent wrappers when the owner content changes.

MozReview-Commit-ID: LNIf4ZrCZLo

--HG--
extra : rebase_source : 8041d1601962d61e675e78e3447c7772eee89df0
2017-08-19 13:03:59 -07:00
Kris Maglione 470160f420 Bug 1391110: Part 1 - Convert FrameLoader bindings to WebIDL. r=smaug
XPConnect wrapper overhead for this interface has been showing up heavily in a
lot of my profiles, in some places accounting for 50ms of the 80ms we spend
getting getting <browser> messageManagers. This improves the situation
considerably.

MozReview-Commit-ID: 9d1hCORxsYG

--HG--
rename : dom/base/nsIFrameLoader.idl => dom/webidl/FrameLoader.webidl
extra : rebase_source : d8a1fc1a19632ba36a9fc6f63873f7534671a13b
2017-08-19 00:55:00 -07: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
Nicholas Nethercote 4b042e431f Bug 1390428 (part 7) - Remove a tricky nsXPIDLCString variable. r=erahm.
The existing comment was very helpful here.

--HG--
extra : rebase_source : c120df1e06051286e5ecfd765a1098d86c036622
2017-08-17 14:23:39 +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
Sebastian Hengst 59fe8429ad merge mozilla-central to mozilla-inbound. r=merge a=merge on a CLOSED TREE 2017-08-23 16:32:39 +02:00
Sebastian Hengst 99e5cb9c14 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: GSKVB94r7Kk
2017-08-23 16:29:51 +02:00
John Dai b50868f89a Bug 1392790 - Avoid doing [CEReactions] if custom element preference is disabled. r=smaug 2017-08-23 02:36:00 -04:00
Makoto Kato fa46fdd1ad Bug 1348073 - Part 1. MoveCaret should move caret when focus node is whitespace only even if it is no frame. r=jfkthame
When enabling lazy frame construction, whitespace only node might not have frame.  So editor/libeditor/tests/test_bug1315065.html is failure because nsFrameSelection::MoveCaret returns error since focus node is whitespace only node that has no frame.

So if focus node is whitespace only, we should promote to parent to get primary frame then try again.

MozReview-Commit-ID: K83T2LP3Pc5

--HG--
extra : rebase_source : 707584424e83574dd3151e12a915473f676ce5a0
2017-08-23 19:09:07 +09:00
Emilio Cobos Álvarez 1e6e97fed1 Bug 1389743: Only reconstruct frames synchronously from ContentRemoved when called from frame construction. r=mats
There's only one case of sync frame construction from ContentRemoved now, and
it's not on the element being removed, but on the whitespace siblings if needed,
and _only_ when they don't support lazy frame construction.

Basically, this switches all the RecreateFramesForContent calls to use
`aAsyncInsert` (which I changed to an enum class for readability), except when
we're already reframing.

Also, it switches ReframeTextIfNeeded to opt-in into lazy frame construction,
since it's used only when aFlags == CONTENT_REMOVED.

This allows to simplify the DestroyFramesFor API (which I'm happy to rename to
something more meaningful, since now it's something like
DestroyFramesForAndRecreateThemAsync), and do some other consistency cleanups.

A bunch of the ContentRemoved callsites were pretty random at passing
aAsyncInsert, and that was some kind of a mess. This patch ensures consistency,
and makes it impossible to do O(n^2) work when removing DOM nodes, which is
nice.

The underlying reason for this is explained in the description of bug 1377848,
and basically allows us to remove a bunch of Servo hacks on the longer term (a
few of them are going away already, yay!).

MozReview-Commit-ID: 2DrUTxGV8RX

--HG--
extra : rebase_source : f428d839a5482477dea22c0fea600d54f3e8799c
2017-08-23 09:58:57 +02:00
Bobby Holley 7210bd7226 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
Xidorn Quan dd29c6636a Bug 1370779 - Bump version of cssparser.
MozReview-Commit-ID: Atb37wr8iMA
2017-08-23 13:04:03 +10:00
Wes Kocher 6dd42e2664 Merge inbound to central, a=merge
MozReview-Commit-ID: BMWuqvmTljV
2017-08-22 17:07:23 -07:00
Honza Bambas 51907c6b32 Bug 1388448 - Logs for better network requests and context tracking. r=mcmanus 2017-08-17 12:16:00 -04:00
Stone Shih 2c638fc04f Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
MozReview-Commit-ID: 3a2TNVqguVb
2017-07-28 15:14:54 +08:00
Bevis Tseng 09f48a33cf Bug 1392195 - Label PContentPermissionRequest actor. r=billm
--HG--
extra : rebase_source : 0ae882125c89bf44ccce29eb6930b119584247b0
2017-08-21 17:06:05 +08:00
btian 0610efa5fc Bug 1384661 - Part 3: Invalidate cached child array when list of children changes. r=smaug 2017-08-18 11:56:38 +08:00
btian 2683456670 Bug 1384661 - Part 2: Add class nsParentNodeChildContentList. r=smaug 2017-08-21 16:11:56 +08:00
btian 05a1fd9f6a Bug 1384661 - Part 1: Rename class nsChildContentList to nsAttrChildContentList. r=smaug 2017-08-11 10:12:17 +08:00
Wes Kocher 168eaceb20 Merge m-c to inbound, a=merge
MozReview-Commit-ID: IHPBV4z9vPi
2017-08-22 17:14:32 -07:00
Ehsan Akhgari 67ac6e84f7 Bug 1385530 - Avoid addrefing the presshell in Selection::ScrollIntoView() for the asynchronous scrolling case; r=mats 2017-08-22 19:33:13 -04:00
Masayuki Nakano 2eff2ba40d Bug 1392181 - part1: nsTextFragment::SetTo() shouldn't use CheckedInt r=smaug
nsTextFragment::SetTo() may be hot path of performance test but it needs to be
careful for computing allocation size.  However, nsTextFragment uses uint32_t
with only 29 bits to store its text length and using CheckedInt sometimes causes
appearing CheckedInt in profile.  So, using CheckedInt in it doesn't make sense
(and also wrong).

This patch defines NS_MAX_TEXT_FRAGMENT_LENGTH and make SetTo() check the length
of new text by itself.

MozReview-Commit-ID: 5zHtU1Kk6X2

--HG--
extra : rebase_source : e9aecc6b721bb5211ccc1194e027343ef090e2c2
2017-08-21 17:23:41 +09:00
Aryeh Gregor b7375b6f60 Bug 834209 - Return HTMLCollection from HTMLDocument named getter; r=bkelly
The spec says HTMLCollection, and this appears to be what all other
browsers do.

https://html.spec.whatwg.org/#dom-window-nameditem
https://html.spec.whatwg.org/#dom-document-nameditem

MozReview-Commit-ID: 87aABNaQmiz

--HG--
extra : rebase_source : dfc6e445fd00d718632464357727be378da41e6c
2017-08-20 17:20:24 +03:00
Nicholas Nethercote ac72ddb583 Bug 1390760 - Measure ServoComputedData::visited_style. r=bholley.
For the Obama wikipedia page, this covers about 85% of the unmeasured
ComputedValues structs. The about:memory output looks like this:

> +---2,443,648 B (02.41%) -- computed-values
> |   +--1,088,272 B (01.07%) -- dom
> |   +----945,744 B (00.93%) -- non-dom
> |   +----409,632 B (00.40%) -- visited

I'm not sure why some CVs are still being missed.

MozReview-Commit-ID: 1bYWwSi4ihn

--HG--
extra : rebase_source : 14e4bd36a54bbbd8fd265f559704bec5a5e3b154
2017-08-21 16:07:16 +10:00
Nicholas Nethercote 8a72cf2251 Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm.
--HG--
extra : rebase_source : 69d58b0cfb56efc6b03d8e2d7be2ce3c3e6cd843
2017-08-21 20:01:27 +10:00
Olli Pettay 6e1dc494d2 Bug 1391423, add a nursery for purple buffer to allow faster addref/release on the main thread, r=mccr8
--HG--
extra : rebase_source : 4dcb8af2d3f2518ab0fd00b65fbf1d0096d8e810
2017-08-22 00:01:47 +03:00
Gabor Krizsanits 60d53ef3a0 Bug 1391363 - This test should be only disabled for non-e10s. r=me 2017-08-18 12:25:58 +02:00
Sebastian Hengst 02a34cdd40 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-08-21 13:43:53 +02:00
Stone Shih 7646d41f1d Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
MozReview-Commit-ID: 6jwQxxNIC2n
2017-08-11 14:58:08 +08:00
Shawn Huang cba2d8bb55 Backed out changeset 40b781f6504c (bug 1345457) for breaking xhr test case r=backout 2017-08-21 16:32:00 +08:00
Masayuki Nakano a7240d8532 Bug 1391538 - nsTextFragment for text nodes in <input> or <textarea> shouldn't store text as single byte characters even if all characters are less than U+0100 r=smaug
nsTextFrame stores text as single byte character array if all characters are
less than U+0100.  Although, this saves footprint, but retrieving and modifying
text needs converting cost.  Therefore, if it's created for a text node in
<input> or <textarea>, it should store text as char16_t array.

MozReview-Commit-ID: 9Z82rketT7g

--HG--
extra : rebase_source : 59f59ac1488c21a57d95d253cc794a011d672c95
2017-08-18 16:05:16 +09:00
Wes Kocher c043502159 Merge m-c to autoland, a=merge
MozReview-Commit-ID: 7sFZmPUXSx6
2017-08-18 17:21:29 -07:00
Wes Kocher b1fc5e008c Merge inbound to central, a=merge
MozReview-Commit-ID: 4cWGBbMEU2x
2017-08-18 15:53:07 -07:00
Wes Kocher c1383cebf3 Merge m-c to autoland, a=merge
MozReview-Commit-ID: KLrOCT1a7El
2017-08-17 16:23:45 -07:00
Joel Maher a4e30a204e Bug 1391371 - turn on non-e10s tests for windows7-debug. r=ahal
MozReview-Commit-ID: 9CzUf6Omk38
2017-08-17 15:46:03 -04:00
Chris Pearce fcd4613526 Bug 1390748 - Pre-declare MediaDecoder in HTMLMediaElement. r=jwwang
I noticed that touching MediaDecoder rebuilds a lot of seemingly unrelated
code. This is because HTMLMediaElement includes MediaDecoder.h, and
HTMLMediaElement is included in a number of places. Having HTMLMediaElement.h
predeclare rather than include fixes it.

MozReview-Commit-ID: I0vrPgqvvge

--HG--
extra : rebase_source : 505f9dce979aad0529b07d2c046dca5028af6de6
2017-08-15 17:09:06 +12:00
Paul Bone e576261a1f Bug 1386660 - Part 4: Refactor pref code in nsJSEnvironment.cpp. r=jonco 2017-08-08 13:11:24 +10:00
Cameron McCormack c8564a9ea5 Bug 1388113 - Hold on to pseudo-element atoms longer. r=bholley
MozReview-Commit-ID: 98eW8VwVFPT

--HG--
extra : rebase_source : dc0b80d9cc693da3abe858ba52d691416332dee7
2017-08-17 14:37:32 -04:00
Carsten "Tomcat" Book 99aa3f8e70 Merge mozilla-central to mozilla-inbound 2017-08-17 13:13:10 +02:00
Nicholas Nethercote 025461bde7 Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is only used in ways that nsCStrings can also be used
(i.e. no null checks or implicit conversions to |char*|).

In every case the patch trivially replaces the nsXPIDLCString with an
nsCString. (Also, there are a couple of unused nsXPIDLCString variables that
the patch simply removes.)
2017-08-16 13:58:35 +10:00
Carsten "Tomcat" Book 2b8080e2fc Backed out changeset 4a31e4302e03 (bug 1390748)
--HG--
extra : rebase_source : 9571466ebc151a9788a380008c5d8941e3e24665
2017-08-17 08:35:30 +02:00
Chris Pearce 60751f0b79 Bug 1390748 - Pre-declare MediaDecoder in HTMLMediaElement. r=jwwang
I noticed that touching MediaDecoder rebuilds a lot of seemingly unrelated
code. This is because HTMLMediaElement includes MediaDecoder.h, and
HTMLMediaElement is included in a number of places. Having HTMLMediaElement.h
predeclare rather than include fixes it.

MozReview-Commit-ID: I0vrPgqvvge

--HG--
extra : rebase_source : 505f9dce979aad0529b07d2c046dca5028af6de6
2017-08-15 17:09:06 +12:00