Commit Graph

3649 Commits

Author SHA1 Message Date
shindli
d288e9cae7 Merge inbound to mozilla-central. a=merge 2018-06-29 00:53:32 +03:00
Chris Pearce
56d56555be Bug 1471800 - Ensure HTMLMediaElement doesn't play its MediaDecoder in a readyState update after it's OwnerDoc has been removed from its DocShell. r=jya
It's possible that if the HTMLMediaElement is loading while we're loading a new
document into a docshell, that the HTMLMediaElement can reach readyState
HAVE_FUTURE_DATA just after its OwnerDoc is removed from the docshell. If the
HTMLMediaElement wasn't paused, then it may start playing due to the readyState
change in HTMLMediaElement::ChangeReadyState().

For years we've had hard to reproduce issues where media started playing after
we've closed the tab; I bet this was the cause!

When we detect that the document has been removed from its DocShell,
HTMLMediaElement::NotifyOwnerDocumentActivityChanged() is called, and that
suspends the MediaDecoder just in case we need to resurrect the media element,
for example if the tab comes out of the BF cache. When we suspend we set
mPausedForInactiveDocumentOrChannel=true, and all other calls to
MediaDecoder::Play() are guarded by checks on
mPausedForInactiveDocumentOrChannel.

So we should also guard the MediaDecoder::Play() call in ChangeReadyState()
with a check on mPausedForInactiveDocumentOrChannel too.

MozReview-Commit-ID: GfmZasT9jdr

--HG--
extra : rebase_source : 5539503795868e9496fe34014b5c04d2ed48241b
extra : source : e94884022fa7df95adf90e44a44e4f168d60f01a
2018-06-28 15:54:36 +12:00
Cosmin Sabou
bc28a91735 Backed out changeset 97499b2f5612 (bug 1471800) as requested by cpearce. 2018-06-28 13:53:42 +03:00
Andrew Osmond
481ecf53ca Bug 1470430 - MediaDocumentStreamListener should allow off main thread OnDataAvailable calls. r=smaug
This patch makes MediaDocumentStreamListener implement the
nsIThreadRetargetableStreamListener interface. This allows callers to
redirect the OnDataAvailable calls to another thread if possible. Since
ImageDocument's use ImageListener which inherits from this class, and we
are often viewing large images this way, it would be nice to move the IO
to the image IO thread.
2018-06-28 14:07:27 -04:00
Boris Zbarsky
e2386da2d1 Bug 1209035. Fix incorrect "is this control focused?" checks in form code. r=smaug
For number controls, nsContentUtils::IsFocusedContent doesn't really do the
right thing, because the thing it thinks is focused is the anonymous text
element inside the number control.  As a result, we weren't properly updating
the state of the currently-focused number control when hitting enter in it to
submit the form.

The HTMLFormElement change is enough on its own to fix the bug.  The constraint
validation change is a just-in-case.

I haven't figured out a sane way to write a reftest for this, unfortunately:
the enter key press needs to look like a real user event to trigger the
submission behavior.
2018-06-27 12:04:26 -04:00
Emilio Cobos Álvarez
89fd549c61 Bug 1471013: Make MozAutoplayMediaBlocked chrome-only. r=smaug
Summary: MozReview-Commit-ID: JVLMpCeMkAs

Reviewers: smaug

Tags: #secure-revision

Bug #: 1471013

Differential Revision: https://phabricator.services.mozilla.com/D1840

MozReview-Commit-ID: 2he7tHFbZ8t
2018-06-27 11:24:17 +02:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Emilio Cobos Álvarez
c7d35aa526 Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug
MozReview-Commit-ID: DsNuF7GAflJ
2018-06-26 18:22:06 +02:00
Cosmin Sabou
f86643152d Merge mozilla-central to autoland. a=merge 2018-06-28 13:11:09 +03:00
Chris Pearce
dc1195caea Bug 1471800 - Ensure HTMLMediaElement doesn't play its MediaDecoder in a readyState update after it's OwnerDoc has been removed from its DocShell. r=jya
It's possible that if the HTMLMediaElement is loading while we're loading a new
document into a docshell, that the HTMLMediaElement can reach readyState
HAVE_FUTURE_DATA just after its OwnerDoc is removed from the docshell. If the
HTMLMediaElement wasn't paused, then it may start playing due to the readyState
change in HTMLMediaElement::ChangeReadyState().

For years we've had hard to reproduce issues where media started playing after
we've closed the tab; I bet this was the cause!

When we detect that the document has been removed from its DocShell,
HTMLMediaElement::NotifyOwnerDocumentActivityChanged() is called, and that
suspends the MediaDecoder just in case we need to resurrect the media element,
for example if the tab comes out of the BF cache. When we suspend we set
mPausedForInactiveDocumentOrChannel=true, and all other calls to
MediaDecoder::Play() are guarded by checks on
mPausedForInactiveDocumentOrChannel.

So we should also guard the MediaDecoder::Play() call in ChangeReadyState()
with a check on mPausedForInactiveDocumentOrChannel too.

MozReview-Commit-ID: GfmZasT9jdr

--HG--
extra : rebase_source : dba32e8341a3dd70355ccdd7fd8790911a92acc8
extra : source : e94884022fa7df95adf90e44a44e4f168d60f01a
2018-06-28 15:54:36 +12:00
Margareta Eliza Balazs
c866c30fcf Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-06-26 12:24:32 +03:00
Chris Peterson
2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Chris Pearce
63dbf9d6f7 Bug 1470346 - Gesture activate all documents in tab, even across origins, upon user interaction. r=smaug
Sometimes when video is playing, a preroll ad plays, and that may be in a cross
origin iframe. If autoplay media is disabled, we require a user gesture in a
document before playback in that document is permitted, and we require each
origin to be gesture activated separately. So in the cross origin preroll video
add case, then the user will have to click once to unblock playback for the
cross origin ad, and then once the preroll ad finishes, the user will have to
click again to activate playback of the same origin content video.

This is a bad user experience.

So we should instead make gesture activation propagate up the doc tree
irrespective of crossing origins.  This way, when the user clicks to activate,
all documents in that tab are also also effectively gesture activated, and so
can autoplay.

MozReview-Commit-ID: 1HZQ5zkubR

--HG--
extra : rebase_source : d6b75732548cb1d73b9f82dce60a5e6e97d1da14
2018-06-22 11:52:20 +12:00
Emilio Cobos Álvarez
47ebd819b3 Bug 1449806: Merge {Servo,Generic}SpecifiedValues into MappedDeclarations. r=xidorn
The idea would be that this header is only included in cpp files, thus it's ok
to include ServoBindings, etc.

MozReview-Commit-ID: EgQEsR0cZd4
2018-06-25 11:14:39 +02:00
Bryce Van Dyk
926f765909 Bug 1450845 - MediaDecoderStateMachine now ignores SeekToNextFrame if already seeking. r=jya
SeekToNextFrame is handled differently than other seeks by the
MediaDecoderStateMachine, and should not take place while other seeks already
are. Bug 1410225 implemented some changes in HTMLMediaElement to prevent this,
but it's still possible to move to a seeking state in the MDSM and accept
SeekToNextFrame (as in this bug).

This changeset changes the MDSM to reject SeekToNextFrame if a seek is already
happening. Since the MDSM now does this the changes from bug 1410225 can be
removed.

This has the functional change of the promise from SeekToNextFrame being
rejected if the seek in not performed due to another seek. Previously the
promise would succeed when the other seek completed. This seems sensible as the
next frame seek does not actually take place.

MozReview-Commit-ID: HD9WRFq3LZV

--HG--
extra : rebase_source : fb276010119038db4319b3b81bcbf51ef2cab1d9
2018-06-06 15:17:30 -04:00
Emilio Cobos Álvarez
c228998b4f Bug 1410578: Make <link rel="stylesheet"> work in shadow trees. r=heycam
Summary: Somewhat straight-forward, mostly removing special-casing.

Differential Revision: https://phabricator.services.mozilla.com/D1761

MozReview-Commit-ID: 6f8duD4pGrl
2018-06-22 04:15:56 +02:00
Cosmin Sabou
4c18cd4036 Merge inbound to central. a=merge
--HG--
rename : servo/components/style/properties/longhand/box.mako.rs => servo/components/style/properties/longhands/box.mako.rs
2018-06-21 04:16:40 +03:00
Andrea Marchesini
5b9437cad2 Bug 1461921 - Block storage access for third-parties on the tracking protection list - part 5 - Cookies, r=ehsan 2018-06-20 13:38:22 -04:00
Valentin Gosu
a8e3a8c349 Bug 1448330 - Make nsIURI.clone a private method r=mayhemer
MozReview-Commit-ID: 1efpeaEPaXP

--HG--
extra : rebase_source : e660f1e5bcae9b7119bc5b37713691069272b375
2018-06-14 13:05:43 +02:00
catalin.badea392@gmail.com
9c36800bd7 Bug 1469385 - Remove InsertChildAt_Deprecated and RemoveChildAt_Deprecated, r=bz,smaug 2018-06-19 12:21:18 +03:00
Emilio Cobos Álvarez
99895a902b Bug 1469112: Use HTMLSlotElement::FromNode more consistently. r=smaug
MozReview-Commit-ID: 1k8lVazP0lR

--HG--
extra : rebase_source : fb505610b745dc414c2f28a0ba3130eec6160666
2018-06-15 20:14:02 -07:00
Ehsan Akhgari
4fbe444307 Bug 1462432 - Part 2: Override the dummy channel's tracking status if the document is coming from a tracking resource; r=baku 2018-06-13 16:18:39 -04:00
sotaro
967ea144d0 Bug 1465224 - Add Video rotation handling r=nical 2018-06-13 10:40:23 -07:00
Christoph Kerschbaumer
c26de76230 Bug 1467093 - Update the content type of the channel used within nsHTMLDocument::Open(). r=smaug 2018-06-07 14:01:25 +02:00
Joel Maher
50b91c0a14 Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
Kyle Machulis
a50b3fa9e5 Bug 1457689 - Fix documain.domain setting exception type; r=bz
Change exception type to comply with HTML spec, which uses security
error instead of bad document domain.

MozReview-Commit-ID: Iefkeskn9bM

--HG--
extra : rebase_source : 282507d687c8fe19a326df95632694bcc6c5dd29
2018-06-07 11:45:09 -07:00
Kyle Machulis
14d4b9546c Bug 819475 - Make document.domain non-nullable; r=bz
Make document.domain non-nullable, to conform to the HTML spec.

MozReview-Commit-ID: B1YuQekBgZD

--HG--
extra : rebase_source : 00999e16549e62c783f06f61c62000ab7677cf1d
2018-06-07 12:29:23 -07:00
Chris Pearce
2c5f707722 Bug 1467350 - Make HTMLMediaElement::mPaused Watchable and update Wakelock status via a watcher. r=jya
We currently observe changes to HTMLMediaElement::mPaused via a hand-rolled
wrapper class. We can use use mozilla::Watchable<> and avoid rolling our
own equivalent here.

This also paves the way for using state watching on other observable state
in HTMLMediaElement.

MozReview-Commit-ID: 4lBlJiV15iG

--HG--
extra : rebase_source : 22f9d811371f9d609dc96a9d958645e5c634eb17
extra : intermediate-source : bdb8280da440a711c6cd51b65ead7ba9e4bb3597
extra : source : fd8c4b8656a9996eea94d2092caaf3c10fe2a835
2018-05-21 14:19:47 +12:00
Chris Pearce
52d5517ef6 Bug 1464922 - Remove HTMLMediaElement::mAttemptPlayUponLoadedMetadata. r=bryce
We don't need to track this state anymore, as we don't need to delay calling
MediaDecoder::Play() or delay firing the "playing" event anymore.

MozReview-Commit-ID: E3B9l6ep7FP

--HG--
extra : rebase_source : 63df836bf0249ed40b0659cd42794e92966cefb9
2018-05-29 08:09:26 +12:00
Chris Pearce
e08b3c171c Bug 1464922 - Don't allow media without audio tracks to autoplay. r=bryce
I don't think we should allow media without audio tracks to autoplay because:
* It means play() before loaded metadata behaves differently than play()
called after loaded metadata.
* With the current impl we dispatch the "play" event and then the "pause"
event when we decide we should block, which may confuse some sites' controls.
* Delaying running the play() algorithm until we've loaded metadata would add
significant complexity, and may break sites.
* Chrome doesn't have this provision, meaning the complexity required to
support it will not result in much benefit to us.

MozReview-Commit-ID: FSVlDJAOisw

--HG--
extra : rebase_source : 93b1bcf8d8edbd6ca10ad918b40a87cd3cfbbf0b
2018-05-28 22:09:14 +12:00
Andreas Pehrson
6c6e70fcbc Bug 1453127 - Ensure TrackID uniqueness for captured MediaDecoder. r=jya 2018-05-29 10:21:51 +02:00
Andreas Pehrson
9fcd68ce86 Bug 1453127 - Make sure decoder-captured tracks end when changing src. r=jya 2018-05-29 10:13:14 +02:00
Andrea Marchesini
7ba8b77e07 Bug 1466023 - Separate FontTableURI and BlobURL, r=qdot
This patch splits FontTableURI and BlobURL in 2 classes:
FontTableURIProtocolHandler and BlobURLProtocolHandler
both under mozilla::dom.

It also removes a memory reporter because that report is already covered by the
BlobURL one.

--HG--
rename : dom/file/nsHostObjectProtocolHandler.cpp => dom/file/BlobURLProtocolHandler.cpp
rename : dom/file/nsHostObjectProtocolHandler.h => dom/file/BlobURLProtocolHandler.h
2018-06-02 15:51:42 +02:00
Emilio Cobos Álvarez
1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Boris Zbarsky
bddc220e1b Bug 1466253. HTMLFieldSetElement::GetType should return void. r=qdot 2018-06-01 22:35:26 -04:00
Boris Zbarsky
640e7f7112 Bug 1465875 part 5. Eliminate nsIDOMNSEditableElement. r=qdot 2018-06-01 22:35:23 -04:00
Boris Zbarsky
15b087c696 Bug 1465875 part 4. Eliminate random mentions of nsIDOMNSEditableElement. r=qdot 2018-06-01 22:35:23 -04:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Noemi Erli
cb93f27a88 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-06-01 00:59:09 +03:00
Noemi Erli
54db5253b6 Merge inbound to mozilla-central. a=merge 2018-06-01 00:51:37 +03:00
Olli Pettay
a6044a582c Bug 1462746, ensure SubtreeRoot always returns non-null value, r=mrbkap
--HG--
extra : rebase_source : 969acaa902db68eff48f6849da849522f2043b4a
2018-06-01 00:11:45 +03:00
Nazım Can Altınova
361380987c Bug 1464496 - Part 1: Merge ServoDeclarationBlock and DeclarationBlock r=emilio
MozReview-Commit-ID: By9fV70Oq0K

--HG--
extra : rebase_source : 837afe9c33b21d7db41ff19d3aaf6cf3e9eedbdf
2018-05-30 18:15:25 +02:00
Andreea Pavel
38bcf897f1 Merge mozilla-inbound to mozilla-central. a=merge 2018-05-31 13:04:21 +03:00
Emilio Cobos Álvarez
fe09ffd3af Bug 1465478: Introduce Element::FromNode. r=smaug
And use it in a couple places I noticed.

MozReview-Commit-ID: 8baSMrbdEbF
2018-05-31 02:46:10 +02:00
Masayuki Nakano
99341a9445 Bug 1463985 - part 1: Rename EditAction to EditSubAction and related stuff r=m_kato
When we implement InputEvent.inputType, we need to set a stack class to record
which edit action is currently handled.  However, currently, we call smaller
jobs as edit action.  For example, when user types a character at selecting
some characters, then, EditAction::deleteSelection is performed first, then,
EditAction::insertText is performed.  However, for the InputEvent.inputType,
we need inserText information.  So, for making new enum EditAction, we need
to rename current EditAction to EditSubAction.

And also this renames related stuff:

EditorBase::mIsInEditAction -> EditorBase::mIsInEditSubAction
EditorBase::IsInEditAction() -> EditorBase::IsInEditSubAction()
EditorBase::mAction -> EditorBase::mTopLevelEditSubAction
TextEditRules::mTheAction -> TextEditRules::mTopLevelEditSubAction
EditorBase::StartOperation() ->
  EditorBase::OnStartToHandleTopLevelEditSubAction()
EditorBase::EndOperation() ->
  EditorBase::OnEndHandlingTopLevelEditSubAction()
AutoRules -> AutoTopLevelEditSubActionNotifier
RulesInfo -> EditSubActionInfo

MozReview-Commit-ID: cvSkPUjFm1

--HG--
extra : rebase_source : baf527a3e353b7a8ebe9a46be2243b059c500234
2018-05-28 20:12:34 +09:00
Andreea Pavel
5a5a03c800 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2018-05-31 13:07:31 +03:00
Jan de Mooij
ad9d1f408f Bug 1464374 part 8 - Use GetRealmPrincipals in nsHTMLDocument::Open assertion. r=bz 2018-05-31 11:28:49 +02:00
Olli Pettay
58495709d9 Bug 1459693, ensure the right anonymous element is focused when calling input.focus(), r=mccr8
--HG--
extra : rebase_source : ea1ebf59a730b27b42f23c34ad7bf81e345767f5
2018-05-30 17:04:18 +03:00
Csoregi Natalia
f3599e000e Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-05-30 12:28:56 +03:00
Csoregi Natalia
83a923ef7a Merge inbound to mozilla-central. a=merge 2018-05-30 12:25:03 +03:00