diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 197a0ed2baaa..f12ba175a9ab 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index d60a6e18cfca..3eccb0e23450 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 7a0d42bbae2d..d5d72ecfe82a 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 197a0ed2baaa..f12ba175a9ab 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 825a3ca79acb..60d2aadc8b76 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"branch": "",
"revision": ""
},
- "revision": "04a13c212e02a36e590e5fd166af2f8e0abfbad7",
+ "revision": "37b9db0c5bc096893c78468b1a3cf3d02962e231",
"repo_path": "/integration/gaia-central"
}
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 010661918ecf..ee34e968d152 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index 99cbfd684b62..487cd21bfac4 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/inari/sources.xml b/b2g/config/inari/sources.xml
index 081b5e87d69c..8817479b9b54 100644
--- a/b2g/config/inari/sources.xml
+++ b/b2g/config/inari/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/leo/sources.xml b/b2g/config/leo/sources.xml
index 8c8e53113a2b..17b3d0a67d31 100644
--- a/b2g/config/leo/sources.xml
+++ b/b2g/config/leo/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/mako/sources.xml b/b2g/config/mako/sources.xml
index 0d22fd690156..8a7faafaaca4 100644
--- a/b2g/config/mako/sources.xml
+++ b/b2g/config/mako/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index 8f9c1bca73bb..a4d5aae9a250 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/browser/base/content/test/general/mochitest.ini b/browser/base/content/test/general/mochitest.ini
index 13acd7a6c5f6..caccc6f7f848 100644
--- a/browser/base/content/test/general/mochitest.ini
+++ b/browser/base/content/test/general/mochitest.ini
@@ -1,5 +1,5 @@
[DEFAULT]
-skip-if = buildapp == 'b2g'
+skip-if = buildapp == 'b2g' || e10s
support-files =
audio.ogg
bug364677-data.xml
diff --git a/browser/components/feeds/test/mochitest.ini b/browser/components/feeds/test/mochitest.ini
index c3ce5c0fcc2a..46725466ec33 100644
--- a/browser/components/feeds/test/mochitest.ini
+++ b/browser/components/feeds/test/mochitest.ini
@@ -1,5 +1,5 @@
[DEFAULT]
-skip-if = buildapp == 'b2g'
+skip-if = buildapp == 'b2g' || e10s
support-files =
bug368464-data.xml
bug408328-data.xml
diff --git a/caps/tests/mochitest/mochitest.ini b/caps/tests/mochitest/mochitest.ini
index 962348088b73..187150a05c45 100644
--- a/caps/tests/mochitest/mochitest.ini
+++ b/caps/tests/mochitest/mochitest.ini
@@ -3,6 +3,7 @@ support-files =
file_disableScript.html
[test_app_principal_equality.html]
+skip-if = e10s
[test_bug246699.html]
[test_bug292789.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
diff --git a/content/base/test/csp/mochitest.ini b/content/base/test/csp/mochitest.ini
index 08650553ee81..67cda615536f 100644
--- a/content/base/test/csp/mochitest.ini
+++ b/content/base/test/csp/mochitest.ini
@@ -1,4 +1,5 @@
[DEFAULT]
+skip-if = e10s
support-files =
file_CSP.css
file_CSP.sjs
diff --git a/content/base/test/mochitest.ini b/content/base/test/mochitest.ini
index b2743a15d782..6b2e835a27ec 100644
--- a/content/base/test/mochitest.ini
+++ b/content/base/test/mochitest.ini
@@ -220,7 +220,7 @@ skip-if = toolkit == 'android'
[test_CrossSiteXHR_cache.html]
skip-if = toolkit == 'android'
[test_CrossSiteXHR_origin.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(https not working, bug 907770) b2g-debug(https not working, bug 907770) b2g-desktop(https not working, bug 907770)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(https not working, bug 907770) b2g-debug(https not working, bug 907770) b2g-desktop(https not working, bug 907770)
[test_DOMException.html]
[test_EventSource_redirects.html]
[test_NodeIterator_basics_filters.xhtml]
@@ -230,7 +230,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(https not working, bug
[test_XHR.html]
[test_XHRDocURI.html]
[test_XHRSendData.html]
-skip-if = buildapp == 'b2g' # b2g(seems to stall) b2g-debug(seems to stall) b2g-desktop(seems to stall)
+skip-if = buildapp == 'b2g' || e10s # b2g(seems to stall) b2g-debug(seems to stall) b2g-desktop(seems to stall)
[test_XHR_anon.html]
[test_XHR_header.html]
[test_XHR_onuploadprogress.html]
@@ -244,7 +244,7 @@ skip-if = buildapp == 'b2g' # b2g(flaky on B2G, bug 960743) b2g-debug(flaky on B
[test_base.xhtml]
[test_blobconstructor.html]
[test_bug166235.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
[test_bug199959.html]
[test_bug218236.html]
[test_bug218277.html]
@@ -254,6 +254,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(clipboard undefined) b
[test_bug276037-1.html]
[test_bug276037-2.xhtml]
[test_bug282547.html]
+skip-if = e10s
[test_bug28293.html]
[test_bug28293.xhtml]
[test_bug298064.html]
@@ -324,6 +325,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(https not working, bug
[test_bug402150.html^headers^]
[test_bug403841.html]
[test_bug403852.html]
+skip-if = e10s
[test_bug403868.xml]
[test_bug405182.html]
[test_bug409380.html]
@@ -347,7 +349,7 @@ skip-if = buildapp == 'b2g' # b2g(bug 901343, specialpowers.wrap issue [nsIChann
[test_bug422403-2.xhtml]
skip-if = buildapp == 'b2g'
[test_bug422537.html]
-skip-if = buildapp == 'b2g' # b2g(xmlhttprequest causes crash, bug 902271) b2g-debug(xmlhttprequest causes crash, bug 902271) b2g-desktop(xmlhttprequest causes crash, bug 902271)
+skip-if = buildapp == 'b2g' || e10s # b2g(xmlhttprequest causes crash, bug 902271) b2g-debug(xmlhttprequest causes crash, bug 902271) b2g-desktop(xmlhttprequest causes crash, bug 902271)
[test_bug424212.html]
[test_bug424359-1.html]
skip-if = buildapp == 'b2g'
@@ -362,7 +364,7 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
[test_bug429157.html]
[test_bug431082.html]
[test_bug431701.html]
-skip-if = buildapp == 'b2g' # b2g(xmlhttprequest causes crash, bug 902271) b2g-debug(xmlhttprequest causes crash, bug 902271) b2g-desktop(xmlhttprequest causes crash, bug 902271)
+skip-if = buildapp == 'b2g' || e10s # b2g(xmlhttprequest causes crash, bug 902271) b2g-debug(xmlhttprequest causes crash, bug 902271) b2g-desktop(xmlhttprequest causes crash, bug 902271)
[test_bug431833.html]
[test_bug433533.html]
[test_bug433662.html]
@@ -398,7 +400,7 @@ skip-if = buildapp == 'b2g'
[test_bug475156.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 855762 # b2g(36 total - bug 902611) b2g-debug(36 total - bug 902611) b2g-desktop(36 total - bug 902611)
[test_bug482935.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 855762
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 855762
[test_bug484396.html]
[test_bug493881.html]
[test_bug493881.js]
@@ -442,7 +444,7 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
[test_bug564863.xhtml]
[test_bug567350.html]
[test_bug578096.html]
-skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(debug-only failure; crash) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
+skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || e10s # b2g-debug(debug-only failure; crash) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
[test_bug585978.html]
skip-if = (toolkit == 'gonk' && debug) #debug-only timeout
[test_bug587931.html]
@@ -525,7 +527,7 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #bug 901343, specialpowers.wr
[test_bug819051.html]
[test_bug820909.html]
[test_bug827160.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #needs plugin support # b2g(needs plugin support) b2g-debug(debug-only failure) b2g-desktop(needs plugin support)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #needs plugin support # b2g(needs plugin support) b2g-debug(debug-only failure) b2g-desktop(needs plugin support)
[test_bug840098.html]
[test_bug868999.html]
[test_bug869000.html]
@@ -544,9 +546,9 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' #needs plugin support # b2g(
[test_classList.html]
# This test fails on the Mac for some reason
[test_copyimage.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows' #b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows' || e10s #b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
[test_copypaste.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 904183 # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
[test_copypaste.xhtml]
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(bug 904183) b2g-debug(bug 904183) b2g-desktop(bug 904183)
[test_createHTMLDocument.html]
@@ -555,8 +557,9 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(bug 904183
[test_domparsing.html]
[test_elementTraversal.html]
[test_fileapi.html]
+skip-if = e10s
[test_fileapi_slice.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 775227
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 775227
[test_getElementById.html]
[test_html_colors_quirks.html]
[test_html_colors_standards.html]
@@ -572,27 +575,27 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 775227
[test_meta_viewport5.html]
[test_meta_viewport6.html]
[test_mixed_content_blocker.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT, SSL_REQUIRED
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
[test_mixed_content_blocker_bug803225.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT, SSL_REQUIRED
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
[test_mixed_content_blocker_frameNavigation.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT, SSL_REQUIRED
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT, SSL_REQUIRED
[test_mozfiledataurl.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT
[test_mutationobservers.html]
-skip-if = buildapp == 'b2g' # b2g(bug 901385, showmodaldialog) b2g-debug(bug 901385, showmodaldialog) b2g-desktop(bug 901385, showmodaldialog)
+skip-if = buildapp == 'b2g' || e10s # b2g(bug 901385, showmodaldialog) b2g-debug(bug 901385, showmodaldialog) b2g-desktop(bug 901385, showmodaldialog)
[test_nodelist_holes.html]
[test_object.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(needs plugin support) b2g-debug(needs plugin support) b2g-desktop(needs plugin support)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(needs plugin support) b2g-debug(needs plugin support) b2g-desktop(needs plugin support)
[test_plugin_freezing.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #CLICK_TO_PLAY
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #CLICK_TO_PLAY
[test_processing_instruction_update_stylesheet.xhtml]
[test_range_bounds.html]
-skip-if = toolkit == 'android'
+skip-if = toolkit == 'android' || e10s
[test_reentrant_flush.html]
-skip-if = toolkit == 'android' #RANDOM
+skip-if = toolkit == 'android' || e10s #RANDOM
[test_sync_xhr_timer.xhtml]
-skip-if = toolkit == 'android' #RANDOM
+skip-if = toolkit == 'android' || e10s #RANDOM
[test_text_wholeText.html]
[test_textnode_normalize_in_selection.html]
[test_textnode_split_in_selection.html]
@@ -603,13 +606,13 @@ skip-if = toolkit == 'android' #RANDOM
[test_w3element_traversal.xhtml]
[test_w3element_traversal_svg.html]
[test_websocket.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android'
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s
[test_websocket_basic.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_websocket_hello.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_x-frame-options.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(observerservice issue) b2g-debug(observerservice issue) b2g-desktop(observerservice issue)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(observerservice issue) b2g-debug(observerservice issue) b2g-desktop(observerservice issue)
[test_xbl_userdata.xhtml]
[test_xhr_abort_after_load.html]
skip-if = toolkit == 'android'
diff --git a/content/base/test/websocket_hybi/mochitest.ini b/content/base/test/websocket_hybi/mochitest.ini
index b3ce53452dcc..8e6a75704bed 100644
--- a/content/base/test/websocket_hybi/mochitest.ini
+++ b/content/base/test/websocket_hybi/mochitest.ini
@@ -1,4 +1,5 @@
[DEFAULT]
+skip-if = e10s
support-files =
file_binary-frames_wsh.py
file_check-binary-messages_wsh.py
diff --git a/content/canvas/test/webgl/mochitest.ini b/content/canvas/test/webgl/mochitest.ini
index 88012bb97e5e..42d49fab2b87 100644
--- a/content/canvas/test/webgl/mochitest.ini
+++ b/content/canvas/test/webgl/mochitest.ini
@@ -1,4 +1,5 @@
[DEFAULT]
+skip-if = e10s
support-files =
00_test_list.txt
failing_tests_android.txt
diff --git a/content/html/content/src/HTMLMediaElement.cpp b/content/html/content/src/HTMLMediaElement.cpp
index 05117b7377e2..73adc54e0876 100644
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -78,6 +78,8 @@
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/WakeLock.h"
+#include "mozilla/dom/TextTrack.h"
+
#include "ImageContainer.h"
#include "nsRange.h"
#include
@@ -3947,9 +3949,11 @@ HTMLMediaElement::AddTextTrack(TextTrackKind aKind,
const nsAString& aLabel,
const nsAString& aLanguage)
{
- return mTextTrackManager ? mTextTrackManager->AddTextTrack(aKind, aLabel,
- aLanguage)
- : nullptr;
+ if (mTextTrackManager) {
+ return mTextTrackManager->AddTextTrack(aKind, aLabel, aLanguage,
+ TextTrackSource::AddTextTrack);
+ }
+ return nullptr;
}
void
diff --git a/content/html/content/src/HTMLTrackElement.cpp b/content/html/content/src/HTMLTrackElement.cpp
index 394cf8a8b65c..e98af97bd2be 100644
--- a/content/html/content/src/HTMLTrackElement.cpp
+++ b/content/html/content/src/HTMLTrackElement.cpp
@@ -153,7 +153,9 @@ HTMLTrackElement::CreateTextTrack()
kind = TextTrackKind::Subtitles;
}
- mTrack = new TextTrack(OwnerDoc()->GetParentObject(), kind, label, srcLang);
+ mTrack = new TextTrack(OwnerDoc()->GetParentObject(), kind, label, srcLang,
+ TextTrackSource::Track);
+ mTrack->SetTrackElement(this);
if (mMediaParent) {
mMediaParent->AddTextTrack(mTrack);
diff --git a/content/html/content/src/TextTrackManager.cpp b/content/html/content/src/TextTrackManager.cpp
index 2cedc111a733..ce571d9da5ce 100644
--- a/content/html/content/src/TextTrackManager.cpp
+++ b/content/html/content/src/TextTrackManager.cpp
@@ -20,6 +20,59 @@
namespace mozilla {
namespace dom {
+CompareTextTracks::CompareTextTracks(HTMLMediaElement* aMediaElement)
+{
+ mMediaElement = aMediaElement;
+}
+
+int32_t
+CompareTextTracks::TrackChildPosition(TextTrack* aTextTrack) const {
+ HTMLTrackElement* trackElement = aTextTrack->GetTrackElement();
+ if (!trackElement) {
+ return -1;
+ }
+ return mMediaElement->IndexOf(trackElement);
+}
+
+bool
+CompareTextTracks::Equals(TextTrack* aOne, TextTrack* aTwo) const {
+ // Two tracks can never be equal. If they have corresponding TrackElements
+ // they would need to occupy the same tree position (impossible) and in the
+ // case of tracks coming from AddTextTrack source we put the newest at the
+ // last position, so they won't be equal as well.
+ return false;
+}
+
+bool
+CompareTextTracks::LessThan(TextTrack* aOne, TextTrack* aTwo) const
+{
+ TextTrackSource sourceOne = aOne->GetTextTrackSource();
+ TextTrackSource sourceTwo = aTwo->GetTextTrackSource();
+ if (sourceOne != sourceTwo) {
+ return sourceOne == Track ||
+ (sourceOne == AddTextTrack && sourceTwo == MediaResourceSpecific);
+ }
+ switch (sourceOne) {
+ case Track: {
+ int32_t positionOne = TrackChildPosition(aOne);
+ int32_t positionTwo = TrackChildPosition(aTwo);
+ // If either position one or positiontwo are -1 then something has gone
+ // wrong. In this case we should just put them at the back of the list.
+ return positionOne != -1 && positionTwo != -1 &&
+ positionOne < positionTwo;
+ }
+ case AddTextTrack:
+ // For AddTextTrack sources the tracks will already be in the correct relative
+ // order in the source array. Assume we're called in iteration order and can
+ // therefore always report aOne < aTwo to maintain the original temporal ordering.
+ return true;
+ case MediaResourceSpecific:
+ // No rules for Media Resource Specific tracks yet.
+ break;
+ }
+ return true;
+}
+
NS_IMPL_CYCLE_COLLECTION_3(TextTrackManager, mTextTracks,
mPendingTextTracks, mNewCues)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(TextTrackManager, AddRef)
@@ -58,10 +111,15 @@ TextTrackManager::TextTracks() const
already_AddRefed
TextTrackManager::AddTextTrack(TextTrackKind aKind, const nsAString& aLabel,
- const nsAString& aLanguage)
+ const nsAString& aLanguage,
+ TextTrackSource aTextTrackSource)
{
+ if (!mMediaElement) {
+ return nullptr;
+ }
nsRefPtr ttrack =
- mTextTracks->AddTextTrack(aKind, aLabel, aLanguage);
+ mTextTracks->AddTextTrack(aKind, aLabel, aLanguage, aTextTrackSource,
+ CompareTextTracks(mMediaElement));
ttrack->SetReadyState(HTMLTrackElement::READY_STATE_LOADED);
AddCues(ttrack);
return ttrack.forget();
@@ -70,7 +128,10 @@ TextTrackManager::AddTextTrack(TextTrackKind aKind, const nsAString& aLabel,
void
TextTrackManager::AddTextTrack(TextTrack* aTextTrack)
{
- mTextTracks->AddTextTrack(aTextTrack);
+ if (!mMediaElement) {
+ return;
+ }
+ mTextTracks->AddTextTrack(aTextTrack, CompareTextTracks(mMediaElement));
AddCues(aTextTrack);
}
@@ -157,7 +218,8 @@ TextTrackManager::PopulatePendingList()
TextTrack* ttrack = mTextTracks->IndexedGetter(index, dummy);
if (ttrack && ttrack->Mode() != TextTrackMode::Disabled &&
ttrack->ReadyState() == HTMLTrackElement::READY_STATE_LOADING) {
- mPendingTextTracks->AddTextTrack(ttrack);
+ mPendingTextTracks->AddTextTrack(ttrack,
+ CompareTextTracks(mMediaElement));
}
}
}
diff --git a/content/html/content/src/TextTrackManager.h b/content/html/content/src/TextTrackManager.h
index f0ffa55cf2fb..7d0f3a8bb5b6 100644
--- a/content/html/content/src/TextTrackManager.h
+++ b/content/html/content/src/TextTrackManager.h
@@ -19,6 +19,17 @@ namespace mozilla {
namespace dom {
class HTMLMediaElement;
+
+class CompareTextTracks {
+private:
+ HTMLMediaElement* mMediaElement;
+public:
+ CompareTextTracks(HTMLMediaElement* aMediaElement);
+ int32_t TrackChildPosition(TextTrack* aTrack) const;
+ bool Equals(TextTrack* aOne, TextTrack* aTwo) const;
+ bool LessThan(TextTrack* aOne, TextTrack* aTwo) const;
+};
+
class TextTrack;
class TextTrackCue;
@@ -34,7 +45,8 @@ public:
TextTrackList* TextTracks() const;
already_AddRefed AddTextTrack(TextTrackKind aKind,
const nsAString& aLabel,
- const nsAString& aLanguage);
+ const nsAString& aLanguage,
+ TextTrackSource aTextTrackSource);
void AddTextTrack(TextTrack* aTextTrack);
void RemoveTextTrack(TextTrack* aTextTrack, bool aPendingListOnly);
void DidSeek();
diff --git a/content/html/content/test/forms/mochitest.ini b/content/html/content/test/forms/mochitest.ini
index b2851db2464a..8af9557b5d92 100644
--- a/content/html/content/test/forms/mochitest.ini
+++ b/content/html/content/test/forms/mochitest.ini
@@ -54,10 +54,12 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
[test_input_url.html]
[test_label_control_attribute.html]
[test_max_attribute.html]
+skip-if = e10s
[test_maxlength_attribute.html]
[test_meter_element.html]
[test_meter_pseudo-classes.html]
[test_min_attribute.html]
+skip-if = e10s
[test_mozistextfield.html]
[test_novalidate_attribute.html]
[test_option_disabled.html]
@@ -67,16 +69,18 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
[test_pattern_attribute.html]
[test_progress_element.html]
[test_required_attribute.html]
+skip-if = e10s
[test_restore_form_elements.html]
[test_save_restore_radio_groups.html]
[test_select_selectedOptions.html]
[test_set_range_text.html]
[test_step_attribute.html]
+skip-if = e10s
[test_stepup_stepdown.html]
[test_submit_invalid_file.html]
[test_textarea_attributes_reflection.html]
[test_validation.html]
-skip-if = buildapp == 'b2g' # b2g(374 total, bug 901848, no keygen support) b2g-debug(374 total, bug 901848, no keygen support) b2g-desktop(374 total, bug 901848, no keygen support)
+skip-if = buildapp == 'b2g' || e10s # b2g(374 total, bug 901848, no keygen support) b2g-debug(374 total, bug 901848, no keygen support) b2g-desktop(374 total, bug 901848, no keygen support)
[test_valueAsDate_pref.html]
[test_valueasdate_attribute.html]
[test_valueasnumber_attribute.html]
diff --git a/content/html/content/test/mochitest.ini b/content/html/content/test/mochitest.ini
index 9e5b8fa93c78..8e61a9d99d88 100644
--- a/content/html/content/test/mochitest.ini
+++ b/content/html/content/test/mochitest.ini
@@ -246,7 +246,7 @@ skip-if = toolkit == 'android'
[test_bug518122.html]
[test_bug519987.html]
[test_bug523771.html]
-skip-if = buildapp == 'b2g' # b2g(onload of iframe not firing, because submit not working?) b2g-debug(onload of iframe not firing, because submit not working?) b2g-desktop(onload of iframe not firing, because submit not working?)
+skip-if = buildapp == 'b2g' || e10s # b2g(onload of iframe not firing, because submit not working?) b2g-debug(onload of iframe not firing, because submit not working?) b2g-desktop(onload of iframe not firing, because submit not working?)
[test_bug529819.html]
[test_bug529859.html]
[test_bug535043.html]
@@ -270,7 +270,7 @@ skip-if = toolkit == 'android' #TIMED_OUT
[test_bug560112.html]
[test_bug561634.html]
[test_bug561636.html]
-skip-if = buildapp == 'b2g' # b2g(observerservice not working) b2g-debug(observerservice not working) b2g-desktop(observerservice not working)
+skip-if = buildapp == 'b2g' || e10s # b2g(observerservice not working) b2g-debug(observerservice not working) b2g-desktop(observerservice not working)
[test_bug561640.html]
[test_bug564001.html]
[test_bug566046.html]
@@ -291,16 +291,19 @@ skip-if = buildapp == 'b2g' # b2g(observerservice not working) b2g-debug(observe
[test_bug589.html]
[test_bug590353-1.html]
[test_bug590353-2.html]
+skip-if = e10s
[test_bug590363.html]
[test_bug592802.html]
[test_bug593689.html]
[test_bug595429.html]
+skip-if = e10s
[test_bug595447.html]
[test_bug595449.html]
-skip-if = (toolkit == 'gonk' && debug) #debug-only failure
+skip-if = (toolkit == 'gonk' && debug) || e10s #debug-only failure
[test_bug596350.html]
[test_bug596511.html]
[test_bug598643.html]
+skip-if = e10s
[test_bug598833-1.html]
[test_bug600155.html]
[test_bug601030.html]
@@ -316,7 +319,7 @@ skip-if = (toolkit == 'gonk' && debug) #debug-only failure
[test_bug612730.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(form control not selected/checked with synthesizeMouse, also fails on Android) b2g-debug(form control not selected/checked with synthesizeMouse, also fails on Android) b2g-desktop(form control not selected/checked with synthesizeMouse, also fails on Android)
[test_bug613113.html]
-skip-if = buildapp == 'b2g' # b2g(bug 587671, need an invalidformsubmit observer) b2g-debug(bug 587671, need an invalidformsubmit observer) b2g-desktop(bug 587671, need an invalidformsubmit observer)
+skip-if = buildapp == 'b2g' || e10s # b2g(bug 587671, need an invalidformsubmit observer) b2g-debug(bug 587671, need an invalidformsubmit observer) b2g-desktop(bug 587671, need an invalidformsubmit observer)
[test_bug613722.html]
[test_bug613979.html]
[test_bug615595.html]
@@ -324,22 +327,29 @@ skip-if = buildapp == 'b2g' # b2g(bug 587671, need an invalidformsubmit observer
skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(form control not selected/checked with synthesizeMouse, also fails on Android) b2g-debug(form control not selected/checked with synthesizeMouse, also fails on Android) b2g-desktop(form control not selected/checked with synthesizeMouse, also fails on Android)
[test_bug617528.html]
[test_bug618948.html]
-skip-if = buildapp == 'b2g' # b2g(bug 587671, need an invalidformsubmit observer) b2g-debug(bug 587671, need an invalidformsubmit observer) b2g-desktop(bug 587671, need an invalidformsubmit observer)
+skip-if = buildapp == 'b2g' || e10s # b2g(bug 587671, need an invalidformsubmit observer) b2g-debug(bug 587671, need an invalidformsubmit observer) b2g-desktop(bug 587671, need an invalidformsubmit observer)
[test_bug619278.html]
-skip-if = buildapp == 'b2g' # b2g(bug 587671, need an invalidformsubmit observer) b2g-debug(bug 587671, need an invalidformsubmit observer) b2g-desktop(bug 587671, need an invalidformsubmit observer)
+skip-if = buildapp == 'b2g' || e10s # b2g(bug 587671, need an invalidformsubmit observer) b2g-debug(bug 587671, need an invalidformsubmit observer) b2g-desktop(bug 587671, need an invalidformsubmit observer)
[test_bug622558.html]
+skip-if = e10s
[test_bug622597.html]
-skip-if = buildapp == 'b2g' # b2g(bug 587671, need an invalidformsubmit observer) b2g-debug(bug 587671, need an invalidformsubmit observer) b2g-desktop(bug 587671, need an invalidformsubmit observer)
+skip-if = buildapp == 'b2g' || e10s # b2g(bug 587671, need an invalidformsubmit observer) b2g-debug(bug 587671, need an invalidformsubmit observer) b2g-desktop(bug 587671, need an invalidformsubmit observer)
[test_bug623291.html]
+skip-if = e10s
[test_bug6296.html]
+skip-if = e10s
[test_bug629801.html]
+skip-if = e10s
[test_bug633058.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || e10s #Bug 931116, b2g desktop specific, initial triage
[test_bug636336.html]
+skip-if = e10s
[test_bug641219.html]
+skip-if = e10s
[test_bug643051.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || e10s #Bug 931116, b2g desktop specific, initial triage
[test_bug646157.html]
+skip-if = e10s
[test_bug649134.html]
# This extra subdirectory is needed due to the nature of this test.
# With the bug, the test loads the base URL of the bug649134/file_*.sjs
@@ -390,7 +400,7 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
[test_bug839913.html]
[test_bug840877.html]
[test_bug841466.html]
-skip-if = (toolkit == 'gonk' && debug) #debug-only failure
+skip-if = (toolkit == 'gonk' && debug) || e10s #debug-only failure
[test_bug845057.html]
[test_bug869040.html]
[test_bug870787.html]
@@ -407,33 +417,35 @@ skip-if = (toolkit == 'gonk' && debug) #debug-only failure
[test_embed_attributes_reflection.html]
[test_formData.html]
[test_formSubmission.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) b2g-debug(NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) b2g-desktop(NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT # b2g(NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) b2g-debug(NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) b2g-desktop(NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)
[test_formSubmission2.html]
skip-if = toolkit == 'android'
[test_formelements.html]
[test_fullscreen-api.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(time out, some kind of focus issue) b2g-debug(time out, some kind of focus issue) b2g-desktop(time out, some kind of focus issue)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT # b2g(time out, some kind of focus issue) b2g-debug(time out, some kind of focus issue) b2g-desktop(time out, some kind of focus issue)
[test_hidden.html]
[test_html_attributes_reflection.html]
[test_htmlcollection.html]
[test_iframe_sandbox_general.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || e10s #Bug 931116, b2g desktop specific, initial triage
[test_iframe_sandbox_inheritance.html]
-skip-if = buildapp == 'b2g' # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
+skip-if = buildapp == 'b2g' || e10s # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
[test_iframe_sandbox_modal.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #modal tests fail on android # b2g(modal tests fail on B2G) b2g-debug(modal tests fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #modal tests fail on android # b2g(modal tests fail on B2G) b2g-debug(modal tests fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
[test_iframe_sandbox_navigation.html]
-skip-if = buildapp == 'b2g' # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
+skip-if = buildapp == 'b2g' || e10s # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
[test_iframe_sandbox_navigation2.html]
-skip-if = buildapp == 'b2g' # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
+skip-if = buildapp == 'b2g' || e10s # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
[test_iframe_sandbox_plugins.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(plugins not supported) b2g-debug(plugins not supported) b2g-desktop(plugins not supported)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(plugins not supported) b2g-debug(plugins not supported) b2g-desktop(plugins not supported)
[test_iframe_sandbox_popups.html]
-skip-if = buildapp == 'b2g' # b2g(multiple concurrent window.open()s fail on B2G) b2g-debug(multiple concurrent window.open()s fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
+skip-if = buildapp == 'b2g' || e10s # b2g(multiple concurrent window.open()s fail on B2G) b2g-debug(multiple concurrent window.open()s fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
[test_iframe_sandbox_popups_inheritance.html]
-skip-if = buildapp == 'b2g' # b2g(multiple concurrent window.open()s fail on B2G) b2g-debug(multiple concurrent window.open()s fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
+skip-if = buildapp == 'b2g' || e10s # b2g(multiple concurrent window.open()s fail on B2G) b2g-debug(multiple concurrent window.open()s fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
[test_iframe_sandbox_same_origin.html]
+skip-if = e10s
[test_iframe_sandbox_workers.html]
+skip-if = e10s
[test_img_attributes_reflection.html]
[test_imageSrcSet.html]
[test_li_attributes_reflection.html]
@@ -447,7 +459,7 @@ skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(Perma-
[test_nested_invalid_fieldsets.html]
[test_object_attributes_reflection.html]
[test_object_plugin_nav.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(plugins not supported) b2g-debug(plugins not supported) b2g-desktop(plugins not supported)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT # b2g(plugins not supported) b2g-debug(plugins not supported) b2g-desktop(plugins not supported)
[test_ol_attributes_reflection.html]
[test_option_defaultSelected.html]
[test_option_selected_state.html]
diff --git a/content/html/document/test/mochitest.ini b/content/html/document/test/mochitest.ini
index 414b3d9eabb4..c6a262a0c8d1 100644
--- a/content/html/document/test/mochitest.ini
+++ b/content/html/document/test/mochitest.ini
@@ -25,9 +25,9 @@ support-files =
[test_bug1823.html]
[test_bug57600.html]
[test_bug196523.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || e10s #Bug 931116, b2g desktop specific, initial triage
[test_bug199692.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit == 'android' #bug 811644 #Bug 931116, b2g desktop specific, initial triage
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit == 'android' || e10s #bug 811644 #Bug 931116, b2g desktop specific, initial triage
[test_bug172261.html]
[test_bug255820.html]
[test_bug259332.html]
@@ -38,10 +38,10 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit == 'android' #bug
[test_bug340017.xhtml]
[test_bug359657.html]
[test_bug369370.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android'
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s
[test_bug380383.html]
[test_bug391777.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(showmodaldialog) b2g-debug(showmodaldialog) b2g-desktop(showmodaldialog)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(showmodaldialog) b2g-debug(showmodaldialog) b2g-desktop(showmodaldialog)
[test_bug402680.html]
[test_bug403868.html]
[test_bug403868.xhtml]
@@ -71,10 +71,10 @@ skip-if = toolkit == 'android'
[test_bug677495.html]
[test_bug677495-1.html]
[test_bug741266.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(needs control of popup window size) b2g-debug(needs control of popup window size) b2g-desktop(needs control of popup window size)
+skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(needs control of popup window size) b2g-debug(needs control of popup window size) b2g-desktop(needs control of popup window size)
[test_non-ascii-cookie.html]
-skip-if = buildapp == 'b2g'
+skip-if = buildapp == 'b2g' || e10s
[test_bug765780.html]
[test_bug871161.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || e10s #Bug 931116, b2g desktop specific, initial triage
support-files = file_bug871161-1.html file_bug871161-2.html
diff --git a/content/media/TextTrack.cpp b/content/media/TextTrack.cpp
index a5cc694fac3e..15232897bb22 100644
--- a/content/media/TextTrack.cpp
+++ b/content/media/TextTrack.cpp
@@ -16,20 +16,22 @@
namespace mozilla {
namespace dom {
-NS_IMPL_CYCLE_COLLECTION_INHERITED_4(TextTrack,
+NS_IMPL_CYCLE_COLLECTION_INHERITED_5(TextTrack,
nsDOMEventTargetHelper,
mParent,
mCueList,
mActiveCueList,
- mTextTrackList)
+ mTextTrackList,
+ mTrackElement)
NS_IMPL_ADDREF_INHERITED(TextTrack, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(TextTrack, nsDOMEventTargetHelper)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TextTrack)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
-TextTrack::TextTrack(nsISupports* aParent)
+TextTrack::TextTrack(nsISupports* aParent, TextTrackSource aTextTrackSource)
: mParent(aParent)
+ , mTextTrackSource(aTextTrackSource)
{
SetDefaultSettings();
SetIsDOMBinding();
@@ -38,8 +40,10 @@ TextTrack::TextTrack(nsISupports* aParent)
TextTrack::TextTrack(nsISupports* aParent,
TextTrackKind aKind,
const nsAString& aLabel,
- const nsAString& aLanguage)
+ const nsAString& aLanguage,
+ TextTrackSource aTextTrackSource)
: mParent(aParent)
+ , mTextTrackSource(aTextTrackSource)
{
SetDefaultSettings();
mKind = aKind;
@@ -52,9 +56,11 @@ TextTrack::TextTrack(nsISupports* aParent,
TextTrackList* aTextTrackList,
TextTrackKind aKind,
const nsAString& aLabel,
- const nsAString& aLanguage)
+ const nsAString& aLanguage,
+ TextTrackSource aTextTrackSource)
: mParent(aParent)
, mTextTrackList(aTextTrackList)
+ , mTextTrackSource(aTextTrackSource)
{
SetDefaultSettings();
mKind = aKind;
@@ -211,5 +217,15 @@ TextTrack::SetTextTrackList(TextTrackList* aTextTrackList)
mTextTrackList = aTextTrackList;
}
+HTMLTrackElement*
+TextTrack::GetTrackElement() {
+ return mTrackElement;
+}
+
+void
+TextTrack::SetTrackElement(HTMLTrackElement* aTrackElement) {
+ mTrackElement = aTrackElement;
+}
+
} // namespace dom
} // namespace mozilla
diff --git a/content/media/TextTrack.h b/content/media/TextTrack.h
index 6d9a163e06c1..9d7096d106ab 100644
--- a/content/media/TextTrack.h
+++ b/content/media/TextTrack.h
@@ -20,6 +20,13 @@ class TextTrackList;
class TextTrackCue;
class TextTrackCueList;
class TextTrackRegion;
+class HTMLTrackElement;
+
+enum TextTrackSource {
+ Track,
+ AddTextTrack,
+ MediaResourceSpecific
+};
class TextTrack MOZ_FINAL : public nsDOMEventTargetHelper
{
@@ -27,16 +34,19 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TextTrack, nsDOMEventTargetHelper)
- TextTrack(nsISupports* aParent);
+ TextTrack(nsISupports* aParent,
+ TextTrackSource aTextTrackSource);
TextTrack(nsISupports* aParent,
TextTrackKind aKind,
const nsAString& aLabel,
- const nsAString& aLanguage);
+ const nsAString& aLanguage,
+ TextTrackSource aTextTrackSource);
TextTrack(nsISupports* aParent,
TextTrackList* aTextTrackList,
TextTrackKind aKind,
const nsAString& aLabel,
- const nsAString& aLanguage);
+ const nsAString& aLanguage,
+ TextTrackSource aTextTrackSource);
void SetDefaultSettings();
@@ -99,6 +109,13 @@ public:
IMPL_EVENT_HANDLER(cuechange)
+ HTMLTrackElement* GetTrackElement();
+ void SetTrackElement(HTMLTrackElement* aTrackElement);
+
+ TextTrackSource GetTextTrackSource() {
+ return mTextTrackSource;
+ }
+
private:
void UpdateActiveCueList();
@@ -114,10 +131,14 @@ private:
nsRefPtr mCueList;
nsRefPtr mActiveCueList;
+ nsRefPtr mTrackElement;
uint32_t mCuePos;
uint16_t mReadyState;
bool mDirty;
+
+ // An enum that represents where the track was sourced from.
+ TextTrackSource mTextTrackSource;
};
} // namespace dom
diff --git a/content/media/TextTrackList.cpp b/content/media/TextTrackList.cpp
index fde2e80caabd..6e01f74d6e56 100644
--- a/content/media/TextTrackList.cpp
+++ b/content/media/TextTrackList.cpp
@@ -64,17 +64,21 @@ TextTrackList::IndexedGetter(uint32_t aIndex, bool& aFound)
already_AddRefed
TextTrackList::AddTextTrack(TextTrackKind aKind,
const nsAString& aLabel,
- const nsAString& aLanguage)
+ const nsAString& aLanguage,
+ TextTrackSource aTextTrackSource,
+ const CompareTextTracks& aCompareTT)
{
- nsRefPtr track = new TextTrack(mGlobal, this, aKind, aLabel, aLanguage);
- AddTextTrack(track);
+ nsRefPtr track = new TextTrack(mGlobal, this, aKind, aLabel, aLanguage,
+ aTextTrackSource);
+ AddTextTrack(track, aCompareTT);
return track.forget();
}
void
-TextTrackList::AddTextTrack(TextTrack* aTextTrack)
+TextTrackList::AddTextTrack(TextTrack* aTextTrack,
+ const CompareTextTracks& aCompareTT)
{
- if (mTextTracks.AppendElement(aTextTrack)) {
+ if (mTextTracks.InsertElementSorted(aTextTrack, aCompareTT)) {
aTextTrack->SetTextTrackList(this);
CreateAndDispatchTrackEventRunner(aTextTrack, NS_LITERAL_STRING("addtrack"));
}
diff --git a/content/media/TextTrackList.h b/content/media/TextTrackList.h
index fa0d54318b9f..8e0af46bc4c1 100644
--- a/content/media/TextTrackList.h
+++ b/content/media/TextTrackList.h
@@ -16,6 +16,7 @@ namespace dom {
class HTMLMediaElement;
class TextTrackManager;
+class CompareTextTracks;
class TrackEvent;
class TrackEventRunner;
@@ -48,10 +49,12 @@ public:
already_AddRefed AddTextTrack(TextTrackKind aKind,
const nsAString& aLabel,
- const nsAString& aLanguage);
+ const nsAString& aLanguage,
+ TextTrackSource aTextTrackSource,
+ const CompareTextTracks& aCompareTT);
TextTrack* GetTrackById(const nsAString& aId);
- void AddTextTrack(TextTrack* aTextTrack);
+ void AddTextTrack(TextTrack* aTextTrack, const CompareTextTracks& aCompareTT);
void RemoveTextTrack(TextTrack* aTrack);
void DidSeek();
diff --git a/content/media/encoder/Makefile.in b/content/media/encoder/Makefile.in
deleted file mode 100644
index 3f27e6e851fd..000000000000
--- a/content/media/encoder/Makefile.in
+++ /dev/null
@@ -1,13 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/rules.mk
-
-# These includes are from Android JB, for use of MediaCodec.
-INCLUDES += \
- -I$(topsrcdir)/ipc/chromium/src \
- -I$(ANDROID_SOURCE)/frameworks/native/opengl/include/ \
- -I$(ANDROID_SOURCE)/frameworks/native/include/ \
- -I$(ANDROID_SOURCE)/frameworks/av/include/media/ \
- $(NULL)
diff --git a/content/media/encoder/moz.build b/content/media/encoder/moz.build
index 2e6fee457dd5..e3f4768ee977 100644
--- a/content/media/encoder/moz.build
+++ b/content/media/encoder/moz.build
@@ -41,4 +41,14 @@ FAIL_ON_WARNINGS = True
FINAL_LIBRARY = 'gklayout'
+# These includes are from Android JB, for use of MediaCodec.
+LOCAL_INCLUDES += ['/ipc/chromium/src']
+CXXFLAGS += [
+ '-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
+ 'frameworks/native/opengl/include',
+ 'frameworks/native/include',
+ 'frameworks/av/include/media',
+ ]
+]
+
include('/ipc/chromium/chromium-config.mozbuild')
diff --git a/content/media/mediasource/test/mochitest.ini b/content/media/mediasource/test/mochitest.ini
index 7bc811a42a24..7eb02a501c22 100644
--- a/content/media/mediasource/test/mochitest.ini
+++ b/content/media/mediasource/test/mochitest.ini
@@ -1,4 +1,5 @@
[DEFAULT]
+skip-if = e10s
support-files = seek.webm seek.webm^headers^
[test_MediaSource.html]
diff --git a/content/media/omx/RtspOmxReader.cpp b/content/media/omx/RtspOmxReader.cpp
index 92c762e66672..aed8ddcaff07 100644
--- a/content/media/omx/RtspOmxReader.cpp
+++ b/content/media/omx/RtspOmxReader.cpp
@@ -299,6 +299,18 @@ nsresult RtspOmxReader::Seek(int64_t aTime, int64_t aStartTime,
return MediaOmxReader::Seek(aTime, aStartTime, aEndTime, aCurrentTime);
}
+nsresult
+RtspOmxReader::ReadMetadata(MediaInfo* aInfo,
+ MetadataTags** aTags)
+{
+ nsresult rv = MediaOmxReader::ReadMetadata(aInfo, aTags);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ SetActive();
+
+ return NS_OK;
+}
+
void RtspOmxReader::SetIdle() {
// Need to pause RTSP streaming OMXCodec decoding.
if (mRtspResource) {
@@ -319,7 +331,7 @@ void RtspOmxReader::SetActive() {
nsIStreamingProtocolController* controller =
mRtspResource->GetMediaStreamController();
if (controller) {
- controller->Play();
+ controller->Play();
}
}
diff --git a/content/media/omx/RtspOmxReader.h b/content/media/omx/RtspOmxReader.h
index 80093662a9d8..0fd60b2dcd13 100644
--- a/content/media/omx/RtspOmxReader.h
+++ b/content/media/omx/RtspOmxReader.h
@@ -44,6 +44,9 @@ public:
MOZ_COUNT_DTOR(RtspOmxReader);
}
+ virtual nsresult ReadMetadata(MediaInfo* aInfo,
+ MetadataTags** aTags) MOZ_OVERRIDE;
+
// Implement a time-based seek instead of byte-based..
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
int64_t aCurrentTime) MOZ_FINAL MOZ_OVERRIDE;
diff --git a/content/media/omx/mediaresourcemanager/Makefile.in b/content/media/omx/mediaresourcemanager/Makefile.in
deleted file mode 100644
index 8b62fbcf3e76..000000000000
--- a/content/media/omx/mediaresourcemanager/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/rules.mk
-
-CXXFLAGS += \
- -I$(ANDROID_SOURCE)/frameworks/base/include/ \
- -I$(ANDROID_SOURCE)/frameworks/base/include/binder/ \
- -I$(ANDROID_SOURCE)/frameworks/base/include/utils/ \
- -I$(ANDROID_SOURCE)/frameworks/base/include/media/ \
- -I$(ANDROID_SOURCE)/frameworks/base/include/media/stagefright/openmax \
- -I$(ANDROID_SOURCE)/frameworks/base/media/libstagefright/include/ \
- $(NULL)
diff --git a/content/media/omx/mediaresourcemanager/moz.build b/content/media/omx/mediaresourcemanager/moz.build
index a61f94a65f4f..b9ba9e2695af 100644
--- a/content/media/omx/mediaresourcemanager/moz.build
+++ b/content/media/omx/mediaresourcemanager/moz.build
@@ -14,4 +14,15 @@ SOURCES += [
include('/ipc/chromium/chromium-config.mozbuild')
+CXXFLAGS += [
+ '-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
+ 'frameworks/base/include',
+ 'frameworks/base/include/binder',
+ 'frameworks/base/include/utils',
+ 'frameworks/base/include/media/',
+ 'frameworks/base/include/media/stagefright/openmax',
+ 'frameworks/base/media/libstagefright/include',
+ ]
+]
+
FINAL_LIBRARY = 'gklayout'
diff --git a/content/media/test/mochitest.ini b/content/media/test/mochitest.ini
index 8f01a79d75ae..df301b9434df 100644
--- a/content/media/test/mochitest.ini
+++ b/content/media/test/mochitest.ini
@@ -333,7 +333,7 @@ skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed
[test_can_play_type_mpeg.html]
skip-if = buildapp == 'b2g' # b2g(7 failures out of 27) b2g-debug(7 failures out of 27) b2g-desktop(7 failures out of 27)
[test_can_play_type_ogg.html]
-skip-if = buildapp == 'b2g'
+skip-if = buildapp == 'b2g' || e10s
[test_can_play_type_no_ogg.html]
[test_closing_connections.html]
[test_constants.html]
diff --git a/content/media/test/test_texttrack.html b/content/media/test/test_texttrack.html
index 5becbbdb8e34..7540c5abdf4a 100644
--- a/content/media/test/test_texttrack.html
+++ b/content/media/test/test_texttrack.html
@@ -27,11 +27,11 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
is(trackList.length, 0, "Length should be 0.");
ok(typeof video.addTextTrack == "function", "HTMLMediaElement::AddTextTrack() function should be available.")
- video.addTextTrack("subtitles", "label", "en-CA");
+ video.addTextTrack("subtitles", "third", "en-CA");
is(trackList.length, 1, "Length should be 1.");
var textTrack = video.textTracks[0];
- is(textTrack.label, "label", "Label should be set to label.");
+ is(textTrack.label, "third", "Label should be set to third.");
is(textTrack.language, "en-CA", "Language should be en-CA.");
is(textTrack.kind, "subtitles", "Default kind should be subtitles.");
is(textTrack.mode, "hidden", "Default mode should be hidden.");
@@ -47,7 +47,7 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
// All below are read-only properties and so should not allow setting.
textTrack.label = "French subtitles";
- is(textTrack.label, "label", "Label is read-only so should still be \"label\".");
+ is(textTrack.label, "third", "Label is read-only so should still be \"label\".");
textTrack.language = "en";
is(textTrack.language, "en-CA", "Language is read-only so should still be \"en-CA\".");
@@ -60,9 +60,50 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
is(textTrack.mode, value, message);
}
- SimpleTest.finish();
- }
-);
+ // Test that text tracks are sorted correctly when being inserted on the
+ // MediaElements list of text tracks. For this test we add four tracks, the
+ // first one was at the start of the test, the next three are below.
+ var trackOne = document.createElement("track");
+ trackOne.label = "first";
+ trackOne.src = "basic.vtt";
+ video.appendChild(trackOne);
+
+ video.addTextTrack("subtitles", "fourth", "en-CA");
+
+ var trackTwo = document.createElement("track");
+ trackTwo.label = "second";
+ trackTwo.src = "basic.vtt";
+ video.appendChild(trackTwo);
+
+ video.src = "seek.webm";
+ video.preload = "auto";
+
+ document.getElementById("content").appendChild(video);
+
+ video.addEventListener("loadedmetadata", function run_tests() {
+ // Re-que run_tests() at the end of the event loop until the track
+ // element has loaded its data.
+ if (trackOne.readyState == 1 || trackTwo.readyState == 1) {
+ setTimeout(run_tests, 0);
+ return;
+ }
+ is(trackOne.readyState, 2, "First Track::ReadyState should be set to LOADED.");
+ is(trackTwo.readyState, 2, "Second Track::ReadyState should be set to LOADED.");
+
+ // For the tracks to be sorted the first two tracks, added through a
+ // TrackElement, must occupy the first two indexes in their TrackElement
+ // tree order. The second two tracks, added through the 'addTextTrack'
+ // method, will occupy the last two indexes in the order that they were
+ // added in.
+ var labels = [ "first", "second", "third", "fourth" ];
+ is(video.textTracks.length, labels.length, "TextTracks length should be " + labels.length);
+ for (var i = 0; i < video.textTracks.length; i++) {
+ isnot(video.textTracks[i], null, "Video should have a text track at " + i + " index.");
+ is(video.textTracks[i].label, labels[i], "Text track at " + i + " should be " + labels[i]);
+ }
+ SimpleTest.finish();
+ });
+});