Commit Graph

742 Commits

Author SHA1 Message Date
Kris Maglione
2ffe4aca2e Bug 1350049: Handle nsParser being finalized before resuming. r=hsivonen
This is a hybrid of the previous two approaches. The nsParser weak reference
sometimes stays alive after it's been detached from the document, after which
attempting to remove it throws. This stores a reference to the original
parser, and checks that it's still the current parser when it comes time to
resume.

MozReview-Commit-ID: 1JSi2FmPxt0
2017-03-28 15:24:26 -07:00
Xidorn Quan
53ee36eabe Bug 1345696 part 7 - Provide @font-face rules for stylo backend. r=heycam
MozReview-Commit-ID: CHPxz7iOLg6
2017-03-27 17:53:27 +11:00
Xidorn Quan
6eb87266b6 Bug 1345696 part 1 - Lots of fixup for the next patch. r=heycam
The next patch moves nsCSSFontFaceRule into a separate header, which
somehow affects lots of header dependencies. I'm not completely sure
why this happens, though.

MozReview-Commit-ID: KuXbsaX0NUd
2017-03-28 20:05:12 +11:00
Kirk Steuber
fada0072b5 Bug 1350381 - Change Flash blocking to allow the setting "Ask to Activate" to control CTA of unknown documents. r=qdot
Previously, we operated under the understanding that with Flash blocking activated, non-whitelisted documents would be set to CTA. We are changing that such that now, documents will only be CTA'ed if Flash is set to "Ask to Activate".

Flash blocking will now behave according to the following chart:

User Setting   Flash block   Whitelisted sites   Blacklisted sites    Unlisted sites
"Never ..."    Off           Deny                Deny                 Deny
"Ask ..."      Off           Ask                 Ask                  Ask
"Always ..."   Off           Allow               Allow                Allow
"Never ..."    On            Deny                Deny                 Deny
"Ask ..."      On            Allow               Deny                 Ask
"Always ..."   On            Allow               Deny                 Allow

This patch also completely reworks the flash blocking testing. Test data and most code remains consolidated, but will be run in multiple different tests. This avoids having to extend the timeout for Flash block testing to an extremely long length. The new Flash block testing additionally tests each of the six cases (rows) in the table above.

MozReview-Commit-ID: 5aPGUEiUiCv
2017-03-24 14:15:02 -07:00
Boris Zbarsky
923091e284 Bug 1342823 part 2. Simplify the management of whether our document's frame request callbacks are scheduled. r=farre
MozReview-Commit-ID: 46oVKKbCLbn
2017-03-27 14:52:36 -04:00
Boris Zbarsky
9e23fdf8e2 Bug 1342823 part 1. Move some one-bit booleans in nsIDocument next to all the other one-bit booleans. r=farre
MozReview-Commit-ID: 3FLVka93lCq
2017-03-27 14:51:55 -04:00
Alastor Wu
8f4b05a9b5 Bug 1347758 - part2 : remove add/removeMediaContent() and related codes. r=Ehsan
Since the window would know when need to resume the media, we don't need the
add/removeMediaContent() anymore.

MozReview-Commit-ID: F9MSiqqnOiV
2017-03-24 14:43:40 +08:00
Alastor Wu
c49d1c3d44 Bug 1347758 - part1 : window should know whehter there is any alive media component and decide to resume the tab or not. r=Ehsan
We should let window decide whether resume the media component, not document.
Because we might have media component which is not in DOM tree, but we still
want to play it.

Window should be resumed when all following conditions are true,
(1) the tab is in the foreground
(2) there is any alive media component (MediaElement/WebAudio/PlugIn...)
(3) the window is blocked (nsISuspendedTypes::SUSPENDED_BLOCK)

MozReview-Commit-ID: JXw5MA4FCxF
2017-03-24 14:43:26 +08:00
Iris Hsiao
a501d530f1 Backed out 6 changesets (bug 1347758) for eslint failure
Backed out changeset 9becd55242c1 (bug 1347758)
Backed out changeset 2abce19f5001 (bug 1347758)
Backed out changeset 80232d4c85d5 (bug 1347758)
Backed out changeset 1fd084ec34d4 (bug 1347758)
Backed out changeset cafb3c12027b (bug 1347758)
Backed out changeset 85846edfe957 (bug 1347758)
2017-03-24 16:58:08 +08:00
Alastor Wu
30b1724816 Bug 1347758 - part2 : remove add/removeMediaContent() and related codes. r=Ehsan
Since the window would know when need to resume the media, we don't need the
add/removeMediaContent() anymore.

MozReview-Commit-ID: F9MSiqqnOiV
2017-03-24 12:01:46 +08:00
Alastor Wu
70f4131dc4 Bug 1347758 - part1 : window should know whehter there is any alive media component and decide to resume the tab or not. r=Ehsan
We should let window decide whether resume the media component, not document.
Because we might have media component which is not in DOM tree, but we still
want to play it.

Window should be resumed when all following conditions are true,
(1) the tab is in the foreground
(2) there is any alive media component (MediaElement/WebAudio/PlugIn...)
(3) the window is blocked (nsISuspendedTypes::SUSPENDED_BLOCK)

MozReview-Commit-ID: JXw5MA4FCxF
2017-03-24 12:01:43 +08:00
Carsten "Tomcat" Book
0947398f26 merge autoland to mozilla-central a=merge 2017-03-23 13:42:40 +01:00
Carsten "Tomcat" Book
0ba47846aa Merge mozilla-central to mozilla-inbound 2017-03-22 16:13:03 +01:00
Andrea Marchesini
8f5f953fba Bug 1343933 - Renaming Principal classes - part 2 - NullPrincipal, r=qdot 2017-03-22 11:38:40 +01:00
Gijs Kruitbosch
0832e365bc Bug 1348623 - revert changes from bug 1044586 and fix preferences reload bug by changing the event listener, r=smaug
In bug 1044586 we changed nsDocument::GetEventTargetParent such that events for
a document were not sent to its parent window if the inner window for the
document wasn't the current inner window. Unfortunately it seems this means
event listeners on the window sometimes miss user input events (mousedown etc.)
when user input takes place before the first paint of a new document that's
loading. In order to fix this, this patch backs out the changes from bug 1044586.

This reintroduces the issue we had before with the preference window, where
reloading the preferences quickly meant that its listeners (attached to the
window) got confused by DOMContentLoaded events from a previously loaded
document. Instead of the broad fix to nsDocument::GetEventTargetParent, this
patch simply changes the event listeners from the preferences code to be
attached to the document instead of the window, thus ensuring they only get
notified for events relating to their own document.

MozReview-Commit-ID: 9DImyNst9fS
2017-03-20 17:16:34 +00:00
Mantaroh Yoshinaga
ceae2f02e8 Bug 1062106 part 2 - Remove unused SVG Attribute Animations cascade level. r=birtles,dbaron,xidorn
The previous patch in this series converted all uses of mapped attributes
for animation to be animated as CSS properties (that is, to be treated
as presentation hints in the cascade).

As result, we no longer need the SVG Animation presentation hints level
of the cascade, the corresponding rule processor(SVGAttrAnimationRuleProcessor),
or the corresponding eRestyle_SVGAttrAnimations restyle hint. So this patch
removes these unused rule processor and restyle hint.

MozReview-Commit-ID: Hm8IDaqc3ym
2017-03-21 15:43:26 +09:00
Manish Goregaokar
de1687e9f8 Bug 1341086 - Part 2: stylo: Support all non-ts pseudos with an argument; r=emilio,heycam
MozReview-Commit-ID: IHjX2Q3k8eD
2017-03-16 14:10:22 -07:00
Iris Hsiao
3a84bb5c77 Backed out 4 changesets (bug 1062106) for build bustage
Backed out changeset 7ac1fffb6a87 (bug 1062106)
Backed out changeset 7682b2da0437 (bug 1062106)
Backed out changeset e77bfa57be61 (bug 1062106)
Backed out changeset a565aca3013c (bug 1062106)
2017-03-21 16:41:18 +08:00
Mantaroh Yoshinaga
1ff18a18d4 Bug 1062106 part 2 - Remove unused SVG Attribute Animations cascade level. r=birtles,dbaron
The previous patch in this series converted all uses of mapped attributes
for animation to be animated as CSS properties (that is, to be treated
as presentation hints in the cascade).

As result, we no longer need the SVG Animation presentation hints level
of the cascade, the corresponding rule processor(SVGAttrAnimationRuleProcessor),
or the corresponding eRestyle_SVGAttrAnimations restyle hint. So this patch
removes these unused rule processor and restyle hint.

MozReview-Commit-ID: Hm8IDaqc3ym
2017-03-21 15:43:26 +09:00
Wes Kocher
29c38a6108 Merge inbound to central, a=merge
MozReview-Commit-ID: 2omKclRg40c
2017-03-20 18:19:52 -07:00
Ting-Yu Lin
900bd55b15 Bug 1338446 Part 3 - Label SheetLoadData in Loader::PostLoadEvent. r=heycam
When constructing a Loader without passing a document, we added a DocGroup
parameter so that we could still use it to dispatch events to the DocGroup.

Delete NS_ENSURE_TRUE because new() is infallable.

Use another runnable pointer for calling dispatching because forget() will
nuke the pointer and we need to use evt afterwards.

MozReview-Commit-ID: Ce2K6j4pUhA
2017-03-13 17:00:57 +08:00
Kris Maglione
227525437a Bug 1348523: Store a weak reference to the blocked parser, and use when unblocking. r=hsivonen
Users in nightlies are hitting the assertion in UnblockParser that ensures the
parser is blocked. The only way that should be able to happen is if the
initial parser is destroyed and a new one is created before we try to unblock.
In theory, that shouldn't happen for the initial parser when it's blocked
this early, so my best guess is that an add-on is ending the document load and
then re-opening the document.

MozReview-Commit-ID: iQkE2aWDTZ
2017-03-18 14:20:41 -07:00
Sebastian Hengst
bcb685d9e1 merge mozilla-central to autoland. r=merge a=merge 2017-03-18 16:35:12 +01:00
Kris Maglione
96e9d02181 Bug 1333990: Follow-up: Use Promise& rather than OwningNonNull<Promise> for binding arguments. r=bz
MozReview-Commit-ID: 23aYwjCPJ6l
2017-03-17 13:55:27 -07:00
Kris Maglione
9c4ce2fcac Bug 1333990: Follow-up: Add cycle collection and comments where unnecessary. r=bz
MozReview-Commit-ID: 70omvafFFFH
2017-03-17 13:54:32 -07:00
Cameron McCormack
0344da46e0 Bug 1330843 - Allow JS to create NAC pseudo-elements. r=bholley
MozReview-Commit-ID: 2aBPoCOsT6R
2017-03-17 15:30:34 +08:00
Kris Maglione
e8289edf84 Bug 1333990: Part 2d - Add a utility to block HTML parsing until sandbox scripts are ready. r=hsivonen,billm
In order to asynchronously load content scripts that need to run very early in
the page load cycle, before any ordinary page scripts, we need to be able to
block parsing from the document-element-inserted listener. Since the script
loader operates by returning promises, blocking on promise resolution is the
simplest way to achieve this.

MozReview-Commit-ID: CTWlyrP6dqG
2017-03-16 16:47:35 -07:00
Bevis Tseng
cbf352d0db Bug 1332491 - Delete SelectorCacheKey synchronously. r=bz
1. The current asynchronous behavior is pointless, because we still remove the
   hashtable entry synchronously, which deletes the value, and it's the value
   we're using.
2. Trying to asynchronously delete the value is difficult, and not currently
   needed because we can't get a memory-pressure notification while we're using
   the value, and hence can't expire it from the expiration tracker.
   Note: we can't get this memory-pressure notification because the stage 2 of
   mozalloc_handle_oom() to reclaim memory when OOM is not implemented yet.
2017-03-13 14:37:19 +08:00
Carsten "Tomcat" Book
80b8226308 merge mozilla-inbound to mozilla-central a=merge 2017-03-15 13:12:42 +01:00
Samael Wang
420d13b9bd Bug 1346703 - Replace PR_LogPrint with MOZ_LOG, remove unnecessary checks and add a nullptr check. r=ehsan 2017-03-14 16:58:45 +08:00
Kirk Steuber
82f36355d4 Bug 1345611 - Change behavior of subdocument Flash blocking to be Third-Party Flash blocking r=bsmedberg,qdot
The previous implementation regarding to the Flash Blocking Subdocument list blocked all subdocuments that matched the list. This patch changes that so that subdocuments are only blocked if they are on the Subdocument Block List and also are loaded in a Third-Party context.

The changes to cert8.db and key3.db add the https certificate for subdocument.example.com so that testing can verify that a scheme mismatch between the document and its parent results in a third-party classification.

MozReview-Commit-ID: IXnA4iPzB4y
2017-03-10 10:50:21 -08:00
Manish Goregaokar
be24bd2d60 Bug 1329093 - Part 4: stylo: Delay SVG mapped attr resolution till later; r=bz
MozReview-Commit-ID: 2GvHPg1egjS
2017-03-09 17:46:26 -08:00
Wei-Cheng Pan
7a678cdad2 Bug 1310127 - Part 17: Use MOZ_MUST_USE in netwerk/protocol/http r=smaug
MozReview-Commit-ID: 5gvVZtsa3yS
2016-12-20 11:49:32 +08:00
Alastor Wu
3e5501715a Bug 1338137 - part1 : ref media content when the media element bind to tree. r=baku
In bug1319771, we found that the tab would become visible unexpectly in short
period in some situations. We don't want to resume the tab in this kind of
situation, so we check whether there is any alive media component in the tab
using IsServiceStarted(). However, since we have lots different ways to create
the service, this function is not accurate at all.

Therefore, we can add media element directly to the document when it binds to
tree so that we can really know whether there is any alive media component.

MozReview-Commit-ID: FvZFg91IqgE
2017-03-04 01:14:24 +08:00
Ben Kelly
3e3147f98d Bug 1266747 P1 Track the last focus time on the nsIDocument. r=smaug 2017-02-28 22:12:27 -05:00
Sebastian Hengst
60f5eb6bba Backed out changeset d19ad1c1c214 (bug 1266747) for failing dom/workers/test/serviceworkers/test_claim.html. r=backout 2017-02-28 18:56:14 +01:00
Ben Kelly
eda30dce7a Bug 1266747 P1 Track the last focus time on the nsIDocument. r=smaug 2017-02-28 10:48:51 -05:00
Carsten "Tomcat" Book
b156024e5f merge mozilla-inbound to mozilla-central a=merge 2017-02-24 11:46:38 +01:00
Brad Werth
79bc1141f0 Bug 1290218 Part 8: Implement ServoStyleSheet Clone. r=heycam
MozReview-Commit-ID: Y2KcoMjhbn
2017-02-15 13:33:17 -08:00
Ehsan Akhgari
7965288852 Bug 1341898 - Make nsDocument::IsWebComponentsEnabled use a cached bool pref; r=baku 2017-02-23 13:25:21 -05:00
Andrea Marchesini
5e3def60d4 Bug 1341218 - nsNullPrincipal should serialize its URL, r=qdot 2017-02-23 14:30:23 +01:00
Carsten "Tomcat" Book
a9d738f08d Merge mozilla-central to mozilla-inbound 2017-02-22 14:40:19 +01:00
Jessica Jong
be4c818826 Bug 1340086 - Remove uses of AnimationsPaused() since it is always false after bug 1316330. r=mrbkap 2017-02-22 01:00:00 -05:00
Sebastian Hengst
4b7b49e7d2 Backed out changeset a6267555a244 (bug 1341218) for various test failures, e.g. xpcshell test dom/push/test/xpcshell/test_service_parent.js. r=backout 2017-02-22 11:21:37 +01:00
Andrea Marchesini
4a3922fdec Bug 1341218 - nsNullPrincipal should consider its URI in ::Write/::Read, r=qdot 2017-02-22 10:01:43 +01:00
Cameron McCormack
b16e5f7bca Bug 1337258 - Support ServoStyleSheets in nsStyleSheetService. r=xidorn
MozReview-Commit-ID: 4vaHzDBZHFg
2017-02-21 10:42:27 +08:00
Xidorn Quan
32f8d92717 Bug 1340926 part 2 - Avoid record deprecated operation inside about: pages. r=Ehsan
MozReview-Commit-ID: GksnEDiHboq
2017-02-20 12:35:56 +11:00
Xidorn Quan
02da52f4a5 Bug 1340926 part 1 - Make nsDocument::IsAboutPage usable in const function. r=Ehsan
MozReview-Commit-ID: 6MYH6VAQ911
2017-02-20 12:35:15 +11:00
Tobias Schneider
18718b4035 Bug 1337936 - (intersection-observer) Revise lifetime management. r=smaug
MozReview-Commit-ID: 4pzm00igBLR
2017-02-22 10:45:13 -08:00
Sebastian Hengst
52b71b9942 Backed out changeset b0838d45e9b6 (bug 1335475) for failing e.g. dom/plugins/test/crashtests/539897-1.html. r=backout 2017-03-10 23:28:13 +01:00