Commit Graph

742 Commits

Author SHA1 Message Date
Mats Palmgren
4339227f60 Bug 1370654 - Use mPendingLoads.GetOrInsert() to avoid a second hashtable lookup for Put(). Remove a redundant Get() before Remove(). r=froydnj
MozReview-Commit-ID: 36rxXpEwKcB
2017-06-08 12:48:32 +02:00
Christoph Kerschbaumer
e76e8e5e6a Bug 1024557 - Ignore x-frame-options if CSP with frame-ancestors exists. r=smaug 2017-06-07 21:17:49 +02:00
Brad Werth
6e1c9dec3d Bug 1369903 Part 1: Remove over-specified stylesheet calls in nsDocument. r=emilio
MozReview-Commit-ID: 6YHC0vvvrtn
2017-06-05 08:49:21 -07:00
Christoph Kerschbaumer
dafda3db17 Bug 1363975 - Have loadOneTab() provide the correct triggeringPrincipal. r=gijs,smaug 2017-05-31 20:59:02 +02:00
Jonathan Kew
116a1e3d84 Bug 1368654 - pt 1 - Implement memory reporter support for FrameProperties. r=mats 2017-05-31 19:52:47 +01:00
Carsten "Tomcat" Book
6b72a34215 Merge mozilla-central to autoland + + UPGRADE_NSS_RELEASE 2017-05-30 11:55:06 +02:00
Masayuki Nakano
61876e44c2 Bug 1367683 Optimize initializing nsRange r=smaug
nsRange::DoSetRange() adds/remove its root to/from mutation observer, initializes common ancestor, registers itself to the common ancestor, unregisters itself from old common ancestor, and notifies selection listeners of selection change.

However, those runtime cost is expensive but on the other hand, a lot of callers set both start and end of the range and that causes calling DoSetRange() twice.

This patch renames Set() to SetStartAndEnd() for easier to understand the meaning and make it call DoSetRange() only once.

MozReview-Commit-ID: FRV55tuBAgg
2017-05-30 13:18:25 +09:00
Ehsan Akhgari
bfc5e1dbb3 Bug 1361709 - Move FlushPendingLinkUpdatesFromRunnable to idle dispatch; r=smaug 2017-05-29 16:22:24 -04:00
Boris Zbarsky
f364d500c6 Bug 1364360 part 1. Make Element::GetScrollFrame follow the spec more closely in the quirks mode case. r=ehsan 2017-05-25 13:39:44 -04:00
Ting-Yu Lin
b8f0384e83 Bug 1363640 Part 2 - Move the logic in SupportsServoStyleBackend() to UpdateStyleBackendType(). r=heycam
SupportsServoStyleBackend() uses methods in nsIDocument, so it would be more
straightforward to do that in UpdateStyleBackendType().

Also, call StyloEnabled() before doing other logic so that the warning about
"no docshell" won't show up when stylo is built but disabled.

MozReview-Commit-ID: 9ZUYatPBv1r
2017-05-09 18:33:57 -07:00
Ting-Yu Lin
672280851d Bug 1363640 Part 1 - Move IsContentDocument() and IsTopLevelContentDocument() from nsDocument to nsIDocument. r=heycam
In this way, the callers who have nsIDocument don't need to cast to nsDocument.

MozReview-Commit-ID: 8zVUjkbrlaG
2017-05-09 18:28:36 -07:00
Bill McCloskey
4a7e0b4811 Bug 1365184 - Fix docgroup mismatch during cycle collection (r=smaug)
MozReview-Commit-ID: Ld68RGU6lmB
2017-05-23 12:04:31 -07:00
Sebastian Hengst
09a5305d26 Backed out changeset 44635c073692 (bug 1345058) on suspicion of causing intermittent xpcshell failures in toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js on OS X. r=backout 2017-05-19 13:13:18 +02:00
Henry Chang
53df2ddfd9 Bug 1345058 - Asynchronously decide if a flash document should be blocked. r=baku,bytesized
Technically speaking, we use the new async API 'nsIURIClassifier.asyncClassifyLocalWithTables'
to replace the old sync API. However, since we cannot guarantee the async call will be done when
we neet its result, we need a sync call as a fallback in this case. This is a sub-optimal
solution and we will be investigating if there's a better solution if the sync call
is used too frequently.

MozReview-Commit-ID: L1uQ2eaYr1e
2017-05-10 15:32:34 +08:00
Carsten "Tomcat" Book
ca52a53101 Backed out changeset 37d295d7eec9 (bug 1347791) 2017-05-17 08:11:07 +02:00
Alastor Wu
e20ed47b06 Bug 1347791 - part3 : move block/resume logic from back-end to front-end. r=baku,mikedeboer
Previous design allows us calling resume/block from both front-end and back-end,
it's not easy to know who called these operations.

So move all these logic to frond-end side, it's more clear than before.

One important thing is that we should block tab before loading the content.
If we block the tab after loading, the media might not be blocked because it had
already started (that is one situation I observed from test).

The value of block state would be stored in the outer window, before media want
to start, it would check this value to know whether it can start playing or not.

---

In addition, introduce new attribute "media-blocked".

The "media-blocked" attribute indicates that whether the tab is allowed to play autoplay media.
The "activemedia-blocked" attribute indicates whether the tab has blocked the autoplay media.

MozReview-Commit-ID: FnNh3zmItxo
2017-05-17 11:56:06 +08:00
Benjamin Smedberg
a69d5e3644 Bug 1335475 - Deny plugins from non-HTTP/HTTPS origins. r=bytesized,qdot
MozReview-Commit-ID: 3kPeycfMWVw
2017-03-07 09:34:03 -05:00
Daniel Holbert
b8f558366f Bug 1364180: In nsDocument::ResetToURI(), clear mCachedRootElement immediately after that element is removed. r=bz
Previously, we cleared mCachedRootElement a bit later -- after removing *all*
of the children and calling nsNodeUtils::ContentRemoved() and UnbindFromTree on
each of them.  This was problematic, because these cleanup functions can
involve calls to GetRootElement() -- and prior to this patch, any such
GetRootElement() calls would likely return the stale value in
mCachedRootElement.

Now, with this patch, we'll be clearing mCachedRootElement
sooner, so these GetRootElement() calls will return the correct current root
(which will likely be null in this case, since we're emptying the document of
children).

MozReview-Commit-ID: 8skGJyic1pC
2017-05-11 13:14:08 -07:00
Andrea Marchesini
b813058b9d Bug 1363429 - Get rid of nsIDOMLocation, r=bz, r=honza, f=ochameau 2017-05-11 07:26:08 +02:00
Iris Hsiao
68dd07eb3d Backed out changeset c56bd0d1e7c9 (bug 1363429) for build bustage, using-declaration causes a multiple declaration of 'nsIDocument::GetLocation' 2017-05-11 13:55:40 +08:00
Andrea Marchesini
c913bd427b Bug 1363429 - Get rid of nsIDOMLocation, r=bz, r=honza, f=ochameau 2017-05-11 07:26:08 +02:00
Andrea Marchesini
5af136db77 Bug 1363395 - nsGlobalWindow::GetLocation should support to be called on the outer window, r=smaug 2017-05-09 22:41:19 +02:00
Edgar Chen
f26c06473b Bug 1354013 - Creating customized built-in elements without relevant definitions registered first shouldn't throw NotFoundError; r=wchen
per spec change: https://github.com/w3c/webcomponents/issues/608

MozReview-Commit-ID: 3W4qTndQsP7
2017-04-06 17:00:41 +08:00
Andrea Marchesini
43341968d2 Bug 1362003 - nsGlobalWindow::GetLocation doesn't need to receive an ErrorResult param, r=bz
Renaming nsGlobalWindow::GetLocation() to Location().
2017-05-08 15:49:31 +02:00
Andrea Marchesini
80bc31371c Bug 1362119 - part 1 - Moving dom/base/Script{Loader,Element}.* in dom/script, r=ehsan
This patch does these things:

1. it moves nsScriptElement, nsScriptLoader, ScriptSettings, nsIScriptElement
   and nsIScriptLoaderObserver in dom/script
2. it renames nsScriptElement to mozilla::dom::ScriptElement
3. it renames nsScriptLaoder to mozilla::dom::ScriptLoader
2017-05-08 08:24:22 +02:00
Carsten "Tomcat" Book
c4daf63d34 Backed out changeset 5d77f6b14633 (bug 1362119) for android bustage in nsCCUncollectableMarker.cpp:500:7: error: 'TraceScriptHolder' is not a member of 'mozilla' 2017-05-08 09:54:38 +02:00
Andrea Marchesini
71aba8e0ee Bug 1362119 - part 1 - Moving dom/base/Script{Loader,Element}.* in dom/script, r=ehsan
This patch does these things:

1. it moves nsScriptElement, nsScriptLoader, ScriptSettings, nsIScriptElement
   and nsIScriptLoaderObserver in dom/script
2. it renames nsScriptElement to mozilla::dom::ScriptElement
3. it renames nsScriptLaoder to mozilla::dom::ScriptLoader
2017-05-08 08:24:22 +02:00
Wes Kocher
714b05616e Merge inbound to m-c a=merge
MozReview-Commit-ID: JgXkqrOwl3N
2017-05-03 13:40:24 -07:00
Andreas Farre
3b2975055b Bug 1355480 - Add telemetry for measuring timeout execution. r=smaug, data-r=bsmedberg
Measure execution time by adding telemetry probes for tracking
foreground, tracking background, non-tracking foreground and
non-tracking background timeouts.
2017-05-02 07:23:00 -04:00
Sebastian Hengst
6502d52b40 Backed out changeset 69439c0cd3e6 (bug 1355480) on suspicion of triggering assertion CompositorThreadHolder::IsInCompositorThread() on Windows 8 x64 M-e10s. r=backout 2017-05-02 23:41:44 +02:00
Andreas Farre
72cb52644f Bug 1355480 - Add telemetry for measuring timeout execution. r=smaug, data-r=bsmedberg
Measure execution time by adding telemetry probes for tracking
foreground, tracking background, non-tracking foreground and
non-tracking background timeouts.
2017-05-02 07:23:00 -04:00
Kirk Steuber
9386a2f3e1 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI
2017-04-20 12:57:48 -07:00
Daniel Holbert
90b2977b5a Bug 1361268: Clear nsIDocument::mCachedRootElement *before* removing from doc's child list, rather than *after* removing. r=bz
Internally, doRemoveChildAt does quite a bit of cleanup, and that includes some
calls to nsIDocument::GetRootElement().  Before this patch, those calls will
misleadingly return the still-present mCachedRootElement member-var.  We'd
really like those invocations to find an empty cached variable, and fall back
to checking the actual updated child list.

MozReview-Commit-ID: 8hhKcWyUVYQ
2017-05-02 16:08:02 -07:00
Aryeh Gregor
594c362b60 Bug 1251198 - Remove various obsolete events from document.createEvent r=smaug
Other browsers do not support any of these (IIRC), telemetry reports
essentially zero usage, and supporting them is contrary to the DOM spec.

Notes on specific events:

CommandEvent and SimpleGestureEvent: These are not supposed to be
web-exposed APIs, so I hid the interfaces from web content too
(necessary to avoid test_all_synthetic_events.html failures).

DataContainerEvent: This was a non-standard substitute for CustomEvent
that seemed to have only one user, so I removed it entirely and switched
the user (MozillaFileLogger.js) to CustomEvent.

ScrollAreaEvent: This is entirely non-standard, but we apparently expose
it deliberately to web content, so I didn't see any reason to remove it
from createEvent.

SimpleGestureEvent and XULCommandEvent: Can still be created from
createEvent(), but not by content.

TimeEvent: This is still in because it has no constructor, so there's no
other way to create it.  Ideally we'd update the SMIL spec to add a
constructor.  I did remove TimeEvents.

MozReview-Commit-ID: 7Yi2oCl9SM2
2017-04-20 15:45:37 +03:00
Sumit Tiwari
4a179064e0 Fix for bug 1142497 - change mDOMMediaQueryLists to use mozilla::LinkedList;r=erahm
MozReview-Commit-ID: G9RtgdYudqA
2017-04-06 20:45:16 -04:00
Boris Zbarsky
7da2837ca0 Bug 1356498 followup: fix compiler bustage. 2017-04-18 21:26:43 -04:00
Boris Zbarsky
81120d1e38 Bug 1356498. Change nsDocument's unlink to unbind/remove its kids the same way other places (including FragmentOrElement's unlink) do. r=mystor
This prevents us from trying to re-set the base URI to the href of a <base> element that's being unlinked.
2017-04-18 20:56:45 -04:00
John Dai
107dac4471 Bug 1309147 - Part 4: Add CEReactions for CustomElementRegistry. r=bz
MozReview-Commit-ID: ID2TIL9C47R
2017-03-30 18:58:48 +08:00
Olli Pettay
1a7d96f92a Bug 1355540, use SegmentedVector for pending links to avoid slow hashtable lookups in hot codepaths, r=bz 2017-04-15 18:55:05 +03:00
Sebastian Hengst
c609a620b6 merge mozilla-central to autoland. r=merge a=merge 2017-04-14 17:22:00 +02:00
Iris Hsiao
98dbf05642 merge autoland to mozilla-central a=merge 2017-04-14 17:09:58 +08:00
Olli Pettay
8867fcc4c4 Bug 1355787, nsIdentifierMapEntry should let one to use either strings or atoms as keys to avoid slow string assignments when possible. r=nfroyd 2017-04-13 22:12:20 +03:00
Brad Werth
d8233b3df7 Bug 1341721 Part 4: Re-enable reftest 360746, and remove the assert saying that alternate sheets are not supported. r=heycam
MozReview-Commit-ID: GuKebiq3zAJ
2017-04-13 13:01:24 +08:00
Andrea Marchesini
5029e7e133 Bug 1354441 - Update MediaQueryList to the latest version of the spec, r=jwatt 2017-04-10 16:29:06 +02:00
Ehsan Akhgari
4e1e6d412e Bug 1354643 - Part 2: Stop calling Preferences::GetBool() from nsDocument::IsWebAnimationsEnabled(); r=mystor 2017-04-08 18:40:28 -04:00
Ehsan Akhgari
137564bf67 Bug 1354643 - Part 1: Stop calling Preferences::GetBool() from nsDocument::IsElementAnimateEnabled(); r=mystor 2017-04-08 18:40:27 -04:00
Xidorn Quan
3c8434fe47 Bug 1343964 part 4 - Have document and svg:use element own URLExtraData. r=bholley,bz
MozReview-Commit-ID: 8451L5qJvEx
2017-04-06 16:51:29 +10:00
Bevis Tseng
a0785a7f8a Bug 1346145 - Label nsIDocument::SelectorCache. r=ehsan
SelectorCache::NotifyExpired() will be invoked by nsExpirationTracker::TimerCallback() from an unlabel runnable.
We adopt the change in nsExpirationTracker to provide a DocGroup EventTarget for the invocation of this callback.
2017-03-13 14:49:28 +08:00
Kris Maglione
014af2b87b Bug 1352827: Handle potential null reference during cleanup by CC. r=hsivonen
MozReview-Commit-ID: G7BM3nuEKY1
2017-04-02 15:05:51 -07:00
Gijs Kruitbosch
96bb6a5e24 Bug 1320124 - don't allow privileged loads inside unprivileged loads, r=bz
MozReview-Commit-ID: 3zoknjtslHI
2017-04-03 21:49:16 +01:00