From 1ac826c95f8f831da3795c45a847f4bbc0b0acf9 Mon Sep 17 00:00:00 2001 From: bechen Date: Thu, 18 May 2017 11:02:25 +0800 Subject: [PATCH] Bug 1298307 - Check cue's active state first, then verify displaystate. r=alwu,smaug MozReview-Commit-ID: 4sqPNY9Czsr --HG-- extra : rebase_source : e612e00520c839c3460d56618b5f3e30e47bc026 --- dom/media/test/test_webvtt_empty_displaystate.html | 12 ++++++++++-- dom/webidl/VTTCue.webidl | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dom/media/test/test_webvtt_empty_displaystate.html b/dom/media/test/test_webvtt_empty_displaystate.html index 54de86e61502..42c8008dcc93 100644 --- a/dom/media/test/test_webvtt_empty_displaystate.html +++ b/dom/media/test/test_webvtt_empty_displaystate.html @@ -65,11 +65,19 @@ function runTest() { info("--- add cue ---"); track.addCue(cue); - + video.ontimeupdate = function () { + info("--- video.currentTime is " + video.currentTime); + }; cue.onenter = function () { cue.onenter = null; isReceivedOnEnterEvent = true; - checkCueDisplayState(cue, true /* has display-state */); + var cueChrome = SpecialPowers.wrap(cue); + info("cueChrome.getActive " + cueChrome.getActive); + if (cueChrome.getActive) { + checkCueDisplayState(cue, true /* has display-state */); + } else { + ok(false, "The cue start time is 0, should be always active!?"); + } cue.onexit = function () { cue.onexit = null; diff --git a/dom/webidl/VTTCue.webidl b/dom/webidl/VTTCue.webidl index f74db7a58c71..4f8214c21d96 100644 --- a/dom/webidl/VTTCue.webidl +++ b/dom/webidl/VTTCue.webidl @@ -68,4 +68,6 @@ partial interface VTTCue { readonly attribute double computedPosition; [ChromeOnly] readonly attribute PositionAlignSetting computedPositionAlign; + [ChromeOnly] + readonly attribute boolean getActive; };