Commit Graph

2877 Commits

Author SHA1 Message Date
Alastor Wu
ac5a951f4a Bug 1373888 - part6 : only release the wakelock when video is paused. r=cpearce
Wakelock would automatically handle the lock/unlock by listening "hidden/visible", we
don't need to handle it in HTMLVideoElement.

MozReview-Commit-ID: AcOwR2nqm6L

--HG--
extra : rebase_source : 8f96b8cd908332be33ed3289dd288990da56c1c9
2017-08-29 15:25:57 +08:00
Alastor Wu
5aaf1c6ce7 Bug 1373888 - part5 : only request audio wake lock when it's audible. r=cpearce
No need to prevent sleeping for non-audible audio.

MozReview-Commit-ID: 6p3azSUWTU2

--HG--
extra : rebase_source : 89ff9d1753ac4a23269ec100920e18020ab5aafb
2017-08-29 15:25:44 +08:00
Alastor Wu
6a6ee2a0d7 Bug 1373888 - part3 : rename the topic of the wake lock. r=cpearce
For knowing the wake lock usage more clearly, we should use more specific topic name.

In OSX, you can use "$ pmset -g assertions" to check all the wakelock.
In Windows, using "$ powser -energy" to generate the energy report.

MozReview-Commit-ID: rAXnkxTvLc

--HG--
extra : rebase_source : 42ebf204673d3c913739f64c71c24af20d37c95d
2017-08-29 10:54:28 +08:00
Alastor Wu
71ad2fdb83 Bug 1373888 - part2 : remove the timer which was used for b2g. r=cpearce
The timer was added for the b2g issue, now we can remove it.

MozReview-Commit-ID: BNjIghImCzC

--HG--
extra : rebase_source : c5490d417b2d40619eb7092dfc21b19a99982a1c
2017-08-29 10:54:25 +08:00
Alastor Wu
f570c3c5ec Bug 1373888 - part1 : remove useless function. r=cpearce,smaug
These functions didn't be used by anyone, remove them.

MozReview-Commit-ID: BLj8GsVp1gR

--HG--
extra : rebase_source : 1b7eee86c62314401c2374a2979ba2a42fda2490
2017-08-29 10:54:18 +08:00
JW Wang
f8f989dd93 Bug 1394313 - replace use of nsAutoPtr with UniquePtr in MediaDecoderOwner.h. r=cpearce
MozReview-Commit-ID: 49lyvMzg7oY

--HG--
extra : rebase_source : b83cd03b0026c73d0293ef937a3c2544349f464d
2017-08-28 14:10:35 +08:00
Tom Ritter
ae930caa79 Bug 1393535 Fix unused variable warnings in dom/ r=cpearce
MozReview-Commit-ID: 1Ql20AHx1Jz

--HG--
extra : rebase_source : 21105b4fc70953ecdccd4c1e7fe9c9d5564795c4
2017-08-24 11:52:36 -05:00
Sebastian Hengst
3549a5a1ac merge mozilla-central to autoland. r=merge a=merge 2017-08-28 17:09:10 +02:00
Sebastian Hengst
9769c22d10 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: AeoHOxZLi6m
2017-08-28 16:53:53 +02:00
John Lin
bad6535260 Bug 842782 - p2: introduce attributes for orientation lock to video element. r=jwwang,smaug
MozReview-Commit-ID: odq1y9qH1
2017-08-28 18:15:31 +08:00
Sebastian Hengst
3074ff30be Backed out changeset ba812092214c (bug 842782) 2017-08-28 09:59:11 +02:00
John Lin
ae733d5007 Bug 842782 - p2: introduce attributes for orientation lock to video element. r=jwwang,smaug
MozReview-Commit-ID: odq1y9qH1

--HG--
extra : rebase_source : 65daa7bde05ceee01704bb3677c5511c39c20848
2017-08-25 14:23:03 +08:00
Masayuki Nakano
5c2c570f9b Bug 1393816 - part1: Cache a range until new range is created in Selection r=smaug
When setting value of <input type="text">, nsTextEditorState removes all
ranges of normal selection first.  Then, TextEditor sets the value.  Finally,
TextEditor collapses the selection at the end of the text.

In bug 1386471, we got that there are some problems to remove the call of
Selection::RemoveAllRanges() in nsTextEditorState.  Therefore, we need another
approach to improve Selection::Collapse().

The approach of this patch is, when removing all ranges from normal selection,
Selection can cache an nsRange instance if there is an instance which is not
referenced from other than the Selection (i.e., it'll be removed when
Selection::Clear() is called).  Then, Selection::Collapse() can reuse it.  With
this fix, Selection::Collapse() can reduce allocation cost and may reduce some
other cost like adding it to mutation observer.

However, keeping nsRange instance may cause increasing mutation observer's cost
since nsRange will be adjusted its start node/offset and end node/offset with
mutation observer to guarantee that the range is always valid.  So, we can
cache such range only when the caller (or its callee) will set selection range
later.  Therefore, this patch adds Selection::RemoveAllRangesTemporarily()
and make only nsTextEditorState::SetValue() and
ContentEventHandler::OnSelectionEvent() use it.

MozReview-Commit-ID: FjWrbz4S1ld

--HG--
extra : rebase_source : 83677640525e0b1a84bdd7fce63ff4704b9cc22b
2017-08-25 19:21:39 +09:00
Masayuki Nakano
da1455e4b2 Bug 1393348 - part1: nsTextEditorState should use nsTextInputSelectionImpl::GetSelection(SelectionType) instead of nsTextInputSelectionImpl::GetSelection(RawSelectionType, nsISelection**) r=m_kato
nsTextEditorState stores selection controller as
RefPtr<nsTextInputSelectionImpl> mSelCon.  However, some methods still use
nsTextInputSelectionImpl::GetSelection(RawSelectionType, nsISelection**) which
is a virtual method overriding nsISelectionController.

So, instead, we should make it use
nsTextInputSelectionImpl::GetSelection(SelectionType).

MozReview-Commit-ID: Cvxa85LegsO

--HG--
extra : rebase_source : f8618fb9b4b2a1d3a02b4ce49906c8b995766e3f
2017-08-24 16:19:28 +09:00
Chris Pearce
4ffa31745b Bug 1392498 - Move TimeIntervals to dom::TimeRanges conversion into TimeRanges class. r=jya
If TimeUnits.h includes mozilla/dom/TimeRanges.h, then the build ends up
pulling in the Gecko DOM bindings, which pulls in a whole lot of JavaScript and
DOM bindings code. That makes it trickier to import GeckoMedia into Servo, and
makes Gecko's build slower, so move the code to convert TimeIntervals into
dom::TimeRanges.

Also remove an extraneous "virtual" and add "const" to some functions in TimeRanges.

MozReview-Commit-ID: BLeehaf9gCE

--HG--
extra : rebase_source : 84ef054cf8fd5b4434dc761a1b0a39803d3231f5
2017-08-21 15:08:25 +12:00
Bobby Holley
8fb4fb3d6c Bug 1393791 - Stop unbinding native-anonymous content off a script runner. r=emilio
The failure mode in the attached crashtest is an inconsistency in the flattened
tree. Specifically, we null out mVideoControls in an nsVideoFrame, but defer
the UnbindFromTree call on that NAC element, which measn that its mParent still
points to the nsVideoFrame's mContent. Because all this stuff runs off of script
runners, and the anonymous content destroyer is not guaranteed to run before
other potential script runners, we end up running arbitrary script while the
tree mismatch exists. This script calls back into ProcessPendingRestyles, which
causes trouble.

We could build a separate deferral mechanism, but it's not clear that we actually
need to defer the unbind anymore. The deferred unbind was added in bug 489008,
which predated a lot of simplifications in layout/dom interaction.

MozReview-Commit-ID: 1JYAhiXKVJC
2017-08-27 15:29:36 -07:00
Sebastian Hengst
de6f7dc3a1 merge mozilla-central to mozilla-inbound. r=merge a=merge on a CLOSED TREE 2017-08-25 13:21:40 +02:00
Nicholas Nethercote
7e120ce35e 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

--HG--
extra : rebase_source : 7b05708bd21dc4e3812ea041647fa74bb413d0b9
2017-08-25 14:47:54 +10:00
JW Wang
c62c2c21b4 Bug 1392919. P3 - remove unused code and fix naming. r=gerald
MozReview-Commit-ID: 36PqGtOpAbf

--HG--
extra : rebase_source : 9ff9234f1f5db9151808d9a2ee33ced6d9e089c6
2017-08-23 14:42:25 +08:00
Ryan VanderMeulen
3d0158833d Merge autoland to m-c. a=merge 2017-08-24 20:20:08 -04:00
Alastor Wu
556554c6f5 Bug 1382780 - part2 : separate the value of actual playback rate and media element's attribute. r=cpearce
According to [1], we should separate the value of actual playback rate and media elemenet's attribute.
But still keep a MAX and MIN threshold to control the highest and lowser playback rate for decoder.

[1] http://w3c-test.org/html/semantics/embedded-content/media-elements/playing-the-media-resource/playbackRate.html

MozReview-Commit-ID: EGCa4yrNXO6

--HG--
extra : rebase_source : d03b831eeebb3e3e3bb0759394eab0116be0f1d5
2017-08-24 16:58:45 +08:00
Alastor Wu
8417fdd605 Bug 1382780 - part1 : return NS_ERROR_DOM_NOT_SUPPORTED_ERR for the negative playback rate. r=cpearce
According to [1], we should return NotSupportedError for the negative playback rate.

[1] https://github.com/w3c/web-platform-tests/pull/6522

MozReview-Commit-ID: KoqDkBmP3h9

--HG--
extra : rebase_source : ddf1cdd03a980686df6d6613e1bd507bf37d8337
2017-08-24 16:58:42 +08: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
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
Andrew Sutherland
792729291f Bug 1383518 - Part 1: Augment test_formSubmission.html test to include ServiceWorker variants. r=bkelly
This test causes the expected serviceworker failure messages in the child
process and then hangs the test.

--HG--
extra : rebase_source : b1ea1db02d84ce7eb1e7b939cd1ef96825ab8e9f
2017-08-23 04:23:13 -04:00
Andrew Sutherland
9bd2e89d01 Bug 1383518 - Part 0: Test whitespace cleanup. r=bkelly
This test had trailing whitespace in a number of places, including one spot
inside a <textarea> that explicitly had a test expectation against it.

Since it's popular to have text editors purge trailing whitespace, this patch
converts the one significant piece of trailing whitespace to use an HTML
entity to encode a trailing ASCII space character.  This keeps that test happy.

--HG--
extra : rebase_source : ce6b3f3b923d06c3364b44ff006c8e245bd4f133
2017-08-23 04:18:39 -04:00
Masatoshi Kimura
5f035965ac Bug 1390209 - Remove unused nsIDOMHTML*Element interfaces. r=qdot
MozReview-Commit-ID: DagD3IHhRZy

--HG--
extra : rebase_source : 2add5ad8e9181ba9bf29f53a6df75b730ab5ea78
2017-08-15 01:31:47 +09:00
Aryeh Gregor
1b3b415680 Bug 1389421 - Support nonce IDL property; r=ckerschb,smaug
We already support the actual functionality, but nobody added support
for the IDL property to the .webidl file.

Also added <style nonce> to the web-platform-tests reflection tests,
since nobody updated that to the current spec either.

This does not add support for .nonce to SVGScriptElement, because I
couldn't find any standard that specified it.  I updated the wpt tests
to expect .nonce to work on HTMLScriptElement but not SVGScriptElement.

MozReview-Commit-ID: F1K7WMfMoDi

--HG--
extra : rebase_source : 247c63b63446dc0d60062bb9d9c61228c379b989
2017-08-21 14:49:44 +03:00
JW Wang
2834911596 Bug 1391170 - lessen the assertion in AddMediaElementToURITable() so we can move MediaDecoder::GetResource() to private. r=gerald
If AddMediaElementToURITable() is called after the decoder Load failed, mDecoder
will be reset and it is sufficient to assert mDecoder only.

MozReview-Commit-ID: 58WT8zFeiFj

--HG--
extra : rebase_source : 712579b544e9a9ce971778b85795d06e58bd4ea5
extra : intermediate-source : 470e2d8a20010e11d7a7dce5540957e89439811e
extra : source : 59f4b2b33212794aa1cf3e8782737a2d4af8c241
2017-08-17 15:41:22 +08:00
JW Wang
934fb866da Bug 1390443. P3 - rewrite the logic about mWaitingForKey. r=cpearce
This fixes the bug where mWaitingForKey is reset only when mPaused is false.
We should reset mWaitingForKey to NOT_WAITING_FOR_KEY when the key is
available and decoding can continue.

http://w3c.github.io/encrypted-media/#resume-playback

MozReview-Commit-ID: LjIhe9cTsdg

--HG--
extra : rebase_source : d2d351928d1994ee3ae688d4e798ab204ab1609c
extra : intermediate-source : e8700b4344aa29f6b2c52ee4d920d59db4012577
extra : source : 41e1c10f32465ca0abac61bbfd555ee89a8c67a1
2017-08-17 10:47:07 +08:00
JW Wang
6ce3e3224c Bug 1390443. P1 - don't change nextFrameStatus when MDSM reaches the end of playback. r=cpearce
Instead, MediaDecoder::NextFrameStatus() checks IsEnded() and returns
NEXT_FRAME_UNAVAILABLE to ensure we have HAVE_CURRENT_DATA when playback
is ended on the main thread.

This will fix the timing issue (comment 0) which causes 'waiting' to fire.

MozReview-Commit-ID: 7O21x2q0lb8

--HG--
extra : rebase_source : bbd898edfb5f4a47a5062dd2bc916c911caf0c8e
extra : intermediate-source : 2b3e413db02a7aad00d13fdf274b346bccafc414
extra : source : 6f60fad11b65e75b456e128f8414fe2ea545455f
2017-08-16 15:33:58 +08: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
Chung-Sheng Fu
e5b80e9a8f Bug 863246 - Move resources that need to be exposed to web content to locations that are marked as contentaccessible r=billm
MozReview-Commit-ID: ArhSHKPYOr8

--HG--
extra : rebase_source : 888f7ce8f9db809ad5abbe6340af74e9dfb1d73b
2017-06-08 17:52:46 +08:00
Sebastian Hengst
b3764d9e0a Backed out changeset 4f8ac9b281da (bug 1390443) for failing web-platform-tests, e.g. /encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.html. r=backout 2017-08-21 10:20:24 +02:00
Sebastian Hengst
ddc7c75859 Backed out changeset 5bcf66374df8 (bug 1390443) 2017-08-21 10:19:34 +02:00
JW Wang
56bf968d96 Bug 1390443. P3 - rewrite the logic about mWaitingForKey. r=cpearce
This fixes the bug where mWaitingForKey is reset only when mPaused is false.
We should reset mWaitingForKey to NOT_WAITING_FOR_KEY when the key is
available and decoding can continue.

http://w3c.github.io/encrypted-media/#resume-playback

MozReview-Commit-ID: LjIhe9cTsdg

--HG--
extra : rebase_source : 0563bf7831ed66bcdb5bec741b1366243eed49f9
extra : intermediate-source : e8700b4344aa29f6b2c52ee4d920d59db4012577
extra : source : 41e1c10f32465ca0abac61bbfd555ee89a8c67a1
2017-08-17 10:47:07 +08:00
JW Wang
a69873c9a9 Bug 1390443. P1 - don't change nextFrameStatus when MDSM reaches the end of playback. r=cpearce
Instead, MediaDecoder::NextFrameStatus() checks IsEnded() and returns
NEXT_FRAME_UNAVAILABLE to ensure we have HAVE_CURRENT_DATA when playback
is ended on the main thread.

This will fix the timing issue (comment 0) which causes 'waiting' to fire.

MozReview-Commit-ID: 7O21x2q0lb8

--HG--
extra : rebase_source : 0a676ef7278214a707c97687311a73da8bcd983e
extra : intermediate-source : 2b3e413db02a7aad00d13fdf274b346bccafc414
extra : source : 6f60fad11b65e75b456e128f8414fe2ea545455f
2017-08-16 15:33:58 +08:00
Jean-Yves Avenard
329ff1fecf Bug 1391666 - P3. Change to HAVE_ENOUGH_DATA when possible. r=cpearce
In bug 1312886, we made sure that readyState would never become HAVE_ENOUGH_DATA if we were waiting for a key.
However, this is in effect useless as the next call to ChangeReadyState would have reset mWaitingForKey.

In practice, it only meant that we delayed the change from HAVE_FUTURE_DATA to HAVE_ENOUGH_DATA until the next call to UpdateReadyState.

MozReview-Commit-ID: 2wnMeN8xxCS

--HG--
extra : rebase_source : f5b0fa50ead1565882c3bf8ba245702987784d8a
2017-08-18 21:00:08 +02:00
Jean-Yves Avenard
34fd923c04 Bug 1391666 - P2. Reset mWaitingForKey when we have data and autoplay attribute is set r=cpearce
By default, a media element that has never played is in paused mode. As such, we need to reset mWaitingForKey to NOT_WAITING_FOR_KEY otherwise, readyState will never become HAVE_ENOUGH_DATA.

MozReview-Commit-ID: EIi3Crt4zHl

--HG--
extra : rebase_source : e9f9ad4136020db7db081b5c125f664e1c7bda20
2017-08-18 19:20:48 +02: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
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
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
btian
9de84f5fed Bug 1390394 - Mochitest to ensure FormData gets the new files after setting <input type=file>.files. r=smaug
--HG--
extra : rebase_source : 1987a73e03ffa7191f95f0259ba15f131ce709ee
2017-08-17 17:09:41 +08: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
Henry Chang
d09db9fb2b Bug 1390777 - Use srcdoc to replace src=data:xxx whenever possible. r=ckerschb
MozReview-Commit-ID: 1FeRTmZv46N

--HG--
extra : rebase_source : 1b53de3be3fdb37f2b85550bf2b922d4285721aa
2017-08-17 16:00:29 +08: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
Phil Ringnalda
38ce1ea2a0 Backed out 10 changesets (bug 1390748) for build bustage
Backed out changeset 02b36ee5fb17 (bug 1390748)
Backed out changeset 84e8bf01c856 (bug 1390748)
Backed out changeset fc8989be30f3 (bug 1390748)
Backed out changeset 14d421ace6cc (bug 1390748)
Backed out changeset 7dadac869038 (bug 1390748)
Backed out changeset 0e77809e7bc2 (bug 1390748)
Backed out changeset bf78a8dce9c5 (bug 1390748)
Backed out changeset 5fa77990472e (bug 1390748)
Backed out changeset 5d3b637d2485 (bug 1390748)
Backed out changeset 634fe076d134 (bug 1390748)

MozReview-Commit-ID: Dxio8vXDCHg
2017-08-16 21:33:10 -07:00