From 8599325724023ec07d9cae03b6be748a82b72e91 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Mon, 12 Sep 2016 16:20:11 +0800 Subject: [PATCH 001/101] Bug 1302045. Check if we have [GetMediaTime(), GetMediaTime() + aUsecs] in the buffer ranges to decide whether we are in low buffered data. r=cpearce Note we consider [endOfDecodedData, GetMediaTime()] is always in the buffer ranges. MozReview-Commit-ID: F6ez3KYMjht --HG-- extra : rebase_source : c5f53125f509a58c1abf8151847df0f3d2d08674 --- dom/media/MediaDecoderStateMachine.cpp | 32 ++++++++++++++++---------- dom/media/MediaDecoderStateMachine.h | 9 ++++---- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index c06443911634..58fd9c89dfe1 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -916,11 +916,11 @@ MediaDecoderStateMachine::NeedToSkipToNextKeyframe() bool isLowOnDecodedVideo = !mIsVideoPrerolling && ((GetClock() - mDecodedVideoEndTime) * mPlaybackRate > LOW_VIDEO_THRESHOLD_USECS); - bool lowUndecoded = HasLowUndecodedData(); + bool lowBuffered = HasLowBufferedData(); - if ((isLowOnDecodedAudio || isLowOnDecodedVideo) && !lowUndecoded) { + if ((isLowOnDecodedAudio || isLowOnDecodedVideo) && !lowBuffered) { DECODER_LOG("Skipping video decode to the next keyframe lowAudio=%d lowVideo=%d lowUndecoded=%d async=%d", - isLowOnDecodedAudio, isLowOnDecodedVideo, lowUndecoded, mReader->IsAsync()); + isLowOnDecodedAudio, isLowOnDecodedVideo, lowBuffered, mReader->IsAsync()); return true; } @@ -1173,7 +1173,7 @@ MediaDecoderStateMachine::OnVideoDecoded(MediaData* aVideoSample, } TimeDuration decodeTime = TimeStamp::Now() - aDecodeStartTime; if (THRESHOLD_FACTOR * DurationToUsecs(decodeTime) > mLowAudioThresholdUsecs && - !HasLowUndecodedData()) + !HasLowBufferedData()) { mLowAudioThresholdUsecs = std::min(THRESHOLD_FACTOR * DurationToUsecs(decodeTime), mAmpleAudioThresholdUsecs); @@ -1386,7 +1386,7 @@ MediaDecoderStateMachine::MaybeStartBuffering() bool shouldBuffer; if (mReader->UseBufferingHeuristics()) { shouldBuffer = HasLowDecodedData(EXHAUSTED_DATA_MARGIN_USECS) && - (JustExitedQuickBuffering() || HasLowUndecodedData()); + (JustExitedQuickBuffering() || HasLowBufferedData()); } else { MOZ_ASSERT(mReader->IsWaitForDataSupported()); shouldBuffer = (OutOfDecodedAudio() && mReader->IsWaitingAudioData()) || @@ -2265,13 +2265,13 @@ bool MediaDecoderStateMachine::OutOfDecodedAudio() !mMediaSink->HasUnplayedFrames(TrackInfo::kAudioTrack); } -bool MediaDecoderStateMachine::HasLowUndecodedData() +bool MediaDecoderStateMachine::HasLowBufferedData() { MOZ_ASSERT(OnTaskQueue()); - return HasLowUndecodedData(mLowDataThresholdUsecs); + return HasLowBufferedData(mLowDataThresholdUsecs); } -bool MediaDecoderStateMachine::HasLowUndecodedData(int64_t aUsecs) +bool MediaDecoderStateMachine::HasLowBufferedData(int64_t aUsecs) { MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(mState >= DECODER_STATE_DECODING, @@ -2304,9 +2304,17 @@ bool MediaDecoderStateMachine::HasLowUndecodedData(int64_t aUsecs) // Our duration is not up to date. No point buffering. return false; } - media::TimeInterval interval(media::TimeUnit::FromMicroseconds(endOfDecodedData), - media::TimeUnit::FromMicroseconds(std::min(endOfDecodedData + aUsecs, Duration().ToMicroseconds()))); - return endOfDecodedData != INT64_MAX && !mBuffered.Ref().Contains(interval); + + if (endOfDecodedData == INT64_MAX) { + // Have decoded all samples. No point buffering. + return false; + } + + int64_t start = endOfDecodedData; + int64_t end = std::min(GetMediaTime() + aUsecs, Duration().ToMicroseconds()); + media::TimeInterval interval(media::TimeUnit::FromMicroseconds(start), + media::TimeUnit::FromMicroseconds(end)); + return !mBuffered.Ref().Contains(interval); } void @@ -2543,7 +2551,7 @@ MediaDecoderStateMachine::StepBuffering() if ((isLiveStream || !CanPlayThrough()) && elapsed < TimeDuration::FromSeconds(mBufferingWait * mPlaybackRate) && (mQuickBuffering ? HasLowDecodedData(mQuickBufferingLowDataThresholdUsecs) - : HasLowUndecodedData(mBufferingWait * USECS_PER_S)) && + : HasLowBufferedData(mBufferingWait * USECS_PER_S)) && mResource->IsExpectingMoreData()) { DECODER_LOG("Buffering: wait %ds, timeout in %.3lfs %s", mBufferingWait, mBufferingWait - elapsed.ToSeconds(), diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index 70760ad7614f..46fdcc06b8d9 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -401,12 +401,11 @@ protected: } - // Returns true if we're running low on data which is not yet decoded. - // The decoder monitor must be held. - bool HasLowUndecodedData(); + // Returns true if we're running low on buffered data. + bool HasLowBufferedData(); - // Returns true if we have less than aUsecs of undecoded data available. - bool HasLowUndecodedData(int64_t aUsecs); + // Returns true if we have less than aUsecs of buffered data available. + bool HasLowBufferedData(int64_t aUsecs); // Returns true when there's decoded audio waiting to play. // The decoder monitor must be held. From 5564be70f2071b4b6f39776b390008a547fd109e Mon Sep 17 00:00:00 2001 From: JW Wang Date: Tue, 6 Sep 2016 16:28:20 +0800 Subject: [PATCH 002/101] Bug 1300711 - Remove MediaDecoderStateMachine::mQuickBuffering. r=cpearce MozReview-Commit-ID: GW7bhY6ruKG --HG-- extra : rebase_source : 272c297ffa1e5b1034992b6a2b35e5949fb26b84 --- dom/media/MediaDecoderStateMachine.cpp | 61 ++------------------------ dom/media/MediaDecoderStateMachine.h | 14 ------ 2 files changed, 4 insertions(+), 71 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 58fd9c89dfe1..f87c317662d5 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -142,36 +142,6 @@ static_assert(LOW_DATA_THRESHOLD_USECS > AMPLE_AUDIO_USECS, // Amount of excess usecs of data to add in to the "should we buffer" calculation. static const uint32_t EXHAUSTED_DATA_MARGIN_USECS = 100000; -// If we enter buffering within QUICK_BUFFER_THRESHOLD_USECS seconds of starting -// decoding, we'll enter "quick buffering" mode, which exits a lot sooner than -// normal buffering mode. This exists so that if the decode-ahead exhausts the -// downloaded data while decode/playback is just starting up (for example -// after a seek while the media is still playing, or when playing a media -// as soon as it's load started), we won't necessarily stop for 30s and wait -// for buffering. We may actually be able to playback in this case, so exit -// buffering early and try to play. If it turns out we can't play, we'll fall -// back to buffering normally. -static const uint32_t QUICK_BUFFER_THRESHOLD_USECS = 2000000; - -namespace detail { - -// If we're quick buffering, we'll remain in buffering mode while we have less than -// QUICK_BUFFERING_LOW_DATA_USECS of decoded data available. -static const uint32_t QUICK_BUFFERING_LOW_DATA_USECS = 1000000; - -// If QUICK_BUFFERING_LOW_DATA_USECS is > AMPLE_AUDIO_USECS, we won't exit -// quick buffering in a timely fashion, as the decode pauses when it -// reaches AMPLE_AUDIO_USECS decoded data, and thus we'll never reach -// QUICK_BUFFERING_LOW_DATA_USECS. -static_assert(QUICK_BUFFERING_LOW_DATA_USECS <= AMPLE_AUDIO_USECS, - "QUICK_BUFFERING_LOW_DATA_USECS is too large"); - -} // namespace detail - -static TimeDuration UsecsToDuration(int64_t aUsecs) { - return TimeDuration::FromMicroseconds(aUsecs); -} - static int64_t DurationToUsecs(TimeDuration aDuration) { return static_cast(aDuration.ToSeconds() * USECS_PER_S); } @@ -611,14 +581,12 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder, mPlaybackRate(1.0), mLowAudioThresholdUsecs(detail::LOW_AUDIO_USECS), mAmpleAudioThresholdUsecs(detail::AMPLE_AUDIO_USECS), - mQuickBufferingLowDataThresholdUsecs(detail::QUICK_BUFFERING_LOW_DATA_USECS), mIsAudioPrerolling(false), mIsVideoPrerolling(false), mAudioCaptured(false), INIT_WATCHABLE(mAudioCompleted, false), INIT_WATCHABLE(mVideoCompleted, false), mNotifyMetadataBeforeFirstFrame(false), - mQuickBuffering(false), mMinimizePreroll(false), mDecodeThreadWaiting(false), mSentLoadedMetadataEvent(false), @@ -1386,7 +1354,7 @@ MediaDecoderStateMachine::MaybeStartBuffering() bool shouldBuffer; if (mReader->UseBufferingHeuristics()) { shouldBuffer = HasLowDecodedData(EXHAUSTED_DATA_MARGIN_USECS) && - (JustExitedQuickBuffering() || HasLowBufferedData()); + HasLowBufferedData(); } else { MOZ_ASSERT(mReader->IsWaitForDataSupported()); shouldBuffer = (OutOfDecodedAudio() && mReader->IsWaitingAudioData()) || @@ -2470,11 +2438,6 @@ MediaDecoderStateMachine::SeekCompleted() // Try to decode another frame to detect if we're at the end... DECODER_LOG("Seek completed, mCurrentPosition=%lld", mCurrentPosition.Ref()); - // Reset quick buffering status. This ensures that if we began the - // seek while quick-buffering, we won't bypass quick buffering mode - // if we need to buffer after the seek. - mQuickBuffering = false; - if (video) { mMediaSink->Redraw(mInfo.mVideo); mOnPlaybackEvent.Notify(MediaEventType::Invalidate); @@ -2550,12 +2513,10 @@ MediaDecoderStateMachine::StepBuffering() bool isLiveStream = mResource->IsLiveStream(); if ((isLiveStream || !CanPlayThrough()) && elapsed < TimeDuration::FromSeconds(mBufferingWait * mPlaybackRate) && - (mQuickBuffering ? HasLowDecodedData(mQuickBufferingLowDataThresholdUsecs) - : HasLowBufferedData(mBufferingWait * USECS_PER_S)) && + HasLowBufferedData(mBufferingWait * USECS_PER_S) && mResource->IsExpectingMoreData()) { - DECODER_LOG("Buffering: wait %ds, timeout in %.3lfs %s", - mBufferingWait, mBufferingWait - elapsed.ToSeconds(), - (mQuickBuffering ? "(quick exit)" : "")); + DECODER_LOG("Buffering: wait %ds, timeout in %.3lfs", + mBufferingWait, mBufferingWait - elapsed.ToSeconds()); ScheduleStateMachineIn(USECS_PER_S); return; } @@ -2755,14 +2716,6 @@ void MediaDecoderStateMachine::UpdateNextFrameStatus() mNextFrameStatus = status; } -bool MediaDecoderStateMachine::JustExitedQuickBuffering() -{ - MOZ_ASSERT(OnTaskQueue()); - return !mDecodeStartTime.IsNull() && - mQuickBuffering && - (TimeStamp::Now() - mDecodeStartTime) < TimeDuration::FromMicroseconds(QUICK_BUFFER_THRESHOLD_USECS); -} - bool MediaDecoderStateMachine::CanPlayThrough() { @@ -2796,12 +2749,6 @@ MediaDecoderStateMachine::StartBuffering() } TimeDuration decodeDuration = TimeStamp::Now() - mDecodeStartTime; - // Go into quick buffering mode provided we've not just left buffering using - // a "quick exit". This stops us flip-flopping between playing and buffering - // when the download speed is similar to the decode speed. - mQuickBuffering = - !JustExitedQuickBuffering() && - decodeDuration < UsecsToDuration(QUICK_BUFFER_THRESHOLD_USECS); mBufferingStart = TimeStamp::Now(); DECODER_LOG("Changed state from DECODING to BUFFERING, decoded for %.3lfs", diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index 46fdcc06b8d9..c6165180db07 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -411,9 +411,6 @@ protected: // The decoder monitor must be held. bool HasFutureAudio(); - // Returns true if we recently exited "quick buffering" mode. - bool JustExitedQuickBuffering(); - // Recomputes mNextFrameStatus, possibly dispatching notifications to interested // parties. void UpdateNextFrameStatus(); @@ -712,10 +709,6 @@ private: // we detect that the decode can't keep up with rendering. int64_t mAmpleAudioThresholdUsecs; - // If we're quick buffering, we'll remain in buffering mode while we have less than - // QUICK_BUFFERING_LOW_DATA_USECS of decoded data available. - int64_t mQuickBufferingLowDataThresholdUsecs; - // At the start of decoding we want to "preroll" the decode until we've // got a few frames decoded before we consider whether decode is falling // behind. Otherwise our "we're falling behind" logic will trigger @@ -818,13 +811,6 @@ private: // simplified. bool mNotifyMetadataBeforeFirstFrame; - // If this is true while we're in buffering mode, we can exit early, - // as it's likely we may be able to playback. This happens when we enter - // buffering mode soon after the decode starts, because the decode-ahead - // ran fast enough to exhaust all data while the download is starting up. - // Synchronised via decoder monitor. - bool mQuickBuffering; - // True if we should not decode/preroll unnecessary samples, unless we're // played. "Prerolling" in this context refers to when we decode and // buffer decoded samples in advance of when they're needed for playback. From 1042db50c8ce24cc7bca418acbdf34eacc5301b7 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 13 Sep 2016 21:48:45 +0900 Subject: [PATCH 003/101] Bug 1300937 part.1 Check KeyboardEvent.key and KeyboardEvent.code in test_keycodes.xul r=smaug MozReview-Commit-ID: AntOqvmTCcW --HG-- extra : rebase_source : a223980232f1c5bf03b3dc5685afe2990e5dc893 --- .../tests/SimpleTest/NativeKeyCodes.js | 4 +- widget/tests/test_keycodes.xul | 1662 +++++++++-------- 2 files changed, 848 insertions(+), 818 deletions(-) diff --git a/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js b/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js index 4a5045e417e3..c73b5407f761 100644 --- a/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js +++ b/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js @@ -321,13 +321,13 @@ const MAC_VK_JIS_Kana = 0x68; const MAC_VK_F13 = 0x69; const MAC_VK_PC_PrintScreen = 0x69; const MAC_VK_F16 = 0x6A; -const MAC_VK_PC_ScrollLock = 0x6A; const MAC_VK_F14 = 0x6B; -const MAC_VK_PC_Pause = 0x6B; +const MAC_VK_PC_ScrollLock = 0x6B; const MAC_VK_F10 = 0x6D; const MAC_VK_PC_ContextMenu = 0x6E; const MAC_VK_F12 = 0x6F; const MAC_VK_F15 = 0x71; +const MAC_VK_PC_Pause = 0x71; const MAC_VK_Help = 0x72; const MAC_VK_PC_Insert = 0x72; const MAC_VK_Home = 0x73; diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul index 48fbcdbf6ff2..714eef2ff118 100644 --- a/widget/tests/test_keycodes.xul +++ b/widget/tests/test_keycodes.xul @@ -287,7 +287,12 @@ function* runKeyEventTests() // The first parameter is the complete input event. The second parameter is // what to test against. The third parameter is which key events should be // delived for the event. - function testKey(aEvent, aExpectedGeckoKeyCode, aExpectGeckoChar, + // @param aExpectedKeyValues Can be string or array of string. + // If all keyboard events have same key value, + // specify it as string. Otherwise, specify + // each key value in array. + function testKey(aEvent, aExpectedKeyValues, aExpectedCodeValue, + aExpectedGeckoKeyCode, aExpectGeckoChar, aShouldDelivedEvent, aExpectLocation) { ok(aExpectedGeckoKeyCode != undefined, "keycode is undefined"); @@ -349,7 +354,7 @@ function* runKeyEventTests() var firedEventType = i < eventList.length ? eventList[i].type : ""; var expectEventType = i < expectEventTypeList.length ? expectEventTypeList[i] : ""; if (firedEventType != "") - is(firedEventType, expectEventType, name + ", wrong type event fired"); + is(firedEventType, expectEventType, name + ", " + expectEventType + " should be fired"); else is(firedEventType, expectEventType, name + ", a needed event is not fired"); @@ -370,6 +375,13 @@ function* runKeyEventTests() is(e.shiftKey, !!(aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey), name + ", Shift mismatch"); } + var expectedKeyValue = + typeof aExpectedKeyValues === "string" ? aExpectedKeyValues : + i < aExpectedKeyValues.length ? aExpectedKeyValues[i] : + undefined; + is(e.key, expectedKeyValue, name + ", wrong key value"); + is(e.code, aExpectedCodeValue, name + ", wrong code value"); + if (aExpectGeckoChar.length > 0 && e.type == "keypress") { is(e.charCode, aExpectGeckoChar.charCodeAt(keypressCount++), name + ", charcode"); if (aExpectedGeckoKeyCode >= 0) { @@ -400,7 +412,16 @@ function* runKeyEventTests() // Prevent almost all shortcut key handlers. SpecialPowers.addSystemEventListener(document, "keypress", consumer, true); - if (IS_MAC) { + function cleanup() + { + document.removeEventListener("keydown", onKeyEvent, false); + document.removeEventListener("keypress", onKeyEvent, false); + document.removeEventListener("keyup", onKeyEvent, false); + SpecialPowers.removeSystemEventListener(document, "keypress", consumer, true); + } + + function testKeysOnMac() + { // On Mac, you can produce event records for any desired keyboard input // by running with NSPR_LOG_MODULES=TextInputHandlerWidgets:5 and typing // into the browser. We will dump the key event fields to the console @@ -416,1474 +437,1478 @@ function* runKeyEventTests() // Ctrl keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Alt keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{altKey:1}, chars:"\u00e5", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00e5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00c5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Command keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift-cmd gives us the shifted character yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl-cmd gives us the unshifted character yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Alt-cmd gives us the shifted character yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1, altKey:1}, chars:"\u00e5", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00e5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00c5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Greek ctrl keys produce Latin charcodes yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u03b1", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"\u0391"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0391", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Greek command keys yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift-cmd gives us the shifted character yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"\u0391"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl-cmd gives us the unshifted character yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u03b1", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Alt-cmd gives us the shifted character yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1, altKey:1}, chars:"\u00a8", unmodifiedChars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00a8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00a8", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00a8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00b9", unmodifiedChars:"\u0391"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00b9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00b9", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00b9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // German yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A, modifiers: {}, chars:"a", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket, modifiers: {}, chars:"\u00fc", unmodifiedChars:"\u00fc"}, - 0, "\u00fc", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00fc", "BracketLeft", 0, "\u00fc", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, modifiers: {}, chars:"\u00df", unmodifiedChars:"\u00df"}, - nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "\u00df", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00df", "Minus", nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "\u00df", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"}, - nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "?", "Minus", nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Note that Shift+SS is '?' but Cmd+Shift+SS is '/' on German layout. // Therefore, when Cmd key is pressed, the SS key's keycode is changed. yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, modifiers:{metaKey:1}, chars:"\u00df", unmodifiedChars:"\u00df"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "\u00df", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00df", "Minus", nsIDOMKeyEvent.DOM_VK_SLASH, "\u00df", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, modifiers:{metaKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"?"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "Minus", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Caps Lock key event // XXX keyup event of Caps Lock key is not fired. yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock, modifiers:{capsLockKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "CapsLock", "CapsLock", nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock, modifiers:{capsLockKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "CapsLock", "CapsLock", nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift/RightShift key event yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift, modifiers:{shiftKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Shift", "ShiftLeft", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift, modifiers:{shiftKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Shift", "ShiftLeft", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift, modifiers:{shiftRightKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Shift", "ShiftRight", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift, modifiers:{shiftRightKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Shift", "ShiftRight", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Control/RightControl key event yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control, modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Control", "ControlLeft", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control, modifiers:{ctrlKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Control", "ControlLeft", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl, modifiers:{ctrlRightKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Control", "ControlRight", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl, modifiers:{ctrlRightKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Control", "ControlRight", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Option/RightOption key event yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option, modifiers:{altKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Alt", "AltLeft", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option, modifiers:{altKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Alt", "AltLeft", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption, modifiers:{altRightKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Alt", "AltRight", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption, modifiers:{altRightKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Alt", "AltRight", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Command/RightCommand key event yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command, modifiers:{metaKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Meta", "OSLeft", nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command, modifiers:{metaKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Meta", "OSLeft", nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand, modifiers:{metaRightKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Meta", "OSRight", nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand, modifiers:{metaRightKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Meta", "OSRight", nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // all keys on keyboard (keyCode test) yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Tab, modifiers: {}, chars:"\t", unmodifiedChars:"\t"}, - nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Tab", "Tab", nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadClear, modifiers: {}, chars:"\uF739", unmodifiedChars:"\uF739"}, - nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Clear", "NumLock", nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Return, modifiers: {}, chars:"\u000D", unmodifiedChars:"\u000D"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F15, + "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Pause, modifiers: {}, chars:"\uF712", unmodifiedChars:"\uF712"}, - nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F15", "F15", nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Escape, modifiers: {}, chars:"\u001B", unmodifiedChars:"\u001B"}, - nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Escape", "Escape", nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Space, modifiers: {}, chars:" ", unmodifiedChars:" "}, - nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + " ", "Space", nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageUp, modifiers: {}, chars:"\uF72C", unmodifiedChars:"\uF72C"}, - nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "PageUp", "PageUp", nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageDown, modifiers: {}, chars:"\uF72D", unmodifiedChars:"\uF72D"}, - nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "PageDown", "PageDown", nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_End, modifiers: {}, chars:"\uF72B", unmodifiedChars:"\uF72B"}, - nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "End", "End", nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Home, modifiers: {}, chars:"\uF729", unmodifiedChars:"\uF729"}, - nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Home", "Home", nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_LeftArrow, modifiers: {}, chars:"\uF702", unmodifiedChars:"\uF702"}, - nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "ArrowLeft", "ArrowLeft", nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_UpArrow, modifiers: {}, chars:"\uF700", unmodifiedChars:"\uF700"}, - nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "ArrowUp", "ArrowUp", nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightArrow, modifiers: {}, chars:"\uF703", unmodifiedChars:"\uF703"}, - nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "ArrowRight", "ArrowRight", nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_DownArrow, modifiers: {}, chars:"\uF701", unmodifiedChars:"\uF701"}, - nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "ArrowDown", "ArrowDown", nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_PrintScreen, modifiers: {}, chars:"\uF710", unmodifiedChars:"\uF710"}, - nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F13", "F13", nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Delete, modifiers: {}, chars:"\uF728", unmodifiedChars:"\uF728"}, - nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Pause, + "Delete", "Delete", nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_ScrollLock, modifiers: {}, chars:"\uF711", unmodifiedChars:"\uF711"}, - nsIDOMKeyEvent.DOM_VK_SCROLL_LOCK, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F14", "F14", nsIDOMKeyEvent.DOM_VK_SCROLL_LOCK, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_ContextMenu, modifiers: {}, chars:"\u0010", unmodifiedChars:"\u0010"}, - nsIDOMKeyEvent.DOM_VK_CONTEXT_MENU, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "ContextMenu", "ContextMenu", nsIDOMKeyEvent.DOM_VK_CONTEXT_MENU, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F1, modifiers:{fnKey:1}, chars:"\uF704", unmodifiedChars:"\uF704"}, - nsIDOMKeyEvent.DOM_VK_F1, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F1", "F1", nsIDOMKeyEvent.DOM_VK_F1, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F2, modifiers:{fnKey:1}, chars:"\uF705", unmodifiedChars:"\uF705"}, - nsIDOMKeyEvent.DOM_VK_F2, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F2", "F2", nsIDOMKeyEvent.DOM_VK_F2, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F3, modifiers:{fnKey:1}, chars:"\uF706", unmodifiedChars:"\uF706"}, - nsIDOMKeyEvent.DOM_VK_F3, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F3", "F3", nsIDOMKeyEvent.DOM_VK_F3, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F4, modifiers:{fnKey:1}, chars:"\uF707", unmodifiedChars:"\uF707"}, - nsIDOMKeyEvent.DOM_VK_F4, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F4", "F4", nsIDOMKeyEvent.DOM_VK_F4, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F5, modifiers:{fnKey:1}, chars:"\uF708", unmodifiedChars:"\uF708"}, - nsIDOMKeyEvent.DOM_VK_F5, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F5", "F5", nsIDOMKeyEvent.DOM_VK_F5, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F6, modifiers:{fnKey:1}, chars:"\uF709", unmodifiedChars:"\uF709"}, - nsIDOMKeyEvent.DOM_VK_F6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F6", "F6", nsIDOMKeyEvent.DOM_VK_F6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F7, modifiers:{fnKey:1}, chars:"\uF70A", unmodifiedChars:"\uF70A"}, - nsIDOMKeyEvent.DOM_VK_F7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F7", "F7", nsIDOMKeyEvent.DOM_VK_F7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F8, modifiers:{fnKey:1}, chars:"\uF70B", unmodifiedChars:"\uF70B"}, - nsIDOMKeyEvent.DOM_VK_F8, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F8", "F8", nsIDOMKeyEvent.DOM_VK_F8, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F9, modifiers:{fnKey:1}, chars:"\uF70C", unmodifiedChars:"\uF70C"}, - nsIDOMKeyEvent.DOM_VK_F9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F9", "F9", nsIDOMKeyEvent.DOM_VK_F9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F10, modifiers:{fnKey:1}, chars:"\uF70D", unmodifiedChars:"\uF70D"}, - nsIDOMKeyEvent.DOM_VK_F10, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F10", "F10", nsIDOMKeyEvent.DOM_VK_F10, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F11, modifiers:{fnKey:1}, chars:"\uF70E", unmodifiedChars:"\uF70E"}, - nsIDOMKeyEvent.DOM_VK_F11, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F11", "F11", nsIDOMKeyEvent.DOM_VK_F11, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F12, modifiers:{fnKey:1}, chars:"\uF70F", unmodifiedChars:"\uF70F"}, - nsIDOMKeyEvent.DOM_VK_F12, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F12", "F12", nsIDOMKeyEvent.DOM_VK_F12, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F16, modifiers:{fnKey:1}, chars:"\uF713", unmodifiedChars:"\uF713"}, - nsIDOMKeyEvent.DOM_VK_F16, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F16", "F16", nsIDOMKeyEvent.DOM_VK_F16, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F17, modifiers:{fnKey:1}, chars:"\uF714", unmodifiedChars:"\uF714"}, - nsIDOMKeyEvent.DOM_VK_F17, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F17", "F17", nsIDOMKeyEvent.DOM_VK_F17, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F18, modifiers:{fnKey:1}, chars:"\uF715", unmodifiedChars:"\uF715"}, - nsIDOMKeyEvent.DOM_VK_F18, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F18", "F18", nsIDOMKeyEvent.DOM_VK_F18, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F19, modifiers:{fnKey:1}, chars:"\uF716", unmodifiedChars:"\uF716"}, - nsIDOMKeyEvent.DOM_VK_F19, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F19", "F19", nsIDOMKeyEvent.DOM_VK_F19, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // US // Alphabet yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers: {}, chars:"a", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{shiftKey:1}, chars:"A", unmodifiedChars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{altKey:1}, chars:"\u00E5", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, modifiers:{}, chars:"b", unmodifiedChars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, modifiers:{shiftKey:1}, chars:"B", unmodifiedChars:"B"}, - nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "B", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, modifiers:{ctrlKey:1}, chars:"\u0002", unmodifiedChars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, modifiers:{altKey:1}, chars:"\u222B", unmodifiedChars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "\u222B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u222B", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "\u222B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, modifiers:{metaKey:1}, chars:"b", unmodifiedChars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, modifiers:{}, chars:"c", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, modifiers:{shiftKey:1}, chars:"C", unmodifiedChars:"C"}, - nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "C", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, modifiers:{ctrlKey:1}, chars:"\u0003", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, modifiers:{altKey:1}, chars:"\u00E7", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E7", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, modifiers:{metaKey:1}, chars:"c", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, modifiers:{}, chars:"d", unmodifiedChars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, modifiers:{shiftKey:1}, chars:"D", unmodifiedChars:"D"}, - nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "D", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, modifiers:{ctrlKey:1}, chars:"\u0004", unmodifiedChars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, modifiers:{altKey:1}, chars:"\u2202", unmodifiedChars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "\u2202", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2202", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "\u2202", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, modifiers:{}, chars:"e", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"}, - nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "E", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "\u00B4", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + "Dead", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "\u00B4", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, modifiers:{metaKey:1}, chars:"e", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, modifiers:{}, chars:"f", unmodifiedChars:"f"}, - nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, modifiers:{shiftKey:1}, chars:"F", unmodifiedChars:"F"}, - nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, modifiers:{ctrlKey:1}, chars:"\u0006", unmodifiedChars:"f"}, - nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, modifiers:{altKey:1}, chars:"\u0192", unmodifiedChars:"f"}, - nsIDOMKeyEvent.DOM_VK_F, "\u0192", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0192", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "\u0192", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX This test starts fullscreen mode. // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, // modifiers:{metaKey:1}, chars:"f", unmodifiedChars:"f"}, - // nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, modifiers:{}, chars:"g", unmodifiedChars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, modifiers:{shiftKey:1}, chars:"G", unmodifiedChars:"G"}, - nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "G", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, modifiers:{ctrlKey:1}, chars:"\u0007", unmodifiedChars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, modifiers:{altKey:1}, chars:"\u00A9", unmodifiedChars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "\u00A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A9", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "\u00A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, modifiers:{metaKey:1}, chars:"g", unmodifiedChars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, modifiers:{}, chars:"h", unmodifiedChars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, modifiers:{shiftKey:1}, chars:"H", unmodifiedChars:"H"}, - nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "H", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, modifiers:{ctrlKey:1}, chars:"\u0008", unmodifiedChars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, modifiers:{altKey:1}, chars:"\u02D9", unmodifiedChars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "\u02D9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u02D9", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "\u02D9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, modifiers:{metaKey:1}, chars:"h", unmodifiedChars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, modifiers:{}, chars:"i", unmodifiedChars:"i"}, - nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, modifiers:{shiftKey:1}, chars:"I", unmodifiedChars:"I"}, - nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "I", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, modifiers:{ctrlKey:1}, chars:"\u0009", unmodifiedChars:"i"}, - nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, modifiers:{altKey:1}, chars:"", unmodifiedChars:"i"}, - nsIDOMKeyEvent.DOM_VK_I, "\u02C6", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + "Dead", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "\u02C6", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key // XXX This test causes memory leak. // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, // modifiers:{metaKey:1}, chars:"i", unmodifiedChars:"i"}, - // nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, modifiers:{}, chars:"j", unmodifiedChars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, modifiers:{shiftKey:1}, chars:"J", unmodifiedChars:"J"}, - nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "J", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, modifiers:{ctrlKey:1}, chars:"\u000A", unmodifiedChars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, modifiers:{altKey:1}, chars:"\u2206", unmodifiedChars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "\u2206", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2206", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "\u2206", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, modifiers:{metaKey:1}, chars:"j", unmodifiedChars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, modifiers:{}, chars:"k", unmodifiedChars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, modifiers:{shiftKey:1}, chars:"K", unmodifiedChars:"K"}, - nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "K", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, modifiers:{ctrlKey:1}, chars:"\u000B", unmodifiedChars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, modifiers:{altKey:1}, chars:"\u02DA", unmodifiedChars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "\u02DA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u02DA", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "\u02DA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, modifiers:{metaKey:1}, chars:"k", unmodifiedChars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, modifiers:{}, chars:"l", unmodifiedChars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, modifiers:{shiftKey:1}, chars:"L", unmodifiedChars:"L"}, - nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "L", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, modifiers:{ctrlKey:1}, chars:"\u000C", unmodifiedChars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, modifiers:{altKey:1}, chars:"\u00AC", unmodifiedChars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "\u00AC", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00AC", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "\u00AC", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, modifiers:{metaKey:1}, chars:"l", unmodifiedChars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, modifiers:{}, chars:"m", unmodifiedChars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, modifiers:{shiftKey:1}, chars:"M", unmodifiedChars:"M"}, - nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "M", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, modifiers:{ctrlKey:1}, chars:"\u000D", unmodifiedChars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, modifiers:{altKey:1}, chars:"\u00B5", unmodifiedChars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00B5", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, modifiers:{metaKey:1}, chars:"m", unmodifiedChars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, modifiers:{}, chars:"n", unmodifiedChars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, modifiers:{shiftKey:1}, chars:"N", unmodifiedChars:"N"}, - nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "N", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, modifiers:{ctrlKey:1}, chars:"\u000E", unmodifiedChars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, modifiers:{altKey:1}, chars:"", unmodifiedChars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "\u02DC", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + "Dead", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "\u02DC", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, modifiers:{metaKey:1}, chars:"n", unmodifiedChars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, modifiers:{}, chars:"o", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, modifiers:{shiftKey:1}, chars:"O", unmodifiedChars:"O"}, - nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "O", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, modifiers:{ctrlKey:1}, chars:"\u000F", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, modifiers:{altKey:1}, chars:"\u00F8", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00F8", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, modifiers:{metaKey:1}, chars:"o", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, modifiers:{}, chars:"p", unmodifiedChars:"p"}, - nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, modifiers:{shiftKey:1}, chars:"P", unmodifiedChars:"P"}, - nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "P", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, modifiers:{ctrlKey:1}, chars:"\u0010", unmodifiedChars:"p"}, - nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, modifiers:{altKey:1}, chars:"\u03C0", unmodifiedChars:"p"}, - nsIDOMKeyEvent.DOM_VK_P, "\u03C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u03C0", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "\u03C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX This test starts private browsing mode (stopped at the confirmation dialog) // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, // modifiers:{metaKey:1}, chars:"p", unmodifiedChars:"p"}, - // nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, modifiers:{}, chars:"q", unmodifiedChars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, modifiers:{shiftKey:1}, chars:"Q", unmodifiedChars:"Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, modifiers:{ctrlKey:1}, chars:"\u0011", unmodifiedChars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, modifiers:{altKey:1}, chars:"\u0153", unmodifiedChars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "\u0153", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0153", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "\u0153", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, modifiers:{metaKey:1}, chars:"q", unmodifiedChars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, modifiers:{}, chars:"r", unmodifiedChars:"r"}, - nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, modifiers:{shiftKey:1}, chars:"R", unmodifiedChars:"R"}, - nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "R", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, modifiers:{ctrlKey:1}, chars:"\u0012", unmodifiedChars:"r"}, - nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, modifiers:{altKey:1}, chars:"\u00AE", unmodifiedChars:"r"}, - nsIDOMKeyEvent.DOM_VK_R, "\u00AE", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00AE", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "\u00AE", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX This test makes some tabs and dialogs. // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, // modifiers:{metaKey:1}, chars:"r", unmodifiedChars:"r"}, - // nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, modifiers:{}, chars:"s", unmodifiedChars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, modifiers:{shiftKey:1}, chars:"S", unmodifiedChars:"S"}, - nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "S", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, modifiers:{ctrlKey:1}, chars:"\u0013", unmodifiedChars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, modifiers:{altKey:1}, chars:"\u00DF", unmodifiedChars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "\u00DF", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00DF", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "\u00DF", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, modifiers:{metaKey:1}, chars:"s", unmodifiedChars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, modifiers:{}, chars:"t", unmodifiedChars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, modifiers:{shiftKey:1}, chars:"T", unmodifiedChars:"T"}, - nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "T", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, modifiers:{ctrlKey:1}, chars:"\u0014", unmodifiedChars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, modifiers:{altKey:1}, chars:"\u2020", unmodifiedChars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "\u2020", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2020", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "\u2020", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, modifiers:{metaKey:1}, chars:"t", unmodifiedChars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, modifiers:{}, chars:"u", unmodifiedChars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, modifiers:{shiftKey:1}, chars:"U", unmodifiedChars:"U"}, - nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "U", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, modifiers:{ctrlKey:1}, chars:"\u0015", unmodifiedChars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, modifiers:{altKey:1}, chars:"", unmodifiedChars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "\u00A8", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + "Dead", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "\u00A8", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, modifiers:{metaKey:1}, chars:"u", unmodifiedChars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, modifiers:{}, chars:"v", unmodifiedChars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, modifiers:{shiftKey:1}, chars:"V", unmodifiedChars:"V"}, - nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "V", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, modifiers:{ctrlKey:1}, chars:"\u0016", unmodifiedChars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, modifiers:{altKey:1}, chars:"\u221A", unmodifiedChars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "\u221A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u221A", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "\u221A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, modifiers:{metaKey:1}, chars:"v", unmodifiedChars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, modifiers:{}, chars:"w", unmodifiedChars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, modifiers:{shiftKey:1}, chars:"W", unmodifiedChars:"W"}, - nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "W", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, modifiers:{ctrlKey:1}, chars:"\u0017", unmodifiedChars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, modifiers:{altKey:1}, chars:"\u2211", unmodifiedChars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "\u2211", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2211", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "\u2211", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, modifiers:{metaKey:1}, chars:"w", unmodifiedChars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, modifiers:{}, chars:"x", unmodifiedChars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, modifiers:{shiftKey:1}, chars:"X", unmodifiedChars:"X"}, - nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "X", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, modifiers:{ctrlKey:1}, chars:"\u0018", unmodifiedChars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, modifiers:{altKey:1}, chars:"\u2248", unmodifiedChars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "\u2248", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2248", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "\u2248", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, modifiers:{metaKey:1}, chars:"x", unmodifiedChars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, modifiers:{}, chars:"y", unmodifiedChars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, modifiers:{shiftKey:1}, chars:"Y", unmodifiedChars:"Y"}, - nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, modifiers:{ctrlKey:1}, chars:"\u0019", unmodifiedChars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, modifiers:{altKey:1}, chars:"\u00A5", unmodifiedChars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "\u00A5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A5", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "\u00A5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, modifiers:{metaKey:1}, chars:"y", unmodifiedChars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, modifiers:{}, chars:"z", unmodifiedChars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, modifiers:{shiftKey:1}, chars:"Z", unmodifiedChars:"Z"}, - nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, modifiers:{ctrlKey:1}, chars:"\u001A", unmodifiedChars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, modifiers:{altKey:1}, chars:"\u03A9", unmodifiedChars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "\u03A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u03A9", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "\u03A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, modifiers:{metaKey:1}, chars:"z", unmodifiedChars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // numeric yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, modifiers:{}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, modifiers:{shiftKey:1}, chars:"!", unmodifiedChars:"!"}, - nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "!", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, modifiers:{altKey:1}, chars:"\u00A1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, modifiers:{metaKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, modifiers:{}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, modifiers:{shiftKey:1}, chars:"@", unmodifiedChars:"@"}, - nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "@", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, modifiers:{ctrlKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, modifiers:{altKey:1}, chars:"\u00A1", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A1", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, modifiers:{metaKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, modifiers:{}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, modifiers:{shiftKey:1}, chars:"#", unmodifiedChars:"#"}, - nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "#", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, modifiers:{ctrlKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, modifiers:{altKey:1}, chars:"\u00A3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, modifiers:{metaKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, modifiers:{}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, modifiers:{shiftKey:1}, chars:"$", unmodifiedChars:"$"}, - nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "$", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, modifiers:{ctrlKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, modifiers:{altKey:1}, chars:"\u00A2", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "\u00A2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A2", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "\u00A2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, modifiers:{metaKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, modifiers:{}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, modifiers:{shiftKey:1}, chars:"%", unmodifiedChars:"%"}, - nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "%", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, modifiers:{ctrlKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, modifiers:{altKey:1}, chars:"\u221E", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "\u221E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u221E", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "\u221E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, modifiers:{metaKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, modifiers:{}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, modifiers:{shiftKey:1}, chars:"^", unmodifiedChars:"^"}, - nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "^", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, modifiers:{ctrlKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, modifiers:{altKey:1}, chars:"\u00A7", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A7", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, modifiers:{metaKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, modifiers:{}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, - modifiers:{shiftKey:1}, chars:"\u0026", unmodifiedChars:"\u0026"}, - nsIDOMKeyEvent.DOM_VK_7, "\u0026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + modifiers:{shiftKey:1}, chars:"&", unmodifiedChars:"&"}, + "&", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, modifiers:{ctrlKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, modifiers:{altKey:1}, chars:"\u00B6", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00B6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00B6", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00B6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, modifiers:{metaKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, modifiers:{}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, modifiers:{shiftKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "*", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, modifiers:{ctrlKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, modifiers:{altKey:1}, chars:"\u2022", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "\u2022", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2022", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "\u2022", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, modifiers:{metaKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, modifiers:{}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, modifiers:{shiftKey:1}, chars:"(", unmodifiedChars:"("}, - nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "(", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, modifiers:{ctrlKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, modifiers:{altKey:1}, chars:"\u00AA", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00AA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00AA", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00AA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, modifiers:{metaKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, modifiers:{}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, modifiers:{shiftKey:1}, chars:")", unmodifiedChars:")"}, - nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ")", "Digit0", nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, modifiers:{ctrlKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, modifiers:{altKey:1}, chars:"\u00BA", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00BA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00BA", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00BA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, modifiers:{metaKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // other chracters yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, modifiers:{}, chars:"`", unmodifiedChars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, modifiers:{shiftKey:1}, chars:"~", unmodifiedChars:"~"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "~", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, modifiers:{ctrlKey:1}, chars:"`", unmodifiedChars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, modifiers:{altKey:1}, chars:"", unmodifiedChars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + "Dead", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, modifiers:{metaKey:1}, chars:"`", unmodifiedChars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, modifiers:{}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, modifiers:{shiftKey:1}, chars:"_", unmodifiedChars:"_"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "_", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, // modifiers:{ctrlKey:1}, chars:"\u001F", unmodifiedChars:"-"}, - // nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, modifiers:{altKey:1}, chars:"\u2013", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "\u2013", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2013", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "\u2013", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, modifiers:{metaKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, modifiers:{}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, modifiers:{shiftKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, modifiers:{ctrlKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, modifiers:{altKey:1}, chars:"\u2260", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "\u2260", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2260", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "\u2260", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, modifiers:{metaKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, modifiers:{}, chars:"[", unmodifiedChars:"["}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "[", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, modifiers:{shiftKey:1}, chars:"{", unmodifiedChars:"{"}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "{", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, // modifiers:{ctrlKey:1}, chars:"\u001B", unmodifiedChars:"["}, - // nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "[", "LeftBracket", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, modifiers:{altKey:1}, chars:"\u201C", unmodifiedChars:"["}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "\u201C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u201C", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "\u201C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, modifiers:{metaKey:1}, chars:"[", unmodifiedChars:"["}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "[", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, modifiers:{}, chars:"]", unmodifiedChars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, modifiers:{shiftKey:1}, chars:"}", unmodifiedChars:"}"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "}", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, // modifiers:{ctrlKey:1}, chars:"\u001D", unmodifiedChars:"]"}, - // nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, modifiers:{altKey:1}, chars:"\u2018", unmodifiedChars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "\u2018", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2018", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "\u2018", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, modifiers:{metaKey:1}, chars:"]", unmodifiedChars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, modifiers:{}, chars:"\\", unmodifiedChars:"\\"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, modifiers:{shiftKey:1}, chars:"|", unmodifiedChars:"|"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "|", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, // modifiers:{ctrlKey:1}, chars:"\u001C", unmodifiedChars:"\\"}, - // nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, modifiers:{altKey:1}, chars:"\u00AB", unmodifiedChars:"\\"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\u00AB", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00AB", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\u00AB", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, modifiers:{metaKey:1}, chars:"\\", unmodifiedChars:"\\"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, modifiers:{}, chars:";", unmodifiedChars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, modifiers:{shiftKey:1}, chars:":", unmodifiedChars:":"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ":", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, modifiers:{ctrlKey:1}, chars:";", unmodifiedChars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, modifiers:{altKey:1}, chars:"\u2026", unmodifiedChars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, "\u2026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2026", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, "\u2026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, modifiers:{}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, modifiers:{shiftKey:1}, chars:"\"", unmodifiedChars:"\""}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\"", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, modifiers:{ctrlKey:1}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, modifiers:{altKey:1}, chars:"\u00E6", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "\u00E6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E6", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "\u00E6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, modifiers:{}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, - modifiers:{shiftKey:1}, chars:"\u003C", unmodifiedChars:"\u003C"}, - nsIDOMKeyEvent.DOM_VK_COMMA, "\u003C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + modifiers:{shiftKey:1}, chars:"<", unmodifiedChars:"<"}, + "<", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, modifiers:{ctrlKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, modifiers:{altKey:1}, chars:"\u2264", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, "\u2264", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2264", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, "\u2264", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, modifiers:{metaKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, modifiers:{}, chars:".", unmodifiedChars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, - modifiers:{shiftKey:1}, chars:"\u003E", unmodifiedChars:"\u003E"}, - nsIDOMKeyEvent.DOM_VK_PERIOD, "\u003E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + modifiers:{shiftKey:1}, chars:">", unmodifiedChars:">"}, + ">", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, modifiers:{ctrlKey:1}, chars:".", unmodifiedChars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, modifiers:{altKey:1}, chars:"\u2265", unmodifiedChars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, "\u2265", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u2265", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, "\u2265", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, modifiers:{metaKey:1}, chars:".", unmodifiedChars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, modifiers:{}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "?", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, modifiers:{ctrlKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, modifiers:{altKey:1}, chars:"\u00F7", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "\u00F7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00F7", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "\u00F7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, modifiers:{metaKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // numpad yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, modifiers:{numericKeyPadKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, modifiers:{numericKeyPadKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, modifiers:{numericKeyPadKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, modifiers:{numericKeyPadKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, modifiers:{numericKeyPadKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, modifiers:{numericKeyPadKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, modifiers:{numericKeyPadKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, modifiers:{numericKeyPadKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, modifiers:{numericKeyPadKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, modifiers:{numericKeyPadKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, modifiers:{numericKeyPadKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, modifiers:{numericKeyPadKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, modifiers:{numericKeyPadKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, modifiers:{numericKeyPadKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, modifiers:{numericKeyPadKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, modifiers:{numericKeyPadKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, modifiers:{numericKeyPadKey:1, altKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ",", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ",", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, modifiers:{numericKeyPadKey:1, altKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ",", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, modifiers:{numericKeyPadKey:1, metaKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ",", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // French, numeric yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, - modifiers:{}, chars:"\u0026", unmodifiedChars:"\u0026"}, - nsIDOMKeyEvent.DOM_VK_1, "\u0026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + modifiers:{}, chars:"&", unmodifiedChars:"&"}, + "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, modifiers:{shiftKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, - modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"\u0026"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"&"}, + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, - modifiers:{metaKey:1}, chars:"\u0026", unmodifiedChars:"\u0026"}, - nsIDOMKeyEvent.DOM_VK_1, "\u0026", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + modifiers:{metaKey:1}, chars:"&", unmodifiedChars:"&"}, + "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, modifiers:{metaKey:1, shiftKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, modifiers:{}, chars:"\u00E9", unmodifiedChars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E9", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, modifiers:{shiftKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, modifiers:{ctrlKey:1}, chars:"2", unmodifiedChars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, modifiers:{metaKey:1}, chars:"\u00E9", unmodifiedChars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E9", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, modifiers:{metaKey:1, shiftKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, modifiers:{}, chars:"\"", unmodifiedChars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\"", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, modifiers:{shiftKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, modifiers:{ctrlKey:1}, chars:"3", unmodifiedChars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, modifiers:{metaKey:1}, chars:"\"", unmodifiedChars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\"", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Cmd+Shift+3 is a shortcut key of taking a snapshot // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, // modifiers:{metaKey:1, shiftKey:1}, chars:"\"", unmodifiedChars:"\""}, - // nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, modifiers:{}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, modifiers:{shiftKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, modifiers:{ctrlKey:1}, chars:"4", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Cmd+Shift+4 is a shortcut key of taking a snapshot in specific range // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, // modifiers:{metaKey:1, shiftKey:1}, chars:"4", unmodifiedChars:"4"}, - // nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, modifiers:{}, chars:"(", unmodifiedChars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "(", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, modifiers:{shiftKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, modifiers:{ctrlKey:1}, chars:"5", unmodifiedChars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, modifiers:{metaKey:1}, chars:"(", unmodifiedChars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "(", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, modifiers:{metaKey:1, shiftKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, modifiers:{}, chars:"\u00A7", unmodifiedChars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A7", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, modifiers:{shiftKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, // modifiers:{ctrlKey:1}, chars:"\u001D", unmodifiedChars:"\u00A7"}, - // nsIDOMKeyEvent.DOM_VK_6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+6 sets strange char + // "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+6 sets strange char yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, modifiers:{metaKey:1}, chars:"\u00A7", unmodifiedChars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A7", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, modifiers:{metaKey:1, shiftKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, modifiers:{}, chars:"\u00E8", unmodifiedChars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E8", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, modifiers:{shiftKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, modifiers:{ctrlKey:1}, chars:"7", unmodifiedChars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, modifiers:{metaKey:1}, chars:"\u00E8", unmodifiedChars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E8", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, modifiers:{metaKey:1, shiftKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, modifiers:{}, chars:"!", unmodifiedChars:"!"}, - nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "!", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, modifiers:{shiftKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, modifiers:{ctrlKey:1}, chars:"8", unmodifiedChars:"!"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, modifiers:{metaKey:1}, chars:"!", unmodifiedChars:"!"}, - nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "!", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, modifiers:{metaKey:1, shiftKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, modifiers:{}, chars:"\u00E7", unmodifiedChars:"\u00E7"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E7", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, modifiers:{shiftKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, // modifiers:{ctrlKey:1}, chars:"\u001C", unmodifiedChars:"\u00E7"}, - // nsIDOMKeyEvent.DOM_VK_9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+9 sets strange char + // "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+9 sets strange char yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, modifiers:{metaKey:1}, chars:"\u00E7", unmodifiedChars:"\u00E7"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E7", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, modifiers:{metaKey:1, shiftKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, modifiers:{}, chars:"\u00E0", unmodifiedChars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, modifiers:{shiftKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX No events fired, not sure the reason. // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, // modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:"\u00E0"}, - // nsIDOMKeyEvent.DOM_VK_0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, modifiers:{metaKey:1}, chars:"\u00E0", unmodifiedChars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, modifiers:{metaKey:1, shiftKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Thai // keycode should be DOM_VK_[A-Z] of the key on the latest ASCII capable keyboard layout is for alphabet yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_A, modifiers:{}, chars:"\u0E1F", unmodifiedChars:"\u0E1F"}, - nsIDOMKeyEvent.DOM_VK_A, "\u0E1F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E1F", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u0E1F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // keycode should be shifted character if unshifted character isn't an ASCII character yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_Quote, modifiers:{}, chars:"\u0E07", unmodifiedChars:"\u0E07"}, - nsIDOMKeyEvent.DOM_VK_PERIOD, "\u0E07", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E07", "Quote", nsIDOMKeyEvent.DOM_VK_PERIOD, "\u0E07", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // keycode should be zero if the character of the key on the latest ASCII capable keyboard layout isn't for alphabet yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_Period, modifiers:{}, chars:"\u0E43", unmodifiedChars:"\u0E43"}, - 0, "\u0E43", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E43", "Period", 0, "\u0E43", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // keycode should be DOM_VK_[0-9] if the key on the latest ASCII capable keyboard layout is for numeric yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_1, modifiers:{}, chars:"\u0E45", unmodifiedChars:"\u0E45"}, - nsIDOMKeyEvent.DOM_VK_1, "\u0E45", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E45", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "\u0E45", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_2, modifiers:{}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_2, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_3, modifiers:{}, chars:"_", unmodifiedChars:"_"}, - nsIDOMKeyEvent.DOM_VK_3, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "_", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_4, modifiers:{}, chars:"\u0E20", unmodifiedChars:"\u0E20"}, - nsIDOMKeyEvent.DOM_VK_4, "\u0E20", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E20", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "\u0E20", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_5, modifiers:{}, chars:"\u0E16", unmodifiedChars:"\u0E16"}, - nsIDOMKeyEvent.DOM_VK_5, "\u0E16", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E16", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "\u0E16", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_6, modifiers:{}, chars:"\u0E38", unmodifiedChars:"\u0E38"}, - nsIDOMKeyEvent.DOM_VK_6, "\u0E38", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E38", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "\u0E38", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_7, modifiers:{}, chars:"\u0E36", unmodifiedChars:"\u0E36"}, - nsIDOMKeyEvent.DOM_VK_7, "\u0E36", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E36", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u0E36", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_8, modifiers:{}, chars:"\u0E04", unmodifiedChars:"\u0E04"}, - nsIDOMKeyEvent.DOM_VK_8, "\u0E04", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E04", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "\u0E04", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_9, modifiers:{}, chars:"\u0E15", unmodifiedChars:"\u0E15"}, - nsIDOMKeyEvent.DOM_VK_9, "\u0E15", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E15", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u0E15", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_0, modifiers:{}, chars:"\u0E08", unmodifiedChars:"\u0E08"}, - nsIDOMKeyEvent.DOM_VK_0, "\u0E08", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0E08", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u0E08", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dvorak-Qwerty, layout should be changed when Command key is pressed. yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, modifiers:{}, chars:"o", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "o", "KeyS", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, modifiers:{shiftKey:1}, chars:"O", unmodifiedChars:"O"}, - nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "O", "KeyS", nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, modifiers:{ctrlKey:1}, chars:"\u000F", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "o", "KeyS", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, modifiers:{altKey:1}, chars:"\u00F8", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00F8", "KeyS", nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, modifiers:{metaKey:1}, chars:"s", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, modifiers:{}, chars:"e", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "e", "KeyD", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"}, - nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "E", "KeyD", nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "e", "KeyD", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "\u00B4", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + "Dead", "KeyD", nsIDOMKeyEvent.DOM_VK_E, "\u00B4", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_I, modifiers:{metaKey:1, altKey:1}, chars:"^", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_I, "^", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "^", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "^", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_I, modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u02C6", unmodifiedChars:"C"}, - nsIDOMKeyEvent.DOM_VK_I, "\u02C6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - } else if (IS_WIN) { + "\u02C6", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "\u02C6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + cleanup(); + } + + function testKeysOnWindows() + { // On Windows, you can use Spy++ or Winspector (free) to watch window messages. // The keyCode is given by the wParam of the last WM_KEYDOWN message. The // chars string is given by the wParam of the WM_CHAR message. unmodifiedChars @@ -1892,1095 +1917,1100 @@ function* runKeyEventTests() // Plain text input yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{}, chars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, modifiers:{}, chars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{ctrlKey:1}, chars:"\u0001"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Alt keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{altKey:1}, chars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{altKey:1, shiftKey:1}, chars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift-ctrl-alt generates no WM_CHAR, but we still get a keypress yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Greek plain text yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, modifiers:{}, chars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "\u03b1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u03b1", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u03b1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"\u0391"}, - nsIDOMKeyEvent.DOM_VK_A, "\u0391", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0391", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u0391", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Greek ctrl keys produce Latin charcodes yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, modifiers:{ctrlKey:1}, chars:"\u0001"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u03b1", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u0391", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Caps Lock key event yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CAPITAL, modifiers:{capsLockKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "CapsLock", "CapsLock", nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CAPITAL, modifiers:{capsLockKey:0}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "CapsLock", "CapsLock", nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LSHIFT, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Shift", "ShiftLeft", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RSHIFT, modifiers:{shiftRightKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Shift", "ShiftRight", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Ctrl keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LCONTROL, modifiers:{ctrlKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Control", "ControlLeft", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RCONTROL, modifiers:{ctrlRightKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Control", "ControlRight", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Alt keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LMENU, modifiers:{altKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "Alt", "AltLeft", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RMENU, modifiers:{altRightKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "Alt", "AltRight", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Win keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LWIN, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "OS" /* bug 1232918 */, "" /* TODO, should be "OSLeft" */, nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RWIN, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "OS" /* bug 1232918 */, "" /* TODO, should be "OSRight" */, nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // all keys on keyboard (keyCode test) yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK, modifiers:{}, chars:"\u0008"}, - nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Backspace", "Backspace", nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_TAB, modifiers:{}, chars:"\t"}, - nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Tab", "Tab", nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN, modifiers:{}, chars:"\r"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PAUSE, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Pause", "ControlRight" /* TODO, should be "Pause" */, nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANA, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_KANA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Unidentified", "", nsIDOMKeyEvent.DOM_VK_KANA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_JUNJA, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_JUNJA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "JunjaMode", "", nsIDOMKeyEvent.DOM_VK_JUNJA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_FINAL, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_FINAL, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "FinalMode", "", nsIDOMKeyEvent.DOM_VK_FINAL, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANJI, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_KANJI, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Unidentified", "", nsIDOMKeyEvent.DOM_VK_KANJI, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ESCAPE, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Escape", "Escape", nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CONVERT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Convert", "", nsIDOMKeyEvent.DOM_VK_CONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NONCONVERT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_NONCONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "NonConvert", "", nsIDOMKeyEvent.DOM_VK_NONCONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ACCEPT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_ACCEPT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Accept", "", nsIDOMKeyEvent.DOM_VK_ACCEPT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MODECHANGE, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_MODECHANGE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "ModeChange", "", nsIDOMKeyEvent.DOM_VK_MODECHANGE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SPACE, modifiers:{}, chars:" "}, - nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + " ", "Space", nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SELECT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SELECT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Select", "", nsIDOMKeyEvent.DOM_VK_SELECT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRINT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PRINT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Unidentified", "", nsIDOMKeyEvent.DOM_VK_PRINT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_EXECUTE, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_EXECUTE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Execute", "", nsIDOMKeyEvent.DOM_VK_EXECUTE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SNAPSHOT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "PrintScreen", "PrintScreen", nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HELP, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_HELP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Help", "", nsIDOMKeyEvent.DOM_VK_HELP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SLEEP, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SLEEP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Standby", "", nsIDOMKeyEvent.DOM_VK_SLEEP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX TODO: we cannot test Home, Up, PageUp, Left, Right, End, Down, PageDown, Ins and Del. // Backspace and Enter are handled with special path in mozilla::widget::NativeKey. So, let's test them with modifiers too. yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK, modifiers:{ctrlKey:1}, chars:"\u007F"}, - nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Backspace", "Backspace", nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK, modifiers:{altKey:1}, chars:"\u0008"}, - nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Backspace", "Backspace", nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN, modifiers:{ctrlKey:1}, chars:"\n"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN, modifiers:{altKey:1}, chars:"\r"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // US // Alphabet yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{}, chars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, modifiers:{}, chars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, modifiers:{shiftKey:1}, chars:"B"}, - nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "B", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C, modifiers:{}, chars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C, modifiers:{shiftKey:1}, chars:"C"}, - nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "C", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D, modifiers:{}, chars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D, modifiers:{shiftKey:1}, chars:"D"}, - nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "D", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E, modifiers:{}, chars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E, modifiers:{shiftKey:1}, chars:"E"}, - nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "E", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F, modifiers:{}, chars:"f"}, - nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F, modifiers:{shiftKey:1}, chars:"F"}, - nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "F", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G, modifiers:{}, chars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G, modifiers:{shiftKey:1}, chars:"G"}, - nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "G", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H, modifiers:{}, chars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H, modifiers:{shiftKey:1}, chars:"H"}, - nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "H", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I, modifiers:{}, chars:"i"}, - nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I, modifiers:{shiftKey:1}, chars:"I"}, - nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "I", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J, modifiers:{}, chars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J, modifiers:{shiftKey:1}, chars:"J"}, - nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "J", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K, modifiers:{}, chars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K, modifiers:{shiftKey:1}, chars:"K"}, - nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "K", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L, modifiers:{}, chars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L, modifiers:{shiftKey:1}, chars:"L"}, - nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "L", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M, modifiers:{}, chars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M, modifiers:{shiftKey:1}, chars:"M"}, - nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "M", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N, modifiers:{}, chars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N, modifiers:{shiftKey:1}, chars:"N"}, - nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "N", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O, modifiers:{}, chars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O, modifiers:{shiftKey:1}, chars:"O"}, - nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "O", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P, modifiers:{}, chars:"p"}, - nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P, modifiers:{shiftKey:1}, chars:"P"}, - nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "P", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q, modifiers:{}, chars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q, modifiers:{shiftKey:1}, chars:"Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R, modifiers:{}, chars:"r"}, - nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R, modifiers:{shiftKey:1}, chars:"R"}, - nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "R", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S, modifiers:{}, chars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S, modifiers:{shiftKey:1}, chars:"S"}, - nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "S", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T, modifiers:{}, chars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T, modifiers:{shiftKey:1}, chars:"T"}, - nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "T", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U, modifiers:{}, chars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U, modifiers:{shiftKey:1}, chars:"U"}, - nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "U", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V, modifiers:{}, chars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V, modifiers:{shiftKey:1}, chars:"V"}, - nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "V", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W, modifiers:{}, chars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W, modifiers:{shiftKey:1}, chars:"W"}, - nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "W", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, modifiers:{}, chars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, modifiers:{shiftKey:1}, chars:"X"}, - nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "X", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y, modifiers:{}, chars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y, modifiers:{shiftKey:1}, chars:"Y"}, - nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z, modifiers:{}, chars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z, modifiers:{shiftKey:1}, chars:"Z"}, - nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Numeric yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0, modifiers:{}, chars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0, modifiers:{shiftKey:1}, chars:")"}, - nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ")", "Digit0", nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1, modifiers:{}, chars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1, modifiers:{shiftKey:1}, chars:"!"}, - nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "!", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2, modifiers:{}, chars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2, modifiers:{shiftKey:1}, chars:"@"}, - nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "@", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3, modifiers:{}, chars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3, modifiers:{shiftKey:1}, chars:"#"}, - nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "#", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4, modifiers:{}, chars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4, modifiers:{shiftKey:1}, chars:"$"}, - nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "$", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5, modifiers:{}, chars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5, modifiers:{shiftKey:1}, chars:"%"}, - nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "%", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6, modifiers:{}, chars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6, modifiers:{shiftKey:1}, chars:"^"}, - nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "^", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7, modifiers:{}, chars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7, modifiers:{shiftKey:1}, chars:"&"}, - nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "&", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8, modifiers:{}, chars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8, modifiers:{shiftKey:1}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "*", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9, modifiers:{}, chars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9, modifiers:{shiftKey:1}, chars:"("}, - nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "(", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // OEM keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS, modifiers:{}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS, modifiers:{shiftKey:1}, chars:"_"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "_", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS, modifiers:{}, chars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS, modifiers:{shiftKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4, modifiers:{}, chars:"["}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "[", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4, modifiers:{shiftKey:1}, chars:"{"}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "{", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6, modifiers:{}, chars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6, modifiers:{shiftKey:1}, chars:"}"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "}", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, modifiers:{}, chars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, modifiers:{shiftKey:1}, chars:":"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ":", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7, modifiers:{}, chars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7, modifiers:{shiftKey:1}, chars:"\""}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\"", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5, modifiers:{}, chars:"\\"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5, modifiers:{shiftKey:1}, chars:"|"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "|", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA, modifiers:{}, chars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA, modifiers:{shiftKey:1}, chars:"<"}, - nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "<", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD, modifiers:{}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD, modifiers:{shiftKey:1}, chars:">"}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ">", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2, modifiers:{}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2, modifiers:{shiftKey:1}, chars:"?"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "?", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3, modifiers:{}, chars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3, modifiers:{shiftKey:1}, chars:"~"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "~", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Numpad yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD0, modifiers:{numLockKey:1}, chars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD1, modifiers:{numLockKey:1}, chars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD2, modifiers:{numLockKey:1}, chars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD3, modifiers:{numLockKey:1}, chars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD4, modifiers:{numLockKey:1}, chars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD5, modifiers:{numLockKey:1}, chars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD6, modifiers:{numLockKey:1}, chars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD7, modifiers:{numLockKey:1}, chars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD8, modifiers:{numLockKey:1}, chars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD9, modifiers:{numLockKey:1}, chars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MULTIPLY, modifiers:{numLockKey:1}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MULTIPLY, modifiers:{numLockKey:1, shiftKey:1}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ADD, modifiers:{numLockKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ADD, modifiers:{numLockKey:1, shiftKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // VK_SEPARATOR is keycode for NEC's PC-98 series whose keyboard layout was // different from current PC's keyboard layout and it cannot connect to // current PC. Note that even if we synthesize WM_KEYDOWN with // VK_SEPARATOR, it doesn't work on Win7. //yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SEPARATOR, // modifiers:{numLockKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + // "", "", nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); //yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SEPARATOR, // modifiers:{numLockKey:1, shiftKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + // "", "", nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SUBTRACT, modifiers:{numLockKey:1}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SUBTRACT, modifiers:{numLockKey:1, shiftKey:1}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DECIMAL, modifiers:{numLockKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ".", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DECIMAL, modifiers:{numLockKey:1, shiftKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ".", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE, modifiers:{numLockKey:1}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "Slash" /* TODO, should be "NumpadDivide" */, nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE, modifiers:{numLockKey:1, shiftKey:1}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "Slash" /* TODO, should be "NumpadDivide" */, nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Numpad without NumLock yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRIOR, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "PageUp", "Numpad9", nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NEXT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "PageDown", "Numpad3", nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_END, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "End", "Numpad1", nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HOME, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Home", "Numpad7", nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LEFT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "ArrowLeft", "Numpad4", nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_UP, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "ArrowUp", "Numpad8", nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RIGHT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "ArrowRight", "Numpad6", nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DOWN, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "ArrowDown", "Numpad2", nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_INSERT, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_INSERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Insert", "Numpad0", nsIDOMKeyEvent.DOM_VK_INSERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DELETE, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Delete", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CLEAR, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "Clear", "Numpad5", nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Even if widget receives unknown keycode, it should dispatch key events // whose keycode is 0 rather than native keycode. yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:0x3A, modifiers:{numLockKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Unidentified", "", 0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // French // Numeric yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, modifiers:{}, chars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, modifiers:{shiftKey:1}, chars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, modifiers:{}, chars:"&"}, - nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, modifiers:{shiftKey:1}, chars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, modifiers:{}, chars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E9", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, modifiers:{shiftKey:1}, chars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, modifiers:{}, chars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\"", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, modifiers:{shiftKey:1}, chars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, modifiers:{}, chars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, modifiers:{shiftKey:1}, chars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, modifiers:{}, chars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "(", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, modifiers:{shiftKey:1}, chars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, modifiers:{}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "-", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, modifiers:{shiftKey:1}, chars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, modifiers:{}, chars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E8", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, modifiers:{shiftKey:1}, chars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, modifiers:{}, chars:"_"}, - nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "_", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, modifiers:{shiftKey:1}, chars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, modifiers:{}, chars:"\u00E7"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E7", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, modifiers:{shiftKey:1}, chars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Numeric with ShiftLock yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, modifiers:{capsLockKey:1}, chars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, modifiers:{capsLockKey:1}, chars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, modifiers:{capsLockKey:1, shiftKey:1}, chars:"&"}, - nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, modifiers:{capsLockKey:1}, chars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E9", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, modifiers:{capsLockKey:1}, chars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, modifiers:{capsLockKey:1, shiftKey:1}, chars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\"", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, modifiers:{capsLockKey:1}, chars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, modifiers:{capsLockKey:1, shiftKey:1}, chars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, modifiers:{capsLockKey:1}, chars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, modifiers:{capsLockKey:1, shiftKey:1}, chars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "(", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, modifiers:{capsLockKey:1}, chars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, modifiers:{capsLockKey:1, shiftKey:1}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "-", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, modifiers:{capsLockKey:1}, chars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E8", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, modifiers:{capsLockKey:1}, chars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, modifiers:{capsLockKey:1, shiftKey:1}, chars:"_"}, - nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "_", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, modifiers:{capsLockKey:1}, chars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E7"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00E7", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // OEM keys yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, modifiers:{}, chars:"\u00B2"}, - 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00B2", "Backquote", 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "", "Backquote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, modifiers:{}, chars:")"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ")", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, modifiers:{shiftKey:1}, chars:"\u00B0"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00B0", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, modifiers:{}, chars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, modifiers:{shiftKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, // modifiers:{}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + // "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, // modifiers:{shiftKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + // ["^^", "^", "^", "^"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, modifiers:{}, chars:"$"}, - nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "$", "BracketRight", nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, modifiers:{shiftKey:1}, chars:"\u00A3"}, - nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A3", "BracketRight", nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, modifiers:{}, chars:"\u00F9"}, - nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00F9", "Quote", nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, modifiers:{shiftKey:1}, chars:"%"}, - nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "%", "Quote", nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, modifiers:{}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "*", "Backslash", nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, modifiers:{shiftKey:1}, chars:"\u00B5"}, - nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00B5", "Backslash", nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, modifiers:{}, chars:"<"}, - nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "<", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, modifiers:{shiftKey:1}, chars:">"}, - nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ">", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, modifiers:{}, chars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ",", "KeyM", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, modifiers:{shiftKey:1}, chars:"?"}, - nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "?", "KeyM", nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, modifiers:{}, chars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ";", "Comma", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, modifiers:{shiftKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ".", "Comma", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, modifiers:{}, chars:":"}, - nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ":", "Period", nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, modifiers:{shiftKey:1}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "Period", nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, modifiers:{}, chars:"!"}, - nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "!", "Slash", nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, modifiers:{shiftKey:1}, chars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A7", "Slash", nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // OEM keys with ShiftLock yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, modifiers:{capsLockKey:1}, chars:"\u00B2"}, - 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00B2", "Backquote", 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, modifiers:{capsLockKey:1, shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "", "Backquote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, modifiers:{capsLockKey:1}, chars:"\u00B0"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00B0", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, modifiers:{capsLockKey:1, shiftKey:1}, chars:")"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ")", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, modifiers:{capsLockKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, modifiers:{capsLockKey:1, shiftKey:1}, chars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, // modifiers:{capsLockKey:1}, chars:""}, - // 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + // "Dead", "BracketLeft", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, // modifiers:{capsLockKey:1, shiftKey:1}, chars:""}, - // 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + // ["\u00A8\u00A8", "\u00A8", "\u00A8", "\u00A8"], "BracketLeft", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, modifiers:{capsLockKey:1}, chars:"\u00A3"}, - nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A3", "BracketRight", nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, modifiers:{capsLockKey:1, shiftKey:1}, chars:"$"}, - nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "$", "BracketRight", nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, modifiers:{capsLockKey:1}, chars:"%"}, - nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "%", "Quote", nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00F9"}, - nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00F9", "Quote", nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, modifiers:{capsLockKey:1}, chars:"\u00B5"}, - nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00B5", "Backslash", nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, modifiers:{capsLockKey:1, shiftKey:1}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "*", "Backslash", nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, modifiers:{capsLockKey:1}, chars:"<"}, - nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "<", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, modifiers:{capsLockKey:1, shiftKey:1}, chars:">"}, - nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ">", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, modifiers:{capsLockKey:1}, chars:"?"}, - nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "?", "KeyM", nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, modifiers:{capsLockKey:1, shiftKey:1}, chars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ",", "KeyM", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, modifiers:{capsLockKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ".", "Comma", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, modifiers:{capsLockKey:1, shiftKey:1}, chars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ";", "Comma", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, modifiers:{capsLockKey:1}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "Period", nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, modifiers:{capsLockKey:1, shiftKey:1}, chars:":"}, - nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ":", "Period", nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, modifiers:{capsLockKey:1}, chars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A7", "Slash", nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, modifiers:{capsLockKey:1, shiftKey:1}, chars:"!"}, - nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "!", "Slash", nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // AltGr yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, modifiers:{altGrKey:1}, chars:"@"}, - nsIDOMKeyEvent.DOM_VK_0, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "@", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, modifiers:{altGrKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL_BUT_NOT_CAUSE_INPUT, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL_BUT_NOT_CAUSE_INPUT, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, // modifiers:{altGrKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + // "Dead", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, modifiers:{altGrKey:1}, chars:"#"}, - nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "#", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, modifiers:{altGrKey:1}, chars:"{"}, - nsIDOMKeyEvent.DOM_VK_4, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "{", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, modifiers:{altGrKey:1}, chars:"["}, - nsIDOMKeyEvent.DOM_VK_5, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "[", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, modifiers:{altGrKey:1}, chars:"|"}, - nsIDOMKeyEvent.DOM_VK_6, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "|", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, // modifiers:{altGrKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + // "Dead", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, modifiers:{altGrKey:1}, chars:"\\"}, - nsIDOMKeyEvent.DOM_VK_8, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\\", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, modifiers:{altGrKey:1}, chars:"^"}, - nsIDOMKeyEvent.DOM_VK_9, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "^", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, modifiers:{altGrKey:1}, chars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "]", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, modifiers:{altGrKey:1}, chars:"}"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "}", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // German yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:WIN_VK_OEM_2, modifiers:{}, chars:"#"}, - nsIDOMKeyEvent.DOM_VK_HASH, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "#", "Backslash", nsIDOMKeyEvent.DOM_VK_HASH, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:WIN_VK_OEM_2, modifiers:{shiftKey:1}, chars:"'"}, - nsIDOMKeyEvent.DOM_VK_HASH, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "'", "Backslash", nsIDOMKeyEvent.DOM_VK_HASH, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Norwegian yield testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5, modifiers:{}, chars:"|"}, - nsIDOMKeyEvent.DOM_VK_PIPE, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "|", "Backquote", nsIDOMKeyEvent.DOM_VK_PIPE, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5, modifiers:{shiftKey:1}, chars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_PIPE, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "\u00A7", "Backquote", nsIDOMKeyEvent.DOM_VK_PIPE, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Brazilian ABNT yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1, modifiers:{}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "IntlRo" /* TODO, should be "IntlBackslash" */, nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1, modifiers:{shiftKey:1}, chars:"?"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "?", "IntlRo" /* TODO, should be "IntlBackslash" */, nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C2, modifiers:{numLockKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ".", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_DECIMAL, modifiers:{numLockKey:1}, chars:","}, - nsIDOMKeyEvent.DOM_VK_DECIMAL, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ",", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Mac JIS keyboard // The separator key on JIS keyboard for Mac doesn't cause any character even with Japanese keyboard layout. yield testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_ABNT_C2, modifiers:{numLockKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_DECIMAL, modifiers:{numLockKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + ".", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Dead keys on any layouts yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{}, chars:"^^"}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["^^", "^", "^", "^"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, modifiers:{}, chars:"\u00E2"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00E2", "\u00E2", "a"], "KeyQ", nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"\u00C2"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00C2", "\u00C2", "A"], "KeyQ", nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_Q, modifiers:{}, chars:"^q"}, - nsIDOMKeyEvent.DOM_VK_Q, "^q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["^q", "^", "q", "q"], "KeyA", nsIDOMKeyEvent.DOM_VK_Q, "^q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{shiftKey:1}, chars:"\u00A8\u00A8"}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00A8\u00A8", "\u00A8", "\u00A8", "\u00A8"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"\u00C4"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00C4", "\u00C4", "A"], "KeyQ", nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, modifiers:{}, chars:"\u00E4"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00E4", "\u00E4", "a"], "KeyQ", nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_Q, modifiers:{shiftKey:1}, chars:"\u00A8Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00A8Q", "\u00A8", "Q", "Q"], "KeyA", nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{}, chars:"``"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "``", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["``", "`", "`", "`"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "``", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, modifiers:{}, chars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00E0", "\u00E0", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"\u00C0"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00C0", "\u00C0", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, modifiers:{}, chars:"`q"}, - nsIDOMKeyEvent.DOM_VK_Q, "`q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["`q", "`", "q", "q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "`q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{shiftKey:1}, chars:"^^"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["^^", "^", "^", "^"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"\u00C2"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00C2", "\u00C2", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, modifiers:{}, chars:"\u00E2"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00E2", "\u00E2", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, modifiers:{shiftKey:1}, chars:"^Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "^Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["^Q", "^", "Q", "Q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "^Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{}, chars:"\u00B4\u00B4"}, - 0, "\u00B4\u00B4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00B4\u00B4", "\u00B4", "\u00B4", "\u00B4"], "Quote", 0, "\u00B4\u00B4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, modifiers:{}, chars:"\u00E1"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00E1", "\u00E1", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"\u00C1"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00C1", "\u00C1", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, modifiers:{}, chars:"\u00B4q"}, - nsIDOMKeyEvent.DOM_VK_Q, "\u00B4q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00B4q", "\u00B4", "q", "q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "\u00B4q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{shiftKey:1}, chars:"\u00A8\u00A8"}, - 0, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00A8\u00A8", "\u00A8", "\u00A8", "\u00A8"], "Quote", 0, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, modifiers:{shiftKey:1}, chars:"\u00C4"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00C4", "\u00C4", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, modifiers:{}, chars:"\u00E4"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00E4", "\u00E4", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, modifiers:{shiftKey:1}, chars:"\u00A8Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + ["\u00A8Q", "\u00A8", "Q", "Q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + cleanup(); } - document.removeEventListener("keydown", onKeyEvent, false); - document.removeEventListener("keypress", onKeyEvent, false); - document.removeEventListener("keyup", onKeyEvent, false); - SpecialPowers.removeSystemEventListener(document, "keypress", consumer, true); + + if (IS_WIN) { + yield* testKeysOnWindows(); + } else if (IS_MAC) { + yield* testKeysOnMac(); + } else { + cleanup(); + } } // Test the activation (or not) of an HTML accesskey From 05960c4ff6c721cae91897f778816c8f501464ad Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 13 Sep 2016 19:38:23 +0900 Subject: [PATCH 004/101] Bug 1300937 part.2 Automated tests which synthesize native key events on Windows should specify scan code value explicitly r=smaug On Windows, some keys are called "extended key". Their scan code include 0xE000. For example, Enter key in standard position is 0x001C but Numpad's Enter key is 0xE01C. Unfortunately, both of them cause same virtual keycode value, VK_RETURN. Therefore, currently, nsIDOMWindowUtils.sendNativeKey() can synthesize only one native key event of them (only non-extended key's event). Additionally, MapVirtualKeyEx() API with MAPVK_VK_TO_VSC (even with MAPVK_VK_TO_VSC_EX) don't return extended scancode value as expected. For solving these issues, we should include scan code value to the virtual keycode value at calling sendNativeKey(). Fortunately, virtual keycode value on Windows is 0 ~ 255 (0x00 ~ 0xFF) but aNativeKeyCode of sendNativeKey() is int32_t. So, we can use upper 16 bit for specifying scan code. This patch explicitly specifies scan code value at defining WIN_VK_* in NativeKeyCodes.js. Additionally, this patch duplicates native virtual keycode definition for Home, End, Insert, Delete, PageUp, PageDown, ArrowUp, ArrowLeft, ArrowDown, ArrowRight and Enter as WIN_VK_* and WIN_VK_NUMPAD_*. This makes automated tests can specify both positions' keys explicitly. Finally, this patch adds some tests to test_keycodes.xul for testing KeyboardEvent.code value of those keys in both positions. MozReview-Commit-ID: 8n1rQ71dilg --HG-- extra : rebase_source : 8215e56ba1ed9fc54c04eb7ca037b12c3ced5c1b --- .../tests/SimpleTest/NativeKeyCodes.js | 431 +++++++++--------- widget/tests/test_keycodes.xul | 67 ++- widget/windows/KeyboardLayout.cpp | 56 ++- widget/windows/nsWindowDefs.h | 10 +- 4 files changed, 314 insertions(+), 250 deletions(-) diff --git a/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js b/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js index c73b5407f761..39d80cbaa8d6 100644 --- a/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js +++ b/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js @@ -5,214 +5,231 @@ */ // Windows +// Windows' native key code values may include scan code value which can be +// retrieved with |((code & 0xFFFF0000 >> 16)|. If the value is 0, it will +// be computed with active keyboard layout automatically. +// FYI: Don't define scan code here for printable keys, numeric keys and +// IME keys because they depend on active keyboard layout. -const WIN_VK_LBUTTON = 0x01; -const WIN_VK_RBUTTON = 0x02; -const WIN_VK_CANCEL = 0x03; -const WIN_VK_MBUTTON = 0x04; -const WIN_VK_XBUTTON1 = 0x05; -const WIN_VK_XBUTTON2 = 0x06; -const WIN_VK_BACK = 0x08; -const WIN_VK_TAB = 0x09; -const WIN_VK_CLEAR = 0x0C; -const WIN_VK_RETURN = 0x0D; -const WIN_VK_SHIFT = 0x10; -const WIN_VK_CONTROL = 0x11; -const WIN_VK_MENU = 0x12; -const WIN_VK_PAUSE = 0x13; -const WIN_VK_CAPITAL = 0x14; -const WIN_VK_KANA = 0x15; -const WIN_VK_HANGUEL = 0x15; -const WIN_VK_HANGUL = 0x15; -const WIN_VK_JUNJA = 0x17; -const WIN_VK_FINAL = 0x18; -const WIN_VK_HANJA = 0x19; -const WIN_VK_KANJI = 0x19; -const WIN_VK_ESCAPE = 0x1B; -const WIN_VK_CONVERT = 0x1C; -const WIN_VK_NONCONVERT = 0x1D; -const WIN_VK_ACCEPT = 0x1E; -const WIN_VK_MODECHANGE = 0x1F; -const WIN_VK_SPACE = 0x20; -const WIN_VK_PRIOR = 0x21; -const WIN_VK_NEXT = 0x22; -const WIN_VK_END = 0x23; -const WIN_VK_HOME = 0x24; -const WIN_VK_LEFT = 0x25; -const WIN_VK_UP = 0x26; -const WIN_VK_RIGHT = 0x27; -const WIN_VK_DOWN = 0x28; -const WIN_VK_SELECT = 0x29; -const WIN_VK_PRINT = 0x2A; -const WIN_VK_EXECUTE = 0x2B; -const WIN_VK_SNAPSHOT = 0x2C; -const WIN_VK_INSERT = 0x2D; -const WIN_VK_DELETE = 0x2E; -const WIN_VK_HELP = 0x2F; -const WIN_VK_0 = 0x30; -const WIN_VK_1 = 0x31; -const WIN_VK_2 = 0x32; -const WIN_VK_3 = 0x33; -const WIN_VK_4 = 0x34; -const WIN_VK_5 = 0x35; -const WIN_VK_6 = 0x36; -const WIN_VK_7 = 0x37; -const WIN_VK_8 = 0x38; -const WIN_VK_9 = 0x39; -const WIN_VK_A = 0x41; -const WIN_VK_B = 0x42; -const WIN_VK_C = 0x43; -const WIN_VK_D = 0x44; -const WIN_VK_E = 0x45; -const WIN_VK_F = 0x46; -const WIN_VK_G = 0x47; -const WIN_VK_H = 0x48; -const WIN_VK_I = 0x49; -const WIN_VK_J = 0x4A; -const WIN_VK_K = 0x4B; -const WIN_VK_L = 0x4C; -const WIN_VK_M = 0x4D; -const WIN_VK_N = 0x4E; -const WIN_VK_O = 0x4F; -const WIN_VK_P = 0x50; -const WIN_VK_Q = 0x51; -const WIN_VK_R = 0x52; -const WIN_VK_S = 0x53; -const WIN_VK_T = 0x54; -const WIN_VK_U = 0x55; -const WIN_VK_V = 0x56; -const WIN_VK_W = 0x57; -const WIN_VK_X = 0x58; -const WIN_VK_Y = 0x59; -const WIN_VK_Z = 0x5A; -const WIN_VK_LWIN = 0x5B; -const WIN_VK_RWIN = 0x5C; -const WIN_VK_APPS = 0x5D; -const WIN_VK_SLEEP = 0x5F; -const WIN_VK_NUMPAD0 = 0x60; -const WIN_VK_NUMPAD1 = 0x61; -const WIN_VK_NUMPAD2 = 0x62; -const WIN_VK_NUMPAD3 = 0x63; -const WIN_VK_NUMPAD4 = 0x64; -const WIN_VK_NUMPAD5 = 0x65; -const WIN_VK_NUMPAD6 = 0x66; -const WIN_VK_NUMPAD7 = 0x67; -const WIN_VK_NUMPAD8 = 0x68; -const WIN_VK_NUMPAD9 = 0x69; -const WIN_VK_MULTIPLY = 0x6A; -const WIN_VK_ADD = 0x6B; -const WIN_VK_SEPARATOR = 0x6C; -const WIN_VK_OEM_NEC_SEPARATE = 0x6C; -const WIN_VK_SUBTRACT = 0x6D; -const WIN_VK_DECIMAL = 0x6E; -const WIN_VK_DIVIDE = 0x6F; -const WIN_VK_F1 = 0x70; -const WIN_VK_F2 = 0x71; -const WIN_VK_F3 = 0x72; -const WIN_VK_F4 = 0x73; -const WIN_VK_F5 = 0x74; -const WIN_VK_F6 = 0x75; -const WIN_VK_F7 = 0x76; -const WIN_VK_F8 = 0x77; -const WIN_VK_F9 = 0x78; -const WIN_VK_F10 = 0x79; -const WIN_VK_F11 = 0x7A; -const WIN_VK_F12 = 0x7B; -const WIN_VK_F13 = 0x7C; -const WIN_VK_F14 = 0x7D; -const WIN_VK_F15 = 0x7E; -const WIN_VK_F16 = 0x7F; -const WIN_VK_F17 = 0x80; -const WIN_VK_F18 = 0x81; -const WIN_VK_F19 = 0x82; -const WIN_VK_F20 = 0x83; -const WIN_VK_F21 = 0x84; -const WIN_VK_F22 = 0x85; -const WIN_VK_F23 = 0x86; -const WIN_VK_F24 = 0x87; -const WIN_VK_NUMLOCK = 0x90; -const WIN_VK_SCROLL = 0x91; -const WIN_VK_OEM_FJ_JISHO = 0x92; -const WIN_VK_OEM_NEC_EQUAL = 0x92; -const WIN_VK_OEM_FJ_MASSHOU = 0x93; -const WIN_VK_OEM_FJ_TOUROKU = 0x94; -const WIN_VK_OEM_FJ_LOYA = 0x95; -const WIN_VK_OEM_FJ_ROYA = 0x96; -const WIN_VK_LSHIFT = 0xA0; -const WIN_VK_RSHIFT = 0xA1; -const WIN_VK_LCONTROL = 0xA2; -const WIN_VK_RCONTROL = 0xA3; -const WIN_VK_LMENU = 0xA4; -const WIN_VK_RMENU = 0xA5; -const WIN_VK_BROWSER_BACK = 0xA6; -const WIN_VK_BROWSER_FORWARD = 0xA7; -const WIN_VK_BROWSER_REFRESH = 0xA8; -const WIN_VK_BROWSER_STOP = 0xA9; -const WIN_VK_BROWSER_SEARCH = 0xAA; -const WIN_VK_BROWSER_FAVORITES = 0xAB; -const WIN_VK_BROWSER_HOME = 0xAC; -const WIN_VK_VOLUME_MUTE = 0xAD; -const WIN_VK_VOLUME_DOWN = 0xAE; -const WIN_VK_VOLUME_UP = 0xAF; -const WIN_VK_MEDIA_NEXT_TRACK = 0xB0; -const WIN_VK_OEM_FJ_000 = 0xB0; -const WIN_VK_MEDIA_PREV_TRACK = 0xB1; -const WIN_VK_OEM_FJ_EUQAL = 0xB1; -const WIN_VK_MEDIA_STOP = 0xB2; -const WIN_VK_MEDIA_PLAY_PAUSE = 0xB3; -const WIN_VK_OEM_FJ_00 = 0xB3; -const WIN_VK_LAUNCH_MAIL = 0xB4; -const WIN_VK_LAUNCH_MEDIA_SELECT = 0xB5; -const WIN_VK_LAUNCH_APP1 = 0xB6; -const WIN_VK_LAUNCH_APP2 = 0xB7; -const WIN_VK_OEM_1 = 0xBA; -const WIN_VK_OEM_PLUS = 0xBB; -const WIN_VK_OEM_COMMA = 0xBC; -const WIN_VK_OEM_MINUS = 0xBD; -const WIN_VK_OEM_PERIOD = 0xBE; -const WIN_VK_OEM_2 = 0xBF; -const WIN_VK_OEM_3 = 0xC0; -const WIN_VK_ABNT_C1 = 0xC1; -const WIN_VK_ABNT_C2 = 0xC2; -const WIN_VK_OEM_4 = 0xDB; -const WIN_VK_OEM_5 = 0xDC; -const WIN_VK_OEM_6 = 0xDD; -const WIN_VK_OEM_7 = 0xDE; -const WIN_VK_OEM_8 = 0xDF; -const WIN_VK_OEM_NEC_DP1 = 0xE0; -const WIN_VK_OEM_AX = 0xE1; -const WIN_VK_OEM_NEC_DP2 = 0xE1; -const WIN_VK_OEM_102 = 0xE2; -const WIN_VK_OEM_NEC_DP3 = 0xE2; -const WIN_VK_ICO_HELP = 0xE3; -const WIN_VK_OEM_NEC_DP4 = 0xE3; -const WIN_VK_ICO_00 = 0xE4; -const WIN_VK_PROCESSKEY = 0xE5; -const WIN_VK_ICO_CLEAR = 0xE6; -const WIN_VK_PACKET = 0xE7; -const WIN_VK_ERICSSON_BASE = 0xE8; -const WIN_VK_OEM_RESET = 0xE9; -const WIN_VK_OEM_JUMP = 0xEA; -const WIN_VK_OEM_PA1 = 0xEB; -const WIN_VK_OEM_PA2 = 0xEC; -const WIN_VK_OEM_PA3 = 0xED; -const WIN_VK_OEM_WSCTRL = 0xEE; -const WIN_VK_OEM_CUSEL = 0xEF; -const WIN_VK_OEM_ATTN = 0xF0; -const WIN_VK_OEM_FINISH = 0xF1; -const WIN_VK_OEM_COPY = 0xF2; -const WIN_VK_OEM_AUTO = 0xF3; -const WIN_VK_OEM_ENLW = 0xF4; -const WIN_VK_OEM_BACKTAB = 0xF5; -const WIN_VK_ATTN = 0xF6; -const WIN_VK_CRSEL = 0xF7; -const WIN_VK_EXSEL = 0xF8; -const WIN_VK_EREOF = 0xF9; -const WIN_VK_PLAY = 0xFA; -const WIN_VK_ZOOM = 0xFB; -const WIN_VK_NONAME = 0xFC; -const WIN_VK_PA1 = 0xFD; -const WIN_VK_OEM_CLEAR = 0xFE; +const WIN_VK_LBUTTON = 0x00000001; +const WIN_VK_RBUTTON = 0x00000002; +const WIN_VK_CANCEL = 0xE0460003; +const WIN_VK_MBUTTON = 0x00000004; +const WIN_VK_XBUTTON1 = 0x00000005; +const WIN_VK_XBUTTON2 = 0x00000006; +const WIN_VK_BACK = 0x000E0008; +const WIN_VK_TAB = 0x000F0009; +const WIN_VK_CLEAR = 0x004C000C; +const WIN_VK_RETURN = 0x001C000D; +const WIN_VK_SHIFT = 0x002A0010; +const WIN_VK_CONTROL = 0x001D0011; +const WIN_VK_MENU = 0x00380012; +const WIN_VK_PAUSE = 0x00450013; +const WIN_VK_CAPITAL = 0x003A0014; +const WIN_VK_KANA = 0x00000015; +const WIN_VK_HANGUEL = 0x00000015; +const WIN_VK_HANGUL = 0x00000015; +const WIN_VK_JUNJA = 0x00000017; +const WIN_VK_FINAL = 0x00000018; +const WIN_VK_HANJA = 0x00000019; +const WIN_VK_KANJI = 0x00000019; +const WIN_VK_ESCAPE = 0x0001001B; +const WIN_VK_CONVERT = 0x0000001C; +const WIN_VK_NONCONVERT = 0x0000001D; +const WIN_VK_ACCEPT = 0x0000001E; +const WIN_VK_MODECHANGE = 0x0000001F; +const WIN_VK_SPACE = 0x00390020; +const WIN_VK_PRIOR = 0xE0490021; +const WIN_VK_NEXT = 0xE0510022; +const WIN_VK_END = 0xE04F0023; +const WIN_VK_HOME = 0xE0470024; +const WIN_VK_LEFT = 0xE04B0025; +const WIN_VK_UP = 0xE0480026; +const WIN_VK_RIGHT = 0xE04D0027; +const WIN_VK_DOWN = 0xE0500028; +const WIN_VK_SELECT = 0x00000029; +const WIN_VK_PRINT = 0x0000002A; +const WIN_VK_EXECUTE = 0x0000002B; +const WIN_VK_SNAPSHOT = 0xE037002C; +const WIN_VK_INSERT = 0xE052002D; +const WIN_VK_DELETE = 0xE053002E; +const WIN_VK_HELP = 0x0000002F; +const WIN_VK_0 = 0x00000030; +const WIN_VK_1 = 0x00000031; +const WIN_VK_2 = 0x00000032; +const WIN_VK_3 = 0x00000033; +const WIN_VK_4 = 0x00000034; +const WIN_VK_5 = 0x00000035; +const WIN_VK_6 = 0x00000036; +const WIN_VK_7 = 0x00000037; +const WIN_VK_8 = 0x00000038; +const WIN_VK_9 = 0x00000039; +const WIN_VK_A = 0x00000041; +const WIN_VK_B = 0x00000042; +const WIN_VK_C = 0x00000043; +const WIN_VK_D = 0x00000044; +const WIN_VK_E = 0x00000045; +const WIN_VK_F = 0x00000046; +const WIN_VK_G = 0x00000047; +const WIN_VK_H = 0x00000048; +const WIN_VK_I = 0x00000049; +const WIN_VK_J = 0x0000004A; +const WIN_VK_K = 0x0000004B; +const WIN_VK_L = 0x0000004C; +const WIN_VK_M = 0x0000004D; +const WIN_VK_N = 0x0000004E; +const WIN_VK_O = 0x0000004F; +const WIN_VK_P = 0x00000050; +const WIN_VK_Q = 0x00000051; +const WIN_VK_R = 0x00000052; +const WIN_VK_S = 0x00000053; +const WIN_VK_T = 0x00000054; +const WIN_VK_U = 0x00000055; +const WIN_VK_V = 0x00000056; +const WIN_VK_W = 0x00000057; +const WIN_VK_X = 0x00000058; +const WIN_VK_Y = 0x00000059; +const WIN_VK_Z = 0x0000005A; +const WIN_VK_LWIN = 0xE05B005B; +const WIN_VK_RWIN = 0xE05C005C; +const WIN_VK_APPS = 0xE05D005D; +const WIN_VK_SLEEP = 0x0000005F; +const WIN_VK_NUMPAD0 = 0x00520060; +const WIN_VK_NUMPAD1 = 0x004F0061; +const WIN_VK_NUMPAD2 = 0x00500062; +const WIN_VK_NUMPAD3 = 0x00510063; +const WIN_VK_NUMPAD4 = 0x004B0064; +const WIN_VK_NUMPAD5 = 0x004C0065; +const WIN_VK_NUMPAD6 = 0x004D0066; +const WIN_VK_NUMPAD7 = 0x00470067; +const WIN_VK_NUMPAD8 = 0x00480068; +const WIN_VK_NUMPAD9 = 0x00490069; +const WIN_VK_MULTIPLY = 0x0037006A; +const WIN_VK_ADD = 0x004E006B; +const WIN_VK_SEPARATOR = 0x0000006C; +const WIN_VK_OEM_NEC_SEPARATE = 0x0000006C; +const WIN_VK_SUBTRACT = 0x004A006D; +const WIN_VK_DECIMAL = 0x0053006E; +const WIN_VK_DIVIDE = 0xE035006F; +const WIN_VK_F1 = 0x003B0070; +const WIN_VK_F2 = 0x003C0071; +const WIN_VK_F3 = 0x003D0072; +const WIN_VK_F4 = 0x003E0073; +const WIN_VK_F5 = 0x003F0074; +const WIN_VK_F6 = 0x00400075; +const WIN_VK_F7 = 0x00410076; +const WIN_VK_F8 = 0x00420077; +const WIN_VK_F9 = 0x00430078; +const WIN_VK_F10 = 0x00440079; +const WIN_VK_F11 = 0x0057007A; +const WIN_VK_F12 = 0x0058007B; +const WIN_VK_F13 = 0x0064007C; +const WIN_VK_F14 = 0x0065007D; +const WIN_VK_F15 = 0x0066007E; +const WIN_VK_F16 = 0x0067007F; +const WIN_VK_F17 = 0x00680080; +const WIN_VK_F18 = 0x00690081; +const WIN_VK_F19 = 0x006A0082; +const WIN_VK_F20 = 0x006B0083; +const WIN_VK_F21 = 0x006C0084; +const WIN_VK_F22 = 0x006D0085; +const WIN_VK_F23 = 0x006E0086; +const WIN_VK_F24 = 0x00760087; +const WIN_VK_NUMLOCK = 0xE0450090; +const WIN_VK_SCROLL = 0x00460091; +const WIN_VK_OEM_FJ_JISHO = 0x00000092; +const WIN_VK_OEM_NEC_EQUAL = 0x00000092; +const WIN_VK_OEM_FJ_MASSHOU = 0x00000093; +const WIN_VK_OEM_FJ_TOUROKU = 0x00000094; +const WIN_VK_OEM_FJ_LOYA = 0x00000095; +const WIN_VK_OEM_FJ_ROYA = 0x00000096; +const WIN_VK_LSHIFT = 0x002A00A0; +const WIN_VK_RSHIFT = 0x003600A1; +const WIN_VK_LCONTROL = 0x001D00A2; +const WIN_VK_RCONTROL = 0xE01D00A3; +const WIN_VK_LMENU = 0x003800A4; +const WIN_VK_RMENU = 0xE03800A5; +const WIN_VK_BROWSER_BACK = 0xE06A00A6; +const WIN_VK_BROWSER_FORWARD = 0xE06900A7; +const WIN_VK_BROWSER_REFRESH = 0xE06700A8; +const WIN_VK_BROWSER_STOP = 0xE06800A9; +const WIN_VK_BROWSER_SEARCH = 0x000000AA; +const WIN_VK_BROWSER_FAVORITES = 0xE06600AB; +const WIN_VK_BROWSER_HOME = 0xE03200AC; +const WIN_VK_VOLUME_MUTE = 0xE02000AD; +const WIN_VK_VOLUME_DOWN = 0xE02E00AE; +const WIN_VK_VOLUME_UP = 0xE03000AF; +const WIN_VK_MEDIA_NEXT_TRACK = 0xE01900B0; +const WIN_VK_OEM_FJ_000 = 0x000000B0; +const WIN_VK_MEDIA_PREV_TRACK = 0xE01000B1; +const WIN_VK_OEM_FJ_EUQAL = 0x000000B1; +const WIN_VK_MEDIA_STOP = 0xE02400B2; +const WIN_VK_MEDIA_PLAY_PAUSE = 0xE02200B3; +const WIN_VK_OEM_FJ_00 = 0x000000B3; +const WIN_VK_LAUNCH_MAIL = 0xE06C00B4; +const WIN_VK_LAUNCH_MEDIA_SELECT = 0xE06D00B5; +const WIN_VK_LAUNCH_APP1 = 0xE06B00B6; +const WIN_VK_LAUNCH_APP2 = 0xE02100B7; +const WIN_VK_OEM_1 = 0x000000BA; +const WIN_VK_OEM_PLUS = 0x000000BB; +const WIN_VK_OEM_COMMA = 0x000000BC; +const WIN_VK_OEM_MINUS = 0x000000BD; +const WIN_VK_OEM_PERIOD = 0x000000BE; +const WIN_VK_OEM_2 = 0x000000BF; +const WIN_VK_OEM_3 = 0x000000C0; +const WIN_VK_ABNT_C1 = 0x000000C1; +const WIN_VK_ABNT_C2 = 0x000000C2; +const WIN_VK_OEM_4 = 0x000000DB; +const WIN_VK_OEM_5 = 0x000000DC; +const WIN_VK_OEM_6 = 0x000000DD; +const WIN_VK_OEM_7 = 0x000000DE; +const WIN_VK_OEM_8 = 0x000000DF; +const WIN_VK_OEM_NEC_DP1 = 0x000000E0; +const WIN_VK_OEM_AX = 0x000000E1; +const WIN_VK_OEM_NEC_DP2 = 0x000000E1; +const WIN_VK_OEM_102 = 0x000000E2; +const WIN_VK_OEM_NEC_DP3 = 0x000000E2; +const WIN_VK_ICO_HELP = 0x000000E3; +const WIN_VK_OEM_NEC_DP4 = 0x000000E3; +const WIN_VK_ICO_00 = 0x000000E4; +const WIN_VK_PROCESSKEY = 0x000000E5; +const WIN_VK_ICO_CLEAR = 0x000000E6; +const WIN_VK_PACKET = 0x000000E7; +const WIN_VK_ERICSSON_BASE = 0x000000E8; +const WIN_VK_OEM_RESET = 0x000000E9; +const WIN_VK_OEM_JUMP = 0x000000EA; +const WIN_VK_OEM_PA1 = 0x000000EB; +const WIN_VK_OEM_PA2 = 0x000000EC; +const WIN_VK_OEM_PA3 = 0x000000ED; +const WIN_VK_OEM_WSCTRL = 0x000000EE; +const WIN_VK_OEM_CUSEL = 0x000000EF; +const WIN_VK_OEM_ATTN = 0x000000F0; +const WIN_VK_OEM_FINISH = 0x000000F1; +const WIN_VK_OEM_COPY = 0x000000F2; +const WIN_VK_OEM_AUTO = 0x000000F3; +const WIN_VK_OEM_ENLW = 0x000000F4; +const WIN_VK_OEM_BACKTAB = 0x000000F5; +const WIN_VK_ATTN = 0x000000F6; +const WIN_VK_CRSEL = 0x000000F7; +const WIN_VK_EXSEL = 0x000000F8; +const WIN_VK_EREOF = 0x000000F9; +const WIN_VK_PLAY = 0x000000FA; +const WIN_VK_ZOOM = 0x000000FB; +const WIN_VK_NONAME = 0x000000FC; +const WIN_VK_PA1 = 0x000000FD; +const WIN_VK_OEM_CLEAR = 0x000000FE; + +const WIN_VK_NUMPAD_RETURN = 0xE01C000D; +const WIN_VK_NUMPAD_PRIOR = 0x00490021; +const WIN_VK_NUMPAD_NEXT = 0x00510022; +const WIN_VK_NUMPAD_END = 0x004F0023; +const WIN_VK_NUMPAD_HOME = 0x00470024; +const WIN_VK_NUMPAD_LEFT = 0x004B0025; +const WIN_VK_NUMPAD_UP = 0x00480026; +const WIN_VK_NUMPAD_RIGHT = 0x004D0027; +const WIN_VK_NUMPAD_DOWN = 0x00500028; +const WIN_VK_NUMPAD_INSERT = 0x0052002D; +const WIN_VK_NUMPAD_DELETE = 0x0053002E; // Mac diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul index 714eef2ff118..859f4905b894 100644 --- a/widget/tests/test_keycodes.xul +++ b/widget/tests/test_keycodes.xul @@ -1997,10 +1997,10 @@ function* runKeyEventTests() // Win keys yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LWIN, modifiers:{}, chars:""}, - "OS" /* bug 1232918 */, "" /* TODO, should be "OSLeft" */, nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + "OS" /* bug 1232918 */, "OSLeft", nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RWIN, modifiers:{}, chars:""}, - "OS" /* bug 1232918 */, "" /* TODO, should be "OSRight" */, nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + "OS" /* bug 1232918 */, "OSRight", nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // all keys on keyboard (keyCode test) yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK, @@ -2014,7 +2014,7 @@ function* runKeyEventTests() "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PAUSE, modifiers:{}, chars:""}, - "Pause", "ControlRight" /* TODO, should be "Pause" */, nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "Pause", "Pause", nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANA, modifiers:{}, chars:""}, "Unidentified", "", nsIDOMKeyEvent.DOM_VK_KANA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); @@ -2063,7 +2063,36 @@ function* runKeyEventTests() yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SLEEP, modifiers:{}, chars:""}, "Standby", "", nsIDOMKeyEvent.DOM_VK_SLEEP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - // XXX TODO: we cannot test Home, Up, PageUp, Left, Right, End, Down, PageDown, Ins and Del. + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRIOR, + modifiers:{}, chars:""}, + "PageUp", "PageUp", nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NEXT, + modifiers:{}, chars:""}, + "PageDown", "PageDown", nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_END, + modifiers:{}, chars:""}, + "End", "End", nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HOME, + modifiers:{}, chars:""}, + "Home", "Home", nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LEFT, + modifiers:{}, chars:""}, + "ArrowLeft", "ArrowLeft", nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_UP, + modifiers:{}, chars:""}, + "ArrowUp", "ArrowUp", nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RIGHT, + modifiers:{}, chars:""}, + "ArrowRight", "ArrowRight", nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DOWN, + modifiers:{}, chars:""}, + "ArrowDown", "ArrowDown", nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_INSERT, + modifiers:{}, chars:""}, + "Insert", "Insert", nsIDOMKeyEvent.DOM_VK_INSERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DELETE, + modifiers:{}, chars:""}, + "Delete", "Delete", nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Backspace and Enter are handled with special path in mozilla::widget::NativeKey. So, let's test them with modifiers too. yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK, @@ -2436,40 +2465,46 @@ function* runKeyEventTests() ".", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE, modifiers:{numLockKey:1}, chars:"/"}, - "/", "Slash" /* TODO, should be "NumpadDivide" */, nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE, modifiers:{numLockKey:1, shiftKey:1}, chars:"/"}, - "/", "Slash" /* TODO, should be "NumpadDivide" */, nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_RETURN, + modifiers:{numLockKey:1}, chars:"\r"}, + "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_RETURN, + modifiers:{numLockKey:1, shiftKey:1}, chars:"\r"}, + "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Numpad without NumLock - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRIOR, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_PRIOR, modifiers:{}, chars:""}, "PageUp", "Numpad9", nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NEXT, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_NEXT, modifiers:{}, chars:""}, "PageDown", "Numpad3", nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_END, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_END, modifiers:{}, chars:""}, "End", "Numpad1", nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HOME, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_HOME, modifiers:{}, chars:""}, "Home", "Numpad7", nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LEFT, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_LEFT, modifiers:{}, chars:""}, "ArrowLeft", "Numpad4", nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_UP, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_UP, modifiers:{}, chars:""}, "ArrowUp", "Numpad8", nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RIGHT, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_RIGHT, modifiers:{}, chars:""}, "ArrowRight", "Numpad6", nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DOWN, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_DOWN, modifiers:{}, chars:""}, "ArrowDown", "Numpad2", nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_INSERT, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_INSERT, modifiers:{}, chars:""}, "Insert", "Numpad0", nsIDOMKeyEvent.DOM_VK_INSERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DELETE, + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_DELETE, modifiers:{}, chars:""}, "Delete", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CLEAR, diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index e39709b0b675..cc58b02cce1f 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -3728,20 +3728,20 @@ KeyboardLayout::SynthesizeNativeKeyEvent(nsWindowBase* aWidget, OverrideLayout(loadedLayout); uint8_t argumentKeySpecific = 0; - switch (aNativeKeyCode) { + switch (aNativeKeyCode & 0xFF) { case VK_SHIFT: aModifierFlags &= ~(nsIWidget::SHIFT_L | nsIWidget::SHIFT_R); argumentKeySpecific = VK_LSHIFT; break; case VK_LSHIFT: aModifierFlags &= ~nsIWidget::SHIFT_L; - argumentKeySpecific = aNativeKeyCode; - aNativeKeyCode = VK_SHIFT; + argumentKeySpecific = aNativeKeyCode & 0xFF; + aNativeKeyCode = (aNativeKeyCode & 0xFFFF0000) | VK_SHIFT; break; case VK_RSHIFT: aModifierFlags &= ~nsIWidget::SHIFT_R; - argumentKeySpecific = aNativeKeyCode; - aNativeKeyCode = VK_SHIFT; + argumentKeySpecific = aNativeKeyCode & 0xFF; + aNativeKeyCode = (aNativeKeyCode & 0xFFFF0000) | VK_SHIFT; break; case VK_CONTROL: aModifierFlags &= ~(nsIWidget::CTRL_L | nsIWidget::CTRL_R); @@ -3749,13 +3749,13 @@ KeyboardLayout::SynthesizeNativeKeyEvent(nsWindowBase* aWidget, break; case VK_LCONTROL: aModifierFlags &= ~nsIWidget::CTRL_L; - argumentKeySpecific = aNativeKeyCode; - aNativeKeyCode = VK_CONTROL; + argumentKeySpecific = aNativeKeyCode & 0xFF; + aNativeKeyCode = (aNativeKeyCode & 0xFFFF0000) | VK_CONTROL; break; case VK_RCONTROL: aModifierFlags &= ~nsIWidget::CTRL_R; - argumentKeySpecific = aNativeKeyCode; - aNativeKeyCode = VK_CONTROL; + argumentKeySpecific = aNativeKeyCode & 0xFF; + aNativeKeyCode = (aNativeKeyCode & 0xFFFF0000) | VK_CONTROL; break; case VK_MENU: aModifierFlags &= ~(nsIWidget::ALT_L | nsIWidget::ALT_R); @@ -3763,13 +3763,13 @@ KeyboardLayout::SynthesizeNativeKeyEvent(nsWindowBase* aWidget, break; case VK_LMENU: aModifierFlags &= ~nsIWidget::ALT_L; - argumentKeySpecific = aNativeKeyCode; - aNativeKeyCode = VK_MENU; + argumentKeySpecific = aNativeKeyCode & 0xFF; + aNativeKeyCode = (aNativeKeyCode & 0xFFFF0000) | VK_MENU; break; case VK_RMENU: aModifierFlags &= ~nsIWidget::ALT_R; - argumentKeySpecific = aNativeKeyCode; - aNativeKeyCode = VK_MENU; + argumentKeySpecific = aNativeKeyCode & 0xFF; + aNativeKeyCode = (aNativeKeyCode & 0xFFFF0000) | VK_MENU; break; case VK_CAPITAL: aModifierFlags &= ~nsIWidget::CAPS_LOCK; @@ -3783,8 +3783,6 @@ KeyboardLayout::SynthesizeNativeKeyEvent(nsWindowBase* aWidget, AutoTArray keySequence; WinUtils::SetupKeyModifiersSequence(&keySequence, aModifierFlags); - NS_ASSERTION(aNativeKeyCode >= 0 && aNativeKeyCode < 256, - "Native VK key code out of range"); keySequence.AppendElement(KeyPair(aNativeKeyCode, argumentKeySpecific)); // Simulate the pressing of each modifier key and then the real key @@ -3793,18 +3791,22 @@ KeyboardLayout::SynthesizeNativeKeyEvent(nsWindowBase* aWidget, for (uint32_t i = 0; i < keySequence.Length(); ++i) { uint8_t key = keySequence[i].mGeneral; uint8_t keySpecific = keySequence[i].mSpecific; + uint16_t scanCode = keySequence[i].mScanCode; kbdState[key] = 0x81; // key is down and toggled on if appropriate if (keySpecific) { kbdState[keySpecific] = 0x81; } ::SetKeyboardState(kbdState); ModifierKeyState modKeyState; - UINT scanCode = - ComputeScanCodeForVirtualKeyCode(keySpecific ? keySpecific : key); + // If scan code isn't specified explicitly, let's compute it with current + // keyboard layout. + if (!scanCode) { + scanCode = + ComputeScanCodeForVirtualKeyCode(keySpecific ? keySpecific : key); + } LPARAM lParam = static_cast(scanCode << 16); - // Add extended key flag to the lParam for right control key and right alt - // key. - if (keySpecific == VK_RCONTROL || keySpecific == VK_RMENU) { + // If the scan code is for an extended key, set extended key flag. + if ((scanCode & 0xFF00) == 0xE000) { lParam |= 0x1000000; } bool makeSysKeyMsg = IsSysKey(key, modKeyState); @@ -3856,18 +3858,22 @@ KeyboardLayout::SynthesizeNativeKeyEvent(nsWindowBase* aWidget, for (uint32_t i = keySequence.Length(); i > 0; --i) { uint8_t key = keySequence[i - 1].mGeneral; uint8_t keySpecific = keySequence[i - 1].mSpecific; + uint16_t scanCode = keySequence[i - 1].mScanCode; kbdState[key] = 0; // key is up and toggled off if appropriate if (keySpecific) { kbdState[keySpecific] = 0; } ::SetKeyboardState(kbdState); ModifierKeyState modKeyState; - UINT scanCode = - ComputeScanCodeForVirtualKeyCode(keySpecific ? keySpecific : key); + // If scan code isn't specified explicitly, let's compute it with current + // keyboard layout. + if (!scanCode) { + scanCode = + ComputeScanCodeForVirtualKeyCode(keySpecific ? keySpecific : key); + } LPARAM lParam = static_cast(scanCode << 16); - // Add extended key flag to the lParam for right control key and right alt - // key. - if (keySpecific == VK_RCONTROL || keySpecific == VK_RMENU) { + // If the scan code is for an extended key, set extended key flag. + if ((scanCode & 0xFF00) == 0xE000) { lParam |= 0x1000000; } // Don't use WM_SYSKEYUP for Alt keyup. diff --git a/widget/windows/nsWindowDefs.h b/widget/windows/nsWindowDefs.h index 4e7529cd63b2..48a9356d28de 100644 --- a/widget/windows/nsWindowDefs.h +++ b/widget/windows/nsWindowDefs.h @@ -84,11 +84,17 @@ const wchar_t kClassNameTransition[] = L"MozillaTransitionWindowClass"; **************************************************************/ // Used for synthesizing events -struct KeyPair { +struct KeyPair +{ uint8_t mGeneral; uint8_t mSpecific; + uint16_t mScanCode; KeyPair(uint32_t aGeneral, uint32_t aSpecific) - : mGeneral(uint8_t(aGeneral)), mSpecific(uint8_t(aSpecific)) {} + : mGeneral(aGeneral & 0xFF) + , mSpecific(aSpecific & 0xFF) + , mScanCode((aGeneral & 0xFFFF0000) >> 16) + { + } }; #if (WINVER < 0x0600) From 0cf4a632e5c7a5fb4a23c9b210ae1417f8014b4e Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 13 Sep 2016 19:55:29 +0900 Subject: [PATCH 005/101] Bug 1300937 part.3 NativeKeyCodes.js should specify scan code to WIN_VK_ABNT_C1 explicitly for avoiding (perhaps) a bug of MapVirtualKeyEx() API r=smaug Unfortunately, MapVirtualKeyEx() doesn't compute ABNT C1's scan code from its virtual keycode, 0xC1. Therefore, NativeKeyCodes.js should specify 0x0056 explicitly. Fortunately, this key in physical keyboard always generates the scan code value with any keyboard layouts. Therefore, this can test new regressions as expected. FYI: ABNT C1 key is a key in Brazilian keyboard. It's at between "ShiftLeft" and "KeyZ". MozReview-Commit-ID: GmpnFKOsnKD --HG-- extra : rebase_source : 197b249740056e5c4b7c6f3b556f91f50a838d52 --- testing/mochitest/tests/SimpleTest/NativeKeyCodes.js | 9 ++++++++- widget/tests/test_keycodes.xul | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js b/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js index 39d80cbaa8d6..8130f3e18d50 100644 --- a/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js +++ b/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js @@ -10,6 +10,13 @@ // be computed with active keyboard layout automatically. // FYI: Don't define scan code here for printable keys, numeric keys and // IME keys because they depend on active keyboard layout. +// XXX: Although, ABNT C1 key depends on keyboard layout in strictly speaking. +// However, computing its scan code from the virtual keycode, +// WIN_VK_ABNT_C1, doesn't work fine (computed as 0x0073, "IntlRo"). +// Therefore, we should specify it here explicitly (it should be 0x0056, +// "IntlBackslash"). Fortunately, the key always generates 0x0056 with +// any keyboard layouts as far as I've tested. So, this must be safe to +// test new regressions. const WIN_VK_LBUTTON = 0x00000001; const WIN_VK_RBUTTON = 0x00000002; @@ -177,7 +184,7 @@ const WIN_VK_OEM_MINUS = 0x000000BD; const WIN_VK_OEM_PERIOD = 0x000000BE; const WIN_VK_OEM_2 = 0x000000BF; const WIN_VK_OEM_3 = 0x000000C0; -const WIN_VK_ABNT_C1 = 0x000000C1; +const WIN_VK_ABNT_C1 = 0x005600C1; const WIN_VK_ABNT_C2 = 0x000000C2; const WIN_VK_OEM_4 = 0x000000DB; const WIN_VK_OEM_5 = 0x000000DC; diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul index 859f4905b894..285043415850 100644 --- a/widget/tests/test_keycodes.xul +++ b/widget/tests/test_keycodes.xul @@ -2847,10 +2847,10 @@ function* runKeyEventTests() // Brazilian ABNT yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1, modifiers:{}, chars:"/"}, - "/", "IntlRo" /* TODO, should be "IntlBackslash" */, nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "/", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1, modifiers:{shiftKey:1}, chars:"?"}, - "?", "IntlRo" /* TODO, should be "IntlBackslash" */, nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + "?", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C2, modifiers:{numLockKey:1}, chars:"."}, ".", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); From b8318c87fb1346ff819da10744e5444fbabfbd46 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 16 Sep 2016 10:17:44 +0900 Subject: [PATCH 006/101] Bug 1300937 part.4 NativeKey::GetScanCodeWithExtendedFlag() should return 0xE0XX even on WinXP or WinServer2003 r=m_kato For safety, NativeKey::GetScanCodeWithExtendedFlag() returns without extended flag on WinXP and WinServer2003 because ::MapVirtualKeyEx() API doesn't support extend key conversion. However, extended scan code is available even on them when lParam has 0x1000000 especially when it computes KeyboardEvent.code value. Therefore, it should return with 0xE000 for extended keys on any versions of Windows. Note that NativeKey::ComputeVirtualKeyCodeFromScanCodeEx() wraps ::MapVirtualKeyEx() API. It checks if the API is not available for the result of NativeKey::GetScanCodeWithExtendedFlag(). So, returning extended scan code from NativeKey::GetScanCodeWithExtendedFlag() is safe. MozReview-Commit-ID: D2RrHxPI9ET --HG-- extra : rebase_source : 51f277e8331eb7ad109c3227ac1fe73f6de48105 --- widget/windows/KeyboardLayout.cpp | 32 +++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index cc58b02cce1f..035c075711eb 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -966,18 +966,21 @@ NativeKey::NativeKey(nsWindowBase* aWidget, // Therefore, we never get VK_RCONTRL and VK_RMENU for the result of // MapVirtualKeyEx() on WinXP or WinServer2003. // - // If VK_CONTROL or VK_MENU key message is caused by an extended key, - // we should assume that the right key of them is pressed. + // If VK_SHIFT, VK_CONTROL or VK_MENU key message is caused by well + // known scan code, we should decide it as Right key. Otherwise, + // decide it as Left key. switch (mOriginalVirtualKeyCode) { case VK_CONTROL: - mVirtualKeyCode = VK_RCONTROL; + mVirtualKeyCode = + mIsExtended && mScanCode == 0x1D ? VK_RCONTROL : VK_LCONTROL; break; case VK_MENU: - mVirtualKeyCode = VK_RMENU; + mVirtualKeyCode = + mIsExtended && mScanCode == 0x38 ? VK_RMENU : VK_LMENU; break; case VK_SHIFT: - // Neither left shift nor right shift is not an extended key, - // let's use VK_LSHIFT for invalid scan code. + // Neither left shift nor right shift is an extended key, + // let's use VK_LSHIFT for unknown mapping. mVirtualKeyCode = VK_LSHIFT; break; default: @@ -1009,8 +1012,8 @@ NativeKey::NativeKey(nsWindowBase* aWidget, break; case VK_SHIFT: if (mVirtualKeyCode != VK_LSHIFT && mVirtualKeyCode != VK_RSHIFT) { - // Neither left shift nor right shift is not an extended key, - // let's use VK_LSHIFT for invalid scan code. + // Neither left shift nor right shift is an extended key, + // let's use VK_LSHIFT for unknown mapping. mVirtualKeyCode = VK_LSHIFT; } break; @@ -1283,12 +1286,7 @@ NativeKey::IsIMEDoingKakuteiUndo() const UINT NativeKey::GetScanCodeWithExtendedFlag() const { - // MapVirtualKeyEx() has been improved for supporting extended keys since - // Vista. When we call it for mapping a scancode of an extended key and - // a virtual keycode, we need to add 0xE000 to the scancode. - // On Win XP and Win Server 2003, this doesn't support. On them, we have - // no way to get virtual keycodes from scancode of extended keys. - if (!mIsExtended || !IsVistaOrLater()) { + if (!mIsExtended) { return mScanCode; } return (0xE000 | mScanCode); @@ -1382,6 +1380,12 @@ NativeKey::ComputeVirtualKeyCodeFromScanCode() const uint8_t NativeKey::ComputeVirtualKeyCodeFromScanCodeEx() const { + // MapVirtualKeyEx() has been improved for supporting extended keys since + // Vista. When we call it for mapping a scancode of an extended key and + // a virtual keycode, we need to add 0xE000 to the scancode. + // On the other hand, neither WinXP nor WinServer2003 doesn't support 0xE000. + // Therefore, we have no way to get virtual keycode from scan code of + // extended keys. if (NS_WARN_IF(!CanComputeVirtualKeyCodeFromScanCode())) { return 0; } From e0f666d6ebfb12e48f71aa5c8dc9fce8c41088b6 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Tue, 20 Sep 2016 16:53:33 +0900 Subject: [PATCH 007/101] Bug 1303793 - Part 1: Use testharness.js instead of SimpleTest.js to run the test in an iframe easily. r=birtles MozReview-Commit-ID: FlT34Npg8uH --HG-- extra : rebase_source : 6046b27aeb51ca51a965dd5ca990079ab20208a2 --- .../test/mozilla/test_set-easing.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dom/animation/test/mozilla/test_set-easing.html b/dom/animation/test/mozilla/test_set-easing.html index 99f1fdafc614..f2932691dcf4 100644 --- a/dom/animation/test/mozilla/test_set-easing.html +++ b/dom/animation/test/mozilla/test_set-easing.html @@ -2,16 +2,15 @@ Test setting easing in sandbox - - - + + - +
From d41794cec39c8d60b8d9b0a4a064cf1c4135f1b2 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Tue, 20 Sep 2016 16:54:09 +0900 Subject: [PATCH 008/101] Bug 1303793 - Part 2: Run test which uses the Web Animations API in an iframe with the Web Animations API preference. r=birtles MozReview-Commit-ID: 233vs8Aiw5j --HG-- rename : dom/animation/test/mozilla/test_set-easing.html => dom/animation/test/mozilla/file_set-easing.html extra : rebase_source : 13653c93c20c987121773546f71496a30ccd061e --- dom/animation/test/mochitest.ini | 1 + .../test/mozilla/file_set-easing.html | 34 ++++++++++++++++++ .../test/mozilla/test_set-easing.html | 35 ++++--------------- 3 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 dom/animation/test/mozilla/file_set-easing.html diff --git a/dom/animation/test/mochitest.ini b/dom/animation/test/mochitest.ini index 2bb949652241..805377cf7c01 100644 --- a/dom/animation/test/mochitest.ini +++ b/dom/animation/test/mochitest.ini @@ -45,6 +45,7 @@ support-files = mozilla/file_spacing_property_order.html mozilla/file_transform_limits.html mozilla/file_underlying-discrete-value.html + mozilla/file_set-easing.html style/file_animation-seeking-with-current-time.html style/file_animation-seeking-with-start-time.html style/file_animation-setting-effect.html diff --git a/dom/animation/test/mozilla/file_set-easing.html b/dom/animation/test/mozilla/file_set-easing.html new file mode 100644 index 000000000000..072b125cb0ce --- /dev/null +++ b/dom/animation/test/mozilla/file_set-easing.html @@ -0,0 +1,34 @@ + + + +Test setting easing in sandbox + + + + + diff --git a/dom/animation/test/mozilla/test_set-easing.html b/dom/animation/test/mozilla/test_set-easing.html index f2932691dcf4..e0069ff1c888 100644 --- a/dom/animation/test/mozilla/test_set-easing.html +++ b/dom/animation/test/mozilla/test_set-easing.html @@ -1,35 +1,14 @@ - -Test setting easing in sandbox - -
- From 4a28a26c933c57dabe435aec1dec8f7a4797ac8f Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Fri, 16 Sep 2016 18:00:25 +0900 Subject: [PATCH 009/101] Bug 1302980 - Don't reset IME context on preedit_end. r=masayuki You know, when Korean IME commits string, then it sometimes set next preedit string. So reseting context causes that next preedit string is committed. So we shouldn't reset IME context with preedit_end. MozReview-Commit-ID: CZJJvYjcrKY --HG-- extra : rebase_source : d7e2e80930355794a40466c68fe22e43e7164d72 --- widget/gtk/IMContextWrapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index 34dbbbd1cc02..58d7a3681c2f 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -1006,7 +1006,8 @@ IMContextWrapper::OnSelectionChange(nsWindow* aCaller, } bool occurredBeforeComposition = - IsComposing() && !selectionChangeData.mOccurredDuringComposition; + IsComposing() && !selectionChangeData.mOccurredDuringComposition && + !selectionChangeData.mCausedByComposition; if (occurredBeforeComposition) { mPendingResettingIMContext = true; } From 67244308826d0f2169e5ae5479dbd036d0044e4d Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Wed, 24 Aug 2016 07:26:32 -0700 Subject: [PATCH 010/101] Bug 1297535 - Register devtools menu and keys on DOMContentLoaded to happen before CustomizableUI. r=bgrins MozReview-Commit-ID: ACy3yJTgzyA --HG-- extra : rebase_source : 2a092d29def1180603f733e484b8a67600092a64 --- devtools/client/framework/devtools-browser.js | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/devtools/client/framework/devtools-browser.js b/devtools/client/framework/devtools-browser.js index 41a4e513438e..03f497fe2884 100644 --- a/devtools/client/framework/devtools-browser.js +++ b/devtools/client/framework/devtools-browser.js @@ -141,6 +141,10 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { } } break; + case "domwindowopened": + let win = subject.QueryInterface(Ci.nsIDOMEventTarget); + win.addEventListener("DOMContentLoaded", this, { once: true }); + break; } }, @@ -401,11 +405,28 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { CustomizableUI.addWidgetToArea("webide-button", CustomizableUI.AREA_NAVBAR); }, + /** + * Starts setting up devtools on a given browser window. This method is + * called on DOMContentLoaded, so earlier than registerBrowserWindow which + * is called after delayed-startup notification. This method should only do + * what has to be done early. Otherwise devtools should be initialized lazily + * to prevent overloading Firefox startup. + * + * @param {ChromeWindow} window + * The window to which devtools should be hooked to. + */ + _onBrowserWindowLoaded: function (win) { + if (!win.gBrowser) { + return; + } + BrowserMenus.addMenus(win.document); + }, + /** * Add this DevTools's presence to a browser window's document * - * @param {XULDocument} doc - * The document to which devtools should be hooked to. + * @param {ChromeWindow} win + * The window to which devtools should be hooked to. */ _registerBrowserWindow: function (win) { if (gDevToolsBrowser._trackedBrowserWindows.has(win)) { @@ -413,8 +434,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { } gDevToolsBrowser._trackedBrowserWindows.add(win); - BrowserMenus.addMenus(win.document); - // Register the Developer widget in the Hamburger menu or navbar // only once menus are registered as it depends on it. gDevToolsBrowser.installDeveloperWidget(); @@ -679,6 +698,9 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { case "TabSelect": gDevToolsBrowser._updateMenuCheckbox(); break; + case "DOMContentLoaded": + gDevToolsBrowser._onBrowserWindowLoaded(event.target.defaultView); + break; case "unload": // top-level browser window unload gDevToolsBrowser._forgetBrowserWindow(event.target.defaultView); @@ -708,6 +730,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { */ destroy: function () { Services.prefs.removeObserver("devtools.", gDevToolsBrowser); + Services.ww.unregisterNotification(gDevToolsBrowser); Services.obs.removeObserver(gDevToolsBrowser, "browser-delayed-startup-finished"); Services.obs.removeObserver(gDevToolsBrowser.destroy, "quit-application"); @@ -740,6 +763,7 @@ gDevTools.on("toolbox-ready", gDevToolsBrowser._updateMenuCheckbox); gDevTools.on("toolbox-destroyed", gDevToolsBrowser._updateMenuCheckbox); Services.obs.addObserver(gDevToolsBrowser.destroy, "quit-application", false); +Services.ww.registerNotification(gDevToolsBrowser); Services.obs.addObserver(gDevToolsBrowser, "browser-delayed-startup-finished", false); // Fake end of browser window load event for all already opened windows @@ -748,6 +772,7 @@ let enumerator = Services.wm.getEnumerator(gDevTools.chromeWindowType); while (enumerator.hasMoreElements()) { let win = enumerator.getNext(); if (win.gBrowserInit && win.gBrowserInit.delayedStartupFinished) { + gDevToolsBrowser._onBrowserWindowLoaded(win); gDevToolsBrowser._registerBrowserWindow(win); } } From 8a285ee959e05fc910019870687495de81c8cfc1 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Thu, 15 Sep 2016 16:17:17 +0100 Subject: [PATCH 011/101] Bug 1211637 - if there's no docShell (on a local tab) or permitUnload times out (on a remote tab), close the tab, r=billm MozReview-Commit-ID: Cihru0TVxNc --HG-- extra : rebase_source : 5c9bcee84eb0b1f6daaa1fa8d317fc700fe40909 --- browser/base/content/tabbrowser.xml | 4 ++-- toolkit/content/widgets/browser.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 976a888bc678..6ea01ab3a039 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -2368,12 +2368,12 @@ // processes the event queue and may lead to another removeTab() // call before permitUnload() returns. aTab._pendingPermitUnload = true; - let {permitUnload} = browser.permitUnload(); + let {permitUnload, timedOut} = browser.permitUnload(); delete aTab._pendingPermitUnload; // If we were closed during onbeforeunload, we return false now // so we don't (try to) close the same tab again. Of course, we // also stop if the unload was cancelled by the user: - if (aTab.closing || !permitUnload) { + if (aTab.closing || (!timedOut && !permitUnload)) { // NB: deliberately keep the _closedDuringPermitUnload set to // true so we keep exiting early in case of multiple calls. return false; diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index eefc8807b7e5..ead98e871c88 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -1312,7 +1312,7 @@ From 6473ef152725e7786111cd2d725fec8090729289 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Tue, 30 Aug 2016 11:41:14 +1000 Subject: [PATCH 012/101] Bug 1299741 part 1 - Factor out ComputeColorDistance. r=birtles MozReview-Commit-ID: HojkuHyqWoT --HG-- extra : rebase_source : 105d6f259165d6f69900e440226cd8e650b5e6e7 --- layout/style/StyleAnimationValue.cpp | 80 +++++++++++++--------------- layout/style/StyleAnimationValue.h | 11 ++++ 2 files changed, 48 insertions(+), 43 deletions(-) diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index e3e439962472..2b5cafb580b0 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -487,6 +487,39 @@ CalcPositionCoordSquareDistance(const nsCSSValue& aPos1, // CLASS METHODS // ------------- +double +StyleAnimationValue::ComputeColorDistance(nscolor aStartColor, + nscolor aEndColor) +{ + // http://www.w3.org/TR/smil-animation/#animateColorElement says + // that we should use Euclidean RGB cube distance. However, we + // have to extend that to RGBA. For now, we'll just use the + // Euclidean distance in the (part of the) 4-cube of premultiplied + // colors. + + // Get a color component on a 0-1 scale, which is much easier to + // deal with when working with alpha. +#define GET_COMPONENT(component_, color_) \ + (NS_GET_##component_(color_) * (1.0 / 255.0)) + + double startA = GET_COMPONENT(A, aStartColor); + double startR = GET_COMPONENT(R, aStartColor) * startA; + double startG = GET_COMPONENT(G, aStartColor) * startA; + double startB = GET_COMPONENT(B, aStartColor) * startA; + double endA = GET_COMPONENT(A, aEndColor); + double endR = GET_COMPONENT(R, aEndColor) * endA; + double endG = GET_COMPONENT(G, aEndColor) * endA; + double endB = GET_COMPONENT(B, aEndColor) * endA; + +#undef GET_COMPONENT + + double diffA = startA - endA; + double diffR = startR - endR; + double diffG = startG - endG; + double diffB = startB - endB; + return sqrt(diffA * diffA + diffR * diffR + diffG * diffG + diffB * diffB); +} + bool StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty, const StyleAnimationValue& aStartValue, @@ -558,40 +591,9 @@ StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty, return true; } case eUnit_Color: { - // http://www.w3.org/TR/smil-animation/#animateColorElement says - // that we should use Euclidean RGB cube distance. However, we - // have to extend that to RGBA. For now, we'll just use the - // Euclidean distance in the (part of the) 4-cube of premultiplied - // colors. - // FIXME (spec): The CSS transitions spec doesn't say whether - // colors are premultiplied, but things work better when they are, - // so use premultiplication. Spec issue is still open per - // http://lists.w3.org/Archives/Public/www-style/2009Jul/0050.html nscolor startColor = aStartValue.GetCSSValueValue()->GetColorValue(); nscolor endColor = aEndValue.GetCSSValueValue()->GetColorValue(); - - // Get a color component on a 0-1 scale, which is much easier to - // deal with when working with alpha. - #define GET_COMPONENT(component_, color_) \ - (NS_GET_##component_(color_) * (1.0 / 255.0)) - - double startA = GET_COMPONENT(A, startColor); - double startR = GET_COMPONENT(R, startColor) * startA; - double startG = GET_COMPONENT(G, startColor) * startA; - double startB = GET_COMPONENT(B, startColor) * startA; - double endA = GET_COMPONENT(A, endColor); - double endR = GET_COMPONENT(R, endColor) * endA; - double endG = GET_COMPONENT(G, endColor) * endA; - double endB = GET_COMPONENT(B, endColor) * endA; - - #undef GET_COMPONENT - - double diffA = startA - endA; - double diffR = startR - endR; - double diffG = startG - endG; - double diffB = startB - endB; - aDistance = sqrt(diffA * diffA + diffR * diffR + - diffG * diffG + diffB * diffB); + aDistance = ComputeColorDistance(startColor, endColor); return true; } case eUnit_Calc: { @@ -848,17 +850,9 @@ StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty, #endif if (color1.GetUnit() != eCSSUnit_Null) { - StyleAnimationValue color1Value - (color1.GetColorValue(), StyleAnimationValue::ColorConstructor); - StyleAnimationValue color2Value - (color2.GetColorValue(), StyleAnimationValue::ColorConstructor); - double colorDistance; - - DebugOnly ok = - StyleAnimationValue::ComputeDistance(eCSSProperty_color, - color1Value, color2Value, - colorDistance); - MOZ_ASSERT(ok, "should not fail"); + double colorDistance = + StyleAnimationValue::ComputeColorDistance(color1.GetColorValue(), + color2.GetColorValue()); squareDistance += colorDistance * colorDistance; } diff --git a/layout/style/StyleAnimationValue.h b/layout/style/StyleAnimationValue.h index 915db2e65a91..d227940e0443 100644 --- a/layout/style/StyleAnimationValue.h +++ b/layout/style/StyleAnimationValue.h @@ -59,6 +59,17 @@ public: return AddWeighted(aProperty, 1.0, aDest, aCount, aValueToAdd, aDest); } + /** + * Calculates a measure of 'distance' between two colors. + * + * @param aStartColor The start of the interval for which the distance + * should be calculated. + * @param aEndColor The end of the interval for which the distance + * should be calculated. + * @return the result of the calculation. + */ + static double ComputeColorDistance(nscolor aStartColor, nscolor aEndColor); + /** * Calculates a measure of 'distance' between two values. * From 3e7bcf14373883706e20e2c7a430c0f9ba43b984 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 2 Sep 2016 14:59:28 +1000 Subject: [PATCH 013/101] Bug 1299741 part 2 - Move ClampColor to nsColor.h. r=mstange MozReview-Commit-ID: 6qbVhOA3DE4 --HG-- extra : rebase_source : a5ee990caffef332cfd0bfa6753dff392e48166d --- gfx/src/nsColor.h | 17 +++++++++++++++++ layout/style/StyleAnimationValue.cpp | 11 ----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/gfx/src/nsColor.h b/gfx/src/nsColor.h index 572f0d1fcf47..ee369353faaf 100644 --- a/gfx/src/nsColor.h +++ b/gfx/src/nsColor.h @@ -9,6 +9,7 @@ #include // for size_t #include // for uint8_t, uint32_t #include "nscore.h" // for nsAString +#include "nsCoord.h" // for NSToIntRound class nsAString; class nsString; @@ -33,6 +34,22 @@ typedef uint32_t nscolor; #define NS_GET_B(_rgba) ((uint8_t) (((_rgba) >> 16) & 0xff)) #define NS_GET_A(_rgba) ((uint8_t) (((_rgba) >> 24) & 0xff)) +namespace mozilla { + +template +inline uint8_t ClampColor(T aColor) +{ + if (aColor >= 255) { + return 255; + } + if (aColor <= 0) { + return 0; + } + return NSToIntRound(aColor); +} + +} // namespace mozilla + // Fast approximate division by 255. It has the property that // for all 0 <= n <= 255*255, FAST_DIVIDE_BY_255(n) == n/255. // But it only uses two adds and two shifts instead of an diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index 2b5cafb580b0..0c4524f0af7a 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -954,17 +954,6 @@ StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty, return false; } -#define MAX_PACKED_COLOR_COMPONENT 255 - -inline uint8_t ClampColor(double aColor) -{ - if (aColor >= MAX_PACKED_COLOR_COMPONENT) - return MAX_PACKED_COLOR_COMPONENT; - if (aColor <= 0.0) - return 0; - return NSToIntRound(aColor); -} - // Ensure that a float/double value isn't NaN by returning zero instead // (NaN doesn't have a sign) as a general restriction for floating point // values in RestrictValue. From 6cedec766737549ab0f288d47ce225811158a47d Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 2 Sep 2016 17:13:11 +1000 Subject: [PATCH 014/101] Bug 1299741 part 3 - Add LinearBlendColors function for linear blending two colors. r=mstange MozReview-Commit-ID: KVzV2DxXRqu --HG-- extra : rebase_source : de1003c5546f77dc251d1dc1c3634ac79b73481f --- gfx/src/nsColor.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++ gfx/src/nsColor.h | 16 ++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/gfx/src/nsColor.cpp b/gfx/src/nsColor.cpp index 5dc31ed2ff6f..359f9fde47dd 100644 --- a/gfx/src/nsColor.cpp +++ b/gfx/src/nsColor.cpp @@ -5,6 +5,7 @@ #include "mozilla/ArrayUtils.h" // for ArrayLength #include "mozilla/mozalloc.h" // for operator delete, etc +#include "mozilla/MathAlgorithms.h" #include "nsColor.h" #include // for int32_t @@ -256,6 +257,59 @@ NS_ComposeColors(nscolor aBG, nscolor aFG) return NS_RGBA(r, g, b, a); } +namespace mozilla { + +static uint32_t +BlendColorComponent(uint32_t aBg, uint32_t aFg, uint32_t aFgAlpha) +{ + return RoundingDivideBy255(aBg * (255 - aFgAlpha) + aFg * aFgAlpha); +} + +nscolor +LinearBlendColors(nscolor aBg, nscolor aFg, uint_fast8_t aFgRatio) +{ + // Common case that either pure background or pure foreground + if (aFgRatio == 0) { + return aBg; + } + if (aFgRatio == 255) { + return aFg; + } + // Common case that alpha channel is equal (usually both are opaque) + if (NS_GET_A(aBg) == NS_GET_A(aFg)) { + auto r = BlendColorComponent(NS_GET_R(aBg), NS_GET_R(aFg), aFgRatio); + auto g = BlendColorComponent(NS_GET_G(aBg), NS_GET_G(aFg), aFgRatio); + auto b = BlendColorComponent(NS_GET_B(aBg), NS_GET_B(aFg), aFgRatio); + return NS_RGBA(r, g, b, NS_GET_A(aFg)); + } + + constexpr float kFactor = 1.0f / 255.0f; + + float p1 = kFactor * (255 - aFgRatio); + float a1 = kFactor * NS_GET_A(aBg); + float r1 = a1 * NS_GET_R(aBg); + float g1 = a1 * NS_GET_G(aBg); + float b1 = a1 * NS_GET_B(aBg); + + float p2 = 1.0f - p1; + float a2 = kFactor * NS_GET_A(aFg); + float r2 = a2 * NS_GET_R(aFg); + float g2 = a2 * NS_GET_G(aFg); + float b2 = a2 * NS_GET_B(aFg); + + float a = p1 * a1 + p2 * a2; + if (a == 0.0) { + return NS_RGBA(0, 0, 0, 0); + } + + auto r = ClampColor((p1 * r1 + p2 * r2) / a); + auto g = ClampColor((p1 * g1 + p2 * g2) / a); + auto b = ClampColor((p1 * b1 + p2 * b2) / a); + return NS_RGBA(r, g, b, NSToIntRound(a * 255)); +} + +} // namespace mozilla + // Functions to convert from HSL color space to RGB color space. // This is the algorithm described in the CSS3 specification diff --git a/gfx/src/nsColor.h b/gfx/src/nsColor.h index ee369353faaf..2f21c91bf2a8 100644 --- a/gfx/src/nsColor.h +++ b/gfx/src/nsColor.h @@ -77,6 +77,22 @@ NS_HexToRGBA(const nsAString& aBuf, nsHexColorType aType, nscolor* aResult); // you get if you draw aFG on top of aBG with operator OVER. nscolor NS_ComposeColors(nscolor aBG, nscolor aFG); +namespace mozilla { + +inline uint32_t RoundingDivideBy255(uint32_t n) +{ + // There is an approximate alternative: ((n << 8) + n + 32896) >> 16 + // But that is actually slower than this simple expression on a modern + // machine with a modern compiler. + return (n + 127) / 255; +} + +// Blend one RGBA color with another based on a given ratio. +// It is a linear interpolation on each channel with alpha premultipled. +nscolor LinearBlendColors(nscolor aBg, nscolor aFg, uint_fast8_t aFgRatio); + +} // namespace mozilla + // Translate a hex string to a color. Return true if it parses ok, // otherwise return false. // This version accepts 1 to 9 digits (missing digits are 0) From 8b3d5beac636696193efe177b632f636ced07281 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 2 Sep 2016 14:58:10 +1000 Subject: [PATCH 015/101] Bug 1299741 part 4 - Add StyleComplexColor type for storing color combining numeric color and currentcolor. r=dbaron MozReview-Commit-ID: I6DaSaMCgtH --HG-- extra : rebase_source : 0ad610a40431e74a540714491be35ad444fd4372 --- layout/style/StyleComplexColor.h | 51 ++++++++++++++++++++++++++++++++ layout/style/moz.build | 1 + layout/style/nsStyleStruct.h | 6 ++++ 3 files changed, 58 insertions(+) create mode 100644 layout/style/StyleComplexColor.h diff --git a/layout/style/StyleComplexColor.h b/layout/style/StyleComplexColor.h new file mode 100644 index 000000000000..d7732e5b01f2 --- /dev/null +++ b/layout/style/StyleComplexColor.h @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +/* represent a color combines a numeric color and currentcolor */ + +#ifndef mozilla_StyleComplexColor_h_ +#define mozilla_StyleComplexColor_h_ + +#include "nsColor.h" + +namespace mozilla { + +/** + * This struct represents a combined color from a numeric color and + * the current foreground color (currentcolor keyword). + * Conceptually, the formula is "color * (1 - p) + currentcolor * p" + * where p is mForegroundRatio. See mozilla::LinearBlendColors for + * the actual algorithm. + */ +struct StyleComplexColor +{ + nscolor mColor; + uint8_t mForegroundRatio; + + StyleComplexColor() {} + StyleComplexColor(nscolor aColor, uint_fast8_t aForegroundRatio) + : mColor(aColor), mForegroundRatio(aForegroundRatio) {} + + static StyleComplexColor FromColor(nscolor aColor) + { return StyleComplexColor(aColor, 0); } + static StyleComplexColor CurrentColor() + { return StyleComplexColor(NS_RGBA(0, 0, 0, 0), 255); } + + bool IsNumericColor() const { return mForegroundRatio == 0; } + bool IsCurrentColor() const { return mForegroundRatio == 255; } + + bool operator==(const StyleComplexColor& aOther) const { + return mForegroundRatio == aOther.mForegroundRatio && + (IsCurrentColor() || mColor == aOther.mColor); + } + bool operator!=(const StyleComplexColor& aOther) const { + return !(*this == aOther); + } +}; + +} + +#endif // mozilla_StyleComplexColor_h_ diff --git a/layout/style/moz.build b/layout/style/moz.build index 14e8af469f00..6dbdb52be220 100644 --- a/layout/style/moz.build +++ b/layout/style/moz.build @@ -100,6 +100,7 @@ EXPORTS.mozilla += [ 'SheetType.h', 'StyleAnimationValue.h', 'StyleBackendType.h', + 'StyleComplexColor.h', 'StyleContextSource.h', 'StyleSetHandle.h', 'StyleSetHandleInlines.h', diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 2586439c34e6..8dff4db36f6b 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -18,6 +18,7 @@ #include "mozilla/Maybe.h" #include "mozilla/SheetType.h" #include "mozilla/StaticPtr.h" +#include "mozilla/StyleComplexColor.h" #include "mozilla/StyleStructContext.h" #include "mozilla/UniquePtr.h" #include "nsColor.h" @@ -480,6 +481,11 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColor MOZ_COUNT_DTOR(nsStyleColor); } + nscolor CalcComplexColor(const mozilla::StyleComplexColor& aColor) const { + return mozilla::LinearBlendColors(aColor.mColor, mColor, + aColor.mForegroundRatio); + } + nsChangeHint CalcDifference(const nsStyleColor& aNewData) const; static nsChangeHint MaxDifference() { return nsChangeHint_RepaintFrame; From ee132df0169b109ac18c1de90c9586088fceb437 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 16 Sep 2016 09:24:29 +1000 Subject: [PATCH 016/101] Bug 1299741 part 5 - Add css::RGBAColorData struct. r=heycam This struct will be used as part of the storage type of ComplexColor in nsCSSValue. Also this will be used to help unifying color calculation in StyleAnimationValue. MozReview-Commit-ID: C5UUI5DNnRM --HG-- extra : rebase_source : b76c7d39ca21e4316a09524bbbc918a12ab81194 --- layout/style/nsCSSValue.cpp | 7 ++++++ layout/style/nsCSSValue.h | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index 609517315f80..e9db420ebadc 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -478,6 +478,13 @@ void nsCSSValue::SetFloatColorValue(float aComponent1, mValue.mFloatColor->AddRef(); } +void +nsCSSValue::SetRGBAColorValue(const RGBAColorData& aValue) +{ + SetFloatColorValue(aValue.mR, aValue.mG, aValue.mB, + aValue.mA, eCSSUnit_PercentageRGBAColor); +} + void nsCSSValue::SetArrayValue(nsCSSValue::Array* aValue, nsCSSUnit aUnit) { Reset(); diff --git a/layout/style/nsCSSValue.h b/layout/style/nsCSSValue.h index 196ec0b7ddd1..7509f1a13390 100644 --- a/layout/style/nsCSSValue.h +++ b/layout/style/nsCSSValue.h @@ -299,6 +299,52 @@ private: } }; +struct RGBAColorData +{ + // 1.0 means 100% for all components, but the value may fall outside + // the range of [0.0, 1.0], so it is necessary to clamp them when + // converting to nscolor. + float mR; + float mG; + float mB; + float mA; + + RGBAColorData() = default; + MOZ_IMPLICIT RGBAColorData(nscolor aColor) + : mR(NS_GET_R(aColor) * (1.0f / 255.0f)) + , mG(NS_GET_G(aColor) * (1.0f / 255.0f)) + , mB(NS_GET_B(aColor) * (1.0f / 255.0f)) + , mA(NS_GET_A(aColor) * (1.0f / 255.0f)) + {} + RGBAColorData(float aR, float aG, float aB, float aA) + : mR(aR), mG(aG), mB(aB), mA(aA) {} + + bool operator==(const RGBAColorData& aOther) const + { + return mR == aOther.mR && mG == aOther.mG && + mB == aOther.mB && mA == aOther.mA; + } + bool operator!=(const RGBAColorData& aOther) const + { + return !(*this == aOther); + } + + nscolor ToColor() const + { + return NS_RGBA(ClampColor(mR * 255.0f), + ClampColor(mG * 255.0f), + ClampColor(mB * 255.0f), + ClampColor(mA * 255.0f)); + } + + RGBAColorData WithAlpha(float aAlpha) const + { + RGBAColorData result = *this; + result.mA = aAlpha; + return result; + } +}; + } // namespace css } // namespace mozilla @@ -771,6 +817,7 @@ public: float aComponent2, float aComponent3, float aAlpha, nsCSSUnit aUnit); + void SetRGBAColorValue(const mozilla::css::RGBAColorData& aValue); void SetArrayValue(nsCSSValue::Array* aArray, nsCSSUnit aUnit); void SetURLValue(mozilla::css::URLValue* aURI); void SetImageValue(mozilla::css::ImageValue* aImage); From 8f2d2e59ddb4a2e3dda9782b12e850ac9074f53c Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 16 Sep 2016 15:36:39 +1000 Subject: [PATCH 017/101] Bug 1299741 part 6 - Use RGBAColorData for color calculation in StyleAnimationValue. r=birtles This makes it easier for reusing code for calculating ComplexColor. Note that this patch also includes two fixes to the logic: 1. Fix the condition on when DiluteColor should be called instead of AddWeightedColors. See discussion in bug 1216843 comment 199 to 204. 2. Simplify DiluteColor to not using premultiplied color. See discussion in bug 1216843 comment 205 to 206. MozReview-Commit-ID: DOXMpDkwhAK --HG-- extra : rebase_source : 2e914c26fac4613c25d5f1381693617a9bbbe412 --- layout/style/StyleAnimationValue.cpp | 255 +++++++++++---------------- layout/style/StyleAnimationValue.h | 3 +- 2 files changed, 104 insertions(+), 154 deletions(-) diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index 0c4524f0af7a..3a0ee1eb65f6 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -34,6 +34,7 @@ #include "gfx2DGlue.h" using namespace mozilla; +using namespace mozilla::css; using namespace mozilla::gfx; // HELPER METHODS @@ -487,31 +488,53 @@ CalcPositionCoordSquareDistance(const nsCSSValue& aPos1, // CLASS METHODS // ------------- +static RGBAColorData +ExtractColor(const nsCSSValue& aValue) +{ + MOZ_ASSERT(aValue.IsNumericColorUnit(), "The unit should be color"); + // PercentageRGBColor and PercentageRGBAColor component value might be + // greater than 1.0 in case when the color value is accumulated, so we + // can't use nsCSSValue::GetColorValue() here because that function + // clamps its values. + if (aValue.GetUnit() == eCSSUnit_PercentageRGBColor || + aValue.GetUnit() == eCSSUnit_PercentageRGBAColor) { + nsCSSValueFloatColor* floatColor = aValue.GetFloatColorValue(); + return { + floatColor->Comp1(), + floatColor->Comp2(), + floatColor->Comp3(), + floatColor->Alpha() + }; + } + return RGBAColorData(aValue.GetColorValue()); +} + +static RGBAColorData +ExtractColor(const StyleAnimationValue& aValue) +{ + MOZ_ASSERT(aValue.GetUnit() == StyleAnimationValue::eUnit_Color); + nsCSSValue* value = aValue.GetCSSValueValue(); + MOZ_ASSERT(value, "CSS value must be valid"); + return ExtractColor(*value); +} + double -StyleAnimationValue::ComputeColorDistance(nscolor aStartColor, - nscolor aEndColor) +StyleAnimationValue::ComputeColorDistance(const RGBAColorData& aStartColor, + const RGBAColorData& aEndColor) { // http://www.w3.org/TR/smil-animation/#animateColorElement says // that we should use Euclidean RGB cube distance. However, we // have to extend that to RGBA. For now, we'll just use the // Euclidean distance in the (part of the) 4-cube of premultiplied // colors. - - // Get a color component on a 0-1 scale, which is much easier to - // deal with when working with alpha. -#define GET_COMPONENT(component_, color_) \ - (NS_GET_##component_(color_) * (1.0 / 255.0)) - - double startA = GET_COMPONENT(A, aStartColor); - double startR = GET_COMPONENT(R, aStartColor) * startA; - double startG = GET_COMPONENT(G, aStartColor) * startA; - double startB = GET_COMPONENT(B, aStartColor) * startA; - double endA = GET_COMPONENT(A, aEndColor); - double endR = GET_COMPONENT(R, aEndColor) * endA; - double endG = GET_COMPONENT(G, aEndColor) * endA; - double endB = GET_COMPONENT(B, aEndColor) * endA; - -#undef GET_COMPONENT + double startA = aStartColor.mA; + double startR = aStartColor.mR * startA; + double startG = aStartColor.mG * startA; + double startB = aStartColor.mB * startA; + double endA = aEndColor.mA; + double endR = aEndColor.mR * endA; + double endG = aEndColor.mG * endA; + double endB = aEndColor.mB * endA; double diffA = startA - endA; double diffR = startR - endR; @@ -591,9 +614,8 @@ StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty, return true; } case eUnit_Color: { - nscolor startColor = aStartValue.GetCSSValueValue()->GetColorValue(); - nscolor endColor = aEndValue.GetCSSValueValue()->GetColorValue(); - aDistance = ComputeColorDistance(startColor, endColor); + aDistance = ComputeColorDistance(ExtractColor(aStartValue), + ExtractColor(aEndValue)); return true; } case eUnit_Calc: { @@ -850,8 +872,7 @@ StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty, #endif if (color1.GetUnit() != eCSSUnit_Null) { - double colorDistance = - StyleAnimationValue::ComputeColorDistance(color1.GetColorValue(), + double colorDistance = ComputeColorDistance(color1.GetColorValue(), color2.GetColorValue()); squareDistance += colorDistance * colorDistance; } @@ -1146,119 +1167,59 @@ AddCSSValuePercentNumber(const uint32_t aValueRestrictions, eCSSUnit_Number); } -// Returns Tuple(Red, Green, Blue, Alpha). -// Red, Green, and Blue are scaled to the [0, 255] range, and Alpha is scaled -// to the [0, 1] range (though values are allowed to fall outside of these -// ranges). -static Tuple -GetPremultipliedColorComponents(const nsCSSValue& aValue) -{ - // PercentageRGBColor and PercentageRGBAColor component value might be - // greater than 1.0 in case when the color value is accumulated, so we - // can't use nsCSSValue::GetColorValue() here because that function - // clamps its values. - if (aValue.GetUnit() == eCSSUnit_PercentageRGBColor || - aValue.GetUnit() == eCSSUnit_PercentageRGBAColor) { - nsCSSValueFloatColor* floatColor = aValue.GetFloatColorValue(); - double alpha = floatColor->Alpha(); - return MakeTuple(floatColor->Comp1() * 255.0 * alpha, - floatColor->Comp2() * 255.0 * alpha, - floatColor->Comp3() * 255.0 * alpha, - alpha); - } - - nscolor color = aValue.GetColorValue(); - double alpha = NS_GET_A(color) * (1.0 / 255.0); - return MakeTuple(NS_GET_R(color) * alpha, - NS_GET_G(color) * alpha, - NS_GET_B(color) * alpha, - alpha); -} - enum class ColorAdditionType { Clamped, // Clamp each color channel after adding. Unclamped // Do not clamp color channels after adding. }; -// |aAdditionType| should be Clamped in case of interpolation or SMIL -// animation (e.g. 'by' attribute). For now, Unclamped is only for -// accumulation. -static void -AddWeightedColors(double aCoeff1, const nsCSSValue& aValue1, - double aCoeff2, const nsCSSValue& aValue2, - ColorAdditionType aAdditionType, - nsCSSValue& aResult) +// Unclamped AddWeightedColors. +static RGBAColorData +AddWeightedColors(double aCoeff1, const RGBAColorData& aValue1, + double aCoeff2, const RGBAColorData& aValue2) { - MOZ_ASSERT(aValue1.IsNumericColorUnit() && aValue2.IsNumericColorUnit(), - "The unit should be color"); - // FIXME (spec): The CSS transitions spec doesn't say whether - // colors are premultiplied, but things work better when they are, - // so use premultiplication. Spec issue is still open per - // http://lists.w3.org/Archives/Public/www-style/2009Jul/0050.html - - // To save some math, scale the alpha down to a 0-1 scale, but - // leave the color components on a 0-255 scale. - - double R1, G1, B1, A1; - Tie(R1, G1, B1, A1) = GetPremultipliedColorComponents(aValue1); - double R2, G2, B2, A2; - Tie(R2, G2, B2, A2) = GetPremultipliedColorComponents(aValue2); - double Aresf = (A1 * aCoeff1 + A2 * aCoeff2); - if (Aresf <= 0.0) { - aResult.SetColorValue(NS_RGBA(0, 0, 0, 0)); - return; + float factor1 = aValue1.mA * aCoeff1; + float factor2 = aValue2.mA * aCoeff2; + float resultA = factor1 + factor2; + if (resultA <= 0.0) { + return {0, 0, 0, 0}; } - if (Aresf > 1.0) { - Aresf = 1.0; + if (resultA > 1.0) { + resultA = 1.0; } - double factor = 1.0 / Aresf; - double Rres = (R1 * aCoeff1 + R2 * aCoeff2) * factor; - double Gres = (G1 * aCoeff1 + G2 * aCoeff2) * factor; - double Bres = (B1 * aCoeff1 + B2 * aCoeff2) * factor; - - if (aAdditionType == ColorAdditionType::Clamped) { - aResult.SetColorValue( - NS_RGBA(ClampColor(Rres), ClampColor(Gres), ClampColor(Bres), - NSToIntRound(Aresf * 255.0))); - return; - } - - Rres = Rres * (1.0 / 255.0); - Gres = Gres * (1.0 / 255.0); - Bres = Bres * (1.0 / 255.0); - - aResult.SetFloatColorValue(Rres, Gres, Bres, Aresf, - eCSSUnit_PercentageRGBAColor); + float resultFactor = 1.0f / resultA; + return RGBAColorData( + (aValue1.mR * factor1 + aValue2.mR * factor2) * resultFactor, + (aValue1.mG * factor1 + aValue2.mG * factor2) * resultFactor, + (aValue1.mB * factor1 + aValue2.mB * factor2) * resultFactor, + resultA); } -// Multiplies |aValue| color by |aDilutionRation| with premultiplication. -// The result is stored in |aResult|. -// (The logic here should pretty closely match AddWeightedColors()' logic.) -static void -DiluteColor(const nsCSSValue& aValue, double aDilutionRatio, - nsCSSValue& aResult) +// Multiplies |aValue| color by |aDilutionRation|. +static nscolor +DiluteColor(const RGBAColorData& aValue, double aDilutionRatio) { - MOZ_ASSERT(aValue.IsNumericColorUnit(), "The unit should be color"); MOZ_ASSERT(aDilutionRatio >= 0.0 && aDilutionRatio <= 1.0, "Dilution ratio should be in [0, 1]"); + float resultA = aValue.mA * aDilutionRatio; + return resultA <= 0.0 ? NS_RGBA(0, 0, 0, 0) + : aValue.WithAlpha(resultA).ToColor(); +} - // Premultiplication - double R, G, B, A; - Tie(R, G, B, A) = GetPremultipliedColorComponents(aValue); - double Aresf = A * aDilutionRatio; - if (Aresf <= 0.0) { - aResult.SetColorValue(NS_RGBA(0, 0, 0, 0)); - return; - } - - double factor = 1.0 / Aresf; - aResult.SetColorValue( - NS_RGBA(ClampColor(R * aDilutionRatio * factor), - ClampColor(G * aDilutionRatio * factor), - ClampColor(B * aDilutionRatio * factor), - NSToIntRound(Aresf * 255.0))); +// Clamped AddWeightedColors. +static nscolor +AddWeightedColorsAndClamp(double aCoeff1, const RGBAColorData& aValue1, + double aCoeff2, const RGBAColorData& aValue2) +{ + // We are using AddWeighted() with a zero aCoeff2 for colors to + // pretend AddWeighted() against transparent color, i.e. rgba(0, 0, 0, 0). + // But unpremultiplication in AddWeightedColors() does not work well + // for such cases, so we use another function named DiluteColor() which + // has a similar logic to AddWeightedColors(). + return aCoeff2 == 0.0 + ? DiluteColor(aValue1, aCoeff1) + : AddWeightedColors(aCoeff1, aValue1, aCoeff2, aValue2).ToColor(); } void @@ -1298,12 +1259,13 @@ AddWeightedShadowItems(double aCoeff1, const nsCSSValue &aValue1, (i == 2) ? CSS_PROPERTY_VALUE_NONNEGATIVE : 0); } - const nsCSSValue& color1 = array1->Item(4); - const nsCSSValue& color2 = array2->Item(4); + const nsCSSValue& colorValue1 = array1->Item(4); + const nsCSSValue& colorValue2 = array2->Item(4); const nsCSSValue& inset1 = array1->Item(5); const nsCSSValue& inset2 = array2->Item(5); - if ((color1.GetUnit() != color2.GetUnit() && - (!color1.IsNumericColorUnit() || !color2.IsNumericColorUnit())) || + if ((colorValue1.GetUnit() != colorValue2.GetUnit() && + (!colorValue1.IsNumericColorUnit() || + !colorValue2.IsNumericColorUnit())) || inset1.GetUnit() != inset2.GetUnit()) { // We don't know how to animate between color and no-color, or // between inset and not-inset. @@ -1312,13 +1274,15 @@ AddWeightedShadowItems(double aCoeff1, const nsCSSValue &aValue1, return nullptr; } - if (color1.GetUnit() != eCSSUnit_Null) { - if (aCoeff2 == 0.0 && aCoeff1 != 1.0) { - DiluteColor(color1, aCoeff1, resultArray->Item(4)); + if (colorValue1.GetUnit() != eCSSUnit_Null) { + RGBAColorData color1 = ExtractColor(colorValue1); + RGBAColorData color2 = ExtractColor(colorValue2); + if (aColorAdditionType == ColorAdditionType::Clamped) { + resultArray->Item(4).SetColorValue( + AddWeightedColorsAndClamp(aCoeff1, color1, aCoeff2, color2)); } else { - AddWeightedColors(aCoeff1, color1, aCoeff2, color2, - aColorAdditionType, - resultArray->Item(4)); + resultArray->Item(4).SetRGBAColorValue( + AddWeightedColors(aCoeff1, color1, aCoeff2, color2)); } } @@ -2551,23 +2515,11 @@ StyleAnimationValue::AddWeighted(nsCSSPropertyID aProperty, return true; } case eUnit_Color: { - const nsCSSValue* value1 = aValue1.GetCSSValueValue(); - const nsCSSValue* value2 = aValue2.GetCSSValueValue(); - MOZ_ASSERT(value1 && value2, "Both of CSS value should be valid"); + RGBAColorData color1 = ExtractColor(aValue1); + RGBAColorData color2 = ExtractColor(aValue2); auto resultColor = MakeUnique(); - - // We are using AddWeighted() with a zero aCoeff2 for colors to - // pretend AddWeighted() against transparent color, i.e. rgba(0, 0, 0, 0). - // But unpremultiplication in AddWeightedColors() does not work well - // for such cases, so we use another function named DiluteColor() which - // has a similar logic to AddWeightedColors(). - if (aCoeff2 == 0.0) { - DiluteColor(*value1, aCoeff1, *resultColor); - } else { - AddWeightedColors(aCoeff1, *value1, aCoeff2, *value2, - ColorAdditionType::Clamped, - *resultColor); - } + resultColor->SetColorValue( + AddWeightedColorsAndClamp(aCoeff1, color1, aCoeff2, color2)); aResultValue.SetAndAdoptCSSValueValue(resultColor.release(), eUnit_Color); return true; } @@ -2925,14 +2877,11 @@ StyleAnimationValue::Accumulate(nsCSSPropertyID aProperty, return true; } case eUnit_Color: { + RGBAColorData color1 = ExtractColor(aDest); + RGBAColorData color2 = ExtractColor(aValueToAccumulate); auto resultColor = MakeUnique(); - AddWeightedColors(1.0, - *aDest.GetCSSValueValue(), - aCount, - *aValueToAccumulate.GetCSSValueValue(), - ColorAdditionType::Unclamped, - *resultColor); - + resultColor->SetRGBAColorValue( + AddWeightedColors(1.0, color1, aCount, color2)); aDest.SetAndAdoptCSSValueValue(resultColor.release(), eUnit_Color); return true; } diff --git a/layout/style/StyleAnimationValue.h b/layout/style/StyleAnimationValue.h index d227940e0443..b9dcf7da42e3 100644 --- a/layout/style/StyleAnimationValue.h +++ b/layout/style/StyleAnimationValue.h @@ -68,7 +68,8 @@ public: * should be calculated. * @return the result of the calculation. */ - static double ComputeColorDistance(nscolor aStartColor, nscolor aEndColor); + static double ComputeColorDistance(const css::RGBAColorData& aStartColor, + const css::RGBAColorData& aEndColor); /** * Calculates a measure of 'distance' between two values. From 154df81de1efaa0d8aea9b9c18a081f9e3bb88ff Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 16 Sep 2016 15:30:35 +1000 Subject: [PATCH 018/101] Bug 1299741 part 7 - Support storing ComplexColor in nsCSSValue and StyleAnimationValue. r=heycam This is a complete rewrite of the original part 8. Instead of storing the ratio in mValueExtra, all values are stored in a struct in heap, so that we support range outside [0.0, 1.0] in computation. MozReview-Commit-ID: 7xUZSgQE5vA --HG-- extra : rebase_source : 722d2aee06e59cdf061d0daae43d8dbc0a9641b4 --- layout/style/StyleAnimationValue.cpp | 35 ++++++++++++++++ layout/style/StyleAnimationValue.h | 12 ++++++ layout/style/nsCSSValue.cpp | 46 +++++++++++++++++++++ layout/style/nsCSSValue.h | 60 ++++++++++++++++++++++++++++ 4 files changed, 153 insertions(+) diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index 3a0ee1eb65f6..71fe78da4951 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -3211,6 +3211,11 @@ StyleAnimationValue::UncomputeValue(nsCSSPropertyID aProperty, aSpecifiedValue = *val; break; } + case eUnit_ComplexColor: { + aSpecifiedValue.SetComplexColorValue( + do_AddRef(aComputedValue.mValue.mComplexColor)); + break; + } case eUnit_CSSValuePair: { // Rule node processing expects pair values to be collapsed to a // single value if both halves would be equal, for most but not @@ -4517,6 +4522,11 @@ StyleAnimationValue::operator=(const StyleAnimationValue& aOther) mValue.mString = aOther.mValue.mString; mValue.mString->AddRef(); break; + case eUnit_ComplexColor: + MOZ_ASSERT(aOther.mValue.mComplexColor); + mValue.mComplexColor = aOther.mValue.mComplexColor; + mValue.mComplexColor->AddRef(); + break; } return *this; @@ -4594,6 +4604,27 @@ StyleAnimationValue::SetCurrentColorValue() mUnit = eUnit_CurrentColor; } +void +StyleAnimationValue::SetComplexColorValue(const StyleComplexColor& aColor) +{ + if (aColor.IsCurrentColor()) { + SetCurrentColorValue(); + } else if (aColor.IsNumericColor()) { + SetColorValue(aColor.mColor); + } else { + SetComplexColorValue(do_AddRef(new ComplexColorValue(aColor))); + } +} + +void +StyleAnimationValue::SetComplexColorValue( + already_AddRefed aValue) +{ + FreeValue(); + mUnit = eUnit_ComplexColor; + mValue.mComplexColor = aValue.take(); +} + void StyleAnimationValue::SetUnparsedStringValue(const nsString& aString) { @@ -4712,6 +4743,8 @@ StyleAnimationValue::FreeValue() } else if (IsStringUnit(mUnit)) { MOZ_ASSERT(mValue.mString, "expecting non-null string"); mValue.mString->Release(); + } else if (mUnit == eUnit_ComplexColor) { + mValue.mComplexColor->Release(); } } @@ -4768,6 +4801,8 @@ StyleAnimationValue::operator==(const StyleAnimationValue& aOther) const case eUnit_UnparsedString: return (NS_strcmp(GetStringBufferValue(), aOther.GetStringBufferValue()) == 0); + case eUnit_ComplexColor: + return *mValue.mComplexColor == *aOther.mValue.mComplexColor; } NS_NOTREACHED("incomplete case"); diff --git a/layout/style/StyleAnimationValue.h b/layout/style/StyleAnimationValue.h index b9dcf7da42e3..d1d72d7fbfd0 100644 --- a/layout/style/StyleAnimationValue.h +++ b/layout/style/StyleAnimationValue.h @@ -320,6 +320,7 @@ public: eUnit_Color, // nsCSSValue* (never null), always with an nscolor or // an nsCSSValueFloatColor eUnit_CurrentColor, + eUnit_ComplexColor, // ComplexColorValue* (never null) eUnit_Calc, // nsCSSValue* (never null), always with a single // calc() expression that's either length or length+percent eUnit_ObjectPosition, // nsCSSValue* (never null), always with a @@ -354,6 +355,7 @@ private: nsCSSValueSharedList* mCSSValueSharedList; nsCSSValuePairList* mCSSValuePairList; nsStringBuffer* mString; + css::ComplexColorValue* mComplexColor; } mValue; public: @@ -431,6 +433,14 @@ public: /// @return the scale for this value, calculated with reference to @aForFrame. gfxSize GetScaleValue(const nsIFrame* aForFrame) const; + const css::ComplexColorData& GetComplexColorData() const { + MOZ_ASSERT(mUnit == eUnit_ComplexColor, "unit mismatch"); + return *mValue.mComplexColor; + } + StyleComplexColor GetStyleComplexColorValue() const { + return GetComplexColorData().ToComplexColor(); + } + UniquePtr TakeCSSValueListValue() { nsCSSValueList* list = GetCSSValueListValue(); mValue.mCSSValueList = nullptr; @@ -487,6 +497,8 @@ public: void SetFloatValue(float aFloat); void SetColorValue(nscolor aColor); void SetCurrentColorValue(); + void SetComplexColorValue(const StyleComplexColor& aColor); + void SetComplexColorValue(already_AddRefed aValue); void SetUnparsedStringValue(const nsString& aString); void SetCSSValueArrayValue(nsCSSValue::Array* aValue, Unit aUnit); diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index e9db420ebadc..9121dde36270 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -161,6 +161,10 @@ nsCSSValue::nsCSSValue(const nsCSSValue& aCopy) mValue.mFloatColor = aCopy.mValue.mFloatColor; mValue.mFloatColor->AddRef(); } + else if (eCSSUnit_ComplexColor == mUnit) { + mValue.mComplexColor = aCopy.mValue.mComplexColor; + mValue.mComplexColor->AddRef(); + } else if (UnitHasArrayValue()) { mValue.mArray = aCopy.mValue.mArray; mValue.mArray->AddRef(); @@ -271,6 +275,9 @@ bool nsCSSValue::operator==(const nsCSSValue& aOther) const else if (IsFloatColorUnit()) { return *mValue.mFloatColor == *aOther.mValue.mFloatColor; } + else if (eCSSUnit_ComplexColor == mUnit) { + return *mValue.mComplexColor == *aOther.mValue.mComplexColor; + } else if (UnitHasArrayValue()) { return *mValue.mArray == *aOther.mValue.mArray; } @@ -377,6 +384,8 @@ void nsCSSValue::DoReset() mValue.mString->Release(); } else if (IsFloatColorUnit()) { mValue.mFloatColor->Release(); + } else if (eCSSUnit_ComplexColor == mUnit) { + mValue.mComplexColor->Release(); } else if (UnitHasArrayValue()) { mValue.mArray->Release(); } else if (eCSSUnit_URL == mUnit) { @@ -485,6 +494,14 @@ nsCSSValue::SetRGBAColorValue(const RGBAColorData& aValue) aValue.mA, eCSSUnit_PercentageRGBAColor); } +void +nsCSSValue::SetComplexColorValue(already_AddRefed aValue) +{ + Reset(); + mUnit = eCSSUnit_ComplexColor; + mValue.mComplexColor = aValue.take(); +} + void nsCSSValue::SetArrayValue(nsCSSValue::Array* aValue, nsCSSUnit aUnit) { Reset(); @@ -1573,6 +1590,18 @@ nsCSSValue::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult, mValue.mFloatColor->AppendToString(unit, aResult); } } + else if (eCSSUnit_ComplexColor == unit) { + StyleComplexColor color = GetStyleComplexColorValue(); + nsCSSValue serializable; + if (color.IsCurrentColor()) { + serializable.SetIntValue(NS_COLOR_CURRENTCOLOR, eCSSUnit_EnumColor); + } else if (color.IsNumericColor()) { + serializable.SetColorValue(color.mColor); + } else { + MOZ_ASSERT_UNREACHABLE("Cannot serialize a complex color"); + } + serializable.AppendToString(aProperty, aResult, aSerialization); + } else if (eCSSUnit_URL == unit || eCSSUnit_Image == unit) { aResult.AppendLiteral("url("); nsStyleUtil::AppendEscapedCSSString( @@ -1869,6 +1898,7 @@ nsCSSValue::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult, case eCSSUnit_PercentageRGBAColor: break; case eCSSUnit_HSLColor: break; case eCSSUnit_HSLAColor: break; + case eCSSUnit_ComplexColor: break; case eCSSUnit_Percent: aResult.Append(char16_t('%')); break; case eCSSUnit_Number: break; case eCSSUnit_Gradient: break; @@ -2056,6 +2086,11 @@ nsCSSValue::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const n += mValue.mFloatColor->SizeOfIncludingThis(aMallocSizeOf); break; + // Complex Color + case eCSSUnit_ComplexColor: + n += mValue.mComplexColor->SizeOfIncludingThis(aMallocSizeOf); + break; + // Float: nothing extra to measure. case eCSSUnit_Percent: case eCSSUnit_Number: @@ -2784,6 +2819,17 @@ css::ImageValue::~ImageValue() } } +size_t +css::ComplexColorValue::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const +{ + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + } + return n; +} + nsCSSValueGradientStop::nsCSSValueGradientStop() : mLocation(eCSSUnit_None), mColor(eCSSUnit_Null), diff --git a/layout/style/nsCSSValue.h b/layout/style/nsCSSValue.h index 7509f1a13390..06e85e47255f 100644 --- a/layout/style/nsCSSValue.h +++ b/layout/style/nsCSSValue.h @@ -13,6 +13,7 @@ #include "mozilla/Attributes.h" #include "mozilla/MemoryReporting.h" #include "mozilla/SheetType.h" +#include "mozilla/StyleComplexColor.h" #include "mozilla/UniquePtr.h" #include "nsIPrincipal.h" @@ -345,6 +346,56 @@ struct RGBAColorData } }; +struct ComplexColorData +{ + RGBAColorData mColor; + float mForegroundRatio; + + ComplexColorData() = default; + ComplexColorData(const RGBAColorData& aColor, float aForegroundRatio) + : mColor(aColor), mForegroundRatio(aForegroundRatio) {} + ComplexColorData(nscolor aColor, float aForegroundRatio) + : mColor(aColor), mForegroundRatio(aForegroundRatio) {} + explicit ComplexColorData(const StyleComplexColor& aColor) + : mColor(aColor.mColor) + , mForegroundRatio(aColor.mForegroundRatio * (1.0f / 255.0f)) {} + + bool operator==(const ComplexColorData& aOther) const + { + return mForegroundRatio == aOther.mForegroundRatio && + (IsCurrentColor() || mColor == aOther.mColor); + } + bool operator!=(const ComplexColorData& aOther) const + { + return !(*this == aOther); + } + + bool IsCurrentColor() const { return mForegroundRatio >= 1.0f; } + bool IsNumericColor() const { return mForegroundRatio <= 0.0f; } + + StyleComplexColor ToComplexColor() const + { + return StyleComplexColor( + mColor.ToColor(), ClampColor(mForegroundRatio * 255.0f)); + } +}; + +struct ComplexColorValue final : public ComplexColorData +{ + // Just redirect any parameter to the data struct. + template + explicit ComplexColorValue(Args&&... aArgs) + : ComplexColorData(Forward(aArgs)...) {} + ComplexColorValue(const ComplexColorValue&) = delete; + + NS_INLINE_DECL_REFCOUNTING(ComplexColorValue) + + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const; + +private: + ~ComplexColorValue() {} +}; + } // namespace css } // namespace mozilla @@ -439,6 +490,7 @@ enum nsCSSUnit { // allowed. eCSSUnit_HSLColor = 89, // (nsCSSValueFloatColor*) eCSSUnit_HSLAColor = 90, // (nsCSSValueFloatColor*) + eCSSUnit_ComplexColor = 91, // (ComplexColorValue*) eCSSUnit_Percent = 100, // (float) 1.0 == 100%) value is percentage of something eCSSUnit_Number = 101, // (float) value is numeric (usually multiplier, different behavior than percent) @@ -687,6 +739,11 @@ public: nscolor GetColorValue() const; bool IsNonTransparentColor() const; + mozilla::StyleComplexColor GetStyleComplexColorValue() const + { + MOZ_ASSERT(mUnit == eCSSUnit_ComplexColor); + return mValue.mComplexColor->ToComplexColor(); + } Array* GetArrayValue() const { @@ -818,6 +875,8 @@ public: float aComponent3, float aAlpha, nsCSSUnit aUnit); void SetRGBAColorValue(const mozilla::css::RGBAColorData& aValue); + void SetComplexColorValue( + already_AddRefed aValue); void SetArrayValue(nsCSSValue::Array* aArray, nsCSSUnit aUnit); void SetURLValue(mozilla::css::URLValue* aURI); void SetImageValue(mozilla::css::ImageValue* aImage); @@ -925,6 +984,7 @@ protected: nsCSSValuePairList* mPairListDependent; nsCSSValueFloatColor* MOZ_OWNING_REF mFloatColor; mozilla::css::FontFamilyListRefCnt* MOZ_OWNING_REF mFontFamilyList; + mozilla::css::ComplexColorValue* MOZ_OWNING_REF mComplexColor; } mValue; }; From 4034a37e6e04cd42287409609ed192535a6a3b55 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 16 Sep 2016 15:42:30 +1000 Subject: [PATCH 019/101] Bug 1299741 part 8 - Change StyleDataAtOffset to template to simplify code. r=birtles MozReview-Commit-ID: CY8brp8AObH --HG-- extra : rebase_source : 2582ce0e1a665701958f3647d871d8febe7f93fb --- layout/style/StyleAnimationValue.cpp | 49 +++++++++++++--------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index 71fe78da4951..a434766e37f8 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -3331,16 +3331,12 @@ StyleAnimationValue::UncomputeValue(nsCSSPropertyID aProperty, return true; } -inline const void* +template +inline const T& StyleDataAtOffset(const void* aStyleStruct, ptrdiff_t aOffset) { - return reinterpret_cast(aStyleStruct) + aOffset; -} - -inline void* -StyleDataAtOffset(void* aStyleStruct, ptrdiff_t aOffset) -{ - return reinterpret_cast(aStyleStruct) + aOffset; + return *reinterpret_cast( + reinterpret_cast(aStyleStruct) + aOffset); } static void @@ -4214,8 +4210,8 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, }; return true; case eStyleAnimType_Coord: { - const nsStyleCoord& coord = *static_cast( - StyleDataAtOffset(styleStruct, ssOffset)); + const nsStyleCoord& coord = + StyleDataAtOffset(styleStruct, ssOffset); if (nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_NUMBERS_ARE_PIXELS) && coord.GetUnit() == eStyleUnit_Coord) { // For SVG properties where number means the same thing as length, @@ -4238,8 +4234,8 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, NS_SIDE_LEFT == eStyleAnimType_Sides_Left -eStyleAnimType_Sides_Top, "box side constants out of sync with animation side constants"); - const nsStyleCoord &coord = static_cast( - StyleDataAtOffset(styleStruct, ssOffset))-> + const nsStyleCoord &coord = + StyleDataAtOffset(styleStruct, ssOffset). Get(mozilla::css::Side(animType - eStyleAnimType_Sides_Top)); return StyleCoordToValue(coord, aComputedValue); } @@ -4258,13 +4254,13 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, eStyleAnimType_Corner_TopLeft, "box corner constants out of sync with animation corner constants"); - const nsStyleCorners *corners = static_cast( - StyleDataAtOffset(styleStruct, ssOffset)); + const nsStyleCorners& corners = + StyleDataAtOffset(styleStruct, ssOffset); uint8_t fullCorner = animType - eStyleAnimType_Corner_TopLeft; const nsStyleCoord &horiz = - corners->Get(NS_FULL_TO_HALF_CORNER(fullCorner, false)); + corners.Get(NS_FULL_TO_HALF_CORNER(fullCorner, false)); const nsStyleCoord &vert = - corners->Get(NS_FULL_TO_HALF_CORNER(fullCorner, true)); + corners.Get(NS_FULL_TO_HALF_CORNER(fullCorner, true)); nsAutoPtr pair(new nsCSSValuePair); if (!StyleCoordToCSSValue(horiz, pair->mXValue) || !StyleCoordToCSSValue(vert, pair->mYValue)) { @@ -4275,12 +4271,12 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, return true; } case eStyleAnimType_nscoord: - aComputedValue.SetCoordValue(*static_cast( - StyleDataAtOffset(styleStruct, ssOffset))); + aComputedValue.SetCoordValue( + StyleDataAtOffset(styleStruct, ssOffset)); return true; case eStyleAnimType_float: - aComputedValue.SetFloatValue(*static_cast( - StyleDataAtOffset(styleStruct, ssOffset))); + aComputedValue.SetFloatValue( + StyleDataAtOffset(styleStruct, ssOffset)); if (aProperty == eCSSProperty_font_size_adjust && aComputedValue.GetFloatValue() == -1.0f) { // In nsStyleFont, we set mFont.sizeAdjust to -1.0 to represent @@ -4291,12 +4287,12 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, } return true; case eStyleAnimType_Color: - aComputedValue.SetColorValue(*static_cast( - StyleDataAtOffset(styleStruct, ssOffset))); + aComputedValue.SetColorValue( + StyleDataAtOffset(styleStruct, ssOffset)); return true; case eStyleAnimType_PaintServer: { - const nsStyleSVGPaint &paint = *static_cast( - StyleDataAtOffset(styleStruct, ssOffset)); + const nsStyleSVGPaint& paint = + StyleDataAtOffset(styleStruct, ssOffset); if (paint.mType == eStyleSVGPaintType_Color) { aComputedValue.SetColorValue(paint.mPaint.mColor); return true; @@ -4335,9 +4331,8 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, return true; } case eStyleAnimType_Shadow: { - const nsCSSShadowArray *shadowArray = - *static_cast*>( - StyleDataAtOffset(styleStruct, ssOffset)); + const nsCSSShadowArray* shadowArray = + StyleDataAtOffset>(styleStruct, ssOffset); if (!shadowArray) { aComputedValue.SetAndAdoptCSSValueListValue(nullptr, eUnit_Shadow); return true; From a32d5fd147275becaa9794c1727f7eb08f186fc4 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 16 Sep 2016 14:44:09 +1000 Subject: [PATCH 020/101] Bug 1299741 part 9 - Implement interpolation between numeric color and currentcolor. r=birtles MozReview-Commit-ID: DuB6FZYveXE --HG-- extra : rebase_source : ba7be3894c152aeed3de30c8050423303636a42e --- layout/style/StyleAnimationValue.cpp | 89 +++++++++++++++++++++++++++- layout/style/nsCSSProps.h | 3 + 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index a434766e37f8..d815e1f4cc0c 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -70,6 +70,15 @@ GetCommonUnit(nsCSSPropertyID aProperty, // We can use calc() as the common unit. return StyleAnimationValue::eUnit_Calc; } + if ((aFirstUnit == StyleAnimationValue::eUnit_Color || + aFirstUnit == StyleAnimationValue::eUnit_CurrentColor || + aFirstUnit == StyleAnimationValue::eUnit_ComplexColor) && + (aSecondUnit == StyleAnimationValue::eUnit_Color || + aSecondUnit == StyleAnimationValue::eUnit_CurrentColor || + aSecondUnit == StyleAnimationValue::eUnit_ComplexColor)) { + // We can use complex color as the common unit. + return StyleAnimationValue::eUnit_ComplexColor; + } return StyleAnimationValue::eUnit_Null; } return aFirstUnit; @@ -518,6 +527,22 @@ ExtractColor(const StyleAnimationValue& aValue) return ExtractColor(*value); } +static ComplexColorData +ExtractComplexColor(const StyleAnimationValue& aValue) +{ + switch (aValue.GetUnit()) { + case StyleAnimationValue::eUnit_Color: + return ComplexColorData(ExtractColor(aValue), 0.0f); + case StyleAnimationValue::eUnit_CurrentColor: + return ComplexColorData({0, 0, 0, 0}, 1.0f); + case StyleAnimationValue::eUnit_ComplexColor: + return ComplexColorData(aValue.GetComplexColorData()); + default: + MOZ_ASSERT_UNREACHABLE("Unknown unit"); + return ComplexColorData({0, 0, 0, 0}, 0.0f); + } +} + double StyleAnimationValue::ComputeColorDistance(const RGBAColorData& aStartColor, const RGBAColorData& aEndColor) @@ -559,7 +584,6 @@ StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty, case eUnit_Normal: case eUnit_UnparsedString: case eUnit_URL: - case eUnit_CurrentColor: case eUnit_DiscreteCSSValue: return false; @@ -618,6 +642,31 @@ StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty, ExtractColor(aEndValue)); return true; } + case eUnit_CurrentColor: { + aDistance = 0; + return true; + } + case eUnit_ComplexColor: { + ComplexColorData color1 = ExtractComplexColor(aStartValue); + ComplexColorData color2 = ExtractComplexColor(aEndValue); + // Common case is interpolating between a color and a currentcolor + if (color1.IsNumericColor() && color2.IsCurrentColor()) { + double dist = ComputeColorDistance(color1.mColor, NS_RGBA(0, 0, 0, 0)); + aDistance = sqrt(dist * dist + 1); + return true; + } + if (color1.IsCurrentColor() && color2.IsNumericColor()) { + double dist = ComputeColorDistance(NS_RGBA(0, 0, 0, 0), color2.mColor); + aDistance = sqrt(dist * dist + 1); + return true; + } + // If we ever reach here, we may want to use the code in + // bug 1299741 comment 79 to compute it. + MOZ_ASSERT_UNREACHABLE("We shouldn't get here as we only call " + "ComputeDistance on pre-interpolation values"); + aDistance = 0.0; + return true; + } case eUnit_Calc: { PixelCalcValue v1 = ExtractCalcValue(aStartValue); PixelCalcValue v2 = ExtractCalcValue(aEndValue); @@ -2438,7 +2487,6 @@ StyleAnimationValue::AddWeighted(nsCSSPropertyID aProperty, case eUnit_Normal: case eUnit_UnparsedString: case eUnit_URL: - case eUnit_CurrentColor: case eUnit_DiscreteCSSValue: return false; @@ -2523,6 +2571,38 @@ StyleAnimationValue::AddWeighted(nsCSSPropertyID aProperty, aResultValue.SetAndAdoptCSSValueValue(resultColor.release(), eUnit_Color); return true; } + case eUnit_CurrentColor: { + aResultValue.SetCurrentColorValue(); + return true; + } + case eUnit_ComplexColor: { + ComplexColorData color1 = ExtractComplexColor(aValue1); + ComplexColorData color2 = ExtractComplexColor(aValue2); + RefPtr result = new ComplexColorValue; + // Common case is interpolating between a color and a currentcolor. + if (color1.IsNumericColor() && color2.IsCurrentColor()) { + result->mColor = color1.mColor; + result->mForegroundRatio = aCoeff2; + } else if (color1.IsCurrentColor() && color2.IsNumericColor()) { + result->mColor = color2.mColor; + result->mForegroundRatio = aCoeff1; + } else { + float ratio1 = 1.0f - color1.mForegroundRatio; + float ratio2 = 1.0f - color2.mForegroundRatio; + float alpha1 = color1.mColor.mA * ratio1; + float alpha2 = color2.mColor.mA * ratio2; + RGBAColorData resultColor = + AddWeightedColors(aCoeff1, color1.mColor.WithAlpha(alpha1), + aCoeff2, color2.mColor.WithAlpha(alpha2)); + float resultRatio = color1.mForegroundRatio * aCoeff1 + + color2.mForegroundRatio * aCoeff2; + float resultAlpha = resultColor.mA / (1.0f - resultRatio); + result->mColor = resultColor.WithAlpha(resultAlpha); + result->mForegroundRatio = resultRatio; + } + aResultValue.SetComplexColorValue(result.forget()); + return true; + } case eUnit_Calc: { PixelCalcValue v1 = ExtractCalcValue(aValue1); PixelCalcValue v2 = ExtractCalcValue(aValue2); @@ -4290,6 +4370,11 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, aComputedValue.SetColorValue( StyleDataAtOffset(styleStruct, ssOffset)); return true; + case eStyleAnimType_ComplexColor: { + aComputedValue.SetComplexColorValue( + StyleDataAtOffset(styleStruct, ssOffset)); + return true; + } case eStyleAnimType_PaintServer: { const nsStyleSVGPaint& paint = StyleDataAtOffset(styleStruct, ssOffset); diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h index 5f6f31703ff2..15f394162edd 100644 --- a/layout/style/nsCSSProps.h +++ b/layout/style/nsCSSProps.h @@ -315,6 +315,9 @@ enum nsStyleAnimType { // nscolor values eStyleAnimType_Color, + // StyleComplexColor values + eStyleAnimType_ComplexColor, + // nsStyleSVGPaint values eStyleAnimType_PaintServer, From addef001bc29e40a5dd78a43b5902d76a6c7ddf7 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Wed, 31 Aug 2016 17:37:34 +1000 Subject: [PATCH 021/101] Bug 1299741 part 10 - Make nsStyleContext.cpp:ExtractColor return a Maybe so that ExtractColorLenient can reuse that. r=birtles MozReview-Commit-ID: HtqoWoJW8i6 --HG-- extra : rebase_source : 855783009cb8a8c800504299c53055634dbc66bd --- layout/style/nsStyleContext.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index c0cab2e0ef27..094fc8b09310 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -7,6 +7,7 @@ #include "CSSVariableImageTable.h" #include "mozilla/DebugOnly.h" +#include "mozilla/Maybe.h" #include "nsCSSAnonBoxes.h" #include "nsCSSPseudoElements.h" @@ -1477,29 +1478,27 @@ ExtractAnimationValue(nsCSSPropertyID aProperty, "aProperty must be extractable by StyleAnimationValue"); } -static nscolor +static Maybe ExtractColor(nsCSSPropertyID aProperty, nsStyleContext *aStyleContext) { StyleAnimationValue val; ExtractAnimationValue(aProperty, aStyleContext, val); - return val.GetUnit() == StyleAnimationValue::eUnit_CurrentColor - ? aStyleContext->StyleColor()->mColor - : val.GetCSSValueValue()->GetColorValue(); + switch (val.GetUnit()) { + case StyleAnimationValue::eUnit_Color: + return Some(val.GetCSSValueValue()->GetColorValue()); + case StyleAnimationValue::eUnit_CurrentColor: + return Some(aStyleContext->StyleColor()->mColor); + default: + return Nothing(); + } } static nscolor ExtractColorLenient(nsCSSPropertyID aProperty, nsStyleContext *aStyleContext) { - StyleAnimationValue val; - ExtractAnimationValue(aProperty, aStyleContext, val); - if (val.GetUnit() == StyleAnimationValue::eUnit_Color) { - return val.GetCSSValueValue()->GetColorValue(); - } else if (val.GetUnit() == StyleAnimationValue::eUnit_CurrentColor) { - return aStyleContext->StyleColor()->mColor; - } - return NS_RGBA(0, 0, 0, 0); + return ExtractColor(aProperty, aStyleContext).valueOr(NS_RGBA(0, 0, 0, 0)); } struct ColorIndexSet { @@ -1532,7 +1531,7 @@ nsStyleContext::GetVisitedDependentColor(nsCSSPropertyID aProperty) nscolor colors[2]; colors[0] = isPaintProperty ? ExtractColorLenient(aProperty, this) - : ExtractColor(aProperty, this); + : ExtractColor(aProperty, this).value(); nsStyleContext *visitedStyle = this->GetStyleIfVisited(); if (!visitedStyle) { @@ -1540,7 +1539,7 @@ nsStyleContext::GetVisitedDependentColor(nsCSSPropertyID aProperty) } colors[1] = isPaintProperty ? ExtractColorLenient(aProperty, visitedStyle) - : ExtractColor(aProperty, visitedStyle); + : ExtractColor(aProperty, visitedStyle).value(); return nsStyleContext::CombineVisitedColors(colors, this->RelevantLinkVisited()); From 6b6e2ad7b2638fae20f4900a90af40eadf4c5754 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 16 Sep 2016 14:40:45 +1000 Subject: [PATCH 022/101] Bug 1299741 part 11 - Change text-{emphasis,fill,stroke}-color to using StyleComplexColor. r=dbaron MozReview-Commit-ID: 1MlgGAkdPn8 --HG-- extra : rebase_source : 293aa61adaa091bb3d4350a4b86ec9cfbb40eb02 --- layout/generic/TextOverflow.cpp | 4 +- layout/generic/nsTextFrame.cpp | 21 +++-- layout/mathml/nsMathMLChar.cpp | 4 +- layout/mathml/nsMathMLFrame.cpp | 3 +- layout/mathml/nsMathMLmencloseFrame.cpp | 3 +- layout/mathml/nsMathMLmfracFrame.cpp | 9 +- layout/style/StyleAnimationValue.cpp | 35 ------- layout/style/nsCSSPropList.h | 8 +- layout/style/nsComputedDOMStyle.cpp | 16 ++-- layout/style/nsComputedDOMStyle.h | 3 + layout/style/nsRuleNode.cpp | 117 ++++++++++++------------ layout/style/nsStyleContext.cpp | 11 +-- layout/style/nsStyleContext.h | 26 ------ layout/style/nsStyleStruct.cpp | 22 +---- layout/style/nsStyleStruct.h | 9 +- 15 files changed, 108 insertions(+), 183 deletions(-) diff --git a/layout/generic/TextOverflow.cpp b/layout/generic/TextOverflow.cpp index 5b52e0f75ea5..e8f6c5b43e5d 100644 --- a/layout/generic/TextOverflow.cpp +++ b/layout/generic/TextOverflow.cpp @@ -214,8 +214,8 @@ void nsDisplayTextOverflowMarker::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { - nsCSSPropertyID colorProp = mFrame->StyleContext()->GetTextFillColorProp(); - nscolor foregroundColor = nsLayoutUtils::GetColor(mFrame, colorProp); + nscolor foregroundColor = nsLayoutUtils:: + GetColor(mFrame, eCSSProperty__webkit_text_fill_color); // Paint the text-shadows for the overflow marker nsLayoutUtils::PaintTextShadow(mFrame, aCtx, mRect, mVisibleRect, diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 78e2c33e9401..5aa46eb030d5 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -332,7 +332,8 @@ public: if (mFrame->IsSVGText()) { return 0; } - return mFrame->StyleContext()->GetTextStrokeColor(); + return mFrame->StyleColor()-> + CalcComplexColor(mFrame->StyleText()->mWebkitTextStrokeColor); } float GetWebkitTextStrokeWidth() { if (mFrame->IsSVGText()) { @@ -3707,8 +3708,7 @@ nsTextPaintStyle::GetTextColor() } } - return nsLayoutUtils::GetColor(mFrame, - mFrame->StyleContext()->GetTextFillColorProp()); + return nsLayoutUtils::GetColor(mFrame, eCSSProperty__webkit_text_fill_color); } bool @@ -3901,7 +3901,8 @@ nsTextPaintStyle::InitSelectionColorsAndShadow() if (sc) { mSelectionBGColor = sc->GetVisitedDependentColor(eCSSProperty_background_color); - mSelectionTextColor = sc->GetVisitedDependentColor(sc->GetTextFillColorProp()); + mSelectionTextColor = + sc->GetVisitedDependentColor(eCSSProperty__webkit_text_fill_color); mHasSelectionShadow = nsRuleNode::HasAuthorSpecifiedRules(sc, NS_AUTHOR_SPECIFIED_TEXT_SHADOW, @@ -3939,13 +3940,13 @@ nsTextPaintStyle::InitSelectionColorsAndShadow() if (mSelectionTextColor == NS_DONT_CHANGE_COLOR) { nsCSSPropertyID property = mFrame->IsSVGText() ? eCSSProperty_fill - : mFrame->StyleContext()->GetTextFillColorProp(); + : eCSSProperty__webkit_text_fill_color; nscoord frameColor = mFrame->GetVisitedDependentColor(property); mSelectionTextColor = EnsureDifferentColors(frameColor, mSelectionBGColor); } else if (mSelectionTextColor == NS_CHANGE_COLOR_IF_SAME_AS_BG) { nsCSSPropertyID property = mFrame->IsSVGText() ? eCSSProperty_fill - : mFrame->StyleContext()->GetTextFillColorProp(); + : eCSSProperty__webkit_text_fill_color; nscolor frameColor = mFrame->GetVisitedDependentColor(property); if (frameColor == mSelectionBGColor) { mSelectionTextColor = @@ -4952,9 +4953,11 @@ nsTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, DO_GLOBAL_REFLOW_COUNT_DSP("nsTextFrame"); - nsStyleContext* sc = StyleContext(); - bool isTextTransparent = (NS_GET_A(sc->GetTextFillColor()) == 0) && - (NS_GET_A(sc->GetTextStrokeColor()) == 0); + const nsStyleColor* sc = StyleColor(); + const nsStyleText* st = StyleText(); + bool isTextTransparent = + NS_GET_A(sc->CalcComplexColor(st->mWebkitTextFillColor)) == 0 && + NS_GET_A(sc->CalcComplexColor(st->mWebkitTextStrokeColor)) == 0; Maybe isSelected; if (((GetStateBits() & TEXT_NO_RENDERED_GLYPHS) || (isTextTransparent && !StyleText()->HasTextShadow())) && diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index cf6a488cfd13..2edc1fa0d978 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -2124,8 +2124,8 @@ nsMathMLChar::PaintForeground(nsPresContext* aPresContext, RefPtr thebesContext = aRenderingContext.ThebesContext(); // Set color ... - nsCSSPropertyID colorProp = styleContext->GetTextFillColorProp(); - nscolor fgColor = styleContext->GetVisitedDependentColor(colorProp); + nscolor fgColor = styleContext-> + GetVisitedDependentColor(eCSSProperty__webkit_text_fill_color); if (aIsSelected) { // get color to use for selection from the look&feel object fgColor = LookAndFeel::GetColor(LookAndFeel::eColorID_TextSelectForeground, diff --git a/layout/mathml/nsMathMLFrame.cpp b/layout/mathml/nsMathMLFrame.cpp index 24cc19c72e9b..82c3a4a38ef5 100644 --- a/layout/mathml/nsMathMLFrame.cpp +++ b/layout/mathml/nsMathMLFrame.cpp @@ -365,9 +365,8 @@ void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder, NSRectToNonEmptySnappedRect(mRect + ToReferenceFrame(), mFrame->PresContext()->AppUnitsPerDevPixel(), *drawTarget); - nsCSSPropertyID colorProp = mFrame->StyleContext()->GetTextFillColorProp(); ColorPattern color(ToDeviceColor( - mFrame->GetVisitedDependentColor(colorProp))); + mFrame->GetVisitedDependentColor(eCSSProperty__webkit_text_fill_color))); drawTarget->FillRect(rect, color); } diff --git a/layout/mathml/nsMathMLmencloseFrame.cpp b/layout/mathml/nsMathMLmencloseFrame.cpp index 1b463299171a..64277a92e97a 100644 --- a/layout/mathml/nsMathMLmencloseFrame.cpp +++ b/layout/mathml/nsMathMLmencloseFrame.cpp @@ -779,9 +779,8 @@ void nsDisplayNotation::Paint(nsDisplayListBuilder* aBuilder, presContext->AppUnitsPerDevPixel()); rect.Deflate(strokeWidth / 2.f); - nsCSSPropertyID colorProp = mFrame->StyleContext()->GetTextFillColorProp(); ColorPattern color(ToDeviceColor( - mFrame->GetVisitedDependentColor(colorProp))); + mFrame->GetVisitedDependentColor(eCSSProperty__webkit_text_fill_color))); StrokeOptions strokeOptions(strokeWidth); diff --git a/layout/mathml/nsMathMLmfracFrame.cpp b/layout/mathml/nsMathMLmfracFrame.cpp index 1e19aec87f9a..d4ed988c89aa 100644 --- a/layout/mathml/nsMathMLmfracFrame.cpp +++ b/layout/mathml/nsMathMLmfracFrame.cpp @@ -628,12 +628,11 @@ void nsDisplayMathMLSlash::Paint(nsDisplayListBuilder* aBuilder, nsPresContext* presContext = mFrame->PresContext(); Rect rect = NSRectToRect(mRect + ToReferenceFrame(), presContext->AppUnitsPerDevPixel()); - - nsCSSPropertyID colorProp = mFrame->StyleContext()->GetTextFillColorProp(); + ColorPattern color(ToDeviceColor( - mFrame->GetVisitedDependentColor(colorProp))); - - // draw the slash as a parallelogram + mFrame->GetVisitedDependentColor(eCSSProperty__webkit_text_fill_color))); + + // draw the slash as a parallelogram Point delta = Point(presContext->AppUnitsToGfxUnits(mThickness), 0); RefPtr builder = aDrawTarget.CreatePathBuilder(); if (mRTL) { diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index d815e1f4cc0c..ee7ef1934aff 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -3419,17 +3419,6 @@ StyleDataAtOffset(const void* aStyleStruct, ptrdiff_t aOffset) reinterpret_cast(aStyleStruct) + aOffset); } -static void -SetCurrentOrActualColor(bool aIsForeground, nscolor aActualColor, - StyleAnimationValue& aComputedValue) -{ - if (aIsForeground) { - aComputedValue.SetCurrentColorValue(); - } else { - aComputedValue.SetColorValue(aActualColor); - } -} - static void ExtractBorderColor(nsStyleContext* aStyleContext, const void* aStyleBorder, mozilla::css::Side aSide, @@ -3927,30 +3916,6 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty, break; } - case eCSSProperty_text_emphasis_color: { - auto styleText = static_cast(styleStruct); - SetCurrentOrActualColor(styleText->mTextEmphasisColorForeground, - styleText->mTextEmphasisColor, - aComputedValue); - break; - } - - case eCSSProperty__webkit_text_fill_color: { - auto styleText = static_cast(styleStruct); - SetCurrentOrActualColor(styleText->mWebkitTextFillColorForeground, - styleText->mWebkitTextFillColor, - aComputedValue); - break; - } - - case eCSSProperty__webkit_text_stroke_color: { - auto styleText = static_cast(styleStruct); - SetCurrentOrActualColor(styleText->mWebkitTextStrokeColorForeground, - styleText->mWebkitTextStrokeColor, - aComputedValue); - break; - } - case eCSSProperty_border_spacing: { const nsStyleTableBorder *styleTableBorder = static_cast(styleStruct); diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index 6320917528c0..042c256b1e72 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -3981,8 +3981,8 @@ CSS_PROP_TEXT( "", VARIANT_HC, nullptr, - CSS_PROP_NO_OFFSET, - eStyleAnimType_Custom) + offsetof(nsStyleText, mTextEmphasisColor), + eStyleAnimType_ComplexColor) CSS_PROP_TEXT( text-emphasis-position, text_emphasis_position, @@ -4017,7 +4017,7 @@ CSS_PROP_TEXT( VARIANT_HC, nullptr, offsetof(nsStyleText, mWebkitTextFillColor), - eStyleAnimType_Custom) + eStyleAnimType_ComplexColor) CSS_PROP_TEXT( text-indent, text_indent, @@ -4106,7 +4106,7 @@ CSS_PROP_TEXT( VARIANT_HC, nullptr, offsetof(nsStyleText, mWebkitTextStrokeColor), - eStyleAnimType_Custom) + eStyleAnimType_ComplexColor) CSS_PROP_TEXT( -webkit-text-stroke-width, _webkit_text_stroke_width, diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 09b006744480..669ce277e598 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -957,6 +957,13 @@ nsComputedDOMStyle::SetToRGBAColor(nsROCSSPrimitiveValue* aValue, aValue->SetColor(rgbColor); } +void +nsComputedDOMStyle::SetValueFromComplexColor(nsROCSSPrimitiveValue* aValue, + const StyleComplexColor& aColor) +{ + SetToRGBAColor(aValue, StyleColor()->CalcComplexColor(aColor)); +} + already_AddRefed nsComputedDOMStyle::DoGetColor() { @@ -3828,10 +3835,7 @@ already_AddRefed nsComputedDOMStyle::DoGetTextEmphasisColor() { RefPtr val = new nsROCSSPrimitiveValue; - const nsStyleText* text = StyleText(); - nscolor color = text->mTextEmphasisColorForeground ? - StyleColor()->mColor : text->mTextEmphasisColor; - SetToRGBAColor(val, color); + SetValueFromComplexColor(val, StyleText()->mTextEmphasisColor); return val.forget(); } @@ -4076,7 +4080,7 @@ already_AddRefed nsComputedDOMStyle::DoGetWebkitTextFillColor() { RefPtr val = new nsROCSSPrimitiveValue; - SetToRGBAColor(val, mStyleContext->GetTextFillColor()); + SetValueFromComplexColor(val, StyleText()->mWebkitTextFillColor); return val.forget(); } @@ -4084,7 +4088,7 @@ already_AddRefed nsComputedDOMStyle::DoGetWebkitTextStrokeColor() { RefPtr val = new nsROCSSPrimitiveValue; - SetToRGBAColor(val, mStyleContext->GetTextStrokeColor()); + SetValueFromComplexColor(val, StyleText()->mWebkitTextStrokeColor); return val.forget(); } diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index 60c7fef53f04..cd404594498d 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -11,6 +11,7 @@ #include "mozilla/ArenaRefPtr.h" #include "mozilla/ArenaRefPtrInlines.h" #include "mozilla/Attributes.h" +#include "mozilla/StyleComplexColor.h" #include "nsCOMPtr.h" #include "nscore.h" #include "nsCSSProps.h" @@ -583,6 +584,8 @@ private: /* Helper functions */ void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor); + void SetValueFromComplexColor(nsROCSSPrimitiveValue* aValue, + const mozilla::StyleComplexColor& aColor); void SetValueToStyleImage(const nsStyleImage& aStyleImage, nsROCSSPrimitiveValue* aValue); void SetValueToPositionCoord(const mozilla::Position::Coord& aCoord, diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 4160a00b4d1c..76748174bc6e 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -75,6 +75,16 @@ using std::min; using namespace mozilla; using namespace mozilla::dom; +namespace mozilla { + +enum UnsetAction +{ + eUnsetInitial, + eUnsetInherit +}; + +} // namespace mozilla + void* nsConditionalResetStyleData::GetConditionalStyleData(nsStyleStructID aSID, nsStyleContext* aStyleContext) const @@ -1091,6 +1101,41 @@ static bool SetColor(const nsCSSValue& aValue, const nscolor aParentColor, return result; } +template +static void +SetComplexColor(const nsCSSValue& aValue, + const StyleComplexColor& aParentColor, + const StyleComplexColor& aInitialColor, + nsPresContext* aPresContext, + StyleComplexColor& aResult, + RuleNodeCacheConditions& aConditions) +{ + nsCSSUnit unit = aValue.GetUnit(); + if (unit == eCSSUnit_Null) { + return; + } + if (unit == eCSSUnit_Initial || + (UnsetTo == eUnsetInitial && unit == eCSSUnit_Unset)) { + aResult = aInitialColor; + } else if (unit == eCSSUnit_Inherit || + (UnsetTo == eUnsetInherit && unit == eCSSUnit_Unset)) { + aConditions.SetUncacheable(); + aResult = aParentColor; + } else if (unit == eCSSUnit_EnumColor && + aValue.GetIntValue() == NS_COLOR_CURRENTCOLOR) { + aResult = StyleComplexColor::CurrentColor(); + } else if (unit == eCSSUnit_ComplexColor) { + aResult = aValue.GetStyleComplexColorValue(); + } else { + if (!SetColor(aValue, aParentColor.mColor, aPresContext, + nullptr, aResult.mColor, aConditions)) { + MOZ_ASSERT_UNREACHABLE("Unknown color value"); + return; + } + aResult.mForegroundRatio = 0; + } +} + static void SetGradientCoord(const nsCSSValue& aValue, nsPresContext* aPresContext, nsStyleContext* aContext, nsStyleCoord& aResult, RuleNodeCacheConditions& aConditions) @@ -4473,6 +4518,13 @@ nsRuleNode::ComputeTextData(void* aStartStruct, { COMPUTE_START_INHERITED(Text, text, parentText) + auto setComplexColor = [&](const nsCSSValue* aValue, + StyleComplexColor nsStyleText::* aField) { + SetComplexColor(*aValue, parentText->*aField, + StyleComplexColor::CurrentColor(), + mPresContext, text->*aField, conditions); + }; + // tab-size: integer, inherit SetValue(*aRuleData->ValueForTabSize(), text->mTabSize, conditions, @@ -4716,26 +4768,8 @@ nsRuleNode::ComputeTextData(void* aStartStruct, NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE); // text-emphasis-color: color, string, inherit, initial - const nsCSSValue* - textEmphasisColorValue = aRuleData->ValueForTextEmphasisColor(); - if (textEmphasisColorValue->GetUnit() == eCSSUnit_Null) { - // We don't want to change anything in this case. - } else if (textEmphasisColorValue->GetUnit() == eCSSUnit_Inherit || - textEmphasisColorValue->GetUnit() == eCSSUnit_Unset) { - conditions.SetUncacheable(); - text->mTextEmphasisColorForeground = - parentText->mTextEmphasisColorForeground; - text->mTextEmphasisColor = parentText->mTextEmphasisColor; - } else if ((textEmphasisColorValue->GetUnit() == eCSSUnit_EnumColor && - textEmphasisColorValue->GetIntValue() == NS_COLOR_CURRENTCOLOR) || - textEmphasisColorValue->GetUnit() == eCSSUnit_Initial) { - text->mTextEmphasisColorForeground = true; - text->mTextEmphasisColor = mPresContext->DefaultColor(); - } else { - text->mTextEmphasisColorForeground = false; - SetColor(*textEmphasisColorValue, 0, mPresContext, aContext, - text->mTextEmphasisColor, conditions); - } + setComplexColor(aRuleData->ValueForTextEmphasisColor(), + &nsStyleText::mTextEmphasisColor); // text-emphasis-position: enum, inherit, initial SetValue(*aRuleData->ValueForTextEmphasisPosition(), @@ -4809,47 +4843,12 @@ nsRuleNode::ComputeTextData(void* aStartStruct, NS_STYLE_TEXT_RENDERING_AUTO); // -webkit-text-fill-color: color, string, inherit, initial - const nsCSSValue* - webkitTextFillColorValue = aRuleData->ValueForWebkitTextFillColor(); - if (webkitTextFillColorValue->GetUnit() == eCSSUnit_Null) { - // We don't want to change anything in this case. - } else if (webkitTextFillColorValue->GetUnit() == eCSSUnit_Inherit || - webkitTextFillColorValue->GetUnit() == eCSSUnit_Unset) { - conditions.SetUncacheable(); - text->mWebkitTextFillColorForeground = parentText->mWebkitTextFillColorForeground; - text->mWebkitTextFillColor = parentText->mWebkitTextFillColor; - } else if ((webkitTextFillColorValue->GetUnit() == eCSSUnit_EnumColor && - webkitTextFillColorValue->GetIntValue() == NS_COLOR_CURRENTCOLOR) || - webkitTextFillColorValue->GetUnit() == eCSSUnit_Initial) { - text->mWebkitTextFillColorForeground = true; - text->mWebkitTextFillColor = mPresContext->DefaultColor(); - } else { - text->mWebkitTextFillColorForeground = false; - SetColor(*webkitTextFillColorValue, 0, mPresContext, aContext, - text->mWebkitTextFillColor, conditions); - } + setComplexColor(aRuleData->ValueForWebkitTextFillColor(), + &nsStyleText::mWebkitTextFillColor); // -webkit-text-stroke-color: color, string, inherit, initial - const nsCSSValue* webkitTextStrokeColorValue = - aRuleData->ValueForWebkitTextStrokeColor(); - if (webkitTextStrokeColorValue->GetUnit() == eCSSUnit_Null) { - // We don't want to change anything in this case. - } else if (webkitTextStrokeColorValue->GetUnit() == eCSSUnit_Inherit || - webkitTextStrokeColorValue->GetUnit() == eCSSUnit_Unset) { - conditions.SetUncacheable(); - text->mWebkitTextStrokeColorForeground = - parentText->mWebkitTextStrokeColorForeground; - text->mWebkitTextStrokeColor = parentText->mWebkitTextStrokeColor; - } else if ((webkitTextStrokeColorValue->GetUnit() == eCSSUnit_EnumColor && - webkitTextStrokeColorValue->GetIntValue() == NS_COLOR_CURRENTCOLOR) || - webkitTextStrokeColorValue->GetUnit() == eCSSUnit_Initial) { - text->mWebkitTextStrokeColorForeground = true; - text->mWebkitTextStrokeColor = mPresContext->DefaultColor(); - } else { - text->mWebkitTextStrokeColorForeground = false; - SetColor(*webkitTextStrokeColorValue, 0, mPresContext, aContext, - text->mWebkitTextStrokeColor, conditions); - } + setComplexColor(aRuleData->ValueForWebkitTextStrokeColor(), + &nsStyleText::mWebkitTextStrokeColor); // -webkit-text-stroke-width: length, inherit, initial, enum const nsCSSValue* diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 094fc8b09310..7f160d4314c5 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -1218,14 +1218,8 @@ nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext, if (!change && PeekStyleText()) { const nsStyleText* thisVisText = thisVis->StyleText(); const nsStyleText* otherVisText = otherVis->StyleText(); - if (thisVisText->mTextEmphasisColorForeground != - otherVisText->mTextEmphasisColorForeground || - thisVisText->mTextEmphasisColor != otherVisText->mTextEmphasisColor || - thisVisText->mWebkitTextFillColorForeground != - otherVisText->mWebkitTextFillColorForeground || + if (thisVisText->mTextEmphasisColor != otherVisText->mTextEmphasisColor || thisVisText->mWebkitTextFillColor != otherVisText->mWebkitTextFillColor || - thisVisText->mWebkitTextStrokeColorForeground != - otherVisText->mWebkitTextStrokeColorForeground || thisVisText->mWebkitTextStrokeColor != otherVisText->mWebkitTextStrokeColor) { change = true; } @@ -1489,6 +1483,9 @@ ExtractColor(nsCSSPropertyID aProperty, return Some(val.GetCSSValueValue()->GetColorValue()); case StyleAnimationValue::eUnit_CurrentColor: return Some(aStyleContext->StyleColor()->mColor); + case StyleAnimationValue::eUnit_ComplexColor: + return Some(aStyleContext->StyleColor()-> + CalcComplexColor(val.GetStyleComplexColorValue())); default: return Nothing(); } diff --git a/layout/style/nsStyleContext.h b/layout/style/nsStyleContext.h index 9e5bf5895e8b..2c9fbfbdd7ab 100644 --- a/layout/style/nsStyleContext.h +++ b/layout/style/nsStyleContext.h @@ -178,32 +178,6 @@ public: mozilla::NonOwningStyleContextSource aSource, mozilla::NonOwningStyleContextSource aSourceIfVisited, bool aRelevantLinkVisited); - /** - * Get the color property that should be used to fill text. - */ - nsCSSPropertyID GetTextFillColorProp() { - return StyleText()->mWebkitTextFillColorForeground - ? eCSSProperty_color : eCSSProperty__webkit_text_fill_color; - } - - /** - * Get the color that should be used to fill text: either - * the current foreground color, or a separately-specified text fill color. - */ - nscolor GetTextFillColor() { - return (GetTextFillColorProp() == eCSSProperty_color) - ? StyleColor()->mColor : StyleText()->mWebkitTextFillColor; - } - - /** - * Get the color that should be used to stroke text: either - * the current foreground color, or a separately-specified text stroke color. - */ - nscolor GetTextStrokeColor() { - const nsStyleText* textStyle = StyleText(); - return textStyle->mWebkitTextStrokeColorForeground - ? StyleColor()->mColor : textStyle->mWebkitTextStrokeColor; - } // Does this style context or any of its ancestors have text // decoration lines? diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 32ef718112ab..904ff53480bf 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -3679,9 +3679,6 @@ nsStyleText::nsStyleText(StyleStructContext aContext) , mTextAlignLast(NS_STYLE_TEXT_ALIGN_AUTO) , mTextAlignTrue(false) , mTextAlignLastTrue(false) - , mTextEmphasisColorForeground(true) - , mWebkitTextFillColorForeground(true) - , mWebkitTextStrokeColorForeground(true) , mTextTransform(NS_STYLE_TEXT_TRANSFORM_NONE) , mWhiteSpace(NS_STYLE_WHITESPACE_NORMAL) , mWordBreak(NS_STYLE_WORDBREAK_NORMAL) @@ -3695,9 +3692,9 @@ nsStyleText::nsStyleText(StyleStructContext aContext) , mTextEmphasisStyle(NS_STYLE_TEXT_EMPHASIS_STYLE_NONE) , mTextRendering(NS_STYLE_TEXT_RENDERING_AUTO) , mTabSize(NS_STYLE_TABSIZE_INITIAL) - , mTextEmphasisColor(aContext.DefaultColor()) - , mWebkitTextFillColor(aContext.DefaultColor()) - , mWebkitTextStrokeColor(aContext.DefaultColor()) + , mTextEmphasisColor(StyleComplexColor::CurrentColor()) + , mWebkitTextFillColor(StyleComplexColor::CurrentColor()) + , mWebkitTextStrokeColor(StyleComplexColor::CurrentColor()) , mWordSpacing(0, nsStyleCoord::CoordConstructor) , mLetterSpacing(eStyleUnit_Normal) , mLineHeight(eStyleUnit_Normal) @@ -3718,9 +3715,6 @@ nsStyleText::nsStyleText(const nsStyleText& aSource) , mTextAlignLast(aSource.mTextAlignLast) , mTextAlignTrue(false) , mTextAlignLastTrue(false) - , mTextEmphasisColorForeground(aSource.mTextEmphasisColorForeground) - , mWebkitTextFillColorForeground(aSource.mWebkitTextFillColorForeground) - , mWebkitTextStrokeColorForeground(aSource.mWebkitTextStrokeColorForeground) , mTextTransform(aSource.mTextTransform) , mWhiteSpace(aSource.mWhiteSpace) , mWordBreak(aSource.mWordBreak) @@ -3818,16 +3812,8 @@ nsStyleText::CalcDifference(const nsStyleText& aNewData) const return hint; } - MOZ_ASSERT(!mTextEmphasisColorForeground || - !aNewData.mTextEmphasisColorForeground || - mTextEmphasisColor == aNewData.mTextEmphasisColor, - "If the text-emphasis-color are both foreground color, " - "mTextEmphasisColor should also be identical"); - if (mTextEmphasisColorForeground != aNewData.mTextEmphasisColorForeground || - mTextEmphasisColor != aNewData.mTextEmphasisColor || - mWebkitTextFillColorForeground != aNewData.mWebkitTextFillColorForeground || + if (mTextEmphasisColor != aNewData.mTextEmphasisColor || mWebkitTextFillColor != aNewData.mWebkitTextFillColor || - mWebkitTextStrokeColorForeground != aNewData.mWebkitTextStrokeColorForeground || mWebkitTextStrokeColor != aNewData.mWebkitTextStrokeColor) { hint |= nsChangeHint_SchedulePaint | nsChangeHint_RepaintFrame; diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 8dff4db36f6b..0ad6fd9a68e7 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -2090,9 +2090,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText uint8_t mTextAlignLast; // [inherited] see nsStyleConsts.h bool mTextAlignTrue : 1; // [inherited] see nsStyleConsts.h bool mTextAlignLastTrue : 1; // [inherited] see nsStyleConsts.h - bool mTextEmphasisColorForeground : 1;// [inherited] whether text-emphasis-color is currentColor - bool mWebkitTextFillColorForeground : 1; // [inherited] whether -webkit-text-fill-color is currentColor - bool mWebkitTextStrokeColorForeground : 1; // [inherited] whether -webkit-text-stroke-color is currentColor uint8_t mTextTransform; // [inherited] see nsStyleConsts.h uint8_t mWhiteSpace; // [inherited] see nsStyleConsts.h uint8_t mWordBreak; // [inherited] see nsStyleConsts.h @@ -2107,9 +2104,9 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText uint8_t mTextEmphasisStyle; // [inherited] see nsStyleConsts.h uint8_t mTextRendering; // [inherited] see nsStyleConsts.h int32_t mTabSize; // [inherited] see nsStyleConsts.h - nscolor mTextEmphasisColor; // [inherited] - nscolor mWebkitTextFillColor; // [inherited] - nscolor mWebkitTextStrokeColor; // [inherited] + mozilla::StyleComplexColor mTextEmphasisColor; // [inherited] + mozilla::StyleComplexColor mWebkitTextFillColor; // [inherited] + mozilla::StyleComplexColor mWebkitTextStrokeColor; // [inherited] nsStyleCoord mWordSpacing; // [inherited] coord, percent, calc nsStyleCoord mLetterSpacing; // [inherited] coord, normal From 054f4f7ea9caf86a2bd98a528cca6b7474ca4b49 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 2 Sep 2016 17:13:28 +1000 Subject: [PATCH 023/101] Bug 1299741 part 12 - Add test for new currentcolor interpolation. r=birtles MozReview-Commit-ID: 4696qH6yoUc --HG-- extra : rebase_source : 01224dc8a6d9ec613197bce78f6c0a43603242dc --- .../test/test_transitions_per_property.html | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/layout/style/test/test_transitions_per_property.html b/layout/style/test/test_transitions_per_property.html index a506fd8db388..6061e989736b 100644 --- a/layout/style/test/test_transitions_per_property.html +++ b/layout/style/test/test_transitions_per_property.html @@ -265,7 +265,8 @@ var supported_properties = { "text-decoration-color": [ test_color_transition, test_currentcolor_transition, test_border_color_transition ], - "text-emphasis-color": [ test_color_transition ], + "text-emphasis-color": [ test_color_transition, + test_true_currentcolor_transition ], "text-indent": [ test_length_transition, test_percent_transition, test_length_percent_calc_transition, test_length_unclamped, test_percent_unclamped ], @@ -286,8 +287,10 @@ var supported_properties = { test_length_clamped, test_percent_clamped ], "word-spacing": [ test_length_transition, test_length_unclamped ], "z-index": [ test_integer_transition, test_pos_integer_or_auto_transition ], - "-webkit-text-fill-color": [ test_color_transition ], - "-webkit-text-stroke-color": [ test_color_transition ] + "-webkit-text-fill-color": [ test_color_transition, + test_true_currentcolor_transition ], + "-webkit-text-stroke-color": [ test_color_transition, + test_true_currentcolor_transition ] }; if (SupportsMaskShorthand()) { @@ -1329,6 +1332,47 @@ function test_currentcolor_transition(prop, get_color=(x => x), is_shorthand=fal (prop == "color" ? div.parentNode : div).style.removeProperty("color"); } +function test_true_currentcolor_transition(prop, get_color=(x => x), is_shorthand=false) { + const msg_prefix = `color-valued property ${prop}: `; + div.style.setProperty("transition-property", "none", ""); + div.style.setProperty("color", "rgb(128, 0, 0)", ""); + div.style.setProperty(prop, "rgb(0, 0, 128)", ""); + is(get_color(cs.getPropertyValue(prop)), "rgb(0, 0, 128)", + msg_prefix + "computed value before transition"); + div.style.setProperty("transition-property", prop, ""); + div.style.setProperty(prop, "currentcolor", ""); + is(get_color(cs.getPropertyValue(prop)), "rgb(32, 0, 96)", + msg_prefix + "interpolation of rgb color and currentcolor"); + + div.style.setProperty("transition-property", "none", ""); + div.style.setProperty("color", "rgb(128, 0, 0)", ""); + div.style.setProperty(prop, "rgb(0, 0, 128)", ""); + is(get_color(cs.getPropertyValue(prop)), "rgb(0, 0, 128)", + msg_prefix + "computed value before transition"); + div.style.setProperty("transition-property", `color, ${prop}`, ""); + div.style.setProperty("color", "rgb(0, 128, 0)", ""); + div.style.setProperty(prop, "currentcolor", ""); + is(cs.getPropertyValue("color"), "rgb(96, 32, 0)", + "interpolation of rgb color property"); + is(get_color(cs.getPropertyValue(prop)), "rgb(24, 8, 96)", + msg_prefix + "interpolation of rgb color and interpolated currentcolor"); + + div.style.setProperty("transition-property", "none", ""); + div.style.setProperty("color", "rgba(128, 0, 0, 0.1)", ""); + div.style.setProperty(prop, "rgba(0, 0, 128, 0.9)", ""); + is(get_color(cs.getPropertyValue(prop)), "rgba(0, 0, 128, 0.9)", + msg_prefix + "computed value before transition"); + div.style.setProperty("transition-property", prop, ""); + div.style.setProperty(prop, "currentcolor", ""); + is(get_color(cs.getPropertyValue(prop)), "rgba(5, 0, 123, 0.7)", + msg_prefix + "interpolation of rgba color and currentcolor"); + + // It is not possible to check distance, because there is a hidden + // dimension for ratio of currentcolor. + + div.style.removeProperty("color"); +} + function test_border_color_transition(prop, get_color=(x => x), is_shorthand=false) { div.style.setProperty("transition-property", "none", ""); div.style.setProperty(prop, "rgb(128, 64, 0)", ""); From c2cbe4b629c7ed4786a4f98d8be527a277281d6d Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Tue, 20 Sep 2016 10:22:15 +1000 Subject: [PATCH 024/101] Bug 1303693 - OS.File.remove(filename, { ignoreAbsent: true }) throws when the parent directory doesn't exist. r=Yoric MozReview-Commit-ID: HJml1cf430y --HG-- extra : rebase_source : 9dcd346f2afa328b8a57b12096f7e9c07239e9ce --- .../osfile/modules/osfile_win_front.jsm | 3 ++- .../osfile/tests/xpcshell/test_remove.js | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/toolkit/components/osfile/modules/osfile_win_front.jsm b/toolkit/components/osfile/modules/osfile_win_front.jsm index 6908b8765996..e24bffb2623b 100644 --- a/toolkit/components/osfile/modules/osfile_win_front.jsm +++ b/toolkit/components/osfile/modules/osfile_win_front.jsm @@ -426,7 +426,8 @@ return; } - if (ctypes.winLastError == Const.ERROR_FILE_NOT_FOUND) { + if (ctypes.winLastError == Const.ERROR_FILE_NOT_FOUND || + ctypes.winLastError == Const.ERROR_PATH_NOT_FOUND) { if ((!("ignoreAbsent" in options) || options.ignoreAbsent)) { return; } diff --git a/toolkit/components/osfile/tests/xpcshell/test_remove.js b/toolkit/components/osfile/tests/xpcshell/test_remove.js index 6cda29cf44f1..c8dc3305457b 100644 --- a/toolkit/components/osfile/tests/xpcshell/test_remove.js +++ b/toolkit/components/osfile/tests/xpcshell/test_remove.js @@ -35,3 +35,22 @@ add_task(function* test_ignoreAbsent() { } Assert.ok(!exception, "OS.File.remove should not throw when not requested."); }); + +add_task(function* test_ignoreAbsent_directory_missing() { + let absent_file_name = OS.Path.join("absent_parent", "test.tmp"); + + // Removing absent files should throw if "ignoreAbsent" is true. + yield Assert.rejects(OS.File.remove(absent_file_name, {ignoreAbsent: false}), + "OS.File.remove throws if there is no such file."); + + // Removing files from absent directories should not throw if "ignoreAbsent" + // is true or not defined. + let exception = null; + try { + yield OS.File.remove(absent_file_name, {ignoreAbsent: true}); + yield OS.File.remove(absent_file_name); + } catch (ex) { + exception = ex; + } + Assert.ok(!exception, "OS.File.remove should not throw when not requested."); +}); From 2f0220fa93e7eeb991c93be4e745ee70c1685f94 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Tue, 6 Sep 2016 16:51:45 +0800 Subject: [PATCH 025/101] Bug 1303655. Part 1 - Move some code to Decodingstate::Enter(). r=kikuo MozReview-Commit-ID: JjhmE0cgOn --HG-- extra : rebase_source : d46aed6ca12a60de946c0720cdc49bbd2dcbeba3 --- dom/media/MediaDecoderStateMachine.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index f87c317662d5..764925673b77 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -430,7 +430,28 @@ public: void Enter() override { - mMaster->StartDecoding(); + MOZ_ASSERT(mMaster->mSentFirstFrameLoadedEvent); + // Pending seek should've been handled by DECODING_FIRSTFRAME before + // transitioning to DECODING. + MOZ_ASSERT(!mMaster->mQueuedSeek.Exists()); + + if (mMaster->CheckIfDecodeComplete()) { + SetState(DECODER_STATE_COMPLETED); + return; + } + + mMaster->mDecodeStartTime = TimeStamp::Now(); + + // Reset other state to pristine values before starting decode. + mMaster->mIsAudioPrerolling = !mMaster->DonePrerollingAudio() && + !Reader()->IsWaitingAudioData(); + mMaster->mIsVideoPrerolling = !mMaster->DonePrerollingVideo() && + !Reader()->IsWaitingVideoData(); + + // Ensure that we've got tasks enqueued to decode data if we need to. + mMaster->DispatchDecodeTasksIfNeeded(); + + mMaster->ScheduleStateMachine(); } void Step() override From 31666a223cb51275ba132776171a3beeb85c0f4f Mon Sep 17 00:00:00 2001 From: JW Wang Date: Tue, 6 Sep 2016 16:54:14 +0800 Subject: [PATCH 026/101] Bug 1303655. Part 2 - Remove unused functions. r=kikuo MozReview-Commit-ID: 3Y7gVZXledn --HG-- extra : rebase_source : d5d88879459465f6ab6d4ca299b1de70a044b5c2 --- dom/media/MediaDecoderStateMachine.cpp | 28 -------------------------- dom/media/MediaDecoderStateMachine.h | 3 --- 2 files changed, 31 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 764925673b77..1ef0d0add61d 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -1645,34 +1645,6 @@ MediaDecoderStateMachine::DecodeFirstFrame() DispatchDecodeTasksIfNeeded(); } -void -MediaDecoderStateMachine::StartDecoding() -{ - MOZ_ASSERT(OnTaskQueue()); - // Should transition to DECODING only after decoding first frames. - MOZ_ASSERT(mSentFirstFrameLoadedEvent); - MOZ_ASSERT(mState == DECODER_STATE_DECODING); - // Pending seek should've been handled by DECODING_FIRSTFRAME before - // transitioning to DECODING. - MOZ_ASSERT(!mQueuedSeek.Exists()); - - if (CheckIfDecodeComplete()) { - SetState(DECODER_STATE_COMPLETED); - return; - } - - mDecodeStartTime = TimeStamp::Now(); - - // Reset other state to pristine values before starting decode. - mIsAudioPrerolling = !DonePrerollingAudio() && !mReader->IsWaitingAudioData(); - mIsVideoPrerolling = !DonePrerollingVideo() && !mReader->IsWaitingVideoData(); - - // Ensure that we've got tasks enqueued to decode data if we need to. - DispatchDecodeTasksIfNeeded(); - - ScheduleStateMachine(); -} - void MediaDecoderStateMachine::PlayStateChanged() { MOZ_ASSERT(OnTaskQueue()); diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index c6165180db07..2e754c9582ba 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -471,9 +471,6 @@ protected: // The entry action of DECODER_STATE_DECODING_FIRSTFRAME. void DecodeFirstFrame(); - // The entry action of DECODER_STATE_DECODING. - void StartDecoding(); - // Moves the decoder into the shutdown state, and dispatches an error // event to the media element. This begins shutting down the decoder. // The decoder monitor must be held. This is only called on the From 939d348ad4f4d522373b3ed9269d955e77ce4767 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Tue, 6 Sep 2016 16:59:02 +0800 Subject: [PATCH 027/101] Bug 1303655. Part 3 - Move mDecodeStartTime into Decodingstate. r=kikuo MozReview-Commit-ID: ELUr9AHaE2P --HG-- extra : rebase_source : 8cdfbdd076c8a518226aee02b1574d005d3295de --- dom/media/MediaDecoderStateMachine.cpp | 17 +++++++++++++---- dom/media/MediaDecoderStateMachine.h | 3 --- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 1ef0d0add61d..9e4a27a15c23 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -440,7 +440,7 @@ public: return; } - mMaster->mDecodeStartTime = TimeStamp::Now(); + mDecodeStartTime = TimeStamp::Now(); // Reset other state to pristine values before starting decode. mMaster->mIsAudioPrerolling = !mMaster->DonePrerollingAudio() && @@ -454,6 +454,14 @@ public: mMaster->ScheduleStateMachine(); } + void Exit() override + { + if (!mDecodeStartTime.IsNull()) { + TimeDuration decodeDuration = TimeStamp::Now() - mDecodeStartTime; + SLOG("Exiting DECODING, decoded for %.3lfs", decodeDuration.ToSeconds()); + } + } + void Step() override { mMaster->StepDecoding(); @@ -463,6 +471,10 @@ public: { return DECODER_STATE_DECODING; } + +private: + // Time at which we started decoding. + TimeStamp mDecodeStartTime; }; class MediaDecoderStateMachine::SeekingState @@ -2741,11 +2753,8 @@ MediaDecoderStateMachine::StartBuffering() StopPlayback(); } - TimeDuration decodeDuration = TimeStamp::Now() - mDecodeStartTime; mBufferingStart = TimeStamp::Now(); - DECODER_LOG("Changed state from DECODING to BUFFERING, decoded for %.3lfs", - decodeDuration.ToSeconds()); MediaStatistics stats = GetStatistics(); DECODER_LOG("Playback rate: %.1lfKB/s%s download rate: %.1lfKB/s%s", stats.mPlaybackRate/1024, stats.mPlaybackRateReliable ? "" : " (unreliable)", diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index 2e754c9582ba..9d627b2b493c 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -675,9 +675,6 @@ private: // Playback rate. 1.0 : normal speed, 0.5 : two times slower. double mPlaybackRate; - // Time at which we started decoding. Synchronised via decoder monitor. - TimeStamp mDecodeStartTime; - // The maximum number of second we spend buffering when we are short on // unbuffered data. uint32_t mBufferingWait; From 7fca5359ea62ca1ef4cd5296f095c877f35ee905 Mon Sep 17 00:00:00 2001 From: Philipp Kewisch Date: Mon, 19 Sep 2016 22:17:40 +0200 Subject: [PATCH 028/101] Bug 1303725 - Make mach eslint output more helpful in case of an error. r=miker MozReview-Commit-ID: KvTrBfnPjtn --HG-- extra : rebase_source : a8060752ea34cffb964b654535c19b04a0cb8598 --- tools/lint/eslint.lint | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/lint/eslint.lint b/tools/lint/eslint.lint index 5deb1fcc5f52..13db185475ee 100644 --- a/tools/lint/eslint.lint +++ b/tools/lint/eslint.lint @@ -18,6 +18,11 @@ from mozprocess import ProcessHandler from mozlint import result +ESLINT_ERROR_MESSAGE = """ +An error occurred running eslint. Please check the following error messages: + +{} +""".strip() ESLINT_NOT_FOUND_MESSAGE = """ Could not find eslint! We looked at the --binary option, at the ESLINT @@ -325,8 +330,14 @@ def lint(paths, binary=None, fix=None, setup=None, **lintargs): proc.kill() return [] + try: + jsonresult = json.loads(proc.output[0] or '[]') + except ValueError: + print(ESLINT_ERROR_MESSAGE.format("\n".join(proc.output))) + return 1 + results = [] - for obj in json.loads(proc.output[0] or '[]'): + for obj in jsonresult: errors = obj['messages'] for err in errors: From c4f436615b8c7bde368d7774d8f8f427cf8b3154 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Tue, 20 Sep 2016 10:52:48 +0200 Subject: [PATCH 029/101] Bug 1303959 - Bump gaia and platform_build for Aries KK and Nexus 5 L r=me MozReview-Commit-ID: IlaCQlIAZI9 --HG-- extra : rebase_source : 7b101a04d7f90e7f98a0c719ee5df280203ec6b6 --- b2g/config/aries/sources.xml | 2 +- b2g/config/nexus-5-l/sources.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/b2g/config/aries/sources.xml b/b2g/config/aries/sources.xml index 9cb26206071f..0ed0a67a603c 100644 --- a/b2g/config/aries/sources.xml +++ b/b2g/config/aries/sources.xml @@ -8,7 +8,7 @@ - + diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml index e7319942e2d0..0419408a3e85 100644 --- a/b2g/config/nexus-5-l/sources.xml +++ b/b2g/config/nexus-5-l/sources.xml @@ -8,7 +8,7 @@ - + @@ -16,7 +16,7 @@ - + From e87482b1d2780712b756390c645b914bdd8fbbf9 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 20 Sep 2016 12:47:23 +0200 Subject: [PATCH 030/101] Backed out changeset da90ec959a3c (bug 1297535) for memory leaks in browser_885530_showInPrivateBrowsing.js --HG-- extra : rebase_source : a83a2dcd5e21373ae05d29265c5ba8d379e563da --- devtools/client/framework/devtools-browser.js | 33 +++---------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/devtools/client/framework/devtools-browser.js b/devtools/client/framework/devtools-browser.js index 03f497fe2884..41a4e513438e 100644 --- a/devtools/client/framework/devtools-browser.js +++ b/devtools/client/framework/devtools-browser.js @@ -141,10 +141,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { } } break; - case "domwindowopened": - let win = subject.QueryInterface(Ci.nsIDOMEventTarget); - win.addEventListener("DOMContentLoaded", this, { once: true }); - break; } }, @@ -405,28 +401,11 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { CustomizableUI.addWidgetToArea("webide-button", CustomizableUI.AREA_NAVBAR); }, - /** - * Starts setting up devtools on a given browser window. This method is - * called on DOMContentLoaded, so earlier than registerBrowserWindow which - * is called after delayed-startup notification. This method should only do - * what has to be done early. Otherwise devtools should be initialized lazily - * to prevent overloading Firefox startup. - * - * @param {ChromeWindow} window - * The window to which devtools should be hooked to. - */ - _onBrowserWindowLoaded: function (win) { - if (!win.gBrowser) { - return; - } - BrowserMenus.addMenus(win.document); - }, - /** * Add this DevTools's presence to a browser window's document * - * @param {ChromeWindow} win - * The window to which devtools should be hooked to. + * @param {XULDocument} doc + * The document to which devtools should be hooked to. */ _registerBrowserWindow: function (win) { if (gDevToolsBrowser._trackedBrowserWindows.has(win)) { @@ -434,6 +413,8 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { } gDevToolsBrowser._trackedBrowserWindows.add(win); + BrowserMenus.addMenus(win.document); + // Register the Developer widget in the Hamburger menu or navbar // only once menus are registered as it depends on it. gDevToolsBrowser.installDeveloperWidget(); @@ -698,9 +679,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { case "TabSelect": gDevToolsBrowser._updateMenuCheckbox(); break; - case "DOMContentLoaded": - gDevToolsBrowser._onBrowserWindowLoaded(event.target.defaultView); - break; case "unload": // top-level browser window unload gDevToolsBrowser._forgetBrowserWindow(event.target.defaultView); @@ -730,7 +708,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { */ destroy: function () { Services.prefs.removeObserver("devtools.", gDevToolsBrowser); - Services.ww.unregisterNotification(gDevToolsBrowser); Services.obs.removeObserver(gDevToolsBrowser, "browser-delayed-startup-finished"); Services.obs.removeObserver(gDevToolsBrowser.destroy, "quit-application"); @@ -763,7 +740,6 @@ gDevTools.on("toolbox-ready", gDevToolsBrowser._updateMenuCheckbox); gDevTools.on("toolbox-destroyed", gDevToolsBrowser._updateMenuCheckbox); Services.obs.addObserver(gDevToolsBrowser.destroy, "quit-application", false); -Services.ww.registerNotification(gDevToolsBrowser); Services.obs.addObserver(gDevToolsBrowser, "browser-delayed-startup-finished", false); // Fake end of browser window load event for all already opened windows @@ -772,7 +748,6 @@ let enumerator = Services.wm.getEnumerator(gDevTools.chromeWindowType); while (enumerator.hasMoreElements()) { let win = enumerator.getNext(); if (win.gBrowserInit && win.gBrowserInit.delayedStartupFinished) { - gDevToolsBrowser._onBrowserWindowLoaded(win); gDevToolsBrowser._registerBrowserWindow(win); } } From c38cb3848751c2983adeecadbab7d6e9de5cdb3f Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 15:50:31 +1000 Subject: [PATCH 031/101] Bug 1303673: P1. Add RESULT_DETAIL convenience macro. r=cpearce MozReview-Commit-ID: 12YaMnNsvNI --HG-- extra : rebase_source : afb2d9f4c167c53d7515558d28d0fc74a0402c73 --- dom/media/MediaResult.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/media/MediaResult.h b/dom/media/MediaResult.h index 214ad7f5a933..c1e0af64c90e 100644 --- a/dom/media/MediaResult.h +++ b/dom/media/MediaResult.h @@ -59,5 +59,7 @@ private: nsCString mMessage; }; +#define RESULT_DETAIL(arg, ...) nsPrintfCString("%s: " arg, __func__, ##__VA_ARGS__) + } // namespace mozilla #endif // MediaResult_h_ \ No newline at end of file From 83619b5bc0d3702a508dce3a6b16958d40ea60bc Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 15:51:54 +1000 Subject: [PATCH 032/101] Bug 1303673: P2. Change error code to OOM. r=cpearce Only time this error can occur is if we failed to allocate memory. MozReview-Commit-ID: A37SQnraC54 --HG-- extra : rebase_source : b05dcdaf1c91d2f94255cd870872ec80e23c81c7 --- dom/media/platforms/agnostic/BlankDecoderModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/media/platforms/agnostic/BlankDecoderModule.cpp b/dom/media/platforms/agnostic/BlankDecoderModule.cpp index 7609e377de90..7d7bae721302 100644 --- a/dom/media/platforms/agnostic/BlankDecoderModule.cpp +++ b/dom/media/platforms/agnostic/BlankDecoderModule.cpp @@ -82,7 +82,7 @@ private: void OutputFrame(MediaData* aData) { if (!aData) { - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); + mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); return; } From 37455bf7f437bb1d424ecf2935607820a4052258 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 15:56:17 +1000 Subject: [PATCH 033/101] Bug 1303673: P3. Provide decryption status in error. r=cpearce MozReview-Commit-ID: GGWAYcJAZ3R --HG-- extra : rebase_source : f88b6fee5d9e5582e7fa43f9a13f9f3d1ce7af90 --- dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp index 923970fd7db9..7d523d926f5b 100644 --- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp +++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp @@ -93,8 +93,9 @@ public: Input(aDecrypted.mSample); } else if (aDecrypted.mStatus != Ok) { if (mCallback) { - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, - __func__)); + mCallback->Error(MediaResult( + NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL("decrypted.mStatus=%u", uint32_t(aDecrypted.mStatus)))); } } else { MOZ_ASSERT(!mIsShutdown); From 485daa6ea74efb94ec835249cb8c8f14c237077d Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 15:57:32 +1000 Subject: [PATCH 034/101] Bug 1303673: P4. Provide GMP error code in MediaResult. r=cpearce MozReview-Commit-ID: LfXNfMymvk4 --HG-- extra : rebase_source : 12c1bf1fe0245802429bbbbf75910f2906fde9f2 --- .../agnostic/gmp/GMPAudioDecoder.cpp | 39 ++++++++++--------- .../agnostic/gmp/GMPVideoDecoder.cpp | 22 ++++++----- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp b/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp index 796efbdfd3cb..556b3e04bf21 100644 --- a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp +++ b/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp @@ -31,8 +31,10 @@ AudioCallbackAdapter::Decoded(const nsTArray& aPCM, uint64_t aTimeStamp MOZ_ASSERT(IsOnGMPThread()); if (aRate == 0 || aChannels == 0) { - NS_WARNING("Invalid rate or num channels returned on GMP audio samples"); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); + mCallback->Error(MediaResult( + NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL( + "Invalid rate or num channels returned on GMP audio samples"))); return; } @@ -40,7 +42,9 @@ AudioCallbackAdapter::Decoded(const nsTArray& aPCM, uint64_t aTimeStamp MOZ_ASSERT((aPCM.Length() % aChannels) == 0); AlignedAudioBuffer audioData(aPCM.Length()); if (!audioData) { - mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); + mCallback->Error( + MediaResult(NS_ERROR_OUT_OF_MEMORY, + RESULT_DETAIL("Unable to allocate audio buffer"))); return; } @@ -52,9 +56,8 @@ AudioCallbackAdapter::Decoded(const nsTArray& aPCM, uint64_t aTimeStamp mAudioFrameSum = 0; auto timestamp = UsecsToFrames(aTimeStamp, aRate); if (!timestamp.isValid()) { - NS_WARNING("Invalid timestamp"); mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, - __func__)); + RESULT_DETAIL("Invalid timestamp"))); return; } mAudioFrameOffset = timestamp.value(); @@ -63,18 +66,18 @@ AudioCallbackAdapter::Decoded(const nsTArray& aPCM, uint64_t aTimeStamp auto timestamp = FramesToUsecs(mAudioFrameOffset + mAudioFrameSum, aRate); if (!timestamp.isValid()) { - NS_WARNING("Invalid timestamp on audio samples"); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, - __func__)); + mCallback->Error( + MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, + RESULT_DETAIL("Invalid timestamp on audio samples"))); return; } mAudioFrameSum += numFrames; auto duration = FramesToUsecs(numFrames, aRate); if (!duration.isValid()) { - NS_WARNING("Invalid duration on audio samples"); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, - __func__)); + mCallback->Error( + MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, + RESULT_DETAIL("Invalid duration on audio samples"))); return; } @@ -120,16 +123,15 @@ void AudioCallbackAdapter::Error(GMPErr aErr) { MOZ_ASSERT(IsOnGMPThread()); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, - nsPrintfCString("%s: %d", __func__, aErr))); + mCallback->Error( + MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, RESULT_DETAIL("GMPErr:%x", aErr))); } void AudioCallbackAdapter::Terminated() { - NS_WARNING("AAC GMP decoder terminated."); mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, - __func__)); + RESULT_DETAIL("Audio GMP decoder terminated."))); } GMPAudioDecoderParams::GMPAudioDecoderParams(const CreateDecoderParams& aParams) @@ -252,7 +254,8 @@ GMPAudioDecoder::Input(MediaRawData* aSample) RefPtr sample(aSample); if (!mGMP) { - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); + mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL("mGMP not initialized"))); return; } @@ -261,9 +264,7 @@ GMPAudioDecoder::Input(MediaRawData* aSample) gmp::GMPAudioSamplesImpl samples(sample, mConfig.mChannels, mConfig.mRate); nsresult rv = mGMP->Decode(samples); if (NS_FAILED(rv)) { - mCallback->Error( - MediaResult(rv, nsPrintfCString("%s: decode error (%d)", - __func__, rv))); + mCallback->Error(MediaResult(rv, __func__)); } } diff --git a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp index dad4466fd6e3..39c034b4d833 100644 --- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp +++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp @@ -95,16 +95,16 @@ void VideoCallbackAdapter::Error(GMPErr aErr) { MOZ_ASSERT(IsOnGMPThread()); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, - nsPrintfCString("%s: %d", __func__, aErr))); + mCallback->Error( + MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, RESULT_DETAIL("GMPErr:%x", aErr))); } void VideoCallbackAdapter::Terminated() { // Note that this *may* be called from the proxy thread also. - NS_WARNING("GMP decoder terminated."); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); + mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL("Video GMP decoder terminated."))); } GMPVideoDecoderParams::GMPVideoDecoderParams(const CreateDecoderParams& aParams) @@ -184,14 +184,16 @@ GMPVideoDecoder::CreateFrame(MediaRawData* aSample) GMPVideoFrame* ftmp = nullptr; GMPErr err = mHost->CreateFrame(kGMPEncodedVideoFrame, &ftmp); if (GMP_FAILED(err)) { - mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); + mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, + RESULT_DETAIL("Host::CreateFrame:%x", err))); return nullptr; } GMPUniquePtr frame(static_cast(ftmp)); err = frame->CreateEmptyFrame(aSample->Size()); if (GMP_FAILED(err)) { - mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); + mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, + RESULT_DETAIL("GMPVideoEncodedFrame::CreateEmptyFrame:%x", err))); return nullptr; } @@ -322,7 +324,7 @@ GMPVideoDecoder::Input(MediaRawData* aSample) RefPtr sample(aSample); if (!mGMP) { mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, - __func__)); + RESULT_DETAIL("mGMP not initialized"))); return; } @@ -330,13 +332,15 @@ GMPVideoDecoder::Input(MediaRawData* aSample) GMPUniquePtr frame = CreateFrame(sample); if (!frame) { - mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); + mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, + RESULT_DETAIL("CreateFrame returned null"))); return; } nsTArray info; // No codec specific per-frame info to pass. nsresult rv = mGMP->Decode(Move(frame), false, info, 0); if (NS_FAILED(rv)) { - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__)); + mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("mGMP->Decode:%x", rv))); } } From f8966bc13b1a26525ef1e7c514bb1336be560491 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 15:59:42 +1000 Subject: [PATCH 035/101] Bug 1303673: P5. Provide warning when a MediaDataDecoder error occurs. r=cpearce Warnings were provided earlier on and got removed. So we instead make it consistent across all decoders. MozReview-Commit-ID: 53obtEClq98 --HG-- extra : rebase_source : f2e22e0d8ff33e8198b39f5a955b8f233a97daa6 --- dom/media/MediaFormatReader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index dda2af89babb..103fc3f077af 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -720,6 +720,7 @@ void MediaFormatReader::NotifyError(TrackType aTrack, const MediaResult& aError) { MOZ_ASSERT(OnTaskQueue()); + NS_WARNING(aError.Description().get()); LOGV("%s Decoding error", TrackTypeToStr(aTrack)); auto& decoder = GetDecoderData(aTrack); decoder.mError = decoder.HasFatalError() ? decoder.mError : Some(aError); From 78ecdd8c4e0233ba6d93823e038905732b218a9a Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 16:05:32 +1000 Subject: [PATCH 036/101] Bug 1303673: P6. Provide further error details for the apple decoders. r=cpearce MozReview-Commit-ID: 1A0k5BWAlWW --HG-- extra : rebase_source : da0e24eb45bbe3c07468ae84a8485a5d2f9671af --- dom/media/platforms/apple/AppleATDecoder.cpp | 7 ++++--- dom/media/platforms/apple/AppleVTDecoder.cpp | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/dom/media/platforms/apple/AppleATDecoder.cpp b/dom/media/platforms/apple/AppleATDecoder.cpp index 28b4711e082c..0b8dfa46cf08 100644 --- a/dom/media/platforms/apple/AppleATDecoder.cpp +++ b/dom/media/platforms/apple/AppleATDecoder.cpp @@ -194,8 +194,8 @@ AppleATDecoder::SubmitSample(MediaRawData* aSample) if (!mConverter) { rv = SetupDecoder(aSample); if (rv != NS_OK && rv != NS_ERROR_NOT_INITIALIZED) { - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, - __func__)); + mCallback->Error( + MediaResult(rv, RESULT_DETAIL("Unable to create decoder"))); return; } } @@ -207,7 +207,8 @@ AppleATDecoder::SubmitSample(MediaRawData* aSample) rv = DecodeSample(mQueuedSamples[i]); if (NS_FAILED(rv)) { mQueuedSamples.Clear(); - mCallback->Error(MediaResult(rv, __func__)); + mCallback->Error(MediaResult( + rv, RESULT_DETAIL("Unable to decode sample %lld", aSample->mTime))); return; } } diff --git a/dom/media/platforms/apple/AppleVTDecoder.cpp b/dom/media/platforms/apple/AppleVTDecoder.cpp index c58e77cab8d6..81638870a040 100644 --- a/dom/media/platforms/apple/AppleVTDecoder.cpp +++ b/dom/media/platforms/apple/AppleVTDecoder.cpp @@ -310,8 +310,10 @@ AppleVTDecoder::OutputFrame(CVPixelBufferRef aImage, CVReturn rv = CVPixelBufferLockBaseAddress(aImage, kCVPixelBufferLock_ReadOnly); if (rv != kCVReturnSuccess) { NS_ERROR("error locking pixel data"); - mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); - return NS_ERROR_OUT_OF_MEMORY; + mCallback->Error( + MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("CVPixelBufferLockBaseAddress:%x", rv))); + return NS_ERROR_DOM_MEDIA_DECODE_ERR; } // Y plane. buffer.mPlanes[0].mData = @@ -446,14 +448,17 @@ AppleVTDecoder::DoDecode(MediaRawData* aSample) block.receive()); if (rv != noErr) { NS_ERROR("Couldn't create CMBlockBuffer"); - mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); + mCallback->Error( + MediaResult(NS_ERROR_OUT_OF_MEMORY, + RESULT_DETAIL("CMBlockBufferCreateWithMemoryBlock:%x", rv))); return MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__); } CMSampleTimingInfo timestamp = TimingInfoFromSample(aSample); rv = CMSampleBufferCreate(kCFAllocatorDefault, block, true, 0, 0, mFormat, 1, 1, ×tamp, 0, NULL, sample.receive()); if (rv != noErr) { NS_ERROR("Couldn't create CMSampleBuffer"); - mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); + mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, + RESULT_DETAIL("CMSampleBufferCreate:%x", rv))); return MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__); } @@ -467,7 +472,9 @@ AppleVTDecoder::DoDecode(MediaRawData* aSample) if (rv != noErr && !(infoFlags & kVTDecodeInfo_FrameDropped)) { LOG("AppleVTDecoder: Error %d VTDecompressionSessionDecodeFrame", rv); NS_WARNING("Couldn't pass frame to decoder"); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__)); + mCallback->Error( + MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("VTDecompressionSessionDecodeFrame:%x", rv))); return NS_ERROR_DOM_MEDIA_DECODE_ERR; } From 5bb9584b9b86fb4d9727b55783668f7b34f18a09 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 16:18:17 +1000 Subject: [PATCH 037/101] Bug 1303673: P7. Provide MFT error code. r=cpearce MozReview-Commit-ID: BnKR6CKk3eU --HG-- extra : rebase_source : 53c105d1da372bd89698756988723f9e5ce8bed0 --- dom/media/platforms/wmf/WMFMediaDataDecoder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp index 72087cb53d9f..86fa3a4d6ce5 100644 --- a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp +++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp @@ -123,7 +123,8 @@ WMFMediaDataDecoder::ProcessDecode(MediaRawData* aSample) HRESULT hr = mMFTManager->Input(aSample); if (FAILED(hr)) { NS_WARNING("MFTManager rejected sample"); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__)); + mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("MFTManager::Input:%x", hr))); if (!mRecordedError) { SendTelemetry(hr); mRecordedError = true; @@ -150,7 +151,8 @@ WMFMediaDataDecoder::ProcessOutput() mCallback->InputExhausted(); } else if (FAILED(hr)) { NS_WARNING("WMFMediaDataDecoder failed to output data"); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__)); + mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("MFTManager::Output:%x", hr))); if (!mRecordedError) { SendTelemetry(hr); mRecordedError = true; From 84106ef14659f2e47fdd98f506fd9444058c24b1 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 16:32:04 +1000 Subject: [PATCH 038/101] Bug 1303673: P8. Details for the H264 converter. r=cpearce Mark some errors as OOM as that's what they are. MozReview-Commit-ID: 2YEgBjqzMEm --HG-- extra : rebase_source : 2ae43c8252f93adf9d4b0f86de96875152f739a1 --- dom/media/platforms/wrappers/H264Converter.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dom/media/platforms/wrappers/H264Converter.cpp b/dom/media/platforms/wrappers/H264Converter.cpp index 95c1476779d9..d449c60cc3ec 100644 --- a/dom/media/platforms/wrappers/H264Converter.cpp +++ b/dom/media/platforms/wrappers/H264Converter.cpp @@ -55,7 +55,8 @@ H264Converter::Input(MediaRawData* aSample) if (!mp4_demuxer::AnnexB::ConvertSampleToAVCC(aSample)) { // We need AVCC content to be able to later parse the SPS. // This is a no-op if the data is already AVCC. - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); + mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, + RESULT_DETAIL("ConvertSampleToAVCC"))); return; } @@ -88,7 +89,9 @@ H264Converter::Input(MediaRawData* aSample) rv = CheckForSPSChange(aSample); } if (NS_FAILED(rv)) { - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); + mCallback->Error( + MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL("Unable to create H264 decoder"))); return; } @@ -99,7 +102,8 @@ H264Converter::Input(MediaRawData* aSample) if (!mNeedAVCC && !mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample)) { - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); + mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, + RESULT_DETAIL("ConvertSampleToAnnexB"))); return; } @@ -262,8 +266,9 @@ void H264Converter::OnDecoderInitFailed(MediaResult aError) { mInitPromiseRequest.Complete(); - mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, - __func__)); + mCallback->Error( + MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL("Unable to initialize H264 decoder"))); } nsresult From 40284ca39a0eefa7e81fde64388190cba63508f6 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Sep 2016 16:56:58 +1000 Subject: [PATCH 039/101] Bug 1303673: P9. Make some GMP errors non fatal. r=cpearce MozReview-Commit-ID: LMWQtJElle7 --HG-- extra : rebase_source : 02e9a30cf049d26b6e7f7f78c98d8b595a72cac5 --- dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp | 6 ++++-- dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp b/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp index 556b3e04bf21..d863d44d4e01 100644 --- a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp +++ b/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp @@ -123,8 +123,10 @@ void AudioCallbackAdapter::Error(GMPErr aErr) { MOZ_ASSERT(IsOnGMPThread()); - mCallback->Error( - MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, RESULT_DETAIL("GMPErr:%x", aErr))); + mCallback->Error(MediaResult(aErr == GMPDecodeErr + ? NS_ERROR_DOM_MEDIA_DECODE_ERR + : NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL("GMPErr:%x", aErr))); } void diff --git a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp index 39c034b4d833..acc4cc9fb975 100644 --- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp +++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp @@ -95,8 +95,10 @@ void VideoCallbackAdapter::Error(GMPErr aErr) { MOZ_ASSERT(IsOnGMPThread()); - mCallback->Error( - MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, RESULT_DETAIL("GMPErr:%x", aErr))); + mCallback->Error(MediaResult(aErr == GMPDecodeErr + ? NS_ERROR_DOM_MEDIA_DECODE_ERR + : NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL("GMPErr:%x", aErr))); } void From dda95d5cd38a5acbf6fb5e946dad7d1c520dae88 Mon Sep 17 00:00:00 2001 From: Luca Niccoli Date: Tue, 20 Sep 2016 11:14:12 +0200 Subject: [PATCH 040/101] Bug 921063 - Lock and (potentially) wait for remote service startup. r=glandium MozReview-Commit-ID: 5MRX9TtxTLo --HG-- extra : rebase_source : d836573b16aa52199750f50208710294e921bfa1 --- toolkit/xre/nsAppRunner.cpp | 83 +++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 13 deletions(-) diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 08521f879953..0fc73318ee56 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -168,6 +168,11 @@ #ifdef MOZ_ENABLE_XREMOTE #include "XRemoteClient.h" #include "nsIRemoteService.h" +#include "nsProfileLock.h" +#include "SpecialSystemDirectory.h" +#include +// Time to wait for the remoting service to start +#define MOZ_XREMOTE_START_TIMEOUT_SEC 5 #endif #if defined(DEBUG) && defined(XP_WIN32) @@ -1679,17 +1684,13 @@ DumpVersion() #ifdef MOZ_ENABLE_XREMOTE static RemoteResult -RemoteCommandLine(const char* aDesktopStartupID) +ParseRemoteCommandLine(nsCString& program, + const char** profile, + const char** username) { - nsresult rv; ArgResult ar; - const char *profile = 0; - nsAutoCString program(gAppData->remotingName); - ToLowerCase(program); - const char *username = getenv("LOGNAME"); - - ar = CheckArg("p", false, &profile, false); + ar = CheckArg("p", false, profile, false); if (ar == ARG_BAD) { // Leave it to the normal command line handling to handle this situation. return REMOTE_NOT_FOUND; @@ -1704,14 +1705,23 @@ RemoteCommandLine(const char* aDesktopStartupID) program.Assign(temp); } - ar = CheckArg("u", true, &username); + ar = CheckArg("u", true, username); if (ar == ARG_BAD) { PR_fprintf(PR_STDERR, "Error: argument -u requires a username\n"); return REMOTE_ARG_BAD; } + return REMOTE_FOUND; +} + +static RemoteResult +StartRemoteClient(const char* aDesktopStartupID, + nsCString& program, + const char* profile, + const char* username) +{ XRemoteClient client; - rv = client.Init(); + nsresult rv = client.Init(); if (NS_FAILED(rv)) return REMOTE_NOT_FOUND; @@ -3018,6 +3028,8 @@ public: nsCOMPtr mProfileLock; #ifdef MOZ_ENABLE_XREMOTE nsCOMPtr mRemoteService; + nsProfileLock mRemoteLock; + nsCOMPtr mRemoteLockDir; #endif UniquePtr mScopedXPCOM; @@ -3755,17 +3767,58 @@ XREMain::XRE_mainStartup(bool* aExitFlag) } if (!newInstance) { + nsAutoCString program(gAppData->remotingName); + ToLowerCase(program); + + const char* username = getenv("LOGNAME"); + const char* profile = nullptr; + + RemoteResult rr = ParseRemoteCommandLine(program, &profile, &username); + if (rr == REMOTE_ARG_BAD) { + return 1; + } + + nsCOMPtr mutexDir; + rv = GetSpecialSystemDirectory(OS_TemporaryDirectory, getter_AddRefs(mutexDir)); + if (NS_SUCCEEDED(rv)) { + nsAutoCString mutexPath = + program + NS_LITERAL_CSTRING("_") + nsDependentCString(username); + if (profile) { + mutexPath.Append(NS_LITERAL_CSTRING("_") + nsDependentCString(profile)); + } + mutexDir->AppendNative(mutexPath); + + rv = mutexDir->Create(nsIFile::DIRECTORY_TYPE, 0700); + if (NS_SUCCEEDED(rv) || rv == NS_ERROR_FILE_ALREADY_EXISTS) { + mRemoteLockDir = mutexDir; + } + } + + if (mRemoteLockDir) { + const TimeStamp epoch = mozilla::TimeStamp::Now(); + do { + rv = mRemoteLock.Lock(mRemoteLockDir, nullptr); + if (NS_SUCCEEDED(rv)) + break; + sched_yield(); + } while ((TimeStamp::Now() - epoch) + < TimeDuration::FromSeconds(MOZ_XREMOTE_START_TIMEOUT_SEC)); + if (NS_FAILED(rv)) { + NS_WARNING("Cannot lock XRemote start mutex"); + } + } + // Try to remote the entire command line. If this fails, start up normally. const char* desktopStartupIDPtr = mDesktopStartupID.IsEmpty() ? nullptr : mDesktopStartupID.get(); - RemoteResult rr = RemoteCommandLine(desktopStartupIDPtr); + rr = StartRemoteClient(desktopStartupIDPtr, program, profile, username); if (rr == REMOTE_FOUND) { *aExitFlag = true; return 0; - } - else if (rr == REMOTE_ARG_BAD) + } else if (rr == REMOTE_ARG_BAD) { return 1; + } } #endif #if defined(MOZ_WIDGET_GTK) @@ -4331,6 +4384,10 @@ XREMain::XRE_mainRun() mRemoteService = do_GetService("@mozilla.org/toolkit/remote-service;1"); if (mRemoteService) mRemoteService->Startup(mAppData->remotingName, mProfileName.get()); + if (mRemoteLockDir) { + mRemoteLock.Unlock(); + mRemoteLockDir->Remove(false); + } #endif /* MOZ_ENABLE_XREMOTE */ mNativeApp->Enable(); From 2d604e3b724dee436c6bdcdbe4b4358414e56fdd Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Fri, 9 Sep 2016 16:54:05 +0200 Subject: [PATCH 041/101] Bug 1152441 - Part 1: Enhance the Tree component for use in performance waterfall r=fitzgen MozReview-Commit-ID: 753IKgJF6Oj --HG-- extra : rebase_source : 87461fc10e0725b96bf52f7b8a3cfb1f16ac4233 --- .../test/mochitest/test_tree_04.html | 82 +++++++++++++++++-- devtools/client/shared/components/tree.js | 69 ++++++++++++---- 2 files changed, 127 insertions(+), 24 deletions(-) diff --git a/devtools/client/shared/components/test/mochitest/test_tree_04.html b/devtools/client/shared/components/test/mochitest/test_tree_04.html index be35cb2e5a19..8e4c125c9b37 100644 --- a/devtools/client/shared/components/test/mochitest/test_tree_04.html +++ b/devtools/client/shared/components/test/mochitest/test_tree_04.html @@ -15,15 +15,28 @@ Test that we only render visible tree items. From 4ea262bdaddf3b8bdc73a91cc4a9b8d18c8a9dc8 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Fri, 16 Sep 2016 12:06:11 +0200 Subject: [PATCH 070/101] Bug 1303126 - Add a Rep for Symbols. r=Honza,linclark. Simply displays `Symbol("foo")` as `Symbol(foo)`. Adds a test file for testing SymbolRep renders as expected. MozReview-Commit-ID: Kq2wucNASRk --HG-- extra : rebase_source : 596ec8fba77a95a39718e39e4dc8f0e877f98c94 --- .../client/shared/components/reps/moz.build | 1 + devtools/client/shared/components/reps/rep.js | 4 + .../client/shared/components/reps/reps.css | 4 +- .../client/shared/components/reps/symbol.js | 48 ++++++++++++ .../components/test/mochitest/chrome.ini | 1 + .../test/mochitest/test_reps_symbol.html | 75 +++++++++++++++++++ 6 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 devtools/client/shared/components/reps/symbol.js create mode 100644 devtools/client/shared/components/test/mochitest/test_reps_symbol.html diff --git a/devtools/client/shared/components/reps/moz.build b/devtools/client/shared/components/reps/moz.build index 8c8917df9dfe..b5e57ddbd7e9 100644 --- a/devtools/client/shared/components/reps/moz.build +++ b/devtools/client/shared/components/reps/moz.build @@ -26,6 +26,7 @@ DevToolsModules( 'reps.css', 'string.js', 'stylesheet.js', + 'symbol.js', 'text-node.js', 'undefined.js', 'window.js', diff --git a/devtools/client/shared/components/reps/rep.js b/devtools/client/shared/components/reps/rep.js index aee34f6e0af6..5040cefb2082 100644 --- a/devtools/client/shared/components/reps/rep.js +++ b/devtools/client/shared/components/reps/rep.js @@ -20,6 +20,7 @@ define(function (require, exports, module) { const { Number } = require("./number"); const { ArrayRep } = require("./array"); const { Obj } = require("./object"); + const { SymbolRep } = require("./symbol"); // DOM types (grips) const { Attribute } = require("./attribute"); @@ -58,6 +59,7 @@ define(function (require, exports, module) { Null, StringRep, Number, + SymbolRep, ]; /** @@ -98,6 +100,8 @@ define(function (require, exports, module) { let type = typeof object; if (type == "object" && object instanceof String) { type = "string"; + } else if (type == "object" && object.type === "symbol") { + type = "symbol"; } if (isGrip(object)) { diff --git a/devtools/client/shared/components/reps/reps.css b/devtools/client/shared/components/reps/reps.css index 9582df533b74..d90e6b3cf331 100644 --- a/devtools/client/shared/components/reps/reps.css +++ b/devtools/client/shared/components/reps/reps.css @@ -47,6 +47,7 @@ } .objectBox-string, +.objectBox-symbol, .objectBox-text, .objectLink-textNode, .objectBox-table { @@ -61,7 +62,8 @@ color: var(--number-color); } -.objectBox-string { +.objectBox-string, +.objectBox-symbol { color: var(--string-color); } diff --git a/devtools/client/shared/components/reps/symbol.js b/devtools/client/shared/components/reps/symbol.js new file mode 100644 index 000000000000..1117940089b3 --- /dev/null +++ b/devtools/client/shared/components/reps/symbol.js @@ -0,0 +1,48 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* 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/. */ + +"use strict"; + +// Make this available to both AMD and CJS environments +define(function (require, exports, module) { + // Dependencies + const React = require("devtools/client/shared/vendor/react"); + + // Shortcuts + const { span } = React.DOM; + + /** + * Renders a symbol. + */ + const SymbolRep = React.createClass({ + displayName: "SymbolRep", + + propTypes: { + object: React.PropTypes.object.isRequired + }, + + render: function () { + let {object} = this.props; + let {name} = object; + + return ( + span({className: "objectBox objectBox-symbol"}, + `Symbol(${name || ""})` + ) + ); + }, + }); + + function supportsObject(object, type) { + return (type == "symbol"); + } + + // Exports from this module + exports.SymbolRep = { + rep: SymbolRep, + supportsObject: supportsObject, + }; +}); diff --git a/devtools/client/shared/components/test/mochitest/chrome.ini b/devtools/client/shared/components/test/mochitest/chrome.ini index f06ed72d4087..dbbe9bc88a90 100644 --- a/devtools/client/shared/components/test/mochitest/chrome.ini +++ b/devtools/client/shared/components/test/mochitest/chrome.ini @@ -23,6 +23,7 @@ support-files = [test_reps_regexp.html] [test_reps_string.html] [test_reps_stylesheet.html] +[test_reps_symbol.html] [test_reps_text-node.html] [test_reps_undefined.html] [test_reps_window.html] diff --git a/devtools/client/shared/components/test/mochitest/test_reps_symbol.html b/devtools/client/shared/components/test/mochitest/test_reps_symbol.html new file mode 100644 index 000000000000..a17f9397cb3d --- /dev/null +++ b/devtools/client/shared/components/test/mochitest/test_reps_symbol.html @@ -0,0 +1,75 @@ + + + + + + + Rep test - String + + + + +
+
+
+
+ + From 003ca598315d1dd8a619a06d99a3b8742d77a0eb Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Thu, 4 Aug 2016 17:02:14 -0400 Subject: [PATCH 071/101] Bug 1294232 - Refactor blocklisting on Linux to support the downloadable blocklist. r=jrmuizel MozReview-Commit-ID: ESJY9kkqXR8 --HG-- extra : rebase_source : 93a2794de72c53e7414e22e342940e48cf4da84c --- toolkit/xre/glxtest.cpp | 65 ++++++- widget/GfxDriverInfo.cpp | 5 + widget/GfxDriverInfo.h | 14 +- widget/GfxInfoBase.cpp | 15 +- widget/GfxInfoBase.h | 4 + widget/GfxInfoX11.cpp | 359 +++++++++++++++++++-------------------- widget/GfxInfoX11.h | 17 +- 7 files changed, 277 insertions(+), 202 deletions(-) diff --git a/toolkit/xre/glxtest.cpp b/toolkit/xre/glxtest.cpp index 519a5e68be9b..5f608935d53c 100644 --- a/toolkit/xre/glxtest.cpp +++ b/toolkit/xre/glxtest.cpp @@ -62,6 +62,20 @@ typedef uint32_t GLenum; #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 +// GLX_MESA_query_renderer +#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 +#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 +#define GLX_RENDERER_VERSION_MESA 0x8185 +#define GLX_RENDERER_ACCELERATED_MESA 0x8186 +#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 +#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 +#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 +#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A +#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B +#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C +#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D +#define GLX_RENDERER_ID_MESA 0x818E + namespace mozilla { namespace widget { // the read end of the pipe, which will be used by GfxInfo @@ -252,13 +266,14 @@ void glxtest() void* glXBindTexImageEXT = glXGetProcAddress("glXBindTexImageEXT"); ///// Get GL vendor/renderer/versions strings ///// - enum { bufsize = 1024 }; + enum { bufsize = 2048 }; char buf[bufsize]; - const GLubyte *vendorString = glGetString(GL_VENDOR); - const GLubyte *rendererString = glGetString(GL_RENDERER); - const GLubyte *versionString = glGetString(GL_VERSION); - if (!vendorString || !rendererString || !versionString) + const GLubyte* versionString = glGetString(GL_VERSION); + const GLubyte* vendorString = glGetString(GL_VENDOR); + const GLubyte* rendererString = glGetString(GL_RENDERER); + + if (!versionString || !vendorString || !rendererString) fatal_error("glGetString returned null"); int length = snprintf(buf, bufsize, @@ -270,6 +285,46 @@ void glxtest() if (length >= bufsize) fatal_error("GL strings length too large for buffer size"); + // If GLX_MESA_query_renderer is available, populate additional data. + typedef Bool (*PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); + PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESAProc = + cast(glXGetProcAddress("glXQueryCurrentRendererIntegerMESA")); + if (glXQueryCurrentRendererIntegerMESAProc) { + unsigned int vendorId, deviceId, accelerated, videoMemoryMB; + glXQueryCurrentRendererIntegerMESAProc(GLX_RENDERER_VENDOR_ID_MESA, &vendorId); + glXQueryCurrentRendererIntegerMESAProc(GLX_RENDERER_DEVICE_ID_MESA, &deviceId); + glXQueryCurrentRendererIntegerMESAProc(GLX_RENDERER_ACCELERATED_MESA, &accelerated); + glXQueryCurrentRendererIntegerMESAProc(GLX_RENDERER_VIDEO_MEMORY_MESA, &videoMemoryMB); + + // Truncate IDs to 4 digits- that's all PCI IDs are. + vendorId &= 0xFFFF; + deviceId &= 0xFFFF; + + length += snprintf(buf + length, bufsize, + "MESA_VENDOR_ID\n0x%04x\n" + "MESA_DEVICE_ID\n0x%04x\n" + "MESA_ACCELERATED\n%s\n" + "MESA_VRAM\n%dMB\n", + vendorId, deviceId, accelerated ? "TRUE" : "FALSE", + videoMemoryMB); + + if (length >= bufsize) + fatal_error("GL strings length too large for buffer size"); + } + + // From Mesa's GL/internal/dri_interface.h, to be used by DRI clients. + typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (Display *dpy, int scrNum); + PFNGLXGETSCREENDRIVERPROC glXGetScreenDriverProc = + cast(glXGetProcAddress("glXGetScreenDriver")); + if (glXGetScreenDriverProc) { + const char* driDriver = glXGetScreenDriverProc(dpy, DefaultScreen(dpy)); + if (driDriver) { + length += snprintf(buf + length, bufsize, "DRI_DRIVER\n%s\n", driDriver); + if (length >= bufsize) + fatal_error("GL strings length too large for buffer size"); + } + } + ///// Clean up. Indeed, the parent process might fail to kill us (e.g. if it doesn't need to check GL info) ///// so we might be staying alive for longer than expected, so it's important to consume as little memory as ///// possible. Also we want to check that we're able to do that too without generating X errors. diff --git a/widget/GfxDriverInfo.cpp b/widget/GfxDriverInfo.cpp index 6f9a74a4f45d..ff60b2b75630 100644 --- a/widget/GfxDriverInfo.cpp +++ b/widget/GfxDriverInfo.cpp @@ -306,6 +306,11 @@ const nsAString& GfxDriverInfo::GetDeviceVendor(DeviceVendor id) DECLARE_VENDOR_ID(VendorAMD, "0x1022"); DECLARE_VENDOR_ID(VendorATI, "0x1002"); DECLARE_VENDOR_ID(VendorMicrosoft, "0x1414"); + DECLARE_VENDOR_ID(VendorMesaAll, "mesa/all"); + DECLARE_VENDOR_ID(VendorMesaLLVMPipe, "mesa/llvmpipe"); + DECLARE_VENDOR_ID(VendorMesaSoftPipe, "mesa/softpipe"); + DECLARE_VENDOR_ID(VendorMesaSWRast, "mesa/swrast"); + DECLARE_VENDOR_ID(VendorMesaUnknown, "mesa/unknown"); // Suppress a warning. DECLARE_VENDOR_ID(DeviceVendorMax, ""); } diff --git a/widget/GfxDriverInfo.h b/widget/GfxDriverInfo.h index 99d560b81992..5b2a9a1f2826 100644 --- a/widget/GfxDriverInfo.h +++ b/widget/GfxDriverInfo.h @@ -106,6 +106,18 @@ enum DeviceVendor { VendorAMD, VendorATI, VendorMicrosoft, + + // Wildcard for all Mesa drivers. + VendorMesaAll, + // Note that the following list of Mesa drivers is not comprehensive; we pull + // the DRI driver at runtime. These drivers are provided for convenience when + // populating the local blocklist. + VendorMesaLLVMPipe, + VendorMesaSoftPipe, + VendorMesaSWRast, + // A generic ID to be provided when we can't determine the DRI driver on Mesa. + VendorMesaUnknown, + DeviceVendorMax }; @@ -259,7 +271,7 @@ ParseDriverVersion(const nsAString& aVersion, uint64_t *aNumericVersion) { *aNumericVersion = 0; -#if defined(XP_WIN) +#if defined(XP_WIN) || defined(MOZ_X11) int a, b, c, d; char aStr[8], bStr[8], cStr[8], dStr[8]; /* honestly, why do I even bother */ diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index e53db69c59ea..e63036d4217a 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -694,13 +694,12 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray& info, } } -#if defined(XP_WIN) || defined(ANDROID) +#if defined(XP_WIN) || defined(ANDROID) || defined(MOZ_X11) uint64_t driverVersion; ParseDriverVersion(adapterDriverVersionString, &driverVersion); #endif - if (!info[i].mAdapterVendor.Equals(GfxDriverInfo::GetDeviceVendor(VendorAll), nsCaseInsensitiveStringComparator()) && - !info[i].mAdapterVendor.Equals(adapterVendorID, nsCaseInsensitiveStringComparator())) { + if (!DoesVendorMatch(info[i].mAdapterVendor, adapterVendorID)) { continue; } @@ -733,7 +732,7 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray& info, continue; } -#if defined(XP_WIN) || defined(ANDROID) +#if defined(XP_WIN) || defined(ANDROID) || defined(MOZ_X11) switch (info[i].mComparisonOp) { case DRIVER_LESS_THAN: match = driverVersion < info[i].mDriverVersion; @@ -840,6 +839,14 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray& info, return status; } +bool +GfxInfoBase::DoesVendorMatch(const nsAString& aBlocklistVendor, + const nsAString& aAdapterVendor) +{ + return aBlocklistVendor.Equals(aAdapterVendor, nsCaseInsensitiveStringComparator()) || + aBlocklistVendor.Equals(GfxDriverInfo::GetDeviceVendor(VendorAll), nsCaseInsensitiveStringComparator()); +} + nsresult GfxInfoBase::GetFeatureStatusImpl(int32_t aFeature, int32_t* aStatus, diff --git a/widget/GfxInfoBase.h b/widget/GfxInfoBase.h index 6d30f1b719ac..cb89b93a3f0c 100644 --- a/widget/GfxInfoBase.h +++ b/widget/GfxInfoBase.h @@ -106,6 +106,10 @@ protected: virtual const nsTArray& GetGfxDriverInfo() = 0; virtual void DescribeFeatures(JSContext* aCx, JS::Handle obj); + + virtual bool DoesVendorMatch(const nsAString& aBlocklistVendor, + const nsAString& aAdapterVendor); + bool InitFeatureObject( JSContext* aCx, JS::Handle aContainer, diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index d79be5f0119b..3e834ab007e2 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -12,6 +12,8 @@ #include #include "nsCRTGlue.h" #include "prenv.h" +#include "nsPrintfCString.h" +#include "nsWhitespaceTokenizer.h" #include "GfxInfoX11.h" @@ -35,17 +37,10 @@ nsresult GfxInfo::Init() { mGLMajorVersion = 0; - mMajorVersion = 0; - mMinorVersion = 0; - mRevisionVersion = 0; - mIsMesa = false; - mIsNVIDIA = false; - mIsFGLRX = false; - mIsNouveau = false; - mIsIntel = false; - mIsOldSwrast = false; - mIsLlvmpipe = false; + mGLMinorVersion = 0; mHasTextureFromPixmap = false; + mIsMesa = false; + mIsAccelerated = true; return GfxInfoBase::Init(); } @@ -106,7 +101,18 @@ GfxInfo::GetData() bool error = waiting_for_glxtest_process_failed || exited_with_error_code || received_signal; - nsCString textureFromPixmap; + nsCString glVendor; + nsCString glRenderer; + nsCString glVersion; + nsCString textureFromPixmap; + + // Available if GLX_MESA_query_renderer is supported. + nsCString mesaVendor; + nsCString mesaDevice; + nsCString mesaAccelerated; + // Available if using a DRI-based libGL stack. + nsCString driDriver; + nsCString *stringToFill = nullptr; char *bufptr = buf; if (!error) { @@ -119,13 +125,23 @@ GfxInfo::GetData() stringToFill = nullptr; } else if(!strcmp(line, "VENDOR")) - stringToFill = &mVendor; + stringToFill = &glVendor; else if(!strcmp(line, "RENDERER")) - stringToFill = &mRenderer; + stringToFill = &glRenderer; else if(!strcmp(line, "VERSION")) - stringToFill = &mVersion; + stringToFill = &glVersion; else if(!strcmp(line, "TFP")) stringToFill = &textureFromPixmap; + else if(!strcmp(line, "MESA_VENDOR_ID")) + stringToFill = &mesaVendor; + else if(!strcmp(line, "MESA_DEVICE_ID")) + stringToFill = &mesaDevice; + else if(!strcmp(line, "MESA_ACCELERATED")) + stringToFill = &mesaAccelerated; + else if(!strcmp(line, "MESA_VRAM")) + stringToFill = &mAdapterRAM; + else if(!strcmp(line, "DRI_DRIVER")) + stringToFill = &driDriver; } } @@ -143,13 +159,13 @@ GfxInfo::GetData() const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR"); if (spoofedVendor) - mVendor.Assign(spoofedVendor); + glVendor.Assign(spoofedVendor); const char *spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER"); if (spoofedRenderer) - mRenderer.Assign(spoofedRenderer); + glRenderer.Assign(spoofedRenderer); const char *spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION"); if (spoofedVersion) - mVersion.Assign(spoofedVersion); + glVersion.Assign(spoofedVersion); const char *spoofedOS = PR_GetEnv("MOZ_GFX_SPOOF_OS"); if (spoofedOS) mOS.Assign(spoofedOS); @@ -158,9 +174,9 @@ GfxInfo::GetData() mOSRelease.Assign(spoofedOSRelease); if (error || - mVendor.IsEmpty() || - mRenderer.IsEmpty() || - mVersion.IsEmpty() || + glVendor.IsEmpty() || + glRenderer.IsEmpty() || + glVersion.IsEmpty() || mOS.IsEmpty() || mOSRelease.IsEmpty()) { @@ -182,94 +198,135 @@ GfxInfo::GetData() return; } - mAdapterDescription.Append(mVendor); - mAdapterDescription.AppendLiteral(" -- "); - mAdapterDescription.Append(mRenderer); + // Scan the GL_VERSION string for the GL and driver versions. + nsCWhitespaceTokenizer tokenizer(glVersion); + while (tokenizer.hasMoreTokens()) { + nsCString token(tokenizer.nextToken()); + unsigned int major = 0, minor = 0, revision = 0, patch = 0; + if (sscanf(token.get(), "%u.%u.%u.%u", + &major, &minor, &revision, &patch) >= 2) + { + // A survey of GL_VENDOR strings indicates that the first version is + // always the GL version, the second is usually the driver version. + if (mGLMajorVersion == 0) { + mGLMajorVersion = major; + mGLMinorVersion = minor; + } else { + mDriverVersion = nsPrintfCString("%u.%u.%u.%u", major, minor, revision, patch); + } + } + } + + if (mGLMajorVersion == 0) { + NS_WARNING("Failed to parse GL version!"); + return; + } + + // Mesa always exposes itself in the GL_VERSION string, but not always the + // GL_VENDOR string. + mIsMesa = glVersion.Find("Mesa") != -1; + + // We need to use custom vendor IDs for mesa so we can treat them + // differently than the proprietary drivers. + if (mIsMesa) { + mIsAccelerated = !mesaAccelerated.Equals("FALSE"); + // Process software rasterizers before the DRI driver string; we may be + // forcing software rasterization on a DRI-accelerated X server by using + // LIBGL_ALWAYS_SOFTWARE or a similar restriction. + if (strcasestr(glRenderer.get(), "llvmpipe")) { + CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorMesaLLVMPipe), mVendorId); + mIsAccelerated = false; + } else if (strcasestr(glRenderer.get(), "softpipe")) { + CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorMesaSoftPipe), mVendorId); + mIsAccelerated = false; + } else if (strcasestr(glRenderer.get(), "software rasterizer") || + !mIsAccelerated) { + // Fallback to reporting swrast if GLX_MESA_query_renderer tells us + // we're using an unaccelerated context. + CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorMesaSWRast), mVendorId); + mIsAccelerated = false; + } else if (!driDriver.IsEmpty()) { + mVendorId = nsPrintfCString("mesa/%s", driDriver.get()); + } else { + // Some other mesa configuration where we couldn't get enough info. + NS_WARNING("Failed to detect Mesa driver being used!"); + CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorMesaUnknown), mVendorId); + } + + if (!mesaDevice.IsEmpty()) { + mDeviceId = mesaDevice; + } else { + NS_WARNING("Failed to get Mesa device ID! GLX_MESA_query_renderer unsupported?"); + } + } else if (glVendor.EqualsLiteral("NVIDIA Corporation")) { + CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), mVendorId); + // TODO: Use NV-CONTROL X11 extension to query Device ID and VRAM. + } else if (glVendor.EqualsLiteral("ATI Technologies Inc.")) { + CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorATI), mVendorId); + // TODO: Look into ways to find the device ID on FGLRX. + } else { + NS_WARNING("Failed to detect GL vendor!"); + } + + // Fallback to GL_VENDOR and GL_RENDERER. + if (mVendorId.IsEmpty()) + mVendorId.Assign(glVendor.get()); + if (mDeviceId.IsEmpty()) + mDeviceId.Assign(glRenderer.get()); + + mAdapterDescription.Assign(glRenderer); nsAutoCString note; - note.AppendLiteral("OpenGL: "); - note.Append(mAdapterDescription); + note.AppendLiteral("\nOpenGL: "); + note.Append(glRenderer); note.AppendLiteral(" -- "); - note.Append(mVersion); + note.Append(glVersion); if (mHasTextureFromPixmap) note.AppendLiteral(" -- texture_from_pixmap"); note.Append('\n'); #ifdef MOZ_CRASHREPORTER CrashReporter::AppendAppNotesToCrashReport(note); #endif - - // determine the major OpenGL version. That's the first integer in the version string. - mGLMajorVersion = strtol(mVersion.get(), 0, 10); - - // determine driver type (vendor) and where in the version string - // the actual driver version numbers should be expected to be found (whereToReadVersionNumbers) - const char *whereToReadVersionNumbers = nullptr; - const char *Mesa_in_version_string = strstr(mVersion.get(), "Mesa"); - if (Mesa_in_version_string) { - mIsMesa = true; - // with Mesa, the version string contains "Mesa major.minor" and that's all the version information we get: - // there is no actual driver version info. - whereToReadVersionNumbers = Mesa_in_version_string + strlen("Mesa"); - if (strcasestr(mVendor.get(), "nouveau")) - mIsNouveau = true; - if (strcasestr(mRenderer.get(), "intel")) // yes, intel is in the renderer string - mIsIntel = true; - if (strcasestr(mRenderer.get(), "llvmpipe")) - mIsLlvmpipe = true; - if (strcasestr(mRenderer.get(), "software rasterizer")) - mIsOldSwrast = true; - } else if (strstr(mVendor.get(), "NVIDIA Corporation")) { - mIsNVIDIA = true; - // with the NVIDIA driver, the version string contains "NVIDIA major.minor" - // note that here the vendor and version strings behave differently, that's why we don't put this above - // alongside Mesa_in_version_string. - const char *NVIDIA_in_version_string = strstr(mVersion.get(), "NVIDIA"); - if (NVIDIA_in_version_string) - whereToReadVersionNumbers = NVIDIA_in_version_string + strlen("NVIDIA"); - } else if (strstr(mVendor.get(), "ATI Technologies Inc")) { - mIsFGLRX = true; - // with the FGLRX driver, the version string only gives a OpenGL version :/ so let's return that. - // that can at least give a rough idea of how old the driver is. - whereToReadVersionNumbers = mVersion.get(); - } - - // read major.minor version numbers of the driver (not to be confused with the OpenGL version) - if (whereToReadVersionNumbers) { - // copy into writable buffer, for tokenization - strncpy(buf, whereToReadVersionNumbers, buf_size); - bufptr = buf; - - // now try to read major.minor version numbers. In case of failure, gracefully exit: these numbers have - // been initialized as 0 anyways - char *token = NS_strtok(".", &bufptr); - if (token) { - mMajorVersion = strtol(token, 0, 10); - token = NS_strtok(".", &bufptr); - if (token) { - mMinorVersion = strtol(token, 0, 10); - token = NS_strtok(".", &bufptr); - if (token) - mRevisionVersion = strtol(token, 0, 10); - } - } - } -} - -static inline uint64_t version(uint32_t major, uint32_t minor, uint32_t revision = 0) -{ - return (uint64_t(major) << 32) + (uint64_t(minor) << 16) + uint64_t(revision); } const nsTArray& GfxInfo::GetGfxDriverInfo() { - // Nothing here yet. - //if (!mDriverInfo->Length()) { - // - //} + if (!mDriverInfo->Length()) { + // Mesa 10.0 provides the GLX_MESA_query_renderer extension, which allows us + // to query device IDs backing a GL context for blacklisting. + APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, + (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorMesaAll), GfxDriverInfo::allDevices, + GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, + DRIVER_LESS_THAN, V(10,0,0,0), "FEATURE_FAILURE_OLD_MESA", "Mesa 10.0"); + + // NVIDIA baseline (ported from old blocklist) + APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, + (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices, + GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, + DRIVER_LESS_THAN, V(257,21,0,0), "FEATURE_FAILURE_OLD_NVIDIA", "NVIDIA 257.21"); + + // fglrx baseline (chosen arbitrarily as 2013-07-22 release). + APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, + (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorATI), GfxDriverInfo::allDevices, + GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, + DRIVER_LESS_THAN, V(13,15,100,1), "FEATURE_FAILURE_OLD_FGLRX", "fglrx 13.15.100.1"); + } return *mDriverInfo; } +bool +GfxInfo::DoesVendorMatch(const nsAString& aBlocklistVendor, + const nsAString& aAdapterVendor) +{ + if (mIsMesa && aBlocklistVendor.Equals(GfxDriverInfo::GetDeviceVendor(VendorMesaAll), + nsCaseInsensitiveStringComparator())) + { + return true; + } + return GfxInfoBase::DoesVendorMatch(aBlocklistVendor, aAdapterVendor); +} + nsresult GfxInfo::GetFeatureStatusImpl(int32_t aFeature, int32_t *aStatus, @@ -288,6 +345,13 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature, if (aOS) *aOS = os; + if (mGLMajorVersion == 0) { + // If we failed to get a GL version, glxtest failed. + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; + aFailureId = "FEATURE_FAILURE_GLXTEST_FAILED"; + return NS_OK; + } + if (mGLMajorVersion == 1) { // We're on OpenGL 1. In most cases that indicates really old hardware. // We better block them, rather than rely on them to fail gracefully, because they don't! @@ -297,95 +361,15 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature, return NS_OK; } - // Don't evaluate any special cases if we're checking the downloaded blocklist. - if (!aDriverInfo.Length()) { - // Blacklist software GL implementations from using layers acceleration. - // On the test infrastructure, we'll force-enable layers acceleration. - if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && - (mIsLlvmpipe || mIsOldSwrast) && - !PR_GetEnv("MOZ_LAYERS_ALLOW_SOFTWARE_GL")) - { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; - aFailureId = "FEATURE_FAILURE_SOFTWARE_GL"; - return NS_OK; - } - - // Only check features relevant to Linux. - if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS || - aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL || - aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) { - - // whitelist the linux test slaves' current configuration. - // this is necessary as they're still using the slightly outdated 190.42 driver. - // this isn't a huge risk, as at least this is the exact setting in which we do continuous testing, - // and this only affects GeForce 9400 cards on linux on this precise driver version, which is very few users. - // We do the same thing on Windows XP, see in widget/windows/GfxInfo.cpp - if (mIsNVIDIA && - !strcmp(mRenderer.get(), "GeForce 9400/PCI/SSE2") && - !strcmp(mVersion.get(), "3.2.0 NVIDIA 190.42")) - { - *aStatus = nsIGfxInfo::FEATURE_STATUS_OK; - return NS_OK; - } - - if (mIsMesa) { - if (mIsNouveau && version(mMajorVersion, mMinorVersion) < version(8,0)) { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; - aFailureId = "FEATURE_FAILURE_MESA_1"; - aSuggestedDriverVersion.AssignLiteral("Mesa 8.0"); - } - else if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; - aFailureId = "FEATURE_FAILURE_MESA_2"; - aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3"); - } - else if (mIsOldSwrast) { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; - aFailureId = "FEATURE_FAILURE_SW_RAST"; - } - else if (mIsLlvmpipe && version(mMajorVersion, mMinorVersion) < version(9, 1)) { - // bug 791905, Mesa bug 57733, fixed in Mesa 9.1 according to - // https://bugs.freedesktop.org/show_bug.cgi?id=57733#c3 - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; - aFailureId = "FEATURE_FAILURE_MESA_3"; - } - else if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) - { - if (mIsIntel && version(mMajorVersion, mMinorVersion) < version(8,1)) { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; - aFailureId = "FEATURE_FAILURE_MESA_4"; - aSuggestedDriverVersion.AssignLiteral("Mesa 8.1"); - } - } - - } else if (mIsNVIDIA) { - if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(257,21)) { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; - aFailureId = "FEATURE_FAILURE_OLD_NV"; - aSuggestedDriverVersion.AssignLiteral("NVIDIA 257.21"); - } - } else if (mIsFGLRX) { - // FGLRX does not report a driver version number, so we have the OpenGL version instead. - // by requiring OpenGL 3, we effectively require recent drivers. - if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(3, 0)) { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; - aFailureId = "FEATURE_FAILURE_OLD_FGLRX"; - aSuggestedDriverVersion.AssignLiteral(""); - } - // Bug 724640: FGLRX + Linux 2.6.32 is a crashy combo - bool unknownOS = mOS.IsEmpty() || mOSRelease.IsEmpty(); - bool badOS = mOS.Find("Linux", true) != -1 && - mOSRelease.Find("2.6.32") != -1; - if (unknownOS || badOS) { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION; - aFailureId = "FEATURE_FAILURE_OLD_OS"; - } - } else { - // like on windows, let's block unknown vendors. Think of virtual machines. - // Also, this case is hit whenever the GLXtest probe failed to get driver info or crashed. - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; - } - } + // Blacklist software GL implementations from using layers acceleration. + // On the test infrastructure, we'll force-enable layers acceleration. + if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && + !mIsAccelerated && + !PR_GetEnv("MOZ_LAYERS_ALLOW_SOFTWARE_GL")) + { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; + aFailureId = "FEATURE_FAILURE_SOFTWARE_GL"; + return NS_OK; } return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, &os); @@ -433,7 +417,8 @@ GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription) NS_IMETHODIMP GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM) { - aAdapterRAM.Truncate(); + GetData(); + CopyUTF8toUTF16(mAdapterRAM, aAdapterRAM); return NS_OK; } @@ -460,7 +445,7 @@ NS_IMETHODIMP GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion) { GetData(); - CopyASCIItoUTF16(mVersion, aAdapterDriverVersion); + CopyUTF8toUTF16(mDriverVersion, aAdapterDriverVersion); return NS_OK; } @@ -487,7 +472,7 @@ NS_IMETHODIMP GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID) { GetData(); - CopyUTF8toUTF16(mVendor, aAdapterVendorID); + CopyUTF8toUTF16(mVendorId, aAdapterVendorID); return NS_OK; } @@ -501,7 +486,7 @@ NS_IMETHODIMP GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID) { GetData(); - CopyUTF8toUTF16(mRenderer, aAdapterDeviceID); + CopyUTF8toUTF16(mDeviceId, aAdapterDeviceID); return NS_OK; } @@ -536,19 +521,19 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString & aVendorID) { - CopyUTF16toUTF8(aVendorID, mVendor); + CopyUTF16toUTF8(aVendorID, mVendorId); return NS_OK; } NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString & aDeviceID) { - CopyUTF16toUTF8(aDeviceID, mRenderer); + CopyUTF16toUTF8(aDeviceID, mDeviceId); return NS_OK; } NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString & aDriverVersion) { - CopyUTF16toUTF8(aDriverVersion, mVersion); + CopyUTF16toUTF8(aDriverVersion, mDriverVersion); return NS_OK; } diff --git a/widget/GfxInfoX11.h b/widget/GfxInfoX11.h index 0fd036f46b21..af361c96ce2d 100644 --- a/widget/GfxInfoX11.h +++ b/widget/GfxInfoX11.h @@ -9,6 +9,7 @@ #define __GfxInfoX11_h__ #include "GfxInfoBase.h" +#include "nsString.h" namespace mozilla { namespace widget { @@ -64,16 +65,22 @@ protected: OperatingSystem* aOS = nullptr) override; virtual const nsTArray& GetGfxDriverInfo() override; +protected: + virtual bool DoesVendorMatch(const nsAString& aBlocklistVendor, + const nsAString& aAdapterVendor) override; + private: - nsCString mVendor; - nsCString mRenderer; - nsCString mVersion; + nsCString mVendorId; + nsCString mDeviceId; + nsCString mDriverVersion; nsCString mAdapterDescription; + nsCString mAdapterRAM; nsCString mOS; nsCString mOSRelease; - bool mIsMesa, mIsNVIDIA, mIsFGLRX, mIsNouveau, mIsIntel, mIsOldSwrast, mIsLlvmpipe; bool mHasTextureFromPixmap; - int mGLMajorVersion, mMajorVersion, mMinorVersion, mRevisionVersion; + unsigned int mGLMajorVersion, mGLMinorVersion; + bool mIsMesa; + bool mIsAccelerated; void AddCrashReportAnnotations(); }; From 2a854cce3a303f50a223da42249817104b526c64 Mon Sep 17 00:00:00 2001 From: Patrick Brosset Date: Fri, 16 Sep 2016 14:48:15 +0200 Subject: [PATCH 072/101] Bug 1253655 - Get rid of CPOWs in some commandline tests; r=jsnajdr MozReview-Commit-ID: qbKJKI7uAP --HG-- extra : rebase_source : 0a9e2edb5b72e2ec88adfd3d0f96efdf7d6f57e5 --- .../test/browser_cmd_csscoverage_startstop.js | 21 +- .../commandline/test/browser_cmd_media.js | 22 ++- .../test/browser_cmd_pagemod_export.js | 179 ++++++++++-------- devtools/client/commandline/test/helpers.js | 28 +-- .../test/mochitest/browser_dbg_cmd-break.js | 30 +-- 5 files changed, 147 insertions(+), 133 deletions(-) diff --git a/devtools/client/commandline/test/browser_cmd_csscoverage_startstop.js b/devtools/client/commandline/test/browser_cmd_csscoverage_startstop.js index e61801234f22..2bdb86d8667c 100644 --- a/devtools/client/commandline/test/browser_cmd_csscoverage_startstop.js +++ b/devtools/client/commandline/test/browser_cmd_csscoverage_startstop.js @@ -37,17 +37,18 @@ function* navigate(usage, options) { ok(usage.isRunning(), "csscoverage is running"); - let load1Promise = helpers.listenOnce(options.browser, "load", true); + // Load page 1. + options.browser.loadURI(PAGE_1); + // And wait until page 1 and page 2 (an iframe inside page 1) are both loaded. + yield Promise.all([ + BrowserTestUtils.browserLoaded(options.browser, false, PAGE_1), + BrowserTestUtils.browserLoaded(options.browser, true, PAGE_2) + ]); + is(options.browser.currentURI.spec, PAGE_1, "page 1 loaded"); - yield helpers.navigate(PAGE_1, options); - - // Wait for the test pages to auto-cycle - yield load1Promise; - is(options.window.location.href, PAGE_1, "page 1 loaded"); - - // Page 2 is a frame in page 1. JS in the page navigates to page 3. - yield helpers.listenOnce(options.browser, "load", true); - is(options.window.location.href, PAGE_3, "page 3 loaded"); + // page 2 has JS that navigates to page 3 after a timeout. + yield BrowserTestUtils.browserLoaded(options.browser, false, PAGE_3); + is(options.browser.currentURI.spec, PAGE_3, "page 3 loaded"); let toolboxReady = gDevTools.once("toolbox-ready"); diff --git a/devtools/client/commandline/test/browser_cmd_media.js b/devtools/client/commandline/test/browser_cmd_media.js index 360401642af8..559370add633 100644 --- a/devtools/client/commandline/test/browser_cmd_media.js +++ b/devtools/client/commandline/test/browser_cmd_media.js @@ -43,11 +43,12 @@ var tests = { exec: { output: "" }, - post: function () { - let body = options.window.document.body; - let style = options.window.getComputedStyle(body); - is(style.backgroundColor, "rgb(255, 255, 0)", "media correctly emulated"); - } + post: Task.async(function* () { + yield ContentTask.spawn(options.browser, {}, function* () { + let color = content.getComputedStyle(content.document.body).backgroundColor; + is(color, "rgb(255, 255, 0)", "media correctly emulated"); + }); + }) } ]); }, @@ -63,11 +64,12 @@ var tests = { exec: { output: "" }, - post: function () { - let body = options.window.document.body; - let style = options.window.getComputedStyle(body); - is(style.backgroundColor, "rgb(255, 255, 255)", "media reset"); - } + post: Task.async(function* () { + yield ContentTask.spawn(options.browser, {}, function* () { + let color = content.getComputedStyle(content.document.body).backgroundColor; + is(color, "rgb(255, 255, 255)", "media reset"); + }); + }) } ]); } diff --git a/devtools/client/commandline/test/browser_cmd_pagemod_export.js b/devtools/client/commandline/test/browser_cmd_pagemod_export.js index 7127e9cf5d60..c1053a065376 100644 --- a/devtools/client/commandline/test/browser_cmd_pagemod_export.js +++ b/devtools/client/commandline/test/browser_cmd_pagemod_export.js @@ -14,19 +14,29 @@ function* spawnTest() { let options = yield helpers.openTab(TEST_URI); yield helpers.openToolbar(options); - const documentElement = options.document.documentElement; - const initialHtml = documentElement.innerHTML; + function getHTML() { + return ContentTask.spawn(options.browser, {}, function* () { + return content.document.documentElement.innerHTML; + }); + } + + const initialHtml = yield getHTML(); + function resetContent() { - options.document.documentElement.innerHTML = initialHtml; + return ContentTask.spawn(options.browser, initialHtml, function* (html) { + content.document.documentElement.innerHTML = html; + }); } // Test exporting HTML - let oldOpen = options.window.open; - let openURL = ""; - options.window.open = function (url) { - // The URL is a data: URL that contains the document source - openURL = decodeURIComponent(url); - }; + yield ContentTask.spawn(options.browser, {}, function* () { + content.wrappedJSObject.oldOpen = content.open; + content.wrappedJSObject.openURL = ""; + content.wrappedJSObject.open = function (url) { + // The URL is a data: URL that contains the document source + content.wrappedJSObject.openURL = decodeURIComponent(url); + }; + }); yield helpers.audit(options, [ { @@ -41,11 +51,14 @@ function* spawnTest() { exec: { output: "" }, - post: function () { - isnot(openURL.indexOf(''), -1, "export html works: "); - isnot(openURL.indexOf("GCLI"), -1, "export html works: <title>"); - isnot(openURL.indexOf('<p id="someid">#'), -1, "export html works: <p>"); - } + post: Task.async(function* () { + yield ContentTask.spawn(options.browser, {}, function* () { + let openURL = content.wrappedJSObject.openURL; + isnot(openURL.indexOf('<html lang="en">'), -1, "export html works: <html>"); + isnot(openURL.indexOf("<title>GCLI"), -1, "export html works: <title>"); + isnot(openURL.indexOf('<p id="someid">#'), -1, "export html works: <p>"); + }); + }) }, { setup: "export html stdout", @@ -68,8 +81,11 @@ function* spawnTest() { } ]); - options.window.open = oldOpen; - oldOpen = undefined; + yield ContentTask.spawn(options.browser, {}, function* () { + content.wrappedJSObject.open = content.wrappedJSObject.oldOpen; + delete content.wrappedJSObject.openURL; + delete content.wrappedJSObject.oldOpen; + }); // Test 'pagemod replace' yield helpers.audit(options, [ @@ -114,82 +130,84 @@ function* spawnTest() { exec: { output: /^[^:]+: 13\. [^:]+: 0\. [^:]+: 0\.\s*$/ }, - post: function () { - is(documentElement.innerHTML, initialHtml, "no change in the page"); - } + post: Task.async(function* () { + let html = yield getHTML(); + is(html, initialHtml, "no change in the page"); + }) }, { setup: "pagemod replace sOme foOBar true", exec: { output: /^[^:]+: 13\. [^:]+: 2\. [^:]+: 2\.\s*$/ }, - post: function () { - let html = documentElement.innerHTML; + post: Task.async(function* () { + let html = yield getHTML(); isnot(html.indexOf('<p class="foOBarclass">.foOBarclass'), -1, ".someclass changed to .foOBarclass"); isnot(html.indexOf('<p id="foOBarid">#foOBarid'), -1, "#someid changed to #foOBarid"); - resetContent(); - } + yield resetContent(); + }) }, { setup: "pagemod replace some foobar --contentOnly", exec: { output: /^[^:]+: 13\. [^:]+: 2\. [^:]+: 0\.\s*$/ }, - post: function () { - let html = documentElement.innerHTML; + post: Task.async(function* () { + let html = yield getHTML(); isnot(html.indexOf('<p class="someclass">.foobarclass'), -1, ".someclass changed to .foobarclass (content only)"); isnot(html.indexOf('<p id="someid">#foobarid'), -1, "#someid changed to #foobarid (content only)"); - resetContent(); - } + yield resetContent(); + }) }, { setup: "pagemod replace some foobar --attrOnly", exec: { output: /^[^:]+: 13\. [^:]+: 0\. [^:]+: 2\.\s*$/ }, - post: function () { - let html = documentElement.innerHTML; + post: Task.async(function* () { + let html = yield getHTML(); isnot(html.indexOf('<p class="foobarclass">.someclass'), -1, ".someclass changed to .foobarclass (attr only)"); isnot(html.indexOf('<p id="foobarid">#someid'), -1, "#someid changed to #foobarid (attr only)"); - resetContent(); - } + yield resetContent(); + }) }, { setup: "pagemod replace some foobar --root head", exec: { output: /^[^:]+: 2\. [^:]+: 0\. [^:]+: 0\.\s*$/ }, - post: function () { - is(documentElement.innerHTML, initialHtml, "nothing changed"); - } + post: Task.async(function* () { + let html = yield getHTML(); + is(html, initialHtml, "nothing changed"); + }) }, { setup: "pagemod replace some foobar --selector .someclass,div,span", exec: { output: /^[^:]+: 4\. [^:]+: 1\. [^:]+: 1\.\s*$/ }, - post: function () { - let html = documentElement.innerHTML; + post: Task.async(function* () { + let html = yield getHTML(); isnot(html.indexOf('<p class="foobarclass">.foobarclass'), -1, ".someclass changed to .foobarclass"); isnot(html.indexOf('<p id="someid">#someid'), -1, "#someid did not change"); - resetContent(); - } + yield resetContent(); + }) }, ]); @@ -227,56 +245,58 @@ function* spawnTest() { exec: { output: /^[^:]+: 3\. [^:]+: 3\.\s*$/ }, - post: function () { - let html = documentElement.innerHTML; + post: Task.async(function* () { + let html = yield getHTML(); is(html.indexOf('<p class="someclass">'), -1, "p.someclass removed"); is(html.indexOf('<p id="someid">'), -1, "p#someid removed"); is(html.indexOf("<p><strong>"), -1, "<p> wrapping <strong> removed"); isnot(html.indexOf("<span>"), -1, "<span> not removed"); - resetContent(); - } + yield resetContent(); + }) }, { setup: "pagemod remove element p head", exec: { output: /^[^:]+: 0\. [^:]+: 0\.\s*$/ }, - post: function () { - is(documentElement.innerHTML, initialHtml, "nothing changed in the page"); - } + post: Task.async(function* () { + let html = yield getHTML(); + is(html, initialHtml, "nothing changed in the page"); + }) }, { setup: "pagemod remove element p --ifEmptyOnly", exec: { output: /^[^:]+: 3\. [^:]+: 0\.\s*$/ }, - post: function () { - is(documentElement.innerHTML, initialHtml, "nothing changed in the page"); - } + post: Task.async(function* () { + let html = yield getHTML(); + is(html, initialHtml, "nothing changed in the page"); + }) }, { setup: "pagemod remove element meta,title --ifEmptyOnly", exec: { output: /^[^:]+: 2\. [^:]+: 1\.\s*$/ }, - post: function () { - let html = documentElement.innerHTML; + post: Task.async(function* () { + let html = yield getHTML(); is(html.indexOf("<meta charset="), -1, "<meta> removed"); isnot(html.indexOf("<title>"), -1, "<title> not removed"); - resetContent(); - } + yield resetContent(); + }) }, { setup: "pagemod remove element p --stripOnly", exec: { output: /^[^:]+: 3\. [^:]+: 3\.\s*$/ }, - post: function () { - let html = documentElement.innerHTML; + post: Task.async(function* () { + let html = yield getHTML(); is(html.indexOf('<p class="someclass">'), -1, "p.someclass removed"); is(html.indexOf('<p id="someid">'), -1, "p#someid removed"); @@ -285,8 +305,8 @@ function* spawnTest() { isnot(html.indexOf("#someid"), -1, "#someid still exists"); isnot(html.indexOf("<strong>p"), -1, "<strong> still exists"); - resetContent(); - } + yield resetContent(); + }) }, ]); @@ -334,55 +354,60 @@ function* spawnTest() { exec: { output: /^[^:]+: 0\. [^:]+: 0\.\s*$/ }, - post: function () { - is(documentElement.innerHTML, initialHtml, "nothing changed in the page"); - } + post: Task.async(function* () { + let html = yield getHTML(); + is(html, initialHtml, "nothing changed in the page"); + }) }, { setup: "pagemod remove attribute foo p", exec: { output: /^[^:]+: 3\. [^:]+: 0\.\s*$/ }, - post: function () { - is(documentElement.innerHTML, initialHtml, "nothing changed in the page"); - } + post: Task.async(function* () { + let html = yield getHTML(); + is(html, initialHtml, "nothing changed in the page"); + }) }, { setup: "pagemod remove attribute id p,span", exec: { output: /^[^:]+: 5\. [^:]+: 1\.\s*$/ }, - post: function () { - is(documentElement.innerHTML.indexOf('<p id="someid">#someid'), -1, - "p#someid attribute removed"); - isnot(documentElement.innerHTML.indexOf("<p>#someid"), -1, - "p with someid content still exists"); + post: Task.async(function* () { + let html = yield getHTML(); - resetContent(); - } + is(html.indexOf('<p id="someid">#someid'), -1, "p#someid attribute removed"); + isnot(html.indexOf("<p>#someid"), -1, "p with someid content still exists"); + + yield resetContent(); + }) }, { setup: "pagemod remove attribute Class p", exec: { output: /^[^:]+: 3\. [^:]+: 0\.\s*$/ }, - post: function () { - is(documentElement.innerHTML, initialHtml, "nothing changed in the page"); - } + post: Task.async(function* () { + let html = yield getHTML(); + is(html, initialHtml, "nothing changed in the page"); + }) }, { setup: "pagemod remove attribute Class p --ignoreCase", exec: { output: /^[^:]+: 3\. [^:]+: 1\.\s*$/ }, - post: function () { - is(documentElement.innerHTML.indexOf('<p class="someclass">.someclass'), -1, + post: Task.async(function* () { + let html = yield getHTML(); + + is(html.indexOf('<p class="someclass">.someclass'), -1, "p.someclass attribute removed"); - isnot(documentElement.innerHTML.indexOf("<p>.someclass"), -1, + isnot(html.indexOf("<p>.someclass"), -1, "p with someclass content still exists"); - resetContent(); - } + yield resetContent(); + }) }, ]); diff --git a/devtools/client/commandline/test/helpers.js b/devtools/client/commandline/test/helpers.js index 61d1f44d20b4..83c29f1ae63f 100644 --- a/devtools/client/commandline/test/helpers.js +++ b/devtools/client/commandline/test/helpers.js @@ -107,7 +107,6 @@ var { helpers, assert } = (function () { * - tab: The new XUL tab element, as returned by gBrowser.addTab() * - target: The debug target as defined by the devtools framework * - browser: The XUL browser element for the given tab - * - window: Content window for the created tab. a.k.a 'content' in mochitest * - isFirefox: Always true. Allows test sharing with GCLI * * Normally addTab will create an options object containing the values as @@ -133,9 +132,6 @@ var { helpers, assert } = (function () { options.target = TargetFactory.forTab(options.tab); var loaded = helpers.listenOnce(options.browser, "load", true).then(function (ev) { - options.document = options.browser.contentDocument; - options.window = options.document.defaultView; - var reply = callback.call(null, options); return Promise.resolve(reply).then(null, function (error) { @@ -143,9 +139,6 @@ var { helpers, assert } = (function () { }).then(function () { tabbrowser.removeTab(options.tab); - delete options.window; - delete options.document; - delete options.target; delete options.browser; delete options.tab; @@ -168,8 +161,6 @@ var { helpers, assert } = (function () { * - tab * - browser * - target - * - document - * - window * @return A promise which resolves to the options object when the 'load' event * happens on the new tab */ @@ -197,9 +188,6 @@ var { helpers, assert } = (function () { helpers.closeTab = function (options) { options.chromeWindow.gBrowser.removeTab(options.tab); - delete options.window; - delete options.document; - delete options.target; delete options.browser; delete options.tab; @@ -234,7 +222,7 @@ var { helpers, assert } = (function () { /** * Navigate the current tab to a URL */ - helpers.navigate = function (url, options) { + helpers.navigate = Task.async(function* (url, options) { options = options || {}; options.chromeWindow = options.chromeWindow || window; options.tab = options.tab || options.chromeWindow.gBrowser.selectedTab; @@ -242,16 +230,12 @@ var { helpers, assert } = (function () { var tabbrowser = options.chromeWindow.gBrowser; options.browser = tabbrowser.getBrowserForTab(options.tab); - var promise = helpers.listenOnce(options.browser, "load", true).then(function () { - options.document = options.browser.contentDocument; - options.window = options.document.defaultView; - return options; - }); + let onLoaded = BrowserTestUtils.browserLoaded(options.browser); + options.browser.loadURI(url); + yield onLoaded; - options.browser.contentWindow.location = url; - - return promise; - }; + return options; + }); /** * Undo the effects of |helpers.openToolbar| diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_cmd-break.js b/devtools/client/debugger/test/mochitest/browser_dbg_cmd-break.js index 97ded62bccb2..121bc5e998ef 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_cmd-break.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_cmd-break.js @@ -53,23 +53,25 @@ function test() { yield helpers.audit(aOptions, [{ name: "open toolbox", - setup: function () { - return initDebugger(gBrowser.selectedTab).then(([aTab, aDebuggee, aPanel]) => { - // Spin the event loop before causing the debuggee to pause, to allow - // this function to return first. - executeSoon(() => aDebuggee.firstCall()); + setup: Task.async(function* () { + let [aTab, aDebuggee, aPanel] = yield initDebugger(gBrowser.selectedTab); - return waitForSourceAndCaretAndScopes(aPanel, ".html", 1).then(() => { - gPanel = aPanel; - gDebugger = gPanel.panelWin; - gThreadClient = gPanel.panelWin.gThreadClient; - gLineNumber = "" + aOptions.window.wrappedJSObject.gLineNumber; - gSources = gDebugger.DebuggerView.Sources; + // Spin the event loop before causing the debuggee to pause, to allow this + // function to return first. + executeSoon(() => aDebuggee.firstCall()); - expectedActorObj.value = getSourceActor(gSources, TAB_URL); - }); + yield waitForSourceAndCaretAndScopes(aPanel, ".html", 1); + + gPanel = aPanel; + gDebugger = gPanel.panelWin; + gThreadClient = gPanel.panelWin.gThreadClient; + gLineNumber = yield ContentTask.spawn(aOptions.browser, {}, function* () { + return "" + content.wrappedJSObject.gLineNumber; }); - }, + gSources = gDebugger.DebuggerView.Sources; + + expectedActorObj.value = getSourceActor(gSources, TAB_URL); + }), post: function () { ok(gThreadClient, "Debugger client exists."); is(gLineNumber, 14, "gLineNumber is correct."); From 692fc7c09339043292fa1b53867931ae7fd5a831 Mon Sep 17 00:00:00 2001 From: Lin Clark <lclark@mozilla.com> Date: Tue, 20 Sep 2016 11:37:00 -0700 Subject: [PATCH 073/101] Bug 1294517 - Part 1: convert test to use Enzyme MozReview-Commit-ID: QhvwujTmhv --- .../test/components/console-api-call.test.js | 52 ++++++++----------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js index 220ac0195dba..000e1de6f515 100644 --- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js @@ -4,10 +4,13 @@ // Test utils. const expect = require("expect"); -const { renderComponent } = require("devtools/client/webconsole/new-console-output/test/helpers"); +const { render } = require("enzyme"); + +// React +const { createFactory } = require("devtools/client/shared/vendor/react"); // Components under test. -const { ConsoleApiCall } = require("devtools/client/webconsole/new-console-output/components/message-types/console-api-call"); +const ConsoleApiCall = createFactory(require("devtools/client/webconsole/new-console-output/components/message-types/console-api-call").ConsoleApiCall); // Test fakes. const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); @@ -17,64 +20,51 @@ describe("ConsoleAPICall component:", () => { describe("console.log", () => { it("renders string grips", () => { const message = stubPreparedMessages.get("console.log('foobar', 'test')"); - const rendered = renderComponent(ConsoleApiCall, {message, onViewSourceInDebugger}); + const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); - const messageBody = getMessageBody(rendered); // @TODO should output: foobar test - expect(messageBody.textContent).toBe("\"foobar\"\"test\""); - - const consoleStringNodes = messageBody.querySelectorAll(".objectBox-string"); - expect(consoleStringNodes.length).toBe(2); + expect(wrapper.find(".message-body").text()).toBe("\"foobar\"\"test\""); + expect(wrapper.find(".objectBox-string").length).toBe(2); + expect(wrapper.find("div.message.cm-s-mozilla span span.message-flex-body span.message-body.devtools-monospace").length).toBe(1); }); + it("renders repeat node", () => { const message = stubPreparedMessages.get("console.log('foobar', 'test')") .set("repeat", 107); - const rendered = renderComponent(ConsoleApiCall, {message, onViewSourceInDebugger}); + const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); - const repeatNode = getRepeatNode(rendered); - expect(repeatNode[0].textContent).toBe("107"); + expect(wrapper.find(".message-repeats").text()).toBe("107"); + + expect(wrapper.find("span > span.message-flex-body > span.message-body.devtools-monospace + span.message-repeats").length).toBe(1); }); }); describe("console.count", () => { it("renders", () => { const message = stubPreparedMessages.get("console.count('bar')"); - const rendered = renderComponent(ConsoleApiCall, {message, onViewSourceInDebugger}); + const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); - const messageBody = getMessageBody(rendered); - expect(messageBody.textContent).toBe(message.messageText); + expect(wrapper.find(".message-body").text()).toBe("bar: 1"); }); }); describe("console.time", () => { it("does not show anything", () => { const message = stubPreparedMessages.get("console.time('bar')"); - const rendered = renderComponent(ConsoleApiCall, {message, onViewSourceInDebugger}); + const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); - const messageBody = getMessageBody(rendered); - expect(messageBody.textContent).toBe(""); + expect(wrapper.find(".message-body").text()).toBe(""); }); }); describe("console.timeEnd", () => { it("renders as expected", () => { const message = stubPreparedMessages.get("console.timeEnd('bar')"); - const rendered = renderComponent(ConsoleApiCall, {message, onViewSourceInDebugger}); + const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); - const messageBody = getMessageBody(rendered); - expect(messageBody.textContent).toBe(message.messageText); - expect(messageBody.textContent).toMatch(/^bar: \d+(\.\d+)?ms$/); + expect(wrapper.find(".message-body").text()).toBe(message.messageText); + expect(wrapper.find(".message-body").text()).toMatch(/^bar: \d+(\.\d+)?ms$/); }); }); }); - -function getMessageBody(rendered) { - const queryPath = "div.message.cm-s-mozilla span span.message-flex-body span.message-body.devtools-monospace"; - return rendered.querySelector(queryPath); -} - -function getRepeatNode(rendered) { - const repeatPath = "span > span.message-flex-body > span.message-body.devtools-monospace + span.message-repeats"; - return rendered.querySelectorAll(repeatPath); -} From 8ae00aeda4dd22179e7d066a31207bfc42dc15b9 Mon Sep 17 00:00:00 2001 From: Lin Clark <lclark@mozilla.com> Date: Tue, 20 Sep 2016 11:37:00 -0700 Subject: [PATCH 074/101] Bug 1294517 - Part 2: New console frontend: Add tests for console.trace(). r=bgrins MozReview-Commit-ID: 9sldZfh4PLY --- .../test/components/console-api-call.test.js | 23 +++ .../test/store/messages.test.js | 178 ++++++++++-------- 2 files changed, 121 insertions(+), 80 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js index 000e1de6f515..054b8d50f7fa 100644 --- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js @@ -16,6 +16,8 @@ const ConsoleApiCall = createFactory(require("devtools/client/webconsole/new-con const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); const onViewSourceInDebugger = () => {}; +const tempfilePath = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js"; + describe("ConsoleAPICall component:", () => { describe("console.log", () => { it("renders string grips", () => { @@ -67,4 +69,25 @@ describe("ConsoleAPICall component:", () => { expect(wrapper.find(".message-body").text()).toMatch(/^bar: \d+(\.\d+)?ms$/); }); }); + + describe("console.trace", () => { + it("renders", () => { + const message = stubPreparedMessages.get("console.trace()"); + const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); + + expect(wrapper.find(".message-body").text()).toBe("console.trace()"); + + const frameLinks = wrapper.find(`.stack-trace span.frame-link[data-url='${tempfilePath}']`); + expect(frameLinks.length).toBe(3); + + expect(frameLinks.eq(0).find(".frame-link-function-display-name").text()).toBe("bar"); + expect(frameLinks.eq(0).find(".frame-link-filename").text()).toBe(tempfilePath); + + expect(frameLinks.eq(1).find(".frame-link-function-display-name").text()).toBe("foo"); + expect(frameLinks.eq(1).find(".frame-link-filename").text()).toBe(tempfilePath); + + expect(frameLinks.eq(2).find(".frame-link-function-display-name").text()).toBe("triggerPacket"); + expect(frameLinks.eq(2).find(".frame-link-filename").text()).toBe(tempfilePath); + }); + }); }); diff --git a/devtools/client/webconsole/new-console-output/test/store/messages.test.js b/devtools/client/webconsole/new-console-output/test/store/messages.test.js index caf83b630181..1d5f88e1718f 100644 --- a/devtools/client/webconsole/new-console-output/test/store/messages.test.js +++ b/devtools/client/webconsole/new-console-output/test/store/messages.test.js @@ -2,8 +2,10 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -const { getAllMessages } = require("devtools/client/webconsole/new-console-output/selectors/messages"); -const { getRepeatId } = require("devtools/client/webconsole/new-console-output/utils/messages"); +const { + getAllMessages, + getAllMessagesUiById, +} = require("devtools/client/webconsole/new-console-output/selectors/messages"); const { setupActions, setupStore @@ -19,90 +21,106 @@ describe("Message reducer:", () => { actions = setupActions(); }); - it("adds a message to an empty store", () => { - const { dispatch, getState } = setupStore([]); + describe("messagesById", () => { + it("adds a message to an empty store", () => { + const { dispatch, getState } = setupStore([]); - const packet = stubPackets.get("console.log('foobar', 'test')"); - const message = stubPreparedMessages.get("console.log('foobar', 'test')"); - dispatch(actions.messageAdd(packet)); - - const messages = getAllMessages(getState()); - - expect(messages.first()).toEqual(message); - }); - - it("increments repeat on a repeating message", () => { - const { dispatch, getState } = setupStore([ - "console.log('foobar', 'test')", - "console.log('foobar', 'test')" - ]); - - const packet = stubPackets.get("console.log('foobar', 'test')"); - dispatch(actions.messageAdd(packet)); - dispatch(actions.messageAdd(packet)); - - const messages = getAllMessages(getState()); - - expect(messages.size).toBe(1); - expect(messages.first().repeat).toBe(4); - }); - - it("does not clobber a unique message", () => { - const { dispatch, getState } = setupStore([ - "console.log('foobar', 'test')", - "console.log('foobar', 'test')" - ]); - - const packet = stubPackets.get("console.log('foobar', 'test')"); - dispatch(actions.messageAdd(packet)); - - const packet2 = stubPackets.get("console.log(undefined)"); - dispatch(actions.messageAdd(packet2)); - - const messages = getAllMessages(getState()); - - expect(messages.size).toBe(2); - expect(messages.first().repeat).toBe(3); - expect(messages.last().repeat).toBe(1); - }); - - it("clears the store in response to console.clear()", () => { - const { dispatch, getState } = setupStore([ - "console.log('foobar', 'test')", - "console.log(undefined)" - ]); - - dispatch(actions.messageAdd(stubPackets.get("console.clear()"))); - - const messages = getAllMessages(getState()); - - expect(messages.size).toBe(1); - expect(messages.first().parameters[0]).toBe("Console was cleared."); - }); - - it("limits the number of messages displayed", () => { - const { dispatch, getState } = setupStore([]); - - const logLimit = 1000; - const packet = stubPackets.get("console.log(undefined)"); - for (let i = 1; i <= logLimit + 1; i++) { - packet.message.arguments = [`message num ${i}`]; + const packet = stubPackets.get("console.log('foobar', 'test')"); + const message = stubPreparedMessages.get("console.log('foobar', 'test')"); dispatch(actions.messageAdd(packet)); - } - const messages = getAllMessages(getState()); - expect(messages.count()).toBe(logLimit); - expect(messages.first().parameters[0]).toBe(`message num 2`); - expect(messages.last().parameters[0]).toBe(`message num ${logLimit + 1}`); + const messages = getAllMessages(getState()); + + expect(messages.first()).toEqual(message); + }); + + it("increments repeat on a repeating message", () => { + const { dispatch, getState } = setupStore([ + "console.log('foobar', 'test')", + "console.log('foobar', 'test')" + ]); + + const packet = stubPackets.get("console.log('foobar', 'test')"); + dispatch(actions.messageAdd(packet)); + dispatch(actions.messageAdd(packet)); + + const messages = getAllMessages(getState()); + + expect(messages.size).toBe(1); + expect(messages.first().repeat).toBe(4); + }); + + it("does not clobber a unique message", () => { + const { dispatch, getState } = setupStore([ + "console.log('foobar', 'test')", + "console.log('foobar', 'test')" + ]); + + const packet = stubPackets.get("console.log('foobar', 'test')"); + dispatch(actions.messageAdd(packet)); + + const packet2 = stubPackets.get("console.log(undefined)"); + dispatch(actions.messageAdd(packet2)); + + const messages = getAllMessages(getState()); + + expect(messages.size).toBe(2); + expect(messages.first().repeat).toBe(3); + expect(messages.last().repeat).toBe(1); + }); + + it("clears the store in response to console.clear()", () => { + const { dispatch, getState } = setupStore([ + "console.log('foobar', 'test')", + "console.log(undefined)" + ]); + + dispatch(actions.messageAdd(stubPackets.get("console.clear()"))); + + const messages = getAllMessages(getState()); + + expect(messages.size).toBe(1); + expect(messages.first().parameters[0]).toBe("Console was cleared."); + }); + + it("limits the number of messages displayed", () => { + const { dispatch, getState } = setupStore([]); + + const logLimit = 1000; + const packet = stubPackets.get("console.log(undefined)"); + for (let i = 1; i <= logLimit + 1; i++) { + packet.message.arguments = [`message num ${i}`]; + dispatch(actions.messageAdd(packet)); + } + + const messages = getAllMessages(getState()); + expect(messages.count()).toBe(logLimit); + expect(messages.first().parameters[0]).toBe(`message num 2`); + expect(messages.last().parameters[0]).toBe(`message num ${logLimit + 1}`); + }); + + it("does not add null messages to the store", () => { + const { dispatch, getState } = setupStore([]); + + const message = stubPackets.get("console.time('bar')"); + dispatch(actions.messageAdd(message)); + + const messages = getAllMessages(getState()); + expect(messages.size).toBe(0); + }); }); - it("does not add null messages to the store", () => { - const { dispatch, getState } = setupStore([]); + describe("messagesUiById", () => { + it("opens console.trace messages when they are added", () => { + const { dispatch, getState } = setupStore([]); - const message = stubPackets.get("console.time('bar')"); - dispatch(actions.messageAdd(message)); + const message = stubPackets.get("console.trace()"); + dispatch(actions.messageAdd(message)); - const messages = getAllMessages(getState()); - expect(messages.size).toBe(0); + const messages = getAllMessages(getState()); + const messagesUi = getAllMessagesUiById(getState()); + expect(messagesUi.size).toBe(1); + expect(messagesUi.first()).toBe(messages.first().id); + }); }); }); From 0ceff99404c08f4f9e7926e60a7d9d0ff9935e42 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe <chevobbe.nicolas@gmail.com> Date: Tue, 20 Sep 2016 11:37:00 -0700 Subject: [PATCH 075/101] Bug 1299668 - Clear all messages data in state when clearing messagesById;r=linclark MozReview-Commit-ID: kOMl0KiUkG --- .../new-console-output/actions/messages.js | 21 ++++-- .../new-console-output/reducers/messages.js | 9 ++- .../webconsole/new-console-output/store.js | 9 ++- .../test/actions/messages.test.js | 64 +++++++++++-------- .../test/store/messages.test.js | 34 ++++++++-- devtools/client/webconsole/package.json | 1 + 6 files changed, 91 insertions(+), 47 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/actions/messages.js b/devtools/client/webconsole/new-console-output/actions/messages.js index 59044ff6065c..4db49edcc114 100644 --- a/devtools/client/webconsole/new-console-output/actions/messages.js +++ b/devtools/client/webconsole/new-console-output/actions/messages.js @@ -16,19 +16,26 @@ const { MESSAGES_CLEAR, MESSAGE_OPEN, MESSAGE_CLOSE, + MESSAGE_TYPE, } = require("../constants"); const defaultIdGenerator = new IdGenerator(); function messageAdd(packet, idGenerator = null) { - if (idGenerator == null) { - idGenerator = defaultIdGenerator; - } - let message = prepareMessage(packet, idGenerator); + return (dispatch) => { + if (idGenerator == null) { + idGenerator = defaultIdGenerator; + } + let message = prepareMessage(packet, idGenerator); - return { - type: MESSAGE_ADD, - message + if (message.type === MESSAGE_TYPE.CLEAR) { + dispatch(messagesClear()); + } + + dispatch({ + type: MESSAGE_ADD, + message + }); }; } diff --git a/devtools/client/webconsole/new-console-output/reducers/messages.js b/devtools/client/webconsole/new-console-output/reducers/messages.js index 622096c9ba58..df8c741966d9 100644 --- a/devtools/client/webconsole/new-console-output/reducers/messages.js +++ b/devtools/client/webconsole/new-console-output/reducers/messages.js @@ -25,10 +25,6 @@ function messages(state = new MessageState(), action) { return state; } - if (newMessage.type === constants.MESSAGE_TYPE.CLEAR) { - return state.set("messagesById", Immutable.List([newMessage])); - } - if (newMessage.allowRepeating && messagesById.size > 0) { let lastMessage = messagesById.last(); if (lastMessage.repeatId === newMessage.repeatId) { @@ -47,7 +43,10 @@ function messages(state = new MessageState(), action) { } }); case constants.MESSAGES_CLEAR: - return state.set("messagesById", Immutable.List()); + return state.withMutations(function (record) { + record.set("messagesById", Immutable.List()); + record.set("messagesUiById", Immutable.List()); + }); case constants.MESSAGE_OPEN: return state.set("messagesUiById", messagesUiById.push(action.id)); case constants.MESSAGE_CLOSE: diff --git a/devtools/client/webconsole/new-console-output/store.js b/devtools/client/webconsole/new-console-output/store.js index 2e5bf60e4ca0..4165a9b771a4 100644 --- a/devtools/client/webconsole/new-console-output/store.js +++ b/devtools/client/webconsole/new-console-output/store.js @@ -5,7 +5,8 @@ const {FilterState} = require("devtools/client/webconsole/new-console-output/reducers/filters"); const {PrefState} = require("devtools/client/webconsole/new-console-output/reducers/prefs"); -const { combineReducers, createStore } = require("devtools/client/shared/vendor/redux"); +const { applyMiddleware, combineReducers, createStore } = require("devtools/client/shared/vendor/redux"); +const { thunk } = require("devtools/client/shared/redux/middleware/thunk"); const { reducers } = require("./reducers/index"); const Services = require("Services"); @@ -22,7 +23,11 @@ function configureStore() { }) }; - return createStore(combineReducers(reducers), initialState); + return createStore( + combineReducers(reducers), + initialState, + applyMiddleware(thunk) + ); } // Provide the store factory for test code so that each test is working with diff --git a/devtools/client/webconsole/new-console-output/test/actions/messages.test.js b/devtools/client/webconsole/new-console-output/test/actions/messages.test.js index 6f9d0020efc8..4bb175cfa29b 100644 --- a/devtools/client/webconsole/new-console-output/test/actions/messages.test.js +++ b/devtools/client/webconsole/new-console-output/test/actions/messages.test.js @@ -2,52 +2,60 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; +const { thunk } = require("devtools/client/shared/redux/middleware/thunk"); +const configureStore = require("redux-mock-store"); const { getRepeatId } = require("devtools/client/webconsole/new-console-output/utils/messages"); -const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); +const { stubPackets, stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); const { setupActions } = require("devtools/client/webconsole/new-console-output/test/helpers"); const constants = require("devtools/client/webconsole/new-console-output/constants"); +const mockStore = configureStore([ thunk ]); + const expect = require("expect"); let actions; describe("Message actions:", () => { - before(()=>{ + beforeEach(()=>{ actions = setupActions(); }); describe("messageAdd", () => { - it("creates expected action given a packet", () => { - const packet = { - "from": "server1.conn4.child1/consoleActor2", - "type": "consoleAPICall", - "message": { - "arguments": [ - "foobar", - "test" - ], - "columnNumber": 27, - "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", - "functionName": "", - "groupName": "", - "level": "log", - "lineNumber": 1, - "private": false, - "styles": [], - "timeStamp": 1455064271115, - "timer": null, - "workerType": "none", - "category": "webdev" - } - }; - const action = actions.messageAdd(packet); + it("dispatches expected action given a packet", () => { + const packet = stubPackets.get("console.log('foobar', 'test')"); + const store = mockStore({}); + store.dispatch(actions.messageAdd(packet)); + + const expectedActions = store.getActions(); + expect(expectedActions.length).toEqual(1); + + const addAction = expectedActions[0]; + const {message} = addAction; const expected = { type: constants.MESSAGE_ADD, message: stubPreparedMessages.get("console.log('foobar', 'test')") }; + expect(message.toJS()).toEqual(expected.message.toJS()); + }); - expect(action.message.toJS()).toEqual(expected.message.toJS()); + it("dispatches expected actions given a console.clear packet", () => { + const packet = stubPackets.get("console.clear()"); + const store = mockStore({}); + store.dispatch(actions.messageAdd(packet)); + + const expectedActions = store.getActions(); + expect(expectedActions.length).toEqual(2); + + const [clearAction, addAction] = expectedActions; + expect(clearAction.type).toEqual(constants.MESSAGES_CLEAR); + + const {message} = addAction; + const expected = { + type: constants.MESSAGE_ADD, + message: stubPreparedMessages.get("console.clear()") + }; + expect(addAction.type).toEqual(constants.MESSAGE_ADD); + expect(message.toJS()).toEqual(expected.message.toJS()); }); }); diff --git a/devtools/client/webconsole/new-console-output/test/store/messages.test.js b/devtools/client/webconsole/new-console-output/test/store/messages.test.js index 1d5f88e1718f..d2f353620b1f 100644 --- a/devtools/client/webconsole/new-console-output/test/store/messages.test.js +++ b/devtools/client/webconsole/new-console-output/test/store/messages.test.js @@ -69,11 +69,8 @@ describe("Message reducer:", () => { expect(messages.last().repeat).toBe(1); }); - it("clears the store in response to console.clear()", () => { - const { dispatch, getState } = setupStore([ - "console.log('foobar', 'test')", - "console.log(undefined)" - ]); + it("adds a message in response to console.clear()", () => { + const { dispatch, getState } = setupStore([]); dispatch(actions.messageAdd(stubPackets.get("console.clear()"))); @@ -83,6 +80,18 @@ describe("Message reducer:", () => { expect(messages.first().parameters[0]).toBe("Console was cleared."); }); + it("clears the messages list in response to MESSAGES_CLEAR action", () => { + const { dispatch, getState } = setupStore([ + "console.log('foobar', 'test')", + "console.log(undefined)" + ]); + + dispatch(actions.messagesClear()); + + const messages = getAllMessages(getState()); + expect(messages.size).toBe(0); + }); + it("limits the number of messages displayed", () => { const { dispatch, getState } = setupStore([]); @@ -122,5 +131,20 @@ describe("Message reducer:", () => { expect(messagesUi.size).toBe(1); expect(messagesUi.first()).toBe(messages.first().id); }); + + it("clears the messages UI list in response to MESSAGES_CLEAR action", () => { + const { dispatch, getState } = setupStore([ + "console.log('foobar', 'test')", + "console.log(undefined)" + ]); + + const traceMessage = stubPackets.get("console.trace()"); + dispatch(actions.messageAdd(traceMessage)); + + dispatch(actions.messagesClear()); + + const messagesUi = getAllMessagesUiById(getState()); + expect(messagesUi.size).toBe(0); + }); }); }); diff --git a/devtools/client/webconsole/package.json b/devtools/client/webconsole/package.json index b03da8cabcec..23280aba1492 100644 --- a/devtools/client/webconsole/package.json +++ b/devtools/client/webconsole/package.json @@ -10,6 +10,7 @@ "jsdom": "^9.4.1", "jsdom-global": "^2.0.0", "mocha": "^2.5.3", + "redux-mock-store": "^1.1.4", "require-hacker": "^2.1.4", "sinon": "^1.17.5" }, From f3be091eca19b8ac280061fec34ae6d723c928ed Mon Sep 17 00:00:00 2001 From: steveck-chung <schung@mozilla.com> Date: Tue, 20 Sep 2016 11:37:01 -0700 Subject: [PATCH 076/101] Bug 1300058 - Part 1: Handle incoming network event packets. r=linclark MozReview-Commit-ID: 6Dmeb6wbIGi --- .../new-console-output/utils/messages.js | 15 +++++++++++++++ devtools/client/webconsole/webconsole.js | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/devtools/client/webconsole/new-console-output/utils/messages.js b/devtools/client/webconsole/new-console-output/utils/messages.js index 61c32f7cdb86..2a64cf41db28 100644 --- a/devtools/client/webconsole/new-console-output/utils/messages.js +++ b/devtools/client/webconsole/new-console-output/utils/messages.js @@ -131,6 +131,18 @@ function transformPacket(packet) { }); } + case "networkEvent": { + let { networkEvent } = packet; + + // TODO: Replace the ConsoleMessage with NetworkEventMessage + // once the new component is ready. + return new ConsoleMessage({ + source: MESSAGE_SOURCE.CONSOLE_API, + type: MESSAGE_TYPE.LOG, + level: MESSAGE_LEVEL.LOG, + messageText: networkEvent.request.method + " " + networkEvent.request.url, + }); + } case "evaluationResult": default: { let { result } = packet; @@ -165,6 +177,9 @@ function convertCachedPacket(packet) { } else if ("_navPayload" in packet) { convertPacket.type = "navigationMessage"; convertPacket.message = packet; + } else if (packet._type === "NetworkEvent") { + convertPacket.networkEvent = packet; + convertPacket.type = "networkEvent"; } else { throw new Error("Unexpected packet type"); } diff --git a/devtools/client/webconsole/webconsole.js b/devtools/client/webconsole/webconsole.js index e21ee3b39190..011470d26d2a 100644 --- a/devtools/client/webconsole/webconsole.js +++ b/devtools/client/webconsole/webconsole.js @@ -3378,6 +3378,10 @@ WebConsoleConnectionProxy.prototype = { */ _onNetworkEvent: function (type, networkInfo) { if (this.webConsoleFrame) { + if (this.webConsoleFrame.NEW_CONSOLE_OUTPUT_ENABLED) { + this.dispatchMessageAdd(networkInfo); + return; + } this.webConsoleFrame.handleNetworkEvent(networkInfo); } }, From 87ae40f9cfb7c1806dbab1a7a361493b4b1d5f0f Mon Sep 17 00:00:00 2001 From: Ricky Chien <rickychien@users.noreply.github.com> Date: Tue, 20 Sep 2016 11:37:01 -0700 Subject: [PATCH 077/101] Bug 1300057 - New console frontend: Add support for console.assert(). r=linclark MozReview-Commit-ID: DXFAcjrWY6X --- .../message-types/console-api-call.js | 29 ++-- .../test/components/console-api-call.test.js | 9 ++ .../new-console-output/test/fixtures/L10n.js | 4 + .../fixtures/stub-generators/stub-snippets.js | 1 + .../test/fixtures/stubs/consoleApi.js | 144 +++++++++++++++--- 5 files changed, 156 insertions(+), 31 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js index c05c41381e3f..ccc860d7fb3e 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js @@ -18,7 +18,7 @@ const GripMessageBody = createFactory(require("devtools/client/webconsole/new-co const MessageRepeat = createFactory(require("devtools/client/webconsole/new-console-output/components/message-repeat").MessageRepeat); const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon); const CollapseButton = createFactory(require("devtools/client/webconsole/new-console-output/components/collapse-button").CollapseButton); -const {l10n} = require("devtools/client/webconsole/new-console-output/utils/messages"); +const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages"); const actions = require("devtools/client/webconsole/new-console-output/actions/messages"); ConsoleApiCall.displayName = "ConsoleApiCall"; @@ -32,19 +32,22 @@ ConsoleApiCall.propTypes = { function ConsoleApiCall(props) { const { dispatch, message, sourceMapService, onViewSourceInDebugger, open } = props; - const {source, level, stacktrace, type, frame } = message; + const { source, level, stacktrace, type, frame, parameters } = message; let messageBody; if (type === "trace") { - messageBody = dom.span({className: "cm-variable"}, "console.trace()"); - } else if (message.parameters) { - messageBody = message.parameters.map((grip, key) => GripMessageBody({grip, key})); + messageBody = dom.span({ className: "cm-variable" }, "console.trace()"); + } else if (type === "assert") { + let reps = parameters.map((grip, key) => GripMessageBody({ grip, key })); + messageBody = dom.span({ className: "cm-variable" }, "Assertion failed: ", reps); + } else if (parameters) { + messageBody = parameters.map((grip, key) => GripMessageBody({ grip, key })); } else { messageBody = message.messageText; } - const icon = MessageIcon({level}); - const repeat = MessageRepeat({repeat: message.repeat}); + const icon = MessageIcon({ level }); + const repeat = MessageRepeat({ repeat: message.repeat }); const shouldRenderFrame = frame && frame.source !== "debugger eval code"; const location = dom.span({ className: "message-location devtools-monospace" }, shouldRenderFrame ? FrameView({ @@ -58,7 +61,7 @@ function ConsoleApiCall(props) { let collapse = ""; let attachment = ""; if (stacktrace) { - attachment = dom.div({className: "stacktrace devtools-monospace"}, + attachment = dom.div({ className: "stacktrace devtools-monospace" }, StackTrace({ stacktrace: stacktrace, onViewSourceInDebugger: onViewSourceInDebugger @@ -92,16 +95,14 @@ function ConsoleApiCall(props) { classes.push("open"); } - return dom.div({ - className: classes.join(" ") - }, + return dom.div({ className: classes.join(" ") }, // @TODO add timestamp // @TODO add indent if necessary icon, collapse, - dom.span({className: "message-body-wrapper"}, - dom.span({className: "message-flex-body"}, - dom.span({className: "message-body devtools-monospace"}, + dom.span({ className: "message-body-wrapper" }, + dom.span({ className: "message-flex-body" }, + dom.span({ className: "message-body devtools-monospace" }, messageBody ), repeat, diff --git a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js index 054b8d50f7fa..5263e638b9f9 100644 --- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js @@ -51,6 +51,15 @@ describe("ConsoleAPICall component:", () => { }); }); + describe("console.assert", () => { + it("renders", () => { + const message = stubPreparedMessages.get("console.assert(false, {message: 'foobar'})"); + const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); + + expect(wrapper.find(".message-body").text()).toBe("Assertion failed: Object { message: \"foobar\" }"); + }); + }); + describe("console.time", () => { it("does not show anything", () => { const message = stubPreparedMessages.get("console.time('bar')"); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js b/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js index 31883989b9c4..dcdbfe90a5be 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js @@ -14,6 +14,10 @@ class L10n { } return str; } + + getFormatStr(str) { + return this.getStr(str); + } } module.exports = L10n; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js index 92b2df4d41ff..51ea4eea284e 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js @@ -13,6 +13,7 @@ const consoleApiCommands = [ "console.log(null)", "console.clear()", "console.count('bar')", + "console.assert(false, {message: 'foobar'})" ]; let consoleApi = new Map(consoleApiCommands.map( diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js index 98d55ef56ba6..2642b47b3c69 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js @@ -158,6 +158,55 @@ stubPreparedMessages.set("console.count('bar')", new ConsoleMessage({ } })); +stubPreparedMessages.set("console.assert(false, {message: 'foobar'})", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "assert", + "level": "error", + "messageText": null, + "parameters": [ + { + "type": "object", + "actor": "server1.conn7.child1/obj29", + "class": "Object", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 1, + "preview": { + "kind": "Object", + "ownProperties": { + "message": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "foobar" + } + }, + "ownPropertiesLength": 1, + "safeGetterValues": {} + } + } + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"assert\",\"level\":\"error\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn7.child1/obj29\",\"class\":\"Object\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":1,\"preview\":{\"kind\":\"Object\",\"ownProperties\":{\"message\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"foobar\"}},\"ownPropertiesLength\":1,\"safeGetterValues\":{}}}],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":27,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":1}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "stacktrace": [ + { + "columnNumber": 27, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "functionName": "triggerPacket", + "language": 2, + "lineNumber": 1 + } + ], + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "line": 1, + "column": 27 + } +})); + stubPreparedMessages.set("console.trace()", new ConsoleMessage({ "id": "1", "allowRepeating": true, @@ -222,10 +271,10 @@ stubPreparedMessages.set("console.timeEnd('bar')", new ConsoleMessage({ "source": "console-api", "type": "timeEnd", "level": "log", - "messageText": "bar: 2.01ms", + "messageText": "bar: 2.96ms", "parameters": null, "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"timeEnd\",\"level\":\"log\",\"messageText\":\"bar: 2.01ms\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":1}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"timeEnd\",\"level\":\"log\",\"messageText\":\"bar: 2.96ms\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":1}}", "stacktrace": null, "frame": { "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", @@ -260,7 +309,7 @@ stubPackets.set("console.log('foobar', 'test')", { }, "private": false, "styles": [], - "timeStamp": 1471885545204, + "timeStamp": 1472787300416, "timer": null, "workerType": "none", "category": "webdev" @@ -293,7 +342,7 @@ stubPackets.set("console.log(undefined)", { }, "private": false, "styles": [], - "timeStamp": 1471885546075, + "timeStamp": 1472787301216, "timer": null, "workerType": "none", "category": "webdev" @@ -324,7 +373,7 @@ stubPackets.set("console.warn('danger, will robinson!')", { }, "private": false, "styles": [], - "timeStamp": 1471885546795, + "timeStamp": 1472787301959, "timer": null, "workerType": "none", "category": "webdev" @@ -357,7 +406,7 @@ stubPackets.set("console.log(NaN)", { }, "private": false, "styles": [], - "timeStamp": 1471885547605, + "timeStamp": 1472787302818, "timer": null, "workerType": "none", "category": "webdev" @@ -390,7 +439,7 @@ stubPackets.set("console.log(null)", { }, "private": false, "styles": [], - "timeStamp": 1471885548414, + "timeStamp": 1472787303791, "timer": null, "workerType": "none", "category": "webdev" @@ -418,7 +467,7 @@ stubPackets.set("console.clear()", { "userContextId": 0 }, "private": false, - "timeStamp": 1471885549077, + "timeStamp": 1472787304607, "timer": null, "workerType": "none", "styles": [], @@ -452,7 +501,7 @@ stubPackets.set("console.count('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1471885549791, + "timeStamp": 1472787305395, "timer": null, "workerType": "none", "styles": [], @@ -460,9 +509,70 @@ stubPackets.set("console.count('bar')", { } }); -stubPackets.set("console.trace()", { +stubPackets.set("console.assert(false, {message: 'foobar'})", { "from": "server1.conn7.child1/consoleActor2", "type": "consoleAPICall", + "message": { + "arguments": [ + { + "type": "object", + "actor": "server1.conn7.child1/obj29", + "class": "Object", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 1, + "preview": { + "kind": "Object", + "ownProperties": { + "message": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "foobar" + } + }, + "ownPropertiesLength": 1, + "safeGetterValues": {} + } + } + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "functionName": "triggerPacket", + "groupName": "", + "level": "assert", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "signedPkg": "", + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1472787306558, + "timer": null, + "stacktrace": [ + { + "columnNumber": 27, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "functionName": "triggerPacket", + "language": 2, + "lineNumber": 1 + } + ], + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.trace()", { + "from": "server1.conn8.child1/consoleActor2", + "type": "consoleAPICall", "message": { "arguments": [], "columnNumber": 3, @@ -481,7 +591,7 @@ stubPackets.set("console.trace()", { "userContextId": 0 }, "private": false, - "timeStamp": 1471885551114, + "timeStamp": 1472787307887, "timer": null, "stacktrace": [ { @@ -513,7 +623,7 @@ stubPackets.set("console.trace()", { }); stubPackets.set("console.time('bar')", { - "from": "server1.conn8.child1/consoleActor2", + "from": "server1.conn9.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [ @@ -535,10 +645,10 @@ stubPackets.set("console.time('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1471885552201, + "timeStamp": 1472787308764, "timer": { "name": "bar", - "started": 970.09 + "started": 726.395 }, "workerType": "none", "styles": [], @@ -547,7 +657,7 @@ stubPackets.set("console.time('bar')", { }); stubPackets.set("console.timeEnd('bar')", { - "from": "server1.conn8.child1/consoleActor2", + "from": "server1.conn9.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [ @@ -569,9 +679,9 @@ stubPackets.set("console.timeEnd('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1471885552203, + "timeStamp": 1472787308767, "timer": { - "duration": 2.0149999999999864, + "duration": 2.9600000000000364, "name": "bar" }, "workerType": "none", From cfca21105339336e27c07cab5f641c528ef82d0d Mon Sep 17 00:00:00 2001 From: Lin Clark <lclark@mozilla.com> Date: Tue, 20 Sep 2016 11:37:01 -0700 Subject: [PATCH 078/101] Bug 1300494 - New console frontend: Fix rep spacing for console. r=Honza MozReview-Commit-ID: LKikTgd3DgT --- devtools/client/shared/components/reps/grip.js | 2 +- devtools/client/shared/components/reps/object.js | 2 +- devtools/client/shared/components/reps/stylesheet.js | 2 +- .../test/components/evaluation-result.test.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/devtools/client/shared/components/reps/grip.js b/devtools/client/shared/components/reps/grip.js index e6b8e187b908..44cc39ad0329 100644 --- a/devtools/client/shared/components/reps/grip.js +++ b/devtools/client/shared/components/reps/grip.js @@ -34,7 +34,7 @@ define(function (require, exports, module) { if (this.props.objectLink) { return this.props.objectLink({ object: object - }, object.class + " "); + }, object.class); } return object.class || "Object"; }, diff --git a/devtools/client/shared/components/reps/object.js b/devtools/client/shared/components/reps/object.js index c58e6a305ffa..9ff3e908c1ba 100644 --- a/devtools/client/shared/components/reps/object.js +++ b/devtools/client/shared/components/reps/object.js @@ -30,7 +30,7 @@ define(function (require, exports, module) { if (this.props.objectLink) { return this.props.objectLink({ object: object - }, object.class + " "); + }, object.class); } return "Object"; }, diff --git a/devtools/client/shared/components/reps/stylesheet.js b/devtools/client/shared/components/reps/stylesheet.js index 77372deece88..c1fc7f1be219 100644 --- a/devtools/client/shared/components/reps/stylesheet.js +++ b/devtools/client/shared/components/reps/stylesheet.js @@ -32,7 +32,7 @@ define(function (require, exports, module) { return DOM.span({className: "objectBox"}, this.props.objectLink({ object: grip - }, title + " ") + }, title) ); } return title; diff --git a/devtools/client/webconsole/new-console-output/test/components/evaluation-result.test.js b/devtools/client/webconsole/new-console-output/test/components/evaluation-result.test.js index ba0ee34a4bbf..72b8abe63861 100644 --- a/devtools/client/webconsole/new-console-output/test/components/evaluation-result.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/evaluation-result.test.js @@ -20,7 +20,7 @@ describe("EvaluationResult component:", () => { const rendered = renderComponent(EvaluationResult, props); const messageBody = getMessageBody(rendered); - expect(messageBody.textContent).toBe("Date1970-01-01T00:00:00.000Z"); + expect(messageBody.textContent).toBe("Date 1970-01-01T00:00:00.000Z"); }); }); From e3fda8e4e8e2945a93d0a41e82c6fe2bd417d391 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe <chevobbe.nicolas@gmail.com> Date: Tue, 20 Sep 2016 11:37:01 -0700 Subject: [PATCH 079/101] Bug 1300510 - New console frontend: Add a default value for the open prop. r=linclark MozReview-Commit-ID: KwhFDDPpNzJ --- .../new-console-output/components/message-container.js | 6 ++++++ .../components/message-types/console-api-call.js | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/devtools/client/webconsole/new-console-output/components/message-container.js b/devtools/client/webconsole/new-console-output/components/message-container.js index 344e86193bd3..03a43a5ab9d3 100644 --- a/devtools/client/webconsole/new-console-output/components/message-container.js +++ b/devtools/client/webconsole/new-console-output/components/message-container.js @@ -36,6 +36,12 @@ const MessageContainer = createClass({ open: PropTypes.bool.isRequired, }, + getDefaultProps: function () { + return { + open: false + }; + }, + shouldComponentUpdate(nextProps, nextState) { return this.props.message.repeat !== nextProps.message.repeat || this.props.open !== nextProps.open; diff --git a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js index ccc860d7fb3e..baa5535f0610 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js @@ -30,6 +30,10 @@ ConsoleApiCall.propTypes = { open: PropTypes.bool.isRequired, }; +ConsoleApiCall.defaultProps = { + open: false +}; + function ConsoleApiCall(props) { const { dispatch, message, sourceMapService, onViewSourceInDebugger, open } = props; const { source, level, stacktrace, type, frame, parameters } = message; From 1d878678d3293ac294ce010816955205f023c186 Mon Sep 17 00:00:00 2001 From: Lin Clark <lclark@mozilla.com> Date: Tue, 20 Sep 2016 11:37:01 -0700 Subject: [PATCH 080/101] Bug 1301695 Part 1: Use files in page error stub generation. r=nchevobbe MozReview-Commit-ID: HEDt7ZeLYnl --- ...ser_webconsole_update_stubs_console_api.js | 5 ++- ...wser_webconsole_update_stubs_page_error.js | 11 +++--- .../test/fixtures/stub-generators/head.js | 2 ++ .../fixtures/stub-generators/stub-snippets.js | 15 +++++--- .../test/fixtures/stubs/pageError.js | 36 ++++++++++--------- 5 files changed, 39 insertions(+), 30 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js index be9367d350b8..7c375a3b89a7 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js @@ -16,9 +16,8 @@ let stubs = { }; add_task(function* () { - let tempFilePath = OS.Path.join(`${BASE_PATH}/stub-generators`, "test-tempfile.js"); for (var [key, {keys, code}] of snippets) { - OS.File.writeAtomic(tempFilePath, `function triggerPacket() {${code}}`); + OS.File.writeAtomic(TEMP_FILE_PATH, `function triggerPacket() {${code}}`); let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); let hud = toolbox.getCurrentPanel().hud; let {ui} = hud; @@ -45,5 +44,5 @@ add_task(function* () { } let filePath = OS.Path.join(`${BASE_PATH}/stubs`, "consoleApi.js"); OS.File.writeAtomic(filePath, formatFile(stubs)); - OS.File.writeAtomic(tempFilePath, ""); + OS.File.writeAtomic(TEMP_FILE_PATH, ""); }); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js index 7298d345f024..c41cd2b731b2 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js @@ -6,7 +6,7 @@ "use strict"; Cu.import("resource://gre/modules/osfile.jsm"); -const TEST_URI = "data:text/html;charset=utf-8,stub generation"; +const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html"; const { pageError: snippets} = require("devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js"); @@ -20,6 +20,7 @@ add_task(function* () { ok(true, "make the test not fail"); for (var [key,code] of snippets) { + OS.File.writeAtomic(TEMP_FILE_PATH, `${code}`); let received = new Promise(resolve => { toolbox.target.client.addListener("pageError", function onPacket(e, packet) { toolbox.target.client.removeListener("pageError", onPacket); @@ -32,13 +33,8 @@ add_task(function* () { }); }); - info("Injecting script: " + code); - yield ContentTask.spawn(gBrowser.selectedBrowser, code, function(code) { - let container = content.document.createElement("script"); - content.document.body.appendChild(container); - container.textContent = code; - content.document.body.removeChild(container); + content.wrappedJSObject.location.reload(); }); yield received; @@ -46,4 +42,5 @@ add_task(function* () { let filePath = OS.Path.join(`${BASE_PATH}/stubs`, "pageError.js"); OS.File.writeAtomic(filePath, formatFile(stubs)); + OS.File.writeAtomic(TEMP_FILE_PATH, ""); }); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js index f80439b4d5c3..34a4297bfe71 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js @@ -20,6 +20,8 @@ registerCleanupFunction(() => { const { prepareMessage } = require("devtools/client/webconsole/new-console-output/utils/messages"); const BASE_PATH = "../../../../devtools/client/webconsole/new-console-output/test/fixtures"; +const TEMP_FILE_PATH = OS.Path.join(`${BASE_PATH}/stub-generators`, "test-tempfile.js"); + function formatPacket(key, packet) { return ` diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js index 51ea4eea284e..62ae7e99d860 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js @@ -49,11 +49,18 @@ let evaluationResult = new Map(evaluationResultCommands.map(cmd => [cmd, cmd])); // Page Error -const pageErrorCommands = [ - "asdf()", -]; +let pageError = new Map(); -let pageError = new Map(pageErrorCommands.map(cmd => [cmd, cmd])); +pageError.set("Reference Error", ` + function bar() { + asdf() + } + function foo() { + bar() + } + + foo() +`); module.exports = { consoleApi, diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js index 9c17a7ef9988..fcb592a23388 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js @@ -22,9 +22,13 @@ stubPreparedMessages.set("ReferenceError: asdf is not defined", new ConsoleMessa "messageText": "ReferenceError: asdf is not defined", "parameters": null, "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"log\",\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":null}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"log\",\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":5}}", "stacktrace": null, - "frame": null + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "line": 3, + "column": 5 + } })); @@ -35,12 +39,12 @@ stubPackets.set("ReferenceError: asdf is not defined", { "errorMessage": "ReferenceError: asdf is not defined", "errorMessageName": "JSMSG_NOT_DEFINED", "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default", - "sourceName": "data:text/html;charset=utf-8,stub%20generation", + "sourceName": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", "lineText": "", - "lineNumber": 1, - "columnNumber": 1, + "lineNumber": 3, + "columnNumber": 5, "category": "content javascript", - "timeStamp": 1471886066466, + "timeStamp": 1473429607183, "warning": false, "error": false, "exception": true, @@ -49,21 +53,21 @@ stubPackets.set("ReferenceError: asdf is not defined", { "private": false, "stacktrace": [ { - "filename": "data:text/html;charset=utf-8,stub%20generation", - "lineNumber": 1, - "columnNumber": 1, - "functionName": null + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 3, + "columnNumber": 5, + "functionName": "bar" }, { - "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js line 52 > eval", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", "lineNumber": 6, - "columnNumber": 7, - "functionName": null + "columnNumber": 5, + "functionName": "foo" }, { - "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js", - "lineNumber": 53, - "columnNumber": 20, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 9, + "columnNumber": 3, "functionName": null } ] From 0416b4a68ce0128871c066d8df25c5f0b51e3793 Mon Sep 17 00:00:00 2001 From: Lin Clark <lclark@mozilla.com> Date: Tue, 20 Sep 2016 11:37:02 -0700 Subject: [PATCH 081/101] Bug 1301695 Part 2: Convert page error test to enzyme. r=nchevobbe MozReview-Commit-ID: 4YVVv9m3VHh --- .../test/components/page-error.test.js | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js index 6828c8cb2cc5..2484b0fae096 100644 --- a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js @@ -2,27 +2,22 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); +// Test utils. +const expect = require("expect"); +const { render } = require("enzyme"); +// Components under test. const { PageError } = require("devtools/client/webconsole/new-console-output/components/message-types/page-error"); -const expect = require("expect"); - -const { - renderComponent -} = require("devtools/client/webconsole/new-console-output/test/helpers"); +// Test fakes. +const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); describe("PageError component:", () => { it("renders a page error", () => { const message = stubPreparedMessages.get("ReferenceError: asdf is not defined"); - const rendered = renderComponent(PageError, {message}); + const wrapper = render(PageError({ message })); - const messageBody = getMessageBody(rendered); - expect(messageBody.textContent).toBe("ReferenceError: asdf is not defined"); + expect(wrapper.find(".message-body").text()) + .toBe("ReferenceError: asdf is not defined"); }); }); - -function getMessageBody(rendered) { - const queryPath = "div.message span.message-body-wrapper span.message-body"; - return rendered.querySelector(queryPath); -} From 2f13c06726bba4cb538dcd8fbdd00abca3ca7e7e Mon Sep 17 00:00:00 2001 From: Lin Clark <lclark@mozilla.com> Date: Tue, 20 Sep 2016 11:37:02 -0700 Subject: [PATCH 082/101] Bug 1301695 Part 3: Add stacktrace to page error. r=nchevobbe MozReview-Commit-ID: 6u5dHjfIhpe --- .../components/collapse-button.js | 9 ++-- .../message-types/console-api-call.js | 20 ++++---- .../components/message-types/page-error.js | 46 +++++++++++++++++-- .../test/components/console-api-call.test.js | 2 +- .../test/components/page-error.test.js | 15 +++++- .../test/fixtures/stubs/pageError.js | 25 ++++++++-- .../new-console-output/utils/messages.js | 1 + 7 files changed, 96 insertions(+), 22 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/components/collapse-button.js b/devtools/client/webconsole/new-console-output/components/collapse-button.js index abb953136451..8859d2bfec22 100644 --- a/devtools/client/webconsole/new-console-output/components/collapse-button.js +++ b/devtools/client/webconsole/new-console-output/components/collapse-button.js @@ -13,17 +13,18 @@ const { PropTypes, } = require("devtools/client/shared/vendor/react"); +const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages"); + const CollapseButton = createClass({ displayName: "CollapseButton", propTypes: { open: PropTypes.bool.isRequired, - title: PropTypes.string.isRequired, }, render: function () { - const { title, open, onClick } = this.props; + const { open, onClick } = this.props; let classes = ["theme-twisty"]; @@ -33,8 +34,8 @@ const CollapseButton = createClass({ return dom.a({ className: classes.join(" "), - onClick: onClick, - title + onClick, + title: l10n.getStr("messageToggleDetails"), }); } }); diff --git a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js index baa5535f0610..3367e5d8e05d 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js @@ -18,7 +18,6 @@ const GripMessageBody = createFactory(require("devtools/client/webconsole/new-co const MessageRepeat = createFactory(require("devtools/client/webconsole/new-console-output/components/message-repeat").MessageRepeat); const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon); const CollapseButton = createFactory(require("devtools/client/webconsole/new-console-output/components/collapse-button").CollapseButton); -const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages"); const actions = require("devtools/client/webconsole/new-console-output/actions/messages"); ConsoleApiCall.displayName = "ConsoleApiCall"; @@ -27,7 +26,7 @@ ConsoleApiCall.propTypes = { message: PropTypes.object.isRequired, sourceMapService: PropTypes.object, onViewSourceInDebugger: PropTypes.func.isRequired, - open: PropTypes.bool.isRequired, + open: PropTypes.bool, }; ConsoleApiCall.defaultProps = { @@ -65,16 +64,17 @@ function ConsoleApiCall(props) { let collapse = ""; let attachment = ""; if (stacktrace) { - attachment = dom.div({ className: "stacktrace devtools-monospace" }, - StackTrace({ - stacktrace: stacktrace, - onViewSourceInDebugger: onViewSourceInDebugger - }) - ); + if (open) { + attachment = dom.div({ className: "stacktrace devtools-monospace" }, + StackTrace({ + stacktrace: stacktrace, + onViewSourceInDebugger: onViewSourceInDebugger + }) + ); + } collapse = CollapseButton({ - open: open, - title: l10n.getStr("messageToggleDetails"), + open, onClick: function () { if (open) { dispatch(actions.messageClose(message.id)); diff --git a/devtools/client/webconsole/new-console-output/components/message-types/page-error.js b/devtools/client/webconsole/new-console-output/components/message-types/page-error.js index fd8e8cf21d65..2fc6f8137317 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/page-error.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/page-error.js @@ -13,18 +13,27 @@ const { PropTypes } = require("devtools/client/shared/vendor/react"); const FrameView = createFactory(require("devtools/client/shared/components/frame")); +const StackTrace = createFactory(require("devtools/client/shared/components/stack-trace")); +const CollapseButton = createFactory(require("devtools/client/webconsole/new-console-output/components/collapse-button").CollapseButton); const MessageRepeat = createFactory(require("devtools/client/webconsole/new-console-output/components/message-repeat").MessageRepeat); const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon); +const actions = require("devtools/client/webconsole/new-console-output/actions/messages"); + PageError.displayName = "PageError"; PageError.propTypes = { message: PropTypes.object.isRequired, + open: PropTypes.bool, +}; + +PageError.defaultProps = { + open: false }; function PageError(props) { - const { message, sourceMapService, onViewSourceInDebugger } = props; - const { source, level, frame } = message; + const { dispatch, message, open, sourceMapService, onViewSourceInDebugger } = props; + const { source, level, stacktrace, frame } = message; const repeat = MessageRepeat({repeat: message.repeat}); const icon = MessageIcon({level}); @@ -38,6 +47,31 @@ function PageError(props) { }) : null ); + + let collapse = ""; + let attachment = ""; + if (stacktrace) { + if (open) { + attachment = dom.div({ className: "stacktrace devtools-monospace" }, + StackTrace({ + stacktrace: stacktrace, + onViewSourceInDebugger: onViewSourceInDebugger + }) + ); + } + + collapse = CollapseButton({ + open, + onClick: function () { + if (open) { + dispatch(actions.messageClose(message.id)); + } else { + dispatch(actions.messageOpen(message.id)); + } + }, + }); + } + const classes = ["message"]; if (source) { @@ -48,17 +82,23 @@ function PageError(props) { classes.push(level); } + if (open === true) { + classes.push("open"); + } + return dom.div({ className: classes.join(" ") }, icon, + collapse, dom.span({ className: "message-body-wrapper" }, dom.span({ className: "message-flex-body" }, dom.span({ className: "message-body devtools-monospace" }, message.messageText ), repeat - ) + ), + attachment ) ); } diff --git a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js index 5263e638b9f9..e2d2861dbb83 100644 --- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js @@ -82,7 +82,7 @@ describe("ConsoleAPICall component:", () => { describe("console.trace", () => { it("renders", () => { const message = stubPreparedMessages.get("console.trace()"); - const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); + const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger, open: true })); expect(wrapper.find(".message-body").text()).toBe("console.trace()"); diff --git a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js index 2484b0fae096..114c83d3335d 100644 --- a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js @@ -13,11 +13,24 @@ const { PageError } = require("devtools/client/webconsole/new-console-output/com const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); describe("PageError component:", () => { - it("renders a page error", () => { + it("renders", () => { const message = stubPreparedMessages.get("ReferenceError: asdf is not defined"); const wrapper = render(PageError({ message })); expect(wrapper.find(".message-body").text()) .toBe("ReferenceError: asdf is not defined"); + + // The stacktrace should be closed by default. + const frameLinks = wrapper.find(`.stack-trace`); + expect(frameLinks.length).toBe(0); + }); + + it("has a stacktrace which can be openned", () => { + const message = stubPreparedMessages.get("ReferenceError: asdf is not defined"); + const wrapper = render(PageError({ message, open: true })); + + // There should be three stacktrace items. + const frameLinks = wrapper.find(`.stack-trace span.frame-link`); + expect(frameLinks.length).toBe(3); }); }); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js index fcb592a23388..b61551c58a15 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js @@ -22,8 +22,27 @@ stubPreparedMessages.set("ReferenceError: asdf is not defined", new ConsoleMessa "messageText": "ReferenceError: asdf is not defined", "parameters": null, "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"log\",\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":5}}", - "stacktrace": null, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"log\",\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":[{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"lineNumber\":3,\"columnNumber\":5,\"functionName\":\"bar\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"lineNumber\":6,\"columnNumber\":5,\"functionName\":\"foo\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"lineNumber\":9,\"columnNumber\":3,\"functionName\":null}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":5}}", + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 3, + "columnNumber": 5, + "functionName": "bar" + }, + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 6, + "columnNumber": 5, + "functionName": "foo" + }, + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 9, + "columnNumber": 3, + "functionName": null + } + ], "frame": { "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", "line": 3, @@ -44,7 +63,7 @@ stubPackets.set("ReferenceError: asdf is not defined", { "lineNumber": 3, "columnNumber": 5, "category": "content javascript", - "timeStamp": 1473429607183, + "timeStamp": 1473431421453, "warning": false, "error": false, "exception": true, diff --git a/devtools/client/webconsole/new-console-output/utils/messages.js b/devtools/client/webconsole/new-console-output/utils/messages.js index 2a64cf41db28..6624723ca55d 100644 --- a/devtools/client/webconsole/new-console-output/utils/messages.js +++ b/devtools/client/webconsole/new-console-output/utils/messages.js @@ -127,6 +127,7 @@ function transformPacket(packet) { type: MESSAGE_TYPE.LOG, level, messageText: pageError.errorMessage, + stacktrace: pageError.stacktrace ? pageError.stacktrace : null, frame, }); } From e4907ba09eede619816eb84721d2a083038e1ab7 Mon Sep 17 00:00:00 2001 From: Lin Clark <lclark@mozilla.com> Date: Tue, 20 Sep 2016 11:37:02 -0700 Subject: [PATCH 083/101] Bug 1302515 - New console frontend: Update text filtering and expand text filter tests. r=bgrins MozReview-Commit-ID: GsdwVuXs1PS --- .../new-console-output/selectors/messages.js | 27 +++++-- .../fixtures/stub-generators/stub-snippets.js | 1 + .../test/fixtures/stubs/consoleApi.js | 53 ++++++++++++- .../test/store/filters.test.js | 77 ++++++++++++++----- 4 files changed, 133 insertions(+), 25 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/selectors/messages.js b/devtools/client/webconsole/new-console-output/selectors/messages.js index c191780a65a7..a1a7f792d8a5 100644 --- a/devtools/client/webconsole/new-console-output/selectors/messages.js +++ b/devtools/client/webconsole/new-console-output/selectors/messages.js @@ -42,14 +42,29 @@ function search(messages, text = "") { } return messages.filter(function (message) { - // @TODO: message.parameters can be a grip, see how we can handle that - if (!Array.isArray(message.parameters)) { + // Evaluation Results and Console Commands are never filtered. + if ([ MESSAGE_TYPE.RESULT, MESSAGE_TYPE.COMMAND ].includes(message.type)) { return true; } - return message - .parameters.join("") - .toLocaleLowerCase() - .includes(text.toLocaleLowerCase()); + + return ( + // @TODO currently we return true for any object grip. We should find a way to + // search object grips. + message.parameters !== null && !Array.isArray(message.parameters) + // Look for a match in location. + // @TODO Change this to Object.values once it's supported in Node's version of V8 + || Object.keys(message.frame) + .map(key => message.frame[key]) + .join(":") + .includes(text) + // Look for a match in messageText. + || (message.messageText !== null + && message.messageText.toLocaleLowerCase().includes(text.toLocaleLowerCase())) + // Look for a match in parameters. Currently only checks value grips. + || (message.parameters !== null + && message.parameters.join("").toLocaleLowerCase() + .includes(text.toLocaleLowerCase())) + ); }); } diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js index 62ae7e99d860..3fbfc1d30727 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js @@ -11,6 +11,7 @@ const consoleApiCommands = [ "console.warn('danger, will robinson!')", "console.log(NaN)", "console.log(null)", + "console.log('\u9f2c')", "console.clear()", "console.count('bar')", "console.assert(false, {message: 'foobar'})" diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js index 2642b47b3c69..9e1d015a51ea 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js @@ -120,6 +120,26 @@ stubPreparedMessages.set("console.log(null)", new ConsoleMessage({ } })); +stubPreparedMessages.set("console.log('鼬')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "鼬" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"鼬\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "line": 1, + "column": 27 + } +})); + stubPreparedMessages.set("console.clear()", new ConsoleMessage({ "id": "1", "allowRepeating": true, @@ -446,9 +466,40 @@ stubPackets.set("console.log(null)", { } }); -stubPackets.set("console.clear()", { +stubPackets.set("console.log('鼬')", { "from": "server1.conn5.child1/consoleActor2", "type": "consoleAPICall", + "message": { + "arguments": [ + "鼬" + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "signedPkg": "", + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1473786764817, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.clear()", { + "from": "server1.conn6.child1/consoleActor2", + "type": "consoleAPICall", "message": { "arguments": [], "columnNumber": 27, diff --git a/devtools/client/webconsole/new-console-output/test/store/filters.test.js b/devtools/client/webconsole/new-console-output/test/store/filters.test.js index 7ff5ed29b8d1..909d29ed660f 100644 --- a/devtools/client/webconsole/new-console-output/test/store/filters.test.js +++ b/devtools/client/webconsole/new-console-output/test/store/filters.test.js @@ -12,25 +12,16 @@ const { getAllMessages } = require("devtools/client/webconsole/new-console-outpu const { getAllFilters } = require("devtools/client/webconsole/new-console-output/selectors/filters"); const { setupStore } = require("devtools/client/webconsole/new-console-output/test/helpers"); const { MESSAGE_LEVEL } = require("devtools/client/webconsole/new-console-output/constants"); +const { stubPackets } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); describe("Filtering", () => { - const numMessages = 7; - const store = setupStore([ - // Console API - "console.log('foobar', 'test')", - "console.warn('danger, will robinson!')", - "console.log(undefined)", - "console.count('bar')", - // Evaluation Result - "new Date(0)", - // PageError - "ReferenceError: asdf is not defined" - ]); - // Console Command - store.dispatch(messageAdd(new ConsoleCommand({ messageText: `console.warn("x")` }))); + let store; + let numMessages; beforeEach(() => { + store = prepareBaseStore(); store.dispatch(actions.filtersClear()); + numMessages = getAllMessages(store.getState()).size; }); describe("Level filter", () => { @@ -38,7 +29,7 @@ describe("Filtering", () => { store.dispatch(actions.filterToggle(MESSAGE_LEVEL.LOG)); let messages = getAllMessages(store.getState()); - expect(messages.size).toEqual(numMessages - 2); + expect(messages.size).toEqual(numMessages - 3); }); it("filters debug messages", () => { @@ -71,9 +62,39 @@ describe("Filtering", () => { store.dispatch(actions.filterTextSet("danger")); let messages = getAllMessages(store.getState()); - // @TODO figure out what this should filter - // This does not filter out PageErrors, Evaluation Results or console commands - expect(messages.size).toEqual(5); + // This does not filter out Evaluation Results or console commands + expect(messages.size).toEqual(3); + }); + + it("matches unicode values", () => { + store.dispatch(actions.filterTextSet("鼬")); + + let messages = getAllMessages(store.getState()); + // This does not filter out Evaluation Results or console commands + expect(messages.size).toEqual(3); + }); + + it("matches locations", () => { + // Add a message with a different filename. + let locationMsg = + Object.assign({}, stubPackets.get("console.log('foobar', 'test')")); + locationMsg.message = + Object.assign({}, locationMsg.message, { filename: "search-location-test.js" }); + store.dispatch(messageAdd(locationMsg)); + + store.dispatch(actions.filterTextSet("search-location-test.js")); + + let messages = getAllMessages(store.getState()); + // This does not filter out Evaluation Results or console commands + expect(messages.size).toEqual(3); + }); + + it("restores all messages once text is cleared", () => { + store.dispatch(actions.filterTextSet("danger")); + store.dispatch(actions.filterTextSet("")); + + let messages = getAllMessages(store.getState()); + expect(messages.size).toEqual(numMessages); }); }); @@ -113,3 +134,23 @@ describe("Clear filters", () => { }); }); }); + +function prepareBaseStore() { + const store = setupStore([ + // Console API + "console.log('foobar', 'test')", + "console.warn('danger, will robinson!')", + "console.log(undefined)", + "console.count('bar')", + "console.log('鼬')", + // Evaluation Result - never filtered + "new Date(0)", + // PageError + "ReferenceError: asdf is not defined" + ]); + + // Console Command - never filtered + store.dispatch(messageAdd(new ConsoleCommand({ messageText: `console.warn("x")` }))); + + return store; +} From 3a4cc6de15c2303bd7e833d8931f86005210861d Mon Sep 17 00:00:00 2001 From: Ricky Chien <rickychien@users.noreply.github.com> Date: Tue, 20 Sep 2016 11:37:03 -0700 Subject: [PATCH 084/101] Bug 1300058 - New console frontend: Support network event messages. r=linclark MozReview-Commit-ID: BVc8zLjsKPm --- devtools/client/themes/webconsole.css | 4 + .../components/console-output.js | 15 +- .../components/message-container.js | 13 +- .../components/message-types/moz.build | 1 + .../message-types/network-event-message.js | 91 +++++++++ .../webconsole/new-console-output/main.js | 4 +- .../new-console-output-wrapper.js | 14 +- .../new-console-output/reducers/ui.js | 2 +- .../new-console-output/selectors/messages.js | 2 +- .../components/network-event-message.test.js | 65 ++++++ .../new-console-output/test/fixtures/L10n.js | 2 + .../test/fixtures/stub-generators/browser.ini | 3 + ...ser_webconsole_update_stubs_console_api.js | 3 +- ...r_webconsole_update_stubs_network_event.js | 47 +++++ .../test/fixtures/stub-generators/head.js | 32 ++- .../fixtures/stub-generators/stub-snippets.js | 28 +++ .../stub-generators/test-network-event.html | 11 ++ .../test/fixtures/stubs/index.js | 3 + .../test/fixtures/stubs/networkEvent.js | 186 ++++++++++++++++++ .../webconsole/new-console-output/types.js | 11 ++ .../new-console-output/utils/messages.js | 18 +- devtools/client/webconsole/webconsole.js | 7 +- 22 files changed, 535 insertions(+), 27 deletions(-) create mode 100644 devtools/client/webconsole/new-console-output/components/message-types/network-event-message.js create mode 100644 devtools/client/webconsole/new-console-output/test/components/network-event-message.test.js create mode 100644 devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_network_event.js create mode 100644 devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html create mode 100644 devtools/client/webconsole/new-console-output/test/fixtures/stubs/networkEvent.js diff --git a/devtools/client/themes/webconsole.css b/devtools/client/themes/webconsole.css index 05990abb0b48..2473d1464c30 100644 --- a/devtools/client/themes/webconsole.css +++ b/devtools/client/themes/webconsole.css @@ -711,3 +711,7 @@ a.learn-more-link.webconsole-learn-more-link { .webconsole-filterbar-primary .devtools-plaininput { flex: 1 1 100%; } + +.message.network .method { + margin-inline-end: 5px; +} diff --git a/devtools/client/webconsole/new-console-output/components/console-output.js b/devtools/client/webconsole/new-console-output/components/console-output.js index 79ed57989724..31273b5de526 100644 --- a/devtools/client/webconsole/new-console-output/components/console-output.js +++ b/devtools/client/webconsole/new-console-output/components/console-output.js @@ -20,8 +20,11 @@ const ConsoleOutput = createClass({ propTypes: { jsterm: PropTypes.object.isRequired, messages: PropTypes.object.isRequired, + messagesUi: PropTypes.object.isRequired, sourceMapService: PropTypes.object, onViewSourceInDebugger: PropTypes.func.isRequired, + openNetworkPanel: PropTypes.func.isRequired, + openLink: PropTypes.func.isRequired, }, displayName: "ConsoleOutput", @@ -46,10 +49,12 @@ const ConsoleOutput = createClass({ messages, messagesUi, sourceMapService, - onViewSourceInDebugger + onViewSourceInDebugger, + openNetworkPanel, + openLink, } = this.props; - let messageNodes = messages.map(function (message) { + let messageNodes = messages.map((message) => { return ( MessageContainer({ dispatch, @@ -57,7 +62,9 @@ const ConsoleOutput = createClass({ key: message.id, sourceMapService, onViewSourceInDebugger, - open: messagesUi.includes(message.id) + openNetworkPanel, + openLink, + open: messagesUi.includes(message.id), }) ); }); @@ -77,7 +84,7 @@ function isScrolledToBottom(outputNode, scrollNode) { function mapStateToProps(state) { return { messages: getAllMessages(state), - messagesUi: getAllMessagesUiById(state) + messagesUi: getAllMessagesUiById(state), }; } diff --git a/devtools/client/webconsole/new-console-output/components/message-container.js b/devtools/client/webconsole/new-console-output/components/message-container.js index 03a43a5ab9d3..8651127d0c3a 100644 --- a/devtools/client/webconsole/new-console-output/components/message-container.js +++ b/devtools/client/webconsole/new-console-output/components/message-container.js @@ -23,6 +23,7 @@ const componentMap = new Map([ ["ConsoleCommand", require("./message-types/console-command").ConsoleCommand], ["DefaultRenderer", require("./message-types/default-renderer").DefaultRenderer], ["EvaluationResult", require("./message-types/evaluation-result").EvaluationResult], + ["NetworkEventMessage", require("./message-types/network-event-message").NetworkEventMessage], ["PageError", require("./message-types/page-error").PageError] ]); @@ -33,6 +34,8 @@ const MessageContainer = createClass({ message: PropTypes.object.isRequired, sourceMapService: PropTypes.object, onViewSourceInDebugger: PropTypes.func.isRequired, + openNetworkPanel: PropTypes.func.isRequired, + openLink: PropTypes.func.isRequired, open: PropTypes.bool.isRequired, }, @@ -53,7 +56,9 @@ const MessageContainer = createClass({ message, sourceMapService, onViewSourceInDebugger, - open + openNetworkPanel, + openLink, + open, } = this.props; let MessageComponent = createFactory(getMessageComponent(message)); @@ -62,7 +67,9 @@ const MessageContainer = createClass({ message, sourceMapService, onViewSourceInDebugger, - open + openNetworkPanel, + openLink, + open, }); } }); @@ -71,6 +78,8 @@ function getMessageComponent(message) { switch (message.source) { case MESSAGE_SOURCE.CONSOLE_API: return componentMap.get("ConsoleApiCall"); + case MESSAGE_SOURCE.NETWORK: + return componentMap.get("NetworkEventMessage"); case MESSAGE_SOURCE.JAVASCRIPT: switch (message.type) { case MESSAGE_TYPE.COMMAND: diff --git a/devtools/client/webconsole/new-console-output/components/message-types/moz.build b/devtools/client/webconsole/new-console-output/components/message-types/moz.build index d7f8dbfd746b..9b9f720171d7 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/moz.build +++ b/devtools/client/webconsole/new-console-output/components/message-types/moz.build @@ -8,5 +8,6 @@ DevToolsModules( 'console-command.js', 'default-renderer.js', 'evaluation-result.js', + 'network-event-message.js', 'page-error.js', ) diff --git a/devtools/client/webconsole/new-console-output/components/message-types/network-event-message.js b/devtools/client/webconsole/new-console-output/components/message-types/network-event-message.js new file mode 100644 index 000000000000..cfc8fe69b8d3 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/components/message-types/network-event-message.js @@ -0,0 +1,91 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* 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/. */ + +"use strict"; + +// React & Redux +const { + createFactory, + DOM: dom, + PropTypes +} = require("devtools/client/shared/vendor/react"); +const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon); +const CollapseButton = createFactory(require("devtools/client/webconsole/new-console-output/components/collapse-button").CollapseButton); +const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages"); +const actions = require("devtools/client/webconsole/new-console-output/actions/messages"); + +NetworkEventMessage.displayName = "NetworkEventMessage"; + +NetworkEventMessage.propTypes = { + message: PropTypes.object.isRequired, + openNetworkPanel: PropTypes.func.isRequired, + // @TODO: openLink will be used for mixed-content handling + openLink: PropTypes.func.isRequired, + open: PropTypes.bool.isRequired, +}; + +function NetworkEventMessage(props) { + const { dispatch, message, openNetworkPanel, open } = props; + const { actor, source, level, request, response, isXHR, totalTime } = message; + let { method, url } = request; + let { httpVersion, status, statusText } = response; + + let classes = ["message", "cm-s-mozilla"]; + + if (source) { + classes.push(source); + } + + if (level) { + classes.push(level); + } + + if (open) { + classes.push("open"); + } + + let statusInfo = "[]"; + + // @TODO: Status will be enabled after NetworkUpdateEvent packet arrives + if (httpVersion && status && statusText && totalTime) { + statusInfo = `[${httpVersion} ${status} ${statusText} ${totalTime}ms]`; + } + + let xhr = l10n.getStr("webConsoleXhrIndicator"); + + function onUrlClick() { + openNetworkPanel(actor); + } + + return dom.div({ className: classes.join(" ") }, + // @TODO add timestamp + // @TODO add indent if necessary + MessageIcon({ level }), + CollapseButton({ + open, + title: l10n.getStr("messageToggleDetails"), + onClick: () => { + if (open) { + dispatch(actions.messageClose(message.id)); + } else { + dispatch(actions.messageOpen(message.id)); + } + }, + }), + dom.span({ + className: "message-body-wrapper message-body devtools-monospace", + "aria-haspopup": "true" + }, + dom.span({ className: "method" }, method), + isXHR ? dom.span({ className: "xhr" }, xhr) : null, + dom.a({ className: "url", title: url, onClick: onUrlClick }, + url.replace(/\?.+/, "")), + dom.a({ className: "status" }, statusInfo) + ) + ); +} + +module.exports.NetworkEventMessage = NetworkEventMessage; diff --git a/devtools/client/webconsole/new-console-output/main.js b/devtools/client/webconsole/new-console-output/main.js index 9079c7052ab7..8c3d7c3a338d 100644 --- a/devtools/client/webconsole/new-console-output/main.js +++ b/devtools/client/webconsole/new-console-output/main.js @@ -18,7 +18,7 @@ const NewConsoleOutputWrapper = BrowserLoader({ baseURI: "resource://devtools/client/webconsole/new-console-output/", window: this}).require("./new-console-output-wrapper"); -this.NewConsoleOutput = function (parentNode, jsterm, toolbox) { +this.NewConsoleOutput = function (parentNode, jsterm, toolbox, owner) { console.log("Creating NewConsoleOutput", parentNode, NewConsoleOutputWrapper); - return new NewConsoleOutputWrapper(parentNode, jsterm, toolbox); + return new NewConsoleOutputWrapper(parentNode, jsterm, toolbox, owner); }; diff --git a/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js b/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js index d02abb2adb71..ea4d340f3dc2 100644 --- a/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js +++ b/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js @@ -16,7 +16,7 @@ const FilterBar = React.createFactory(require("devtools/client/webconsole/new-co const store = configureStore(); -function NewConsoleOutputWrapper(parentNode, jsterm, toolbox) { +function NewConsoleOutputWrapper(parentNode, jsterm, toolbox, owner) { const sourceMapService = toolbox ? toolbox._sourceMapService : null; let childComponent = ConsoleOutput({ jsterm, @@ -25,7 +25,15 @@ function NewConsoleOutputWrapper(parentNode, jsterm, toolbox) { toolbox, frame.url, frame.line - ) + ), + openNetworkPanel: (requestId) => { + return toolbox.selectTool("netmonitor").then(panel => { + return panel.panelWin.NetMonitorController.inspectRequest(requestId); + }); + }, + openLink: (url) => { + owner.openLink(url); + }, }); let filterBar = FilterBar({}); let provider = React.createElement( @@ -45,7 +53,7 @@ NewConsoleOutputWrapper.prototype = { }, dispatchMessagesClear: () => { store.dispatch(actions.messagesClear()); - } + }, }; // Exports from this module diff --git a/devtools/client/webconsole/new-console-output/reducers/ui.js b/devtools/client/webconsole/new-console-output/reducers/ui.js index a075ff2cd141..9431b669e816 100644 --- a/devtools/client/webconsole/new-console-output/reducers/ui.js +++ b/devtools/client/webconsole/new-console-output/reducers/ui.js @@ -10,7 +10,7 @@ const Immutable = require("devtools/client/shared/vendor/immutable"); const Ui = Immutable.Record({ filterBarVisible: false, - filteredMessageVisible: false + filteredMessageVisible: false, }); function ui(state = new Ui(), action) { diff --git a/devtools/client/webconsole/new-console-output/selectors/messages.js b/devtools/client/webconsole/new-console-output/selectors/messages.js index a1a7f792d8a5..75a2b6eedb60 100644 --- a/devtools/client/webconsole/new-console-output/selectors/messages.js +++ b/devtools/client/webconsole/new-console-output/selectors/messages.js @@ -31,7 +31,7 @@ function getAllMessagesUiById(state) { function filterLevel(messages, filters) { return messages.filter((message) => { - return filters[message.level] === true + return filters.get(message.level) === true || [MESSAGE_TYPE.COMMAND, MESSAGE_TYPE.RESULT].includes(message.type); }); } diff --git a/devtools/client/webconsole/new-console-output/test/components/network-event-message.test.js b/devtools/client/webconsole/new-console-output/test/components/network-event-message.test.js new file mode 100644 index 000000000000..f51e7c3a6e04 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/components/network-event-message.test.js @@ -0,0 +1,65 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +// Test utils. +const expect = require("expect"); +const { render } = require("enzyme"); + +// React +const { createFactory } = require("devtools/client/shared/vendor/react"); + +// Components under test. +const NetworkEventMessage = createFactory(require("devtools/client/webconsole/new-console-output/components/message-types/network-event-message").NetworkEventMessage); + +// Test fakes. +const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); +const onViewSourceInDebugger = () => {}; +const openNetworkPanel = () => {}; +const openLink = () => {}; +const EXPECTED_URL = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html"; + +describe("NetworkEventMessage component:", () => { + describe("GET request", () => { + it("renders as expected", () => { + const message = stubPreparedMessages.get("GET request"); + const wrapper = render(NetworkEventMessage({ message, onViewSourceInDebugger, openNetworkPanel, openLink })); + + expect(wrapper.find(".message-body .method").text()).toBe("GET"); + expect(wrapper.find(".message-body .xhr").length).toBe(0); + expect(wrapper.find(".message-body .url").length).toBe(1); + expect(wrapper.find(".message-body .url").text()).toBe(EXPECTED_URL); + expect(wrapper.find(".message-body .status").length).toBe(1); + expect(wrapper.find("div.message.cm-s-mozilla span.message-body.devtools-monospace").length).toBe(1); + }); + }); + + describe("XHR GET request", () => { + it("renders as expected", () => { + const message = stubPreparedMessages.get("XHR GET request"); + const wrapper = render(NetworkEventMessage({ message, onViewSourceInDebugger, openNetworkPanel, openLink })); + + expect(wrapper.find(".message-body .method").text()).toBe("GET"); + expect(wrapper.find(".message-body .xhr").length).toBe(1); + expect(wrapper.find(".message-body .xhr").text()).toBe("XHR"); + expect(wrapper.find(".message-body .url").text()).toBe(EXPECTED_URL); + expect(wrapper.find(".message-body .status").length).toBe(1); + expect(wrapper.find("div.message.cm-s-mozilla span.message-body.devtools-monospace").length).toBe(1); + }); + }); + + describe("XHR POST request", () => { + it("renders as expected", () => { + const message = stubPreparedMessages.get("XHR POST request"); + const wrapper = render(NetworkEventMessage({ message, onViewSourceInDebugger, openNetworkPanel, openLink })); + + expect(wrapper.find(".message-body .method").text()).toBe("POST"); + expect(wrapper.find(".message-body .xhr").length).toBe(1); + expect(wrapper.find(".message-body .xhr").text()).toBe("XHR"); + expect(wrapper.find(".message-body .url").length).toBe(1); + expect(wrapper.find(".message-body .url").text()).toBe(EXPECTED_URL); + expect(wrapper.find(".message-body .status").length).toBe(1); + expect(wrapper.find("div.message.cm-s-mozilla span.message-body.devtools-monospace").length).toBe(1); + }); + }); +}); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js b/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js index dcdbfe90a5be..52321ead891f 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js @@ -11,6 +11,8 @@ class L10n { return "Error"; case "consoleCleared": return "Console was cleared."; + case "webConsoleXhrIndicator": + return "XHR"; } return str; } diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser.ini b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser.ini index f59e0cfd35cd..9f348544fa3b 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser.ini +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser.ini @@ -5,11 +5,14 @@ support-files = head.js !/devtools/client/framework/test/shared-head.js test-console-api.html + test-network-event.html test-tempfile.js [browser_webconsole_update_stubs_console_api.js] skip-if=true # This is only used to update stubs. It is not an actual test. [browser_webconsole_update_stubs_evaluation_result.js] skip-if=true # This is only used to update stubs. It is not an actual test. +[browser_webconsole_update_stubs_network_event.js] +skip-if=true # This is only used to update stubs. It is not an actual test. [browser_webconsole_update_stubs_page_error.js] skip-if=true # This is only used to update stubs. It is not an actual test. diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js index 7c375a3b89a7..352237b7929d 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js @@ -19,8 +19,7 @@ add_task(function* () { for (var [key, {keys, code}] of snippets) { OS.File.writeAtomic(TEMP_FILE_PATH, `function triggerPacket() {${code}}`); let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); - let hud = toolbox.getCurrentPanel().hud; - let {ui} = hud; + let {ui} = toolbox.getCurrentPanel().hud; ok(ui.jsterm, "jsterm exists"); ok(ui.newConsoleOutput, "newConsoleOutput exists"); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_network_event.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_network_event.js new file mode 100644 index 000000000000..cc018f634eb6 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_network_event.js @@ -0,0 +1,47 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +Cu.import("resource://gre/modules/osfile.jsm"); +const TARGET = "networkEvent"; +const { [TARGET]: snippets } = require("devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js"); +const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html"; + +let stubs = { + preparedMessages: [], + packets: [], +}; + +add_task(function* () { + for (var [key, {keys, code}] of snippets) { + OS.File.writeAtomic(TEMP_FILE_PATH, `function triggerPacket() {${code}}`); + let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); + let {ui} = toolbox.getCurrentPanel().hud; + + ok(ui.jsterm, "jsterm exists"); + ok(ui.newConsoleOutput, "newConsoleOutput exists"); + + let received = new Promise(resolve => { + let i = 0; + toolbox.target.client.addListener(TARGET, (type, res) => { + stubs.packets.push(formatPacket(keys[i], res)); + stubs.preparedMessages.push(formatNetworkStub(keys[i], res)); + if(++i === keys.length ){ + resolve(); + } + }); + }); + + yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function() { + content.wrappedJSObject.triggerPacket(); + }); + + yield received; + } + let filePath = OS.Path.join(`${BASE_PATH}/stubs/${TARGET}.js`); + OS.File.writeAtomic(filePath, formatFile(stubs)); + OS.File.writeAtomic(TEMP_FILE_PATH, ""); +}); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js index 34a4297bfe71..5296cf32c3a4 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js @@ -36,6 +36,36 @@ stubPreparedMessages.set("${key}", new ConsoleMessage(${JSON.stringify(prepared, `; } +function formatNetworkStub(key, packet) { + let actor = packet.eventActor; + let networkInfo = { + _type: "NetworkEvent", + timeStamp: actor.timeStamp, + node: null, + actor: actor.actor, + discardRequestBody: true, + discardResponseBody: true, + startedDateTime: actor.startedDateTime, + request: { + url: actor.url, + method: actor.method, + }, + isXHR: actor.isXHR, + cause: actor.cause, + response: {}, + timings: {}, + // track the list of network event updates + updates: [], + private: actor.private, + fromCache: actor.fromCache, + fromServiceWorker: actor.fromServiceWorker + }; + let prepared = prepareMessage(networkInfo, {getNextId: () => "1"}); + return ` +stubPreparedMessages.set("${key}", new NetworkEventMessage(${JSON.stringify(prepared, null, "\t")})); +`; +} + function formatFile(stubs) { return `/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ @@ -46,7 +76,7 @@ function formatFile(stubs) { * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. */ -const { ConsoleMessage } = require("devtools/client/webconsole/new-console-output/types"); +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); let stubPreparedMessages = new Map(); let stubPackets = new Map(); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js index 3fbfc1d30727..2da3027f2a9d 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js @@ -48,6 +48,33 @@ const evaluationResultCommands = [ let evaluationResult = new Map(evaluationResultCommands.map(cmd => [cmd, cmd])); +// Network Event + +let networkEvent = new Map(); + +networkEvent.set("GET request", { + keys: ["GET request"], + code: ` +let i = document.createElement("img"); +i.src = "inexistent.html"; +`}); + +networkEvent.set("XHR GET request", { + keys: ["XHR GET request"], + code: ` +const xhr = new XMLHttpRequest(); +xhr.open("GET", "inexistent.html"); +xhr.send(); +`}); + +networkEvent.set("XHR POST request", { + keys: ["XHR POST request"], + code: ` +const xhr = new XMLHttpRequest(); +xhr.open("POST", "inexistent.html"); +xhr.send(); +`}); + // Page Error let pageError = new Map(); @@ -66,5 +93,6 @@ pageError.set("Reference Error", ` module.exports = { consoleApi, evaluationResult, + networkEvent, pageError, }; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html new file mode 100644 index 000000000000..c234acea6229 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Stub generator for network event + + +

Stub generator for network event

+ + + diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/index.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/index.js index dfca970d5dec..59b42018042c 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/index.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/index.js @@ -8,6 +8,7 @@ let maps = []; [ "consoleApi", "evaluationResult", + "networkEvent", "pageError", ].forEach((filename) => { maps[filename] = require(`./${filename}`); @@ -18,9 +19,11 @@ module.exports = { stubPreparedMessages: new Map([ ...maps.consoleApi.stubPreparedMessages, ...maps.evaluationResult.stubPreparedMessages, + ...maps.networkEvent.stubPreparedMessages, ...maps.pageError.stubPreparedMessages, ]), stubPackets: new Map([ ...maps.consoleApi.stubPackets, ...maps.evaluationResult.stubPackets, + ...maps.networkEvent.stubPackets, ...maps.pageError.stubPackets, ]), }; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/networkEvent.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/networkEvent.js new file mode 100644 index 000000000000..a3e763093b8e --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/networkEvent.js @@ -0,0 +1,186 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); + +let stubPreparedMessages = new Map(); +let stubPackets = new Map(); + + +stubPreparedMessages.set("GET request", new NetworkEventMessage({ + "id": "1", + "actor": "server1.conn0.child1/netEvent29", + "level": "log", + "isXHR": false, + "request": { + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "GET" + }, + "response": {}, + "source": "network", + "type": "log" +})); + +stubPreparedMessages.set("XHR GET request", new NetworkEventMessage({ + "id": "1", + "actor": "server1.conn1.child1/netEvent29", + "level": "log", + "isXHR": true, + "request": { + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "GET" + }, + "response": {}, + "source": "network", + "type": "log" +})); + +stubPreparedMessages.set("XHR POST request", new NetworkEventMessage({ + "id": "1", + "actor": "server1.conn2.child1/netEvent29", + "level": "log", + "isXHR": true, + "request": { + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "POST" + }, + "response": {}, + "source": "network", + "type": "log" +})); + + +stubPackets.set("GET request", { + "from": "server1.conn0.child1/consoleActor2", + "type": "networkEvent", + "eventActor": { + "actor": "server1.conn0.child1/netEvent29", + "startedDateTime": "2016-09-14T02:38:18.046Z", + "timeStamp": 1473820698046, + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "GET", + "isXHR": false, + "cause": { + "type": 3, + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html", + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 3, + "columnNumber": 1, + "functionName": "triggerPacket", + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js line 52 > eval", + "lineNumber": 4, + "columnNumber": 7, + "functionName": null, + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js", + "lineNumber": 53, + "columnNumber": 20, + "functionName": null, + "asyncCause": null + } + ] + }, + "private": false + } +}); + +stubPackets.set("XHR GET request", { + "from": "server1.conn1.child1/consoleActor2", + "type": "networkEvent", + "eventActor": { + "actor": "server1.conn1.child1/netEvent29", + "startedDateTime": "2016-09-14T02:38:18.812Z", + "timeStamp": 1473820698812, + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "GET", + "isXHR": true, + "cause": { + "type": 11, + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html", + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 4, + "columnNumber": 1, + "functionName": "triggerPacket", + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js line 52 > eval", + "lineNumber": 4, + "columnNumber": 7, + "functionName": null, + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js", + "lineNumber": 53, + "columnNumber": 20, + "functionName": null, + "asyncCause": null + } + ] + }, + "private": false + } +}); + +stubPackets.set("XHR POST request", { + "from": "server1.conn2.child1/consoleActor2", + "type": "networkEvent", + "eventActor": { + "actor": "server1.conn2.child1/netEvent29", + "startedDateTime": "2016-09-14T02:38:19.483Z", + "timeStamp": 1473820699483, + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "POST", + "isXHR": true, + "cause": { + "type": 11, + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html", + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 4, + "columnNumber": 1, + "functionName": "triggerPacket", + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js line 52 > eval", + "lineNumber": 4, + "columnNumber": 7, + "functionName": null, + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js", + "lineNumber": 53, + "columnNumber": 20, + "functionName": null, + "asyncCause": null + } + ] + }, + "private": false + } +}); + + +module.exports = { + stubPreparedMessages, + stubPackets, +} \ No newline at end of file diff --git a/devtools/client/webconsole/new-console-output/types.js b/devtools/client/webconsole/new-console-output/types.js index ed4fd3b3699b..2b21aaf61868 100644 --- a/devtools/client/webconsole/new-console-output/types.js +++ b/devtools/client/webconsole/new-console-output/types.js @@ -35,3 +35,14 @@ exports.ConsoleMessage = Immutable.Record({ stacktrace: null, frame: null, }); + +exports.NetworkEventMessage = Immutable.Record({ + id: null, + actor: null, + level: MESSAGE_LEVEL.LOG, + isXHR: false, + request: null, + response: null, + source: MESSAGE_SOURCE.NETWORK, + type: MESSAGE_TYPE.LOG, +}); diff --git a/devtools/client/webconsole/new-console-output/utils/messages.js b/devtools/client/webconsole/new-console-output/utils/messages.js index 6624723ca55d..b8685a16b4b3 100644 --- a/devtools/client/webconsole/new-console-output/utils/messages.js +++ b/devtools/client/webconsole/new-console-output/utils/messages.js @@ -15,7 +15,10 @@ const { MESSAGE_TYPE, MESSAGE_LEVEL, } = require("../constants"); -const { ConsoleMessage } = require("../types"); +const { + ConsoleMessage, + NetworkEventMessage, +} = require("../types"); function prepareMessage(packet, idGenerator) { // This packet is already in the expected packet structure. Simply return. @@ -135,15 +138,14 @@ function transformPacket(packet) { case "networkEvent": { let { networkEvent } = packet; - // TODO: Replace the ConsoleMessage with NetworkEventMessage - // once the new component is ready. - return new ConsoleMessage({ - source: MESSAGE_SOURCE.CONSOLE_API, - type: MESSAGE_TYPE.LOG, - level: MESSAGE_LEVEL.LOG, - messageText: networkEvent.request.method + " " + networkEvent.request.url, + return new NetworkEventMessage({ + actor: networkEvent.actor, + isXHR: networkEvent.isXHR, + request: networkEvent.request, + response: networkEvent.response, }); } + case "evaluationResult": default: { let { result } = packet; diff --git a/devtools/client/webconsole/webconsole.js b/devtools/client/webconsole/webconsole.js index 011470d26d2a..f087157143b9 100644 --- a/devtools/client/webconsole/webconsole.js +++ b/devtools/client/webconsole/webconsole.js @@ -586,7 +586,8 @@ WebConsoleFrame.prototype = { this.outputNode.parentNode.appendChild(this.experimentalOutputNode); // @TODO Once the toolbox has been converted to React, see if passing // in JSTerm is still necessary. - this.newConsoleOutput = new this.window.NewConsoleOutput(this.experimentalOutputNode, this.jsterm, toolbox); + this.newConsoleOutput = new this.window.NewConsoleOutput( + this.experimentalOutputNode, this.jsterm, toolbox, this.owner); console.log("Created newConsoleOutput", this.newConsoleOutput); let filterToolbar = doc.querySelector(".hud-console-filter-toolbar"); @@ -3380,9 +3381,9 @@ WebConsoleConnectionProxy.prototype = { if (this.webConsoleFrame) { if (this.webConsoleFrame.NEW_CONSOLE_OUTPUT_ENABLED) { this.dispatchMessageAdd(networkInfo); - return; + } else { + this.webConsoleFrame.handleNetworkEvent(networkInfo); } - this.webConsoleFrame.handleNetworkEvent(networkInfo); } }, From bad737cfca27f86482fb0f86918d7f15a580fc35 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Tue, 20 Sep 2016 11:37:03 -0700 Subject: [PATCH 085/101] Bug 1303101 - New console frontend: Match against stacktrace in text filter. r=linclark MozReview-Commit-ID: 8GWuWu9Y8FD --- .../new-console-output/selectors/messages.js | 30 ++++++++-- .../test/components/console-api-call.test.js | 2 +- .../fixtures/stub-generators/stub-snippets.js | 4 +- .../test/fixtures/stubs/consoleApi.js | 56 +++++++++---------- .../test/store/filters.test.js | 39 +++++++++++-- 5 files changed, 89 insertions(+), 42 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/selectors/messages.js b/devtools/client/webconsole/new-console-output/selectors/messages.js index 75a2b6eedb60..289138864457 100644 --- a/devtools/client/webconsole/new-console-output/selectors/messages.js +++ b/devtools/client/webconsole/new-console-output/selectors/messages.js @@ -5,6 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; +const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages"); const { getAllFilters } = require("devtools/client/webconsole/new-console-output/selectors/filters"); const { getLogLimit } = require("devtools/client/webconsole/new-console-output/selectors/prefs"); const { @@ -52,11 +53,21 @@ function search(messages, text = "") { // search object grips. message.parameters !== null && !Array.isArray(message.parameters) // Look for a match in location. - // @TODO Change this to Object.values once it's supported in Node's version of V8 - || Object.keys(message.frame) - .map(key => message.frame[key]) - .join(":") - .includes(text) + || isTextInFrame(text, message.frame) + // Look for a match in stacktrace. + || ( + Array.isArray(message.stacktrace) && + message.stacktrace.some(frame => isTextInFrame(text, + // isTextInFrame expect the properties of the frame object to be in the same + // order they are rendered in the Frame component. + { + functionName: frame.functionName || + l10n.getStr("stacktrace.anonymousFunction"), + filename: frame.filename, + lineNumber: frame.lineNumber, + columnNumber: frame.columnNumber + })) + ) // Look for a match in messageText. || (message.messageText !== null && message.messageText.toLocaleLowerCase().includes(text.toLocaleLowerCase())) @@ -68,6 +79,15 @@ function search(messages, text = "") { }); } +function isTextInFrame(text, frame) { + // @TODO Change this to Object.values once it's supported in Node's version of V8 + return Object.keys(frame) + .map(key => frame[key]) + .join(":") + .toLocaleLowerCase() + .includes(text.toLocaleLowerCase()); +} + function prune(messages, logLimit) { let messageCount = messages.count(); if (messageCount > logLimit) { diff --git a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js index e2d2861dbb83..a15592c778ef 100644 --- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js @@ -89,7 +89,7 @@ describe("ConsoleAPICall component:", () => { const frameLinks = wrapper.find(`.stack-trace span.frame-link[data-url='${tempfilePath}']`); expect(frameLinks.length).toBe(3); - expect(frameLinks.eq(0).find(".frame-link-function-display-name").text()).toBe("bar"); + expect(frameLinks.eq(0).find(".frame-link-function-display-name").text()).toBe("testStacktraceFiltering"); expect(frameLinks.eq(0).find(".frame-link-filename").text()).toBe(tempfilePath); expect(frameLinks.eq(1).find(".frame-link-function-display-name").text()).toBe("foo"); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js index 2da3027f2a9d..994fc720117a 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js @@ -23,11 +23,11 @@ let consoleApi = new Map(consoleApiCommands.map( consoleApi.set("console.trace()", { keys: ["console.trace()"], code: ` -function bar() { +function testStacktraceFiltering() { console.trace() } function foo() { - bar() + testStacktraceFiltering() } foo() diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js index 9e1d015a51ea..0f2339f5f821 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js @@ -188,7 +188,7 @@ stubPreparedMessages.set("console.assert(false, {message: 'foobar'})", new Conso "parameters": [ { "type": "object", - "actor": "server1.conn7.child1/obj29", + "actor": "server1.conn8.child1/obj29", "class": "Object", "extensible": true, "frozen": false, @@ -210,7 +210,7 @@ stubPreparedMessages.set("console.assert(false, {message: 'foobar'})", new Conso } ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"assert\",\"level\":\"error\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn7.child1/obj29\",\"class\":\"Object\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":1,\"preview\":{\"kind\":\"Object\",\"ownProperties\":{\"message\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"foobar\"}},\"ownPropertiesLength\":1,\"safeGetterValues\":{}}}],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":27,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":1}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"assert\",\"level\":\"error\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn8.child1/obj29\",\"class\":\"Object\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":1,\"preview\":{\"kind\":\"Object\",\"ownProperties\":{\"message\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"foobar\"}},\"ownPropertiesLength\":1,\"safeGetterValues\":{}}}],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":27,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":1}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", "stacktrace": [ { "columnNumber": 27, @@ -236,12 +236,12 @@ stubPreparedMessages.set("console.trace()", new ConsoleMessage({ "messageText": null, "parameters": [], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"trace\",\"level\":\"log\",\"messageText\":null,\"parameters\":[],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"bar\",\"language\":2,\"lineNumber\":3},{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"foo\",\"language\":2,\"lineNumber\":6},{\"columnNumber\":1,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":9}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":3}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"trace\",\"level\":\"log\",\"messageText\":null,\"parameters\":[],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"testStacktraceFiltering\",\"language\":2,\"lineNumber\":3},{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"foo\",\"language\":2,\"lineNumber\":6},{\"columnNumber\":1,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":9}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":3}}", "stacktrace": [ { "columnNumber": 3, "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", - "functionName": "bar", + "functionName": "testStacktraceFiltering", "language": 2, "lineNumber": 3 }, @@ -291,10 +291,10 @@ stubPreparedMessages.set("console.timeEnd('bar')", new ConsoleMessage({ "source": "console-api", "type": "timeEnd", "level": "log", - "messageText": "bar: 2.96ms", + "messageText": "bar: 3.28ms", "parameters": null, "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"timeEnd\",\"level\":\"log\",\"messageText\":\"bar: 2.96ms\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":1}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"timeEnd\",\"level\":\"log\",\"messageText\":\"bar: 3.28ms\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":1}}", "stacktrace": null, "frame": { "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", @@ -329,7 +329,7 @@ stubPackets.set("console.log('foobar', 'test')", { }, "private": false, "styles": [], - "timeStamp": 1472787300416, + "timeStamp": 1473960299850, "timer": null, "workerType": "none", "category": "webdev" @@ -362,7 +362,7 @@ stubPackets.set("console.log(undefined)", { }, "private": false, "styles": [], - "timeStamp": 1472787301216, + "timeStamp": 1473960301470, "timer": null, "workerType": "none", "category": "webdev" @@ -393,7 +393,7 @@ stubPackets.set("console.warn('danger, will robinson!')", { }, "private": false, "styles": [], - "timeStamp": 1472787301959, + "timeStamp": 1473960302855, "timer": null, "workerType": "none", "category": "webdev" @@ -426,7 +426,7 @@ stubPackets.set("console.log(NaN)", { }, "private": false, "styles": [], - "timeStamp": 1472787302818, + "timeStamp": 1473960304360, "timer": null, "workerType": "none", "category": "webdev" @@ -459,7 +459,7 @@ stubPackets.set("console.log(null)", { }, "private": false, "styles": [], - "timeStamp": 1472787303791, + "timeStamp": 1473960305590, "timer": null, "workerType": "none", "category": "webdev" @@ -490,7 +490,7 @@ stubPackets.set("console.log('鼬')", { }, "private": false, "styles": [], - "timeStamp": 1473786764817, + "timeStamp": 1473960307139, "timer": null, "workerType": "none", "category": "webdev" @@ -518,7 +518,7 @@ stubPackets.set("console.clear()", { "userContextId": 0 }, "private": false, - "timeStamp": 1472787304607, + "timeStamp": 1473960309103, "timer": null, "workerType": "none", "styles": [], @@ -527,7 +527,7 @@ stubPackets.set("console.clear()", { }); stubPackets.set("console.count('bar')", { - "from": "server1.conn6.child1/consoleActor2", + "from": "server1.conn7.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [ @@ -552,7 +552,7 @@ stubPackets.set("console.count('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1472787305395, + "timeStamp": 1473960310581, "timer": null, "workerType": "none", "styles": [], @@ -561,13 +561,13 @@ stubPackets.set("console.count('bar')", { }); stubPackets.set("console.assert(false, {message: 'foobar'})", { - "from": "server1.conn7.child1/consoleActor2", + "from": "server1.conn8.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [ { "type": "object", - "actor": "server1.conn7.child1/obj29", + "actor": "server1.conn8.child1/obj29", "class": "Object", "extensible": true, "frozen": false, @@ -605,7 +605,7 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", { }, "private": false, "styles": [], - "timeStamp": 1472787306558, + "timeStamp": 1473960312535, "timer": null, "stacktrace": [ { @@ -622,14 +622,14 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", { }); stubPackets.set("console.trace()", { - "from": "server1.conn8.child1/consoleActor2", + "from": "server1.conn9.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [], "columnNumber": 3, "counter": null, "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", - "functionName": "bar", + "functionName": "testStacktraceFiltering", "groupName": "", "level": "trace", "lineNumber": 3, @@ -642,13 +642,13 @@ stubPackets.set("console.trace()", { "userContextId": 0 }, "private": false, - "timeStamp": 1472787307887, + "timeStamp": 1473960313762, "timer": null, "stacktrace": [ { "columnNumber": 3, "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", - "functionName": "bar", + "functionName": "testStacktraceFiltering", "language": 2, "lineNumber": 3 }, @@ -674,7 +674,7 @@ stubPackets.set("console.trace()", { }); stubPackets.set("console.time('bar')", { - "from": "server1.conn9.child1/consoleActor2", + "from": "server1.conn10.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [ @@ -696,10 +696,10 @@ stubPackets.set("console.time('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1472787308764, + "timeStamp": 1473960315572, "timer": { "name": "bar", - "started": 726.395 + "started": 1649.7450000000001 }, "workerType": "none", "styles": [], @@ -708,7 +708,7 @@ stubPackets.set("console.time('bar')", { }); stubPackets.set("console.timeEnd('bar')", { - "from": "server1.conn9.child1/consoleActor2", + "from": "server1.conn10.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [ @@ -730,9 +730,9 @@ stubPackets.set("console.timeEnd('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1472787308767, + "timeStamp": 1473960315576, "timer": { - "duration": 2.9600000000000364, + "duration": 3.2849999999998545, "name": "bar" }, "workerType": "none", diff --git a/devtools/client/webconsole/new-console-output/test/store/filters.test.js b/devtools/client/webconsole/new-console-output/test/store/filters.test.js index 909d29ed660f..2a219f28e976 100644 --- a/devtools/client/webconsole/new-console-output/test/store/filters.test.js +++ b/devtools/client/webconsole/new-console-output/test/store/filters.test.js @@ -17,6 +17,9 @@ const { stubPackets } = require("devtools/client/webconsole/new-console-output/t describe("Filtering", () => { let store; let numMessages; + // Number of messages in prepareBaseStore which are not filtered out, i.e. Evaluation + // Results and console commands . + const numUnfilterableMessages = 2; beforeEach(() => { store = prepareBaseStore(); @@ -62,16 +65,14 @@ describe("Filtering", () => { store.dispatch(actions.filterTextSet("danger")); let messages = getAllMessages(store.getState()); - // This does not filter out Evaluation Results or console commands - expect(messages.size).toEqual(3); + expect(messages.size - numUnfilterableMessages).toEqual(1); }); it("matches unicode values", () => { store.dispatch(actions.filterTextSet("鼬")); let messages = getAllMessages(store.getState()); - // This does not filter out Evaluation Results or console commands - expect(messages.size).toEqual(3); + expect(messages.size - numUnfilterableMessages).toEqual(1); }); it("matches locations", () => { @@ -85,8 +86,34 @@ describe("Filtering", () => { store.dispatch(actions.filterTextSet("search-location-test.js")); let messages = getAllMessages(store.getState()); - // This does not filter out Evaluation Results or console commands - expect(messages.size).toEqual(3); + expect(messages.size - numUnfilterableMessages).toEqual(1); + }); + + it("matches stacktrace functionName", () => { + let traceMessage = stubPackets.get("console.trace()"); + store.dispatch(messageAdd(traceMessage)); + + store.dispatch(actions.filterTextSet("testStacktraceFiltering")); + + let messages = getAllMessages(store.getState()); + expect(messages.size - numUnfilterableMessages).toEqual(1); + }); + + it("matches stacktrace location", () => { + let traceMessage = stubPackets.get("console.trace()"); + traceMessage.message = + Object.assign({}, traceMessage.message, { + filename: "search-location-test.js", + lineNumber: 85, + columnNumber: 13 + }); + + store.dispatch(messageAdd(traceMessage)); + + store.dispatch(actions.filterTextSet("search-location-test.js:85:13")); + + let messages = getAllMessages(store.getState()); + expect(messages.size - numUnfilterableMessages).toEqual(1); }); it("restores all messages once text is cleared", () => { From f65c22b13b1d88ad6c295ad7db9a065df8af1c21 Mon Sep 17 00:00:00 2001 From: Lin Clark Date: Tue, 20 Sep 2016 11:37:03 -0700 Subject: [PATCH 086/101] Bug 1303181 - New console frontend: Fix stub generators. r=bgrins MozReview-Commit-ID: KeMe90yNRq3 --- .../test/components/console-api-call.test.js | 9 +- ...ser_webconsole_update_stubs_console_api.js | 18 +- ...wser_webconsole_update_stubs_page_error.js | 6 +- .../test/fixtures/stub-generators/head.js | 1 - .../fixtures/stub-generators/stub-snippets.js | 8 +- .../test/fixtures/stubs/consoleApi.js | 232 +++++++++++++----- .../test/fixtures/stubs/evaluationResult.js | 2 +- .../test/fixtures/stubs/pageError.js | 22 +- 8 files changed, 208 insertions(+), 90 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js index a15592c778ef..93690e52e203 100644 --- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js @@ -83,20 +83,21 @@ describe("ConsoleAPICall component:", () => { it("renders", () => { const message = stubPreparedMessages.get("console.trace()"); const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger, open: true })); + const filepath = `${tempfilePath}?key=console.trace()`; expect(wrapper.find(".message-body").text()).toBe("console.trace()"); - const frameLinks = wrapper.find(`.stack-trace span.frame-link[data-url='${tempfilePath}']`); + const frameLinks = wrapper.find(`.stack-trace span.frame-link[data-url='${filepath}']`); expect(frameLinks.length).toBe(3); expect(frameLinks.eq(0).find(".frame-link-function-display-name").text()).toBe("testStacktraceFiltering"); - expect(frameLinks.eq(0).find(".frame-link-filename").text()).toBe(tempfilePath); + expect(frameLinks.eq(0).find(".frame-link-filename").text()).toBe(filepath); expect(frameLinks.eq(1).find(".frame-link-function-display-name").text()).toBe("foo"); - expect(frameLinks.eq(1).find(".frame-link-filename").text()).toBe(tempfilePath); + expect(frameLinks.eq(1).find(".frame-link-filename").text()).toBe(filepath); expect(frameLinks.eq(2).find(".frame-link-function-display-name").text()).toBe("triggerPacket"); - expect(frameLinks.eq(2).find(".frame-link-filename").text()).toBe(tempfilePath); + expect(frameLinks.eq(2).find(".frame-link-filename").text()).toBe(filepath); }); }); }); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js index 352237b7929d..25131840c734 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js @@ -17,7 +17,8 @@ let stubs = { add_task(function* () { for (var [key, {keys, code}] of snippets) { - OS.File.writeAtomic(TEMP_FILE_PATH, `function triggerPacket() {${code}}`); + yield OS.File.writeAtomic(TEMP_FILE_PATH, `function triggerPacket() {${code}}`); + let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); let {ui} = toolbox.getCurrentPanel().hud; @@ -26,20 +27,27 @@ add_task(function* () { let received = new Promise(resolve => { let i = 0; - toolbox.target.client.addListener("consoleAPICall", (type, res) => { + let listener = (type, res) => { stubs.packets.push(formatPacket(keys[i], res)); stubs.preparedMessages.push(formatStub(keys[i], res)); if(++i === keys.length ){ + toolbox.target.client.removeListener("consoleAPICall", listener); resolve(); } - }); + }; + toolbox.target.client.addListener("consoleAPICall", listener); }); - yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function() { - content.wrappedJSObject.triggerPacket(); + yield ContentTask.spawn(gBrowser.selectedBrowser, key, function(key) { + var script = content.document.createElement("script"); + script.src = "test-tempfile.js?key=" + encodeURIComponent(key); + script.onload = function() { content.wrappedJSObject.triggerPacket(); } + content.document.body.appendChild(script); }); yield received; + + yield closeTabAndToolbox(); } let filePath = OS.Path.join(`${BASE_PATH}/stubs`, "consoleApi.js"); OS.File.writeAtomic(filePath, formatFile(stubs)); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js index c41cd2b731b2..9323e0031b44 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js @@ -33,8 +33,10 @@ add_task(function* () { }); }); - yield ContentTask.spawn(gBrowser.selectedBrowser, code, function(code) { - content.wrappedJSObject.location.reload(); + yield ContentTask.spawn(gBrowser.selectedBrowser, key, function(key) { + var script = content.document.createElement("script"); + script.src = "test-tempfile.js?key=" + encodeURIComponent(key); + content.document.body.appendChild(script); }); yield received; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js index 5296cf32c3a4..613055b7b82c 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js @@ -22,7 +22,6 @@ const { prepareMessage } = require("devtools/client/webconsole/new-console-outpu const BASE_PATH = "../../../../devtools/client/webconsole/new-console-output/test/fixtures"; const TEMP_FILE_PATH = OS.Path.join(`${BASE_PATH}/stub-generators`, "test-tempfile.js"); - function formatPacket(key, packet) { return ` stubPackets.set("${key}", ${JSON.stringify(packet, null, "\t")}); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js index 994fc720117a..8ad294b3db80 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js @@ -3,6 +3,10 @@ "use strict"; +var {DebuggerServer} = require("devtools/server/main"); +var longString = (new Array(DebuggerServer.LONG_STRING_LENGTH + 4)).join("a"); +var initialString = longString.substring(0, DebuggerServer.LONG_STRING_INITIAL_LENGTH); + // Console API const consoleApiCommands = [ @@ -14,7 +18,9 @@ const consoleApiCommands = [ "console.log('\u9f2c')", "console.clear()", "console.count('bar')", - "console.assert(false, {message: 'foobar'})" + "console.assert(false, {message: 'foobar'})", + "console.log('hello \\nfrom \\rthe \\\"string world!')", + "console.log('\xFA\u1E47\u0129\xE7\xF6d\xEA \u021B\u0115\u0219\u0165')", ]; let consoleApi = new Map(consoleApiCommands.map( diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js index 0f2339f5f821..e88e895d1b6b 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js @@ -7,7 +7,7 @@ * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. */ -const { ConsoleMessage } = require("devtools/client/webconsole/new-console-output/types"); +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); let stubPreparedMessages = new Map(); let stubPackets = new Map(); @@ -25,10 +25,10 @@ stubPreparedMessages.set("console.log('foobar', 'test')", new ConsoleMessage({ "test" ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"foobar\",\"test\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"foobar\",\"test\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27foobar%27%2C%20%27test%27)\",\"line\":1,\"column\":27}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27foobar%27%2C%20%27test%27)", "line": 1, "column": 27 } @@ -47,10 +47,10 @@ stubPreparedMessages.set("console.log(undefined)", new ConsoleMessage({ } ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"undefined\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"undefined\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(undefined)\",\"line\":1,\"column\":27}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(undefined)", "line": 1, "column": 27 } @@ -67,10 +67,10 @@ stubPreparedMessages.set("console.warn('danger, will robinson!')", new ConsoleMe "danger, will robinson!" ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"warn\",\"level\":\"warn\",\"messageText\":null,\"parameters\":[\"danger, will robinson!\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"warn\",\"level\":\"warn\",\"messageText\":null,\"parameters\":[\"danger, will robinson!\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.warn(%27danger%2C%20will%20robinson!%27)\",\"line\":1,\"column\":27}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.warn(%27danger%2C%20will%20robinson!%27)", "line": 1, "column": 27 } @@ -89,10 +89,10 @@ stubPreparedMessages.set("console.log(NaN)", new ConsoleMessage({ } ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"NaN\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"NaN\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(NaN)\",\"line\":1,\"column\":27}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(NaN)", "line": 1, "column": 27 } @@ -111,10 +111,10 @@ stubPreparedMessages.set("console.log(null)", new ConsoleMessage({ } ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"null\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"null\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(null)\",\"line\":1,\"column\":27}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(null)", "line": 1, "column": 27 } @@ -131,10 +131,10 @@ stubPreparedMessages.set("console.log('鼬')", new ConsoleMessage({ "鼬" ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"鼬\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"鼬\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%E9%BC%AC%27)\",\"line\":1,\"column\":27}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%E9%BC%AC%27)", "line": 1, "column": 27 } @@ -151,10 +151,10 @@ stubPreparedMessages.set("console.clear()", new ConsoleMessage({ "Console was cleared." ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"clear\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"Console was cleared.\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"clear\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"Console was cleared.\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.clear()\",\"line\":1,\"column\":27}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.clear()", "line": 1, "column": 27 } @@ -169,10 +169,10 @@ stubPreparedMessages.set("console.count('bar')", new ConsoleMessage({ "messageText": "bar: 1", "parameters": null, "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"debug\",\"messageText\":\"bar: 1\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"debug\",\"messageText\":\"bar: 1\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.count(%27bar%27)\",\"line\":1,\"column\":27}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.count(%27bar%27)", "line": 1, "column": 27 } @@ -188,7 +188,7 @@ stubPreparedMessages.set("console.assert(false, {message: 'foobar'})", new Conso "parameters": [ { "type": "object", - "actor": "server1.conn8.child1/obj29", + "actor": "server1.conn8.child1/obj31", "class": "Object", "extensible": true, "frozen": false, @@ -210,18 +210,58 @@ stubPreparedMessages.set("console.assert(false, {message: 'foobar'})", new Conso } ], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"assert\",\"level\":\"error\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn8.child1/obj29\",\"class\":\"Object\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":1,\"preview\":{\"kind\":\"Object\",\"ownProperties\":{\"message\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"foobar\"}},\"ownPropertiesLength\":1,\"safeGetterValues\":{}}}],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":27,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":1}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":1,\"column\":27}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"assert\",\"level\":\"error\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn8.child1/obj31\",\"class\":\"Object\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":1,\"preview\":{\"kind\":\"Object\",\"ownProperties\":{\"message\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"foobar\"}},\"ownPropertiesLength\":1,\"safeGetterValues\":{}}}],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":27,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":1}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)\",\"line\":1,\"column\":27}}", "stacktrace": [ { "columnNumber": 27, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)", "functionName": "triggerPacket", "language": 2, "lineNumber": 1 } ], "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)", + "line": 1, + "column": 27 + } +})); + +stubPreparedMessages.set("console.log('hello \nfrom \rthe \"string world!')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "hello \nfrom \rthe \"string world!" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"hello \\nfrom \\rthe \\\"string world!\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27hello%20%5Cnfrom%20%5Crthe%20%5C%22string%20world!%27)\",\"line\":1,\"column\":27}}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27hello%20%5Cnfrom%20%5Crthe%20%5C%22string%20world!%27)", + "line": 1, + "column": 27 + } +})); + +stubPreparedMessages.set("console.log('úṇĩçödê țĕșť')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "úṇĩçödê țĕșť" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"úṇĩçödê țĕșť\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%C3%BA%E1%B9%87%C4%A9%C3%A7%C3%B6d%C3%AA%20%C8%9B%C4%95%C8%99%C5%A5%27)\",\"line\":1,\"column\":27}}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%C3%BA%E1%B9%87%C4%A9%C3%A7%C3%B6d%C3%AA%20%C8%9B%C4%95%C8%99%C5%A5%27)", "line": 1, "column": 27 } @@ -236,32 +276,32 @@ stubPreparedMessages.set("console.trace()", new ConsoleMessage({ "messageText": null, "parameters": [], "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"trace\",\"level\":\"log\",\"messageText\":null,\"parameters\":[],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"testStacktraceFiltering\",\"language\":2,\"lineNumber\":3},{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"foo\",\"language\":2,\"lineNumber\":6},{\"columnNumber\":1,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":9}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":3}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"trace\",\"level\":\"log\",\"messageText\":null,\"parameters\":[],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()\",\"functionName\":\"testStacktraceFiltering\",\"language\":2,\"lineNumber\":3},{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()\",\"functionName\":\"foo\",\"language\":2,\"lineNumber\":6},{\"columnNumber\":1,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":9}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()\",\"line\":3,\"column\":3}}", "stacktrace": [ { "columnNumber": 3, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", "functionName": "testStacktraceFiltering", "language": 2, "lineNumber": 3 }, { "columnNumber": 3, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", "functionName": "foo", "language": 2, "lineNumber": 6 }, { "columnNumber": 1, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", "functionName": "triggerPacket", "language": 2, "lineNumber": 9 } ], "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", "line": 3, "column": 3 } @@ -276,10 +316,10 @@ stubPreparedMessages.set("console.time('bar')", new ConsoleMessage({ "messageText": null, "parameters": null, "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"nullMessage\",\"level\":\"log\",\"messageText\":null,\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":2,\"column\":1}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"nullMessage\",\"level\":\"log\",\"messageText\":null,\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)\",\"line\":2,\"column\":1}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)", "line": 2, "column": 1 } @@ -291,13 +331,13 @@ stubPreparedMessages.set("console.timeEnd('bar')", new ConsoleMessage({ "source": "console-api", "type": "timeEnd", "level": "log", - "messageText": "bar: 3.28ms", + "messageText": "bar: 1.63ms", "parameters": null, "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"timeEnd\",\"level\":\"log\",\"messageText\":\"bar: 3.28ms\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":1}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"timeEnd\",\"level\":\"log\",\"messageText\":\"bar: 1.63ms\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)\",\"line\":3,\"column\":1}}", "stacktrace": null, "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)", "line": 3, "column": 1 } @@ -314,7 +354,7 @@ stubPackets.set("console.log('foobar', 'test')", { ], "columnNumber": 27, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27foobar%27%2C%20%27test%27)", "functionName": "triggerPacket", "groupName": "", "level": "log", @@ -329,7 +369,7 @@ stubPackets.set("console.log('foobar', 'test')", { }, "private": false, "styles": [], - "timeStamp": 1473960299850, + "timeStamp": 1473963371646, "timer": null, "workerType": "none", "category": "webdev" @@ -347,7 +387,7 @@ stubPackets.set("console.log(undefined)", { ], "columnNumber": 27, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(undefined)", "functionName": "triggerPacket", "groupName": "", "level": "log", @@ -362,7 +402,7 @@ stubPackets.set("console.log(undefined)", { }, "private": false, "styles": [], - "timeStamp": 1473960301470, + "timeStamp": 1473963372796, "timer": null, "workerType": "none", "category": "webdev" @@ -378,7 +418,7 @@ stubPackets.set("console.warn('danger, will robinson!')", { ], "columnNumber": 27, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.warn(%27danger%2C%20will%20robinson!%27)", "functionName": "triggerPacket", "groupName": "", "level": "warn", @@ -393,7 +433,7 @@ stubPackets.set("console.warn('danger, will robinson!')", { }, "private": false, "styles": [], - "timeStamp": 1473960302855, + "timeStamp": 1473963373921, "timer": null, "workerType": "none", "category": "webdev" @@ -411,7 +451,7 @@ stubPackets.set("console.log(NaN)", { ], "columnNumber": 27, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(NaN)", "functionName": "triggerPacket", "groupName": "", "level": "log", @@ -426,7 +466,7 @@ stubPackets.set("console.log(NaN)", { }, "private": false, "styles": [], - "timeStamp": 1473960304360, + "timeStamp": 1473963375058, "timer": null, "workerType": "none", "category": "webdev" @@ -444,7 +484,7 @@ stubPackets.set("console.log(null)", { ], "columnNumber": 27, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(null)", "functionName": "triggerPacket", "groupName": "", "level": "log", @@ -459,7 +499,7 @@ stubPackets.set("console.log(null)", { }, "private": false, "styles": [], - "timeStamp": 1473960305590, + "timeStamp": 1473963376386, "timer": null, "workerType": "none", "category": "webdev" @@ -475,7 +515,7 @@ stubPackets.set("console.log('鼬')", { ], "columnNumber": 27, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%E9%BC%AC%27)", "functionName": "triggerPacket", "groupName": "", "level": "log", @@ -490,7 +530,7 @@ stubPackets.set("console.log('鼬')", { }, "private": false, "styles": [], - "timeStamp": 1473960307139, + "timeStamp": 1473963377604, "timer": null, "workerType": "none", "category": "webdev" @@ -504,7 +544,7 @@ stubPackets.set("console.clear()", { "arguments": [], "columnNumber": 27, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.clear()", "functionName": "triggerPacket", "groupName": "", "level": "clear", @@ -518,7 +558,7 @@ stubPackets.set("console.clear()", { "userContextId": 0 }, "private": false, - "timeStamp": 1473960309103, + "timeStamp": 1473963378876, "timer": null, "workerType": "none", "styles": [], @@ -538,7 +578,7 @@ stubPackets.set("console.count('bar')", { "count": 1, "label": "bar" }, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.count(%27bar%27)", "functionName": "triggerPacket", "groupName": "", "level": "count", @@ -552,7 +592,7 @@ stubPackets.set("console.count('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1473960310581, + "timeStamp": 1473963380028, "timer": null, "workerType": "none", "styles": [], @@ -567,7 +607,7 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", { "arguments": [ { "type": "object", - "actor": "server1.conn8.child1/obj29", + "actor": "server1.conn8.child1/obj31", "class": "Object", "extensible": true, "frozen": false, @@ -590,7 +630,7 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", { ], "columnNumber": 27, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)", "functionName": "triggerPacket", "groupName": "", "level": "assert", @@ -605,12 +645,12 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", { }, "private": false, "styles": [], - "timeStamp": 1473960312535, + "timeStamp": 1473963381225, "timer": null, "stacktrace": [ { "columnNumber": 27, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)", "functionName": "triggerPacket", "language": 2, "lineNumber": 1 @@ -621,14 +661,76 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", { } }); -stubPackets.set("console.trace()", { +stubPackets.set("console.log('hello \nfrom \rthe \"string world!')", { "from": "server1.conn9.child1/consoleActor2", "type": "consoleAPICall", + "message": { + "arguments": [ + "hello \nfrom \rthe \"string world!" + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27hello%20%5Cnfrom%20%5Crthe%20%5C%22string%20world!%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "signedPkg": "", + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1473963382425, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.log('úṇĩçödê țĕșť')", { + "from": "server1.conn10.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "úṇĩçödê țĕșť" + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%C3%BA%E1%B9%87%C4%A9%C3%A7%C3%B6d%C3%AA%20%C8%9B%C4%95%C8%99%C5%A5%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "signedPkg": "", + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1473963383581, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.trace()", { + "from": "server1.conn11.child1/consoleActor2", + "type": "consoleAPICall", "message": { "arguments": [], "columnNumber": 3, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", "functionName": "testStacktraceFiltering", "groupName": "", "level": "trace", @@ -642,26 +744,26 @@ stubPackets.set("console.trace()", { "userContextId": 0 }, "private": false, - "timeStamp": 1473960313762, + "timeStamp": 1473963384829, "timer": null, "stacktrace": [ { "columnNumber": 3, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", "functionName": "testStacktraceFiltering", "language": 2, "lineNumber": 3 }, { "columnNumber": 3, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", "functionName": "foo", "language": 2, "lineNumber": 6 }, { "columnNumber": 1, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", "functionName": "triggerPacket", "language": 2, "lineNumber": 9 @@ -674,7 +776,7 @@ stubPackets.set("console.trace()", { }); stubPackets.set("console.time('bar')", { - "from": "server1.conn10.child1/consoleActor2", + "from": "server1.conn12.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [ @@ -682,7 +784,7 @@ stubPackets.set("console.time('bar')", { ], "columnNumber": 1, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)", "functionName": "triggerPacket", "groupName": "", "level": "time", @@ -696,10 +798,10 @@ stubPackets.set("console.time('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1473960315572, + "timeStamp": 1473963386059, "timer": { "name": "bar", - "started": 1649.7450000000001 + "started": 745.99 }, "workerType": "none", "styles": [], @@ -708,7 +810,7 @@ stubPackets.set("console.time('bar')", { }); stubPackets.set("console.timeEnd('bar')", { - "from": "server1.conn10.child1/consoleActor2", + "from": "server1.conn12.child1/consoleActor2", "type": "consoleAPICall", "message": { "arguments": [ @@ -716,7 +818,7 @@ stubPackets.set("console.timeEnd('bar')", { ], "columnNumber": 1, "counter": null, - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)", "functionName": "triggerPacket", "groupName": "", "level": "timeEnd", @@ -730,9 +832,9 @@ stubPackets.set("console.timeEnd('bar')", { "userContextId": 0 }, "private": false, - "timeStamp": 1473960315576, + "timeStamp": 1473963386060, "timer": { - "duration": 3.2849999999998545, + "duration": 1.6299999999999955, "name": "bar" }, "workerType": "none", diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js index 461b0a454d5e..b839e0060097 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js @@ -7,7 +7,7 @@ * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. */ -const { ConsoleMessage } = require("devtools/client/webconsole/new-console-output/types"); +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); let stubPreparedMessages = new Map(); let stubPackets = new Map(); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js index b61551c58a15..f8eb7e869a35 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js @@ -7,7 +7,7 @@ * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. */ -const { ConsoleMessage } = require("devtools/client/webconsole/new-console-output/types"); +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); let stubPreparedMessages = new Map(); let stubPackets = new Map(); @@ -22,29 +22,29 @@ stubPreparedMessages.set("ReferenceError: asdf is not defined", new ConsoleMessa "messageText": "ReferenceError: asdf is not defined", "parameters": null, "repeat": 1, - "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"log\",\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":[{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"lineNumber\":3,\"columnNumber\":5,\"functionName\":\"bar\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"lineNumber\":6,\"columnNumber\":5,\"functionName\":\"foo\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"lineNumber\":9,\"columnNumber\":3,\"functionName\":null}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js\",\"line\":3,\"column\":5}}", + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"log\",\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":[{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error\",\"lineNumber\":3,\"columnNumber\":5,\"functionName\":\"bar\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error\",\"lineNumber\":6,\"columnNumber\":5,\"functionName\":\"foo\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error\",\"lineNumber\":9,\"columnNumber\":3,\"functionName\":null}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error\",\"line\":3,\"column\":5}}", "stacktrace": [ { - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", "lineNumber": 3, "columnNumber": 5, "functionName": "bar" }, { - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", "lineNumber": 6, "columnNumber": 5, "functionName": "foo" }, { - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", "lineNumber": 9, "columnNumber": 3, "functionName": null } ], "frame": { - "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", "line": 3, "column": 5 } @@ -58,12 +58,12 @@ stubPackets.set("ReferenceError: asdf is not defined", { "errorMessage": "ReferenceError: asdf is not defined", "errorMessageName": "JSMSG_NOT_DEFINED", "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default", - "sourceName": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "sourceName": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", "lineText": "", "lineNumber": 3, "columnNumber": 5, "category": "content javascript", - "timeStamp": 1473431421453, + "timeStamp": 1473960366996, "warning": false, "error": false, "exception": true, @@ -72,19 +72,19 @@ stubPackets.set("ReferenceError: asdf is not defined", { "private": false, "stacktrace": [ { - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", "lineNumber": 3, "columnNumber": 5, "functionName": "bar" }, { - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", "lineNumber": 6, "columnNumber": 5, "functionName": "foo" }, { - "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", "lineNumber": 9, "columnNumber": 3, "functionName": null From f95d017126fcc5cc0c974e646d93a812a5f96d8d Mon Sep 17 00:00:00 2001 From: Lin Clark Date: Tue, 20 Sep 2016 11:37:03 -0700 Subject: [PATCH 087/101] Bug 1302873 - New console frontend: Remove quotes around strings. r=nchevobbe MozReview-Commit-ID: JKw5URD5nkV --- .../client/shared/components/reps/string.js | 14 +++++++++++-- .../test/mochitest/test_reps_string.html | 10 ++++----- .../components/grip-message-body.js | 21 ++++++++++++++----- .../message-types/console-api-call.js | 18 ++++++++++++++-- .../test/components/console-api-call.test.js | 3 +-- 5 files changed, 50 insertions(+), 16 deletions(-) diff --git a/devtools/client/shared/components/reps/string.js b/devtools/client/shared/components/reps/string.js index 506b4c3e957c..beb15b127367 100644 --- a/devtools/client/shared/components/reps/string.js +++ b/devtools/client/shared/components/reps/string.js @@ -21,6 +21,16 @@ define(function (require, exports, module) { const StringRep = React.createClass({ displayName: "StringRep", + propTypes: { + useQuotes: React.PropTypes.bool, + }, + + getDefaultProps: function () { + return { + useQuotes: true, + }; + }, + render: function () { let text = this.props.object; let member = this.props.member; @@ -35,8 +45,8 @@ define(function (require, exports, module) { let croppedString = this.props.cropLimit ? cropMultipleLines(text, this.props.cropLimit) : cropMultipleLines(text); - let formattedString = this.props.omitQuotes ? - croppedString : "\"" + croppedString + "\""; + let formattedString = this.props.useQuotes ? + "\"" + croppedString + "\"" : croppedString; return ( span({className: "objectBox objectBox-string"}, formattedString diff --git a/devtools/client/shared/components/test/mochitest/test_reps_string.html b/devtools/client/shared/components/test/mochitest/test_reps_string.html index 82bcd72fb60a..77366f27d644 100644 --- a/devtools/client/shared/components/test/mochitest/test_reps_string.html +++ b/devtools/client/shared/components/test/mochitest/test_reps_string.html @@ -27,7 +27,7 @@ window.onload = Task.async(function* () { yield testMultiline(); yield testMultilineOpen(); yield testMultilineLimit(); - yield testOmitQuotes(); + yield testUseQuotes(); } catch(e) { ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e)); } finally { @@ -49,9 +49,9 @@ window.onload = Task.async(function* () { is(renderedComponent.textContent, "\"aaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbb\ncccccccccccccccc\n\"", "String rep has expected text content for multiline string when open"); } - function testOmitQuotes(){ - const renderedComponent = renderComponent(StringRep.rep, { object: getGripStub("testOmitQuotes"), omitQuotes: true }); - is(renderedComponent.textContent, "abc","String rep has expected to omit quotes"); + function testUseQuotes(){ + const renderedComponent = renderComponent(StringRep.rep, { object: getGripStub("testUseQuotes"), useQuotes: false }); + is(renderedComponent.textContent, "abc","String rep was expected to omit quotes"); } function getGripStub(name) { @@ -59,7 +59,7 @@ window.onload = Task.async(function* () { case "testMultiline": return "aaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbb\ncccccccccccccccc\n"; break; - case "testOmitQuotes": + case "testUseQuotes": return "abc"; } } diff --git a/devtools/client/webconsole/new-console-output/components/grip-message-body.js b/devtools/client/webconsole/new-console-output/components/grip-message-body.js index 67cc443014bb..d7d180461a74 100644 --- a/devtools/client/webconsole/new-console-output/components/grip-message-body.js +++ b/devtools/client/webconsole/new-console-output/components/grip-message-body.js @@ -19,6 +19,7 @@ const { } = require("devtools/client/shared/vendor/react"); const { createFactories } = require("devtools/client/shared/components/reps/rep-utils"); const { Rep } = createFactories(require("devtools/client/shared/components/reps/rep")); +const StringRep = createFactories(require("devtools/client/shared/components/reps/string").StringRep).rep; const VariablesViewLink = createFactory(require("devtools/client/webconsole/new-console-output/components/variables-view-link").VariablesViewLink); const { Grip } = require("devtools/client/shared/components/reps/grip"); @@ -33,11 +34,21 @@ GripMessageBody.propTypes = { }; function GripMessageBody(props) { - return Rep({ - object: props.grip, - objectLink: VariablesViewLink, - defaultRep: Grip - }); + const { grip } = props; + + return ( + // @TODO once there is a longString rep, also turn off quotes for those. + typeof grip === "string" + ? StringRep({ + object: grip, + useQuotes: false + }) + : Rep({ + object: grip, + objectLink: VariablesViewLink, + defaultRep: Grip + }) + ); } module.exports.GripMessageBody = GripMessageBody; diff --git a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js index 3367e5d8e05d..83fc616166bc 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js @@ -41,10 +41,10 @@ function ConsoleApiCall(props) { if (type === "trace") { messageBody = dom.span({ className: "cm-variable" }, "console.trace()"); } else if (type === "assert") { - let reps = parameters.map((grip, key) => GripMessageBody({ grip, key })); + let reps = formatReps(parameters); messageBody = dom.span({ className: "cm-variable" }, "Assertion failed: ", reps); } else if (parameters) { - messageBody = parameters.map((grip, key) => GripMessageBody({ grip, key })); + messageBody = formatReps(parameters); } else { messageBody = message.messageText; } @@ -117,4 +117,18 @@ function ConsoleApiCall(props) { ); } +function formatReps(parameters) { + return ( + parameters + // Get all the grips. + .map((grip, key) => GripMessageBody({ grip, key })) + // Interleave spaces. + .reduce((arr, v, i) => { + return i + 1 < parameters.length + ? arr.concat(v, dom.span({}, " ")) + : arr.concat(v); + }, []) + ); +} + module.exports.ConsoleApiCall = ConsoleApiCall; diff --git a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js index 93690e52e203..b07fc4908080 100644 --- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js @@ -24,8 +24,7 @@ describe("ConsoleAPICall component:", () => { const message = stubPreparedMessages.get("console.log('foobar', 'test')"); const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger })); - // @TODO should output: foobar test - expect(wrapper.find(".message-body").text()).toBe("\"foobar\"\"test\""); + expect(wrapper.find(".message-body").text()).toBe("foobar test"); expect(wrapper.find(".objectBox-string").length).toBe(2); expect(wrapper.find("div.message.cm-s-mozilla span span.message-flex-body span.message-body.devtools-monospace").length).toBe(1); }); From f57b5d0b1bde74103d3f6e58ef91fc3cfe3fca8a Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Tue, 20 Sep 2016 11:37:03 -0700 Subject: [PATCH 088/101] Bug 1303612 - New console frontend: pageErrors should include the location. r=linclark MozReview-Commit-ID: 4UUOSHYtu4l --- .../components/message-types/page-error.js | 4 ++-- .../new-console-output/test/components/page-error.test.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/components/message-types/page-error.js b/devtools/client/webconsole/new-console-output/components/message-types/page-error.js index 2fc6f8137317..6fb588325078 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/page-error.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/page-error.js @@ -47,7 +47,6 @@ function PageError(props) { }) : null ); - let collapse = ""; let attachment = ""; if (stacktrace) { @@ -96,7 +95,8 @@ function PageError(props) { dom.span({ className: "message-body devtools-monospace" }, message.messageText ), - repeat + repeat, + location ), attachment ) diff --git a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js index 114c83d3335d..0cbfeb7a8d1a 100644 --- a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js @@ -23,6 +23,12 @@ describe("PageError component:", () => { // The stacktrace should be closed by default. const frameLinks = wrapper.find(`.stack-trace`); expect(frameLinks.length).toBe(0); + + // There should be the location + const locationLink = wrapper.find(`.message-location`); + expect(locationLink.length).toBe(1); + // @TODO Will likely change. See https://github.com/devtools-html/gecko-dev/issues/285 + expect(locationLink.text()).toBe("http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generato"); }); it("has a stacktrace which can be openned", () => { From 7463700aaa89a41e6ad6614face670f63e9bdd95 Mon Sep 17 00:00:00 2001 From: Lin Clark Date: Tue, 20 Sep 2016 11:37:04 -0700 Subject: [PATCH 089/101] Bug 1303787 - New console frontend: Fix missing icons/backgrounds. r=bgrins MozReview-Commit-ID: 5CqORk9Qd84 --- devtools/client/themes/webconsole.css | 37 +++++++++++-------- devtools/client/webconsole/jsterm.js | 3 -- .../message-types/console-api-call.js | 10 ++--- .../message-types/console-command.js | 12 ++---- .../message-types/evaluation-result.js | 12 ++---- .../message-types/network-event-message.js | 12 ++---- .../components/message-types/page-error.js | 14 ++----- 7 files changed, 41 insertions(+), 59 deletions(-) diff --git a/devtools/client/themes/webconsole.css b/devtools/client/themes/webconsole.css index 2473d1464c30..7985ee3c7ed7 100644 --- a/devtools/client/themes/webconsole.css +++ b/devtools/client/themes/webconsole.css @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* Webconsole specific theme variables */ +.theme-light, .theme-firebug { --error-color: #FF0000; --error-background-color: #FFEBEB; @@ -54,12 +55,14 @@ a { } .theme-firebug .message[severity="error"], +.theme-light .message.error, .theme-firebug .message.error { color: var(--error-color); background-color: var(--error-background-color); } .theme-firebug .message[severity="warn"], +.theme-light .message.warn, .theme-firebug .message.warn { background-color: var(--warning-background-color); } @@ -354,24 +357,17 @@ a { .message[category=console][severity=error] > .icon::before, .message[category=output][severity=error] > .icon::before, -.message[category=server][severity=error] > .icon::before, -.message.console-api.error > .icon::before, -.message.output.error > .icon::before, -.message.server.error > .icon::before { +.message[category=server][severity=error] > .icon::before { background-position: -12px -36px; } .message[category=console][severity=warn] > .icon::before, -.message[category=server][severity=warn] > .icon::before, -.message.console-api.warn > .icon::before, -.message.server.warn > .icon::before { +.message[category=server][severity=warn] > .icon::before { background-position: -24px -36px; } .message[category=console][severity=info] > .icon::before, -.message[category=server][severity=info] > .icon::before, -.message.console-api.info > .icon::before, -.message.server.info > .icon::before { +.message[category=server][severity=info] > .icon::before { background-position: -36px -36px; } @@ -390,18 +386,17 @@ a { /* Input and output styles */ .message[category=input] > .indent, .message[category=output] > .indent, -.message.input > .indent, -.message.output > .indent { +.message.command > .indent, +.message.result > .indent { border-inline-end: solid #808080 6px; } .message[category=input] > .icon::before, -.message.input > .icon::before { +.message.command > .icon::before { background-position: -48px -36px; } -.message[category=output] > .icon::before, -.message.output > .icon::before { +.message[category=output] > .icon::before { background-position: -60px -36px; } @@ -712,6 +707,18 @@ a.learn-more-link.webconsole-learn-more-link { flex: 1 1 100%; } +.message.error > .icon::before { + background-position: -12px -36px; +} + +.message.warn > .icon::before { + background-position: -24px -36px; +} + +.message.info > .icon::before { + background-position: -36px -36px; +} + .message.network .method { margin-inline-end: 5px; } diff --git a/devtools/client/webconsole/jsterm.js b/devtools/client/webconsole/jsterm.js index 43d67a787dcb..4ff5d9bb329b 100644 --- a/devtools/client/webconsole/jsterm.js +++ b/devtools/client/webconsole/jsterm.js @@ -446,9 +446,6 @@ JSTerm.prototype = { const { ConsoleCommand } = require("devtools/client/webconsole/new-console-output/types"); let message = new ConsoleCommand({ messageText: executeString, - // @TODO remove category and severity - category: "input", - severity: "log", }); this.hud.newConsoleOutput.dispatchMessageAdd(message); } else { diff --git a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js index 83fc616166bc..322e0eb78723 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/console-api-call.js @@ -87,13 +87,9 @@ function ConsoleApiCall(props) { const classes = ["message", "cm-s-mozilla"]; - if (source) { - classes.push(source); - } - - if (level) { - classes.push(level); - } + classes.push(source); + classes.push(type); + classes.push(level); if (open === true) { classes.push("open"); diff --git a/devtools/client/webconsole/new-console-output/components/message-types/console-command.js b/devtools/client/webconsole/new-console-output/components/message-types/console-command.js index 77afaaf51fb0..81f569a86746 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/console-command.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/console-command.js @@ -26,19 +26,15 @@ ConsoleCommand.propTypes = { */ function ConsoleCommand(props) { const { message } = props; - const {source, level} = message; + const {source, type, level} = message; const icon = MessageIcon({level}); const classes = ["message"]; - if (source) { - classes.push(source); - } - - if (level) { - classes.push(level); - } + classes.push(source); + classes.push(type); + classes.push(level); return dom.div({ className: classes.join(" "), diff --git a/devtools/client/webconsole/new-console-output/components/message-types/evaluation-result.js b/devtools/client/webconsole/new-console-output/components/message-types/evaluation-result.js index d089127dbcf2..58a9c3caf9d0 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/evaluation-result.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/evaluation-result.js @@ -23,18 +23,14 @@ EvaluationResult.propTypes = { function EvaluationResult(props) { const { message } = props; - const {source, level} = message; + const {source, type, level} = message; const icon = MessageIcon({level}); const classes = ["message", "cm-s-mozilla"]; - if (source) { - classes.push(source); - } - - if (level) { - classes.push(level); - } + classes.push(source); + classes.push(type); + classes.push(level); return dom.div({ className: classes.join(" ") diff --git a/devtools/client/webconsole/new-console-output/components/message-types/network-event-message.js b/devtools/client/webconsole/new-console-output/components/message-types/network-event-message.js index cfc8fe69b8d3..bbfbb69318c1 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/network-event-message.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/network-event-message.js @@ -29,19 +29,15 @@ NetworkEventMessage.propTypes = { function NetworkEventMessage(props) { const { dispatch, message, openNetworkPanel, open } = props; - const { actor, source, level, request, response, isXHR, totalTime } = message; + const { actor, source, type, level, request, response, isXHR, totalTime } = message; let { method, url } = request; let { httpVersion, status, statusText } = response; let classes = ["message", "cm-s-mozilla"]; - if (source) { - classes.push(source); - } - - if (level) { - classes.push(level); - } + classes.push(source); + classes.push(type); + classes.push(level); if (open) { classes.push("open"); diff --git a/devtools/client/webconsole/new-console-output/components/message-types/page-error.js b/devtools/client/webconsole/new-console-output/components/message-types/page-error.js index 6fb588325078..143d104976ed 100644 --- a/devtools/client/webconsole/new-console-output/components/message-types/page-error.js +++ b/devtools/client/webconsole/new-console-output/components/message-types/page-error.js @@ -33,7 +33,7 @@ PageError.defaultProps = { function PageError(props) { const { dispatch, message, open, sourceMapService, onViewSourceInDebugger } = props; - const { source, level, stacktrace, frame } = message; + const { source, type, level, stacktrace, frame } = message; const repeat = MessageRepeat({repeat: message.repeat}); const icon = MessageIcon({level}); @@ -72,15 +72,9 @@ function PageError(props) { } const classes = ["message"]; - - if (source) { - classes.push(source); - } - - if (level) { - classes.push(level); - } - + classes.push(source); + classes.push(type); + classes.push(level); if (open === true) { classes.push("open"); } From 4a844cf7d6d5d161319b070cbf7eec5e4303f0c1 Mon Sep 17 00:00:00 2001 From: Lin Clark Date: Tue, 20 Sep 2016 11:37:04 -0700 Subject: [PATCH 090/101] Bug 1303812 - New console frontend: Hide CSS page errors. r=bgrins MozReview-Commit-ID: 6gxO8n1yuYa --- devtools/client/webconsole/webconsole.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devtools/client/webconsole/webconsole.js b/devtools/client/webconsole/webconsole.js index f087157143b9..e409ca1d5ec8 100644 --- a/devtools/client/webconsole/webconsole.js +++ b/devtools/client/webconsole/webconsole.js @@ -3324,7 +3324,10 @@ WebConsoleConnectionProxy.prototype = { _onPageError: function (type, packet) { if (this.webConsoleFrame && packet.from == this._consoleActor) { if (this.webConsoleFrame.NEW_CONSOLE_OUTPUT_ENABLED) { - this.dispatchMessageAdd(packet); + let category = Utils.categoryForScriptError(packet.pageError); + if (category !== CATEGORY_CSS) { + this.dispatchMessageAdd(packet); + } return; } this.webConsoleFrame.handlePageError(packet.pageError); From c6141a5807922a750603cf20c91db58ff4767720 Mon Sep 17 00:00:00 2001 From: Lin Clark Date: Tue, 20 Sep 2016 11:37:04 -0700 Subject: [PATCH 091/101] Bug 1303872 - New console frontend: Make npm test work with devtools/client package.json. r=me MozReview-Commit-ID: 1WiKcETN61Y --- devtools/client/package.json | 2 +- .../webconsole/new-console-output/test/actions/messages.test.js | 2 +- devtools/client/webconsole/package.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/devtools/client/package.json b/devtools/client/package.json index 07c7210a6b3f..d5f305e067a9 100644 --- a/devtools/client/package.json +++ b/devtools/client/package.json @@ -1,6 +1,6 @@ { "name": "devtools", - "version": "0.1", + "version": "0.0.1", "description": "", "main": "", "scripts": { diff --git a/devtools/client/webconsole/new-console-output/test/actions/messages.test.js b/devtools/client/webconsole/new-console-output/test/actions/messages.test.js index 4bb175cfa29b..493fdd06b046 100644 --- a/devtools/client/webconsole/new-console-output/test/actions/messages.test.js +++ b/devtools/client/webconsole/new-console-output/test/actions/messages.test.js @@ -3,7 +3,7 @@ "use strict"; const { thunk } = require("devtools/client/shared/redux/middleware/thunk"); -const configureStore = require("redux-mock-store"); +const configureStore = require("redux-mock-store").default; const { getRepeatId } = require("devtools/client/webconsole/new-console-output/utils/messages"); const { stubPackets, stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index"); const { setupActions } = require("devtools/client/webconsole/new-console-output/test/helpers"); diff --git a/devtools/client/webconsole/package.json b/devtools/client/webconsole/package.json index 23280aba1492..ccc936237190 100644 --- a/devtools/client/webconsole/package.json +++ b/devtools/client/webconsole/package.json @@ -15,6 +15,7 @@ "sinon": "^1.17.5" }, "scripts": { + "postinstall": "cd ../ && npm install && cd webconsole", "test": "NODE_PATH=`pwd`/../../../:`pwd`/../../../devtools/client/shared/vendor/ mocha new-console-output/test/**/*.test.js --compilers js:babel-register -r jsdom-global/register -r ./new-console-output/test/requireHelper.js" } } From fcd80588678276bdc995667ef6b39d330941f83f Mon Sep 17 00:00:00 2001 From: Lin Clark Date: Tue, 20 Sep 2016 11:37:04 -0700 Subject: [PATCH 092/101] Bug 1303872 - Part 2: Update stubs and tests. r=me MozReview-Commit-ID: GsYzVeDXlVA --- .../test/components/console-api-call.test.js | 2 +- .../test/components/page-error.test.js | 2 +- .../test/fixtures/stubs/consoleApi.js | 46 ++++++++++++------- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js index b07fc4908080..d33ffa1a3830 100644 --- a/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/console-api-call.test.js @@ -82,7 +82,7 @@ describe("ConsoleAPICall component:", () => { it("renders", () => { const message = stubPreparedMessages.get("console.trace()"); const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger, open: true })); - const filepath = `${tempfilePath}?key=console.trace()`; + const filepath = `${tempfilePath}`; expect(wrapper.find(".message-body").text()).toBe("console.trace()"); diff --git a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js index 0cbfeb7a8d1a..c62af69d9edc 100644 --- a/devtools/client/webconsole/new-console-output/test/components/page-error.test.js +++ b/devtools/client/webconsole/new-console-output/test/components/page-error.test.js @@ -28,7 +28,7 @@ describe("PageError component:", () => { const locationLink = wrapper.find(`.message-location`); expect(locationLink.length).toBe(1); // @TODO Will likely change. See https://github.com/devtools-html/gecko-dev/issues/285 - expect(locationLink.text()).toBe("http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generato"); + expect(locationLink.text()).toBe("test-tempfile.js:3:5"); }); it("has a stacktrace which can be openned", () => { diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js index e88e895d1b6b..c6f698f10540 100644 --- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js @@ -362,6 +362,7 @@ stubPackets.set("console.log('foobar', 'test')", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -369,7 +370,7 @@ stubPackets.set("console.log('foobar', 'test')", { }, "private": false, "styles": [], - "timeStamp": 1473963371646, + "timeStamp": 1474329261562, "timer": null, "workerType": "none", "category": "webdev" @@ -395,6 +396,7 @@ stubPackets.set("console.log(undefined)", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -402,7 +404,7 @@ stubPackets.set("console.log(undefined)", { }, "private": false, "styles": [], - "timeStamp": 1473963372796, + "timeStamp": 1474329262588, "timer": null, "workerType": "none", "category": "webdev" @@ -426,6 +428,7 @@ stubPackets.set("console.warn('danger, will robinson!')", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -433,7 +436,7 @@ stubPackets.set("console.warn('danger, will robinson!')", { }, "private": false, "styles": [], - "timeStamp": 1473963373921, + "timeStamp": 1474329263650, "timer": null, "workerType": "none", "category": "webdev" @@ -459,6 +462,7 @@ stubPackets.set("console.log(NaN)", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -466,7 +470,7 @@ stubPackets.set("console.log(NaN)", { }, "private": false, "styles": [], - "timeStamp": 1473963375058, + "timeStamp": 1474329264822, "timer": null, "workerType": "none", "category": "webdev" @@ -492,6 +496,7 @@ stubPackets.set("console.log(null)", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -499,7 +504,7 @@ stubPackets.set("console.log(null)", { }, "private": false, "styles": [], - "timeStamp": 1473963376386, + "timeStamp": 1474329265855, "timer": null, "workerType": "none", "category": "webdev" @@ -523,6 +528,7 @@ stubPackets.set("console.log('鼬')", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -530,7 +536,7 @@ stubPackets.set("console.log('鼬')", { }, "private": false, "styles": [], - "timeStamp": 1473963377604, + "timeStamp": 1474329266922, "timer": null, "workerType": "none", "category": "webdev" @@ -552,13 +558,14 @@ stubPackets.set("console.clear()", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", "userContextId": 0 }, "private": false, - "timeStamp": 1473963378876, + "timeStamp": 1474329267971, "timer": null, "workerType": "none", "styles": [], @@ -586,13 +593,14 @@ stubPackets.set("console.count('bar')", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", "userContextId": 0 }, "private": false, - "timeStamp": 1473963380028, + "timeStamp": 1474329269084, "timer": null, "workerType": "none", "styles": [], @@ -638,6 +646,7 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -645,7 +654,7 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", { }, "private": false, "styles": [], - "timeStamp": 1473963381225, + "timeStamp": 1474329270125, "timer": null, "stacktrace": [ { @@ -678,6 +687,7 @@ stubPackets.set("console.log('hello \nfrom \rthe \"string world!')", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -685,7 +695,7 @@ stubPackets.set("console.log('hello \nfrom \rthe \"string world!')", { }, "private": false, "styles": [], - "timeStamp": 1473963382425, + "timeStamp": 1474329271256, "timer": null, "workerType": "none", "category": "webdev" @@ -709,6 +719,7 @@ stubPackets.set("console.log('úṇĩçödê țĕșť')", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", @@ -716,7 +727,7 @@ stubPackets.set("console.log('úṇĩçödê țĕșť')", { }, "private": false, "styles": [], - "timeStamp": 1473963383581, + "timeStamp": 1474329272298, "timer": null, "workerType": "none", "category": "webdev" @@ -738,13 +749,14 @@ stubPackets.set("console.trace()", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", "userContextId": 0 }, "private": false, - "timeStamp": 1473963384829, + "timeStamp": 1474329273375, "timer": null, "stacktrace": [ { @@ -792,16 +804,17 @@ stubPackets.set("console.time('bar')", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", "userContextId": 0 }, "private": false, - "timeStamp": 1473963386059, + "timeStamp": 1474329274410, "timer": { "name": "bar", - "started": 745.99 + "started": 618.57 }, "workerType": "none", "styles": [], @@ -826,15 +839,16 @@ stubPackets.set("console.timeEnd('bar')", { "originAttributes": { "addonId": "", "appId": 0, + "firstPartyDomain": "", "inIsolatedMozBrowser": false, "privateBrowsingId": 0, "signedPkg": "", "userContextId": 0 }, "private": false, - "timeStamp": 1473963386060, + "timeStamp": 1474329274411, "timer": { - "duration": 1.6299999999999955, + "duration": 1.3249999999999318, "name": "bar" }, "workerType": "none", From 34ca0fe328c3ed1420096683132754cf54d09a08 Mon Sep 17 00:00:00 2001 From: Lin Clark Date: Tue, 20 Sep 2016 11:44:22 -0700 Subject: [PATCH 093/101] Bug 1303787 - Part 2: Add .result icon. r=me MozReview-Commit-ID: CLvRjYzQA1V --- devtools/client/themes/webconsole.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devtools/client/themes/webconsole.css b/devtools/client/themes/webconsole.css index 7985ee3c7ed7..b534e3e599aa 100644 --- a/devtools/client/themes/webconsole.css +++ b/devtools/client/themes/webconsole.css @@ -396,7 +396,8 @@ a { background-position: -48px -36px; } -.message[category=output] > .icon::before { +.message[category=output] > .icon::before, +.message.result > .icon::before { background-position: -60px -36px; } From f9783c3c609ab5d04b79779bb9ca5ba1b0b29666 Mon Sep 17 00:00:00 2001 From: Vincent Lequertier Date: Sun, 18 Sep 2016 06:02:00 -0400 Subject: [PATCH 094/101] Bug 1299723 - Force LTR direction on computed property names. r=pbro --- devtools/client/inspector/computed/computed.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devtools/client/inspector/computed/computed.js b/devtools/client/inspector/computed/computed.js index f1f04e1e5f70..b979980fef5d 100644 --- a/devtools/client/inspector/computed/computed.js +++ b/devtools/client/inspector/computed/computed.js @@ -961,6 +961,9 @@ PropertyView.prototype = { // Reset its tabindex attribute otherwise, if an ellipsis is applied // it will be reachable via TABing this.nameNode.setAttribute("tabindex", ""); + // Avoid english text (css properties) from being altered + // by RTL mode + this.nameNode.setAttribute("dir", "ltr"); this.nameNode.textContent = this.nameNode.title = this.name; // Make it hand over the focus to the container this.onFocus = () => this.element.focus(); From 225d8af6d8554cfd7a3117cafb9eef9fce465bb0 Mon Sep 17 00:00:00 2001 From: Filipe Date: Thu, 15 Sep 2016 20:56:58 +0200 Subject: [PATCH 095/101] Bug 1287622 - Remove Cortana-related code from Firefox as it no longer works after Microsoft hard-coded search results to Edge. r=jaws --- browser/app/profile/firefox.js | 8 +-- browser/components/nsBrowserContentHandler.js | 52 ------------------- .../preferences/in-content/search.js | 8 --- .../preferences/in-content/search.xul | 8 --- 4 files changed, 1 insertion(+), 75 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 14a2fe15f0dd..0bee85aaa68d 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -377,12 +377,6 @@ pref("browser.search.context.loadInBackground", false); // comma seperated list of of engines to hide in the search panel. pref("browser.search.hiddenOneOffs", ""); -#ifdef XP_WIN -pref("browser.search.redirectWindowsSearch", true); -#else -pref("browser.search.redirectWindowsSearch", false); -#endif - pref("browser.search.reset.enabled", true); pref("browser.usedOnWindows10", false); @@ -1525,4 +1519,4 @@ pref("browser.crashReports.unsubmittedCheck.enabled", true); // without a user choice before we suppress the notification for // some number of days. pref("browser.crashReports.unsubmittedCheck.chancesUntilSuppress", 4); -pref("browser.crashReports.unsubmittedCheck.autoSubmit", false); \ No newline at end of file +pref("browser.crashReports.unsubmittedCheck.autoSubmit", false); diff --git a/browser/components/nsBrowserContentHandler.js b/browser/components/nsBrowserContentHandler.js index a456f9c407a3..3ed2ac99ed79 100644 --- a/browser/components/nsBrowserContentHandler.js +++ b/browser/components/nsBrowserContentHandler.js @@ -2,8 +2,6 @@ * 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/. */ -Components.utils.importGlobalProperties(["URLSearchParams"]); - Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/AppConstants.jsm"); @@ -744,60 +742,10 @@ nsDefaultCommandLineHandler.prototype = { } } - let redirectWinSearch = false; - if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) { - redirectWinSearch = Services.prefs.getBoolPref("browser.search.redirectWindowsSearch"); - } - try { var ar; while ((ar = cmdLine.handleFlagWithParam("url", false))) { var uri = resolveURIInternal(cmdLine, ar); - - // Searches in the Windows 10 task bar searchbox simply open the default browser - // with a URL for a search on Bing. Here we extract the search term and use the - // user's default search engine instead. - var uriScheme = "", uriHost = "", uriPath = ""; - try { - uriScheme = uri.scheme; - uriHost = uri.host; - uriPath = uri.path; - } catch (e) { - } - - // Most Windows searches are "https://www.bing.com/search...", but bug - // 1182308 reports a Chinese edition of Windows 10 using - // "http://cn.bing.com/search...", so be a bit flexible in what we match. - if (redirectWinSearch && - (uriScheme == "http" || uriScheme == "https") && - uriHost.endsWith(".bing.com") && uriPath.startsWith("/search")) { - try { - var url = uri.QueryInterface(Components.interfaces.nsIURL); - var params = new URLSearchParams(url.query); - // We don't want to rewrite all Bing URLs coming from external apps. Look - // for the magic URL parm that's present in searches from the task bar. - // * Typed searches use "form=WNSGPH" - // * Cortana voice searches use "FORM=WNSBOX" or direct results, or "FORM=WNSFC2" - // for "see more results on Bing.com") - // * Cortana voice searches started from "Hey, Cortana" use "form=WNSHCO" - // or "form=WNSSSV" or "form=WNSSCX" - var allowedParams = ["WNSGPH", "WNSBOX", "WNSFC2", "WNSHCO", "WNSSCX", "WNSSSV"]; - var formParam = params.get("form"); - if (!formParam) { - formParam = params.get("FORM"); - } - if (allowedParams.indexOf(formParam) != -1) { - var term = params.get("q"); - var engine = Services.search.defaultEngine; - logSystemBasedSearch(engine); - var submission = engine.getSubmission(term, null, "system"); - uri = submission.uri; - } - } catch (e) { - Components.utils.reportError("Couldn't redirect Windows search: " + e); - } - } - urilist.push(uri); } } diff --git a/browser/components/preferences/in-content/search.js b/browser/components/preferences/in-content/search.js index be34eb8595e6..eb840081fd65 100644 --- a/browser/components/preferences/in-content/search.js +++ b/browser/components/preferences/in-content/search.js @@ -3,8 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "AppConstants", - "resource://gre/modules/AppConstants.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", @@ -12,12 +10,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task", const ENGINE_FLAVOR = "text/x-moz-search-engine"; -document.addEventListener("Initialized", () => { - if (!AppConstants.isPlatformAndVersionAtLeast("win", "10")) { - document.getElementById("redirectSearchCheckbox").hidden = true; - } -}); - var gEngineView = null; var gSearchPane = { diff --git a/browser/components/preferences/in-content/search.xul b/browser/components/preferences/in-content/search.xul index c01717de8d39..95c7acd85deb 100644 --- a/browser/components/preferences/in-content/search.xul +++ b/browser/components/preferences/in-content/search.xul @@ -12,10 +12,6 @@ name="browser.search.hiddenOneOffs" type="unichar"/> - - From 7e7b3c9f0f4da9183b91ebd716f63307599fe8d8 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Wed, 21 Sep 2016 13:04:01 +1200 Subject: [PATCH 099/101] Bug 1280829 - Only block non-MSE content which is encrypted once it reaches load metadata. r=jya Previously, we'd block loading of non-MSE content when there was a MediaKeys attached, that is, we'd assume that all content was EME content if a MediaKeys was attached. But some sites attach a MediaKeys and then load non-MSE non-EME content, and that (despite being a bit silly) shouldn't fail. MozReview-Commit-ID: 9LupWaehXim --HG-- extra : rebase_source : 6db281feb27a61b49dc565d4d4562a3d2366fc89 --- dom/html/HTMLMediaElement.cpp | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 8f32d8f43d4e..2809743ae131 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -1637,20 +1637,6 @@ nsresult HTMLMediaElement::LoadResource() // Set the media element's CORS mode only when loading a resource mCORSMode = AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin)); -#ifdef MOZ_EME - bool isBlob = false; - if (mMediaKeys && - Preferences::GetBool("media.eme.mse-only", true) && - // We only want mediaSource URLs, but they are BlobURL, so we have to - // check the schema and if they are not MediaStream or real Blob. - (NS_FAILED(mLoadingSrc->SchemeIs(BLOBURI_SCHEME, &isBlob)) || - !isBlob || - IsMediaStreamURI(mLoadingSrc) || - IsBlobURI(mLoadingSrc))) { - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; - } -#endif - HTMLMediaElement* other = LookupMediaElementURITable(mLoadingSrc); if (other && other->mDecoder) { // Clone it. @@ -4340,8 +4326,10 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo, mDecoder->SetFragmentEndTime(mFragmentEnd); } if (mIsEncrypted) { + // We only support playback of encrypted content via MSE by default. if (!mMediaSource && Preferences::GetBool("media.eme.mse-only", true)) { - DecodeError(NS_ERROR_DOM_MEDIA_FATAL_ERR); + DecodeError(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, + "Encrypted content not supported outside of MSE")); return; } @@ -6110,16 +6098,6 @@ HTMLMediaElement::SetMediaKeys(mozilla::dom::MediaKeys* aMediaKeys, return nullptr; } - // We only support EME for MSE content by default. - if (mDecoder && - !mMediaSource && - Preferences::GetBool("media.eme.mse-only", true)) { - ShutdownDecoder(); - promise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR, - NS_LITERAL_CSTRING("EME not supported on non-MSE streams")); - return promise.forget(); - } - // 1. If mediaKeys and the mediaKeys attribute are the same object, // return a resolved promise. if (mMediaKeys == aMediaKeys) { From caf8a7af28cb450a8bf41dcd4d31ca9d5d2e9e7b Mon Sep 17 00:00:00 2001 From: Shane Caraveo Date: Tue, 20 Sep 2016 16:06:37 -0700 Subject: [PATCH 100/101] Bug 1304142 pocket a/b test updates, r=Gijs MozReview-Commit-ID: ChBRc81QQ7Y --HG-- extra : rebase_source : 56c0a97d4cd56e9a9f2b6307b23d4a1f3e0f31d1 --- .eslintignore | 2 + .../browser_misused_characters_in_strings.js | 8 + browser/extensions/pocket/content/main.js | 25 +- .../pocket/content/panels/css/signup.css | 35 +- .../pocket/content/panels/js/saved.js | 8 +- .../pocket/content/panels/js/signup.js | 16 +- .../pocket/content/panels/js/tmpl.js | 334 +++++++++++------- .../panels/tmpl/signup_shell.handlebars | 26 +- .../tmpl/signupstoryboard_shell.handlebars | 27 +- browser/extensions/pocket/content/pktApi.jsm | 23 +- .../pocket/locale/ar/pocket.properties | 41 --- .../pocket/locale/ast/pocket.properties | 2 + .../pocket/locale/az/pocket.properties | 43 +++ .../pocket/locale/bg/pocket.properties | 2 + .../pocket/locale/bn-BD/pocket.properties | 2 + .../pocket/locale/br/pocket.properties | 41 --- .../pocket/locale/bs/pocket.properties | 41 --- .../pocket/locale/ca/pocket.properties | 41 --- .../pocket/locale/cs/pocket.properties | 2 + .../pocket/locale/cy/pocket.properties | 41 --- .../pocket/locale/da/pocket.properties | 2 + .../pocket/locale/de/pocket.properties | 2 + .../pocket/locale/dsb/pocket.properties | 43 +++ .../pocket/locale/en-GB/pocket.properties | 41 --- .../pocket/locale/en-US/pocket.properties | 2 + .../pocket/locale/en-ZA/pocket.properties | 41 --- .../pocket/locale/eo/pocket.properties | 41 --- .../pocket/locale/es-AR/pocket.properties | 41 --- .../pocket/locale/es-CL/pocket.properties | 2 + .../pocket/locale/es-ES/pocket.properties | 7 +- .../pocket/locale/es-MX/pocket.properties | 2 + .../pocket/locale/et/pocket.properties | 2 + .../pocket/locale/eu/pocket.properties | 41 --- .../pocket/locale/fa/pocket.properties | 41 --- .../pocket/locale/fi/pocket.properties | 2 + .../pocket/locale/fr/pocket.properties | 4 +- .../pocket/locale/fy-NL/pocket.properties | 8 +- .../pocket/locale/ga-IE/pocket.properties | 41 --- .../pocket/locale/gd/pocket.properties | 41 --- .../pocket/locale/hi-IN/pocket.properties | 41 --- .../pocket/locale/hr/pocket.properties | 2 + .../pocket/locale/hsb/pocket.properties | 43 +++ .../pocket/locale/hu/pocket.properties | 2 + .../pocket/locale/hy-AM/pocket.properties | 41 --- .../pocket/locale/id/pocket.properties | 41 --- .../pocket/locale/is/pocket.properties | 41 --- .../pocket/locale/it/pocket.properties | 5 + .../pocket/locale/ja-JP-mac/pocket.properties | 41 --- .../pocket/locale/ja/pocket.properties | 70 ++-- browser/extensions/pocket/locale/jar.mn | 13 +- .../pocket/locale/ka/pocket.properties | 41 --- .../pocket/locale/kab/pocket.properties | 43 +++ .../pocket/locale/kk/pocket.properties | 41 --- .../pocket/locale/km/pocket.properties | 41 --- .../pocket/locale/kn/pocket.properties | 41 --- .../pocket/locale/ko/pocket.properties | 41 --- .../pocket/locale/lt/pocket.properties | 41 --- .../pocket/locale/lv/pocket.properties | 2 + .../pocket/locale/mr/pocket.properties | 41 --- .../pocket/locale/my/pocket.properties | 41 --- .../pocket/locale/nb-NO/pocket.properties | 41 --- .../pocket/locale/ne-NP/pocket.properties | 41 --- .../pocket/locale/nl/pocket.properties | 2 + .../pocket/locale/nn-NO/pocket.properties | 2 + .../pocket/locale/or/pocket.properties | 43 +++ .../pocket/locale/pa-IN/pocket.properties | 41 --- .../pocket/locale/pt-BR/pocket.properties | 4 +- .../pocket/locale/pt-PT/pocket.properties | 43 +++ .../pocket/locale/rm/pocket.properties | 2 + .../pocket/locale/ro/pocket.properties | 4 +- .../pocket/locale/ru/pocket.properties | 5 + .../pocket/locale/sk/pocket.properties | 2 + .../pocket/locale/sl/pocket.properties | 2 + .../pocket/locale/son/pocket.properties | 41 --- .../pocket/locale/sq/pocket.properties | 2 + .../pocket/locale/sr/pocket.properties | 2 + .../pocket/locale/sv-SE/pocket.properties | 2 + .../pocket/locale/te/pocket.properties | 2 + .../pocket/locale/th/pocket.properties | 2 + .../pocket/locale/tr/pocket.properties | 2 + .../pocket/locale/uk/pocket.properties | 2 + .../pocket/locale/xh/pocket.properties | 41 --- .../pocket/locale/zh-CN/pocket.properties | 2 + .../pocket/locale/zh-TW/pocket.properties | 3 +- 84 files changed, 731 insertions(+), 1479 deletions(-) delete mode 100644 browser/extensions/pocket/locale/ar/pocket.properties create mode 100644 browser/extensions/pocket/locale/az/pocket.properties delete mode 100644 browser/extensions/pocket/locale/br/pocket.properties delete mode 100644 browser/extensions/pocket/locale/bs/pocket.properties delete mode 100644 browser/extensions/pocket/locale/ca/pocket.properties delete mode 100644 browser/extensions/pocket/locale/cy/pocket.properties create mode 100644 browser/extensions/pocket/locale/dsb/pocket.properties delete mode 100644 browser/extensions/pocket/locale/en-GB/pocket.properties delete mode 100644 browser/extensions/pocket/locale/en-ZA/pocket.properties delete mode 100644 browser/extensions/pocket/locale/eo/pocket.properties delete mode 100644 browser/extensions/pocket/locale/es-AR/pocket.properties delete mode 100644 browser/extensions/pocket/locale/eu/pocket.properties delete mode 100644 browser/extensions/pocket/locale/fa/pocket.properties delete mode 100644 browser/extensions/pocket/locale/ga-IE/pocket.properties delete mode 100644 browser/extensions/pocket/locale/gd/pocket.properties delete mode 100644 browser/extensions/pocket/locale/hi-IN/pocket.properties create mode 100644 browser/extensions/pocket/locale/hsb/pocket.properties delete mode 100644 browser/extensions/pocket/locale/hy-AM/pocket.properties delete mode 100644 browser/extensions/pocket/locale/id/pocket.properties delete mode 100644 browser/extensions/pocket/locale/is/pocket.properties delete mode 100644 browser/extensions/pocket/locale/ja-JP-mac/pocket.properties delete mode 100644 browser/extensions/pocket/locale/ka/pocket.properties create mode 100644 browser/extensions/pocket/locale/kab/pocket.properties delete mode 100644 browser/extensions/pocket/locale/kk/pocket.properties delete mode 100644 browser/extensions/pocket/locale/km/pocket.properties delete mode 100644 browser/extensions/pocket/locale/kn/pocket.properties delete mode 100644 browser/extensions/pocket/locale/ko/pocket.properties delete mode 100644 browser/extensions/pocket/locale/lt/pocket.properties delete mode 100644 browser/extensions/pocket/locale/mr/pocket.properties delete mode 100644 browser/extensions/pocket/locale/my/pocket.properties delete mode 100644 browser/extensions/pocket/locale/nb-NO/pocket.properties delete mode 100644 browser/extensions/pocket/locale/ne-NP/pocket.properties create mode 100644 browser/extensions/pocket/locale/or/pocket.properties delete mode 100644 browser/extensions/pocket/locale/pa-IN/pocket.properties create mode 100644 browser/extensions/pocket/locale/pt-PT/pocket.properties delete mode 100644 browser/extensions/pocket/locale/son/pocket.properties delete mode 100644 browser/extensions/pocket/locale/xh/pocket.properties diff --git a/.eslintignore b/.eslintignore index db3ebf0f518d..727765d6c4c8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -70,6 +70,8 @@ browser/components/sessionstore/** browser/components/tabview/** browser/components/translation/** browser/extensions/pdfjs/** +# generated or library files in pocket +browser/extensions/pocket/content/panels/js/tmpl.js browser/extensions/pocket/content/panels/js/vendor/** browser/locales/** diff --git a/browser/base/content/test/general/browser_misused_characters_in_strings.js b/browser/base/content/test/general/browser_misused_characters_in_strings.js index 9b3c598ffaf9..d4ca1c85694e 100644 --- a/browser/base/content/test/general/browser_misused_characters_in_strings.js +++ b/browser/base/content/test/general/browser_misused_characters_in_strings.js @@ -100,6 +100,14 @@ let gWhitelist = [{ file: "netErrorApp.dtd", key: "securityOverride.warningContent", type: "single-quote" + }, { + file: "pocket.properties", + key: "tos", + type: "double-quote" + }, { + file: "pocket.properties", + key: "tos", + type: "apostrophe" } ]; diff --git a/browser/extensions/pocket/content/main.js b/browser/extensions/pocket/content/main.js index 2d0c8e78f6f5..c47a140e23f5 100644 --- a/browser/extensions/pocket/content/main.js +++ b/browser/extensions/pocket/content/main.js @@ -132,7 +132,7 @@ var pktUI = (function() { if (pktApi.getSignupPanelTabTestVariant() == 'tab') { let site = Services.prefs.getCharPref("extensions.pocket.site"); - openTabWithUrl('https://' + site + '/firefox_learnmore?src=ff_ext&s=ffi&t=buttonclick', true); + openTabWithUrl('https://' + site + '/firefox_learnmore?s=ffi&t=autoredirect&tv=page_learnmore&src=ff_ext', true); // force the panel closed before it opens getPanel().hidePopup(); @@ -146,6 +146,7 @@ var pktUI = (function() { var fxasignedin = (typeof userdata == 'object' && userdata !== null) ? '1' : '0'; var startheight = 490; var inOverflowMenu = isInOverflowMenu(); + var controlvariant = pktApi.getSignupPanelTabTestVariant() == 'control'; if (inOverflowMenu) { @@ -159,6 +160,9 @@ var pktUI = (function() { startheight = 406; } } + if (!controlvariant) { + startheight = 427; + } var variant; if (inOverflowMenu) { @@ -169,7 +173,18 @@ var pktUI = (function() { variant = 'storyboard_lm'; } - var panelId = showPanel("about:pocket-signup?pockethost=" + Services.prefs.getCharPref("extensions.pocket.site") + "&fxasignedin=" + fxasignedin + "&variant=" + variant + '&inoverflowmenu=' + inOverflowMenu + "&locale=" + getUILocale(), { + var panelId = showPanel("about:pocket-signup?pockethost=" + + Services.prefs.getCharPref("extensions.pocket.site") + + "&fxasignedin=" + + fxasignedin + + "&variant=" + + variant + + '&controlvariant=' + + controlvariant + + '&inoverflowmenu=' + + inOverflowMenu + + "&locale=" + + getUILocale(), { onShow: function() { }, onHide: panelDidHide, @@ -469,7 +484,11 @@ var pktUI = (function() { var e = bundle.getSimpleEnumeration(); while (e.hasMoreElements()) { var str = e.getNext().QueryInterface(Components.interfaces.nsIPropertyElement); - strings[str.key] = str.value; + if (str.key in data) { + strings[str.key] = bundle.formatStringFromName(str.key, data[str.key], data[str.key].length); + } else { + strings[str.key] = str.value; + } } pktUIMessaging.sendResponseMessageToPanel(panelId, _initL10NMessageId, { strings: strings }); }); diff --git a/browser/extensions/pocket/content/panels/css/signup.css b/browser/extensions/pocket/content/panels/css/signup.css index 5cdcdd7dc4a4..5c428a29b58d 100644 --- a/browser/extensions/pocket/content/panels/css/signup.css +++ b/browser/extensions/pocket/content/panels/css/signup.css @@ -32,8 +32,8 @@ } .pkt_ext_cf:after { content: " "; - display:table; - clear:both; + display: table; + clear: both; } @keyframes pkt_ext_hide { 0% { @@ -60,7 +60,7 @@ margin: 0 auto 1.5em; max-width: 260px; } -.pkt_ext_containersignup a { +.pkt_ext_containersignup a { color: #4c8fd0; } .pkt_ext_containersignup a:hover { @@ -141,6 +141,17 @@ max-width: 320px; margin-top: 15px; } +.pkt_ext_containersignup .tryitnowspace { + margin-top: 22px; +} +.pkt_ext_signupdetail p.pkt_ext_tos { + color: #777; + font-size: 10px; + line-height: 1.5; + margin-top: 17px; + padding-top: 0; + max-width: 190px; +} /*=Core detail - storyboard --------------------------------------------------------------------------------------- */ @@ -259,6 +270,7 @@ opacity: 0.9; } .pkt_ext_containersignup .signup-btn-firefox, +.pkt_ext_containersignup .signup-btn-tryitnow, .pkt_ext_containersignup .signup-btn-email, .pkt_ext_containersignup .signupinterim-btn-login, .pkt_ext_containersignup .signupinterim-btn-signup, @@ -272,11 +284,15 @@ position: relative; z-index: 10; } +.pkt_ext_containersignup .signup-btn-tryitnow, .pkt_ext_containersignup .signup-btn-firefox { min-width: 14.5em; position: relative; padding: 0; } +.pkt_ext_containersignup .signup-btn-tryitnow{ + margin-top: 25px; +} .pkt_ext_containersignup .signup-btn-firefox .logo { background: url(../img/signup_firefoxlogo@1x.png) center center no-repeat; height: 2.6em; @@ -295,6 +311,7 @@ .pkt_ext_containersignup .forgotreset-btn-change { margin-bottom: 2em; } +.pkt_ext_containersignup .signup-btn-tryitnow .text, .pkt_ext_containersignup .signup-btn-firefox .text { display: inline-block; padding: 0.8em 1.625em; @@ -302,6 +319,7 @@ text-shadow: none; white-space: nowrap; } +.pkt_ext_containersignup .signup-btn-tryitnow .text, .pkt_ext_containersignup .signup-btn-firefox .text { color: #fff; } @@ -322,12 +340,14 @@ width: 200px; } .pkt_ext_signup_overflow .signup-btn-firefox, +.pkt_ext_containersignup .signup-btn-tryitnow, .pkt_ext_signup_overflow .signup-btn-email { font-size: 14px; min-width: 12.6em; padding-left: 0.75em; padding-right: 0.75em; } +.pkt_ext_signup_overflow .signup-btn-tryitnow .text, .pkt_ext_signup_overflow .signup-btn-firefox .text { padding-left: 0; padding-right: 0; @@ -346,17 +366,22 @@ margin-bottom: 0.5em; } .pkt_ext_signup_de .signup-btn-firefox .text, +.pkt_ext_signup_de .signup-btn-tryitnow .text, .pkt_ext_signup_de .signup-btn-email, .pkt_ext_signup_es .pkt_ext_signupdetail_hero .signup-btn-firefox .text, .pkt_ext_signup_es .pkt_ext_signupdetail_hero .signup-btn-email, .pkt_ext_signup_ja .signup-btn-firefox .text, +.pkt_ext_signup_ja .signup-btn-tryitnow .text, .pkt_ext_signup_ja .signup-btn-email, .pkt_ext_signup_ru .signup-btn-firefox .text, +.pkt_ext_signup_ru .signup-btn-tryitnow .text, .pkt_ext_signup_ru .signup-btn-email { font-size: 15px; } .pkt_ext_signup_ja .signup-btn-firefox .text, -.pkt_ext_signup_ru .signup-btn-firefox .text { +.pkt_ext_signup_ja .signup-btn-tryitnow .text, +.pkt_ext_signup_ru .signup-btn-firefox .text, +.pkt_ext_signup_ru .signup-btn-tryitnow .text { left: 15px; } .pkt_ext_signup_de .signup-btn-firefox .logo, @@ -396,4 +421,4 @@ .pkt_ext_signup_overflow.pkt_ext_signup_ja .signup-btn-firefox .logo, .pkt_ext_signup_overflow.pkt_ext_signup_ru .signup-btn-firefox .logo { display: none; -} \ No newline at end of file +} diff --git a/browser/extensions/pocket/content/panels/js/saved.js b/browser/extensions/pocket/content/panels/js/saved.js index b1b8a7bc4c04..0be916e4b504 100644 --- a/browser/extensions/pocket/content/panels/js/saved.js +++ b/browser/extensions/pocket/content/panels/js/saved.js @@ -595,8 +595,14 @@ $(function() thePKT_SAVED.init(); } + var pocketHost = thePKT_SAVED.overlay.pockethost; // send an async message to get string data - thePKT_SAVED.sendMessage("initL10N", {}, function(resp) { + thePKT_SAVED.sendMessage("initL10N", { + tos: [ + 'https://'+ pocketHost +'/tos?s=ffi&t=tos&tv=panel_tryit', + 'https://'+ pocketHost +'/privacy?s=ffi&t=privacypolicy&tv=panel_tryit' + ] + }, function(resp) { window.pocketStrings = resp.strings; window.thePKT_SAVED.create(); }); diff --git a/browser/extensions/pocket/content/panels/js/signup.js b/browser/extensions/pocket/content/panels/js/signup.js index 6f82df02bdc0..5a1aeef20a90 100644 --- a/browser/extensions/pocket/content/panels/js/signup.js +++ b/browser/extensions/pocket/content/panels/js/signup.js @@ -18,6 +18,7 @@ var PKT_SIGNUP_OVERLAY = function (options) this.autocloseTimer = null; this.variant = ""; this.inoverflowmenu = false; + this.controlvariant; this.pockethost = "getpocket.com"; this.fxasignedin = false; this.dictJSON = {}; @@ -56,6 +57,7 @@ var PKT_SIGNUP_OVERLAY = function (options) { this.dictJSON = window.pocketStrings; }; + }; PKT_SIGNUP_OVERLAY.prototype = { @@ -63,6 +65,11 @@ PKT_SIGNUP_OVERLAY.prototype = { { var myself = this; + var controlvariant = window.location.href.match(/controlvariant=([\w|\.]*)&?/); + if (controlvariant && controlvariant.length > 1) + { + this.controlvariant = controlvariant[1]; + } var variant = window.location.href.match(/variant=([\w|\.]*)&?/); if (variant && variant.length > 1) { @@ -98,6 +105,7 @@ PKT_SIGNUP_OVERLAY.prototype = { // set translations this.getTranslations(); this.dictJSON.fxasignedin = this.fxasignedin ? 1 : 0; + this.dictJSON.controlvariant = this.controlvariant == 'true' ? 1 : 0; this.dictJSON.variant = (this.variant ? this.variant : 'undefined'); this.dictJSON.variant += this.fxasignedin ? '_fxa' : '_nonfxa'; this.dictJSON.pockethost = this.pockethost; @@ -173,8 +181,14 @@ $(function() thePKT_SIGNUP.init(); } + var pocketHost = thePKT_SIGNUP.overlay.pockethost; // send an async message to get string data - thePKT_SIGNUP.sendMessage("initL10N", {}, function(resp) { + thePKT_SIGNUP.sendMessage("initL10N", { + tos: [ + 'https://'+ pocketHost +'/tos?s=ffi&t=tos&tv=panel_tryit', + 'https://'+ pocketHost +'/privacy?s=ffi&t=privacypolicy&tv=panel_tryit' + ] + }, function(resp) { window.pocketStrings = resp.strings; window.thePKT_SIGNUP.create(); }); diff --git a/browser/extensions/pocket/content/panels/js/tmpl.js b/browser/extensions/pocket/content/panels/js/tmpl.js index 4a708aa3b251..a03ffda700f1 100644 --- a/browser/extensions/pocket/content/panels/js/tmpl.js +++ b/browser/extensions/pocket/content/panels/js/tmpl.js @@ -1,150 +1,242 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['saved_premiumextras'] = template({"compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) { - return "
\n
"; - }, "useData":true}); -templates['saved_premiumshell'] = template({"compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) { +templates['saved_premiumextras'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + return "
\r\n
"; + },"useData":true}); +templates['saved_premiumshell'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; return "
\n

" - + escapeExpression(((helper = (helper = helpers.suggestedtags || (depth0 != null ? depth0.suggestedtags : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"suggestedtags", "hash":{}, "data":data}) : helper))) + + escapeExpression(((helper = (helper = helpers.suggestedtags || (depth0 != null ? depth0.suggestedtags : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"suggestedtags","hash":{},"data":data}) : helper))) + "

\n
\n
    \n
\n
"; -}, "useData":true}); -templates['saved_shell'] = template({"compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) { +},"useData":true}); +templates['saved_shell'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; return "
\n
\n
\n

" - + escapeExpression(((helper = (helper = helpers.saving || (depth0 != null ? depth0.saving : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"saving", "hash":{}, "data":data}) : helper))) - + "

\n
\n
\n
\n
\n
\n
\n

" - + escapeExpression(((helper = (helper = helpers.pagesaved || (depth0 != null ? depth0.pagesaved : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pagesaved", "hash":{}, "data":data}) : helper))) + + escapeExpression(((helper = (helper = helpers.saving || (depth0 != null ? depth0.saving : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"saving","hash":{},"data":data}) : helper))) + + "

\n
\n
\n
\n
\n
\n \n \n

\n
"; -}, "useData":true}); -templates['signup_shell'] = template({"1":function(depth0, helpers, partials, data) { + + escapeExpression(((helper = (helper = helpers.save || (depth0 != null ? depth0.save : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"save","hash":{},"data":data}) : helper))) + + "\n \n

\n"; +},"useData":true}); +templates['signup_shell'] = template({"1":function(depth0,helpers,partials,data) { + var stack1, buffer = ""; + stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.controlvariant : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}); + if (stack1 != null) { buffer += stack1; } + return buffer; +},"2":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "

" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"learnmore", "hash":{}, "data":data}) : helper))) + + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) + "

\n"; -}, "3":function(depth0, helpers, partials, data) { +},"4":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "

" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"learnmore", "hash":{}, "data":data}) : helper))) + return "

" + + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) + "

\n"; -}, "5":function(depth0, helpers, partials, data) { +},"6":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "

" + + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) + + "

\n"; +},"8":function(depth0,helpers,partials,data) { + var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + return "

" + + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper))) + + "

\n

" - + escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox", "hash":{}, "data":data}) : helper))) - + "

\n"; -}, "7":function(depth0, helpers, partials, data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "

" - + escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox", "hash":{}, "data":data}) : helper))) - + "

\n

" - + escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signupemail", "hash":{}, "data":data}) : helper))) - + "

\n"; -}, "compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "
\n

Pocket

\n

" - + escapeExpression(((helper = (helper = helpers.tagline || (depth0 != null ? depth0.tagline : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"tagline", "hash":{}, "data":data}) : helper))) - + "

\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if", "hash":{}, "fn":this.program(1, data), "inverse":this.program(3, data), "data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "
\n
\n
\n

" - + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave", "hash":{}, "data":data}) : helper))) - + "

\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if", "hash":{}, "fn":this.program(5, data), "inverse":this.program(7, data), "data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + "

" - + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct", "hash":{}, "data":data}) : helper))) + + escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) + " " - + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"loginnow", "hash":{}, "data":data}) : helper))) - + ".

\n
"; -}, "useData":true}); -templates['signupstoryboard_shell'] = template({"1":function(depth0, helpers, partials, data) { + + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) + + ".

\n"; +},"10":function(depth0,helpers,partials,data) { + var stack1, buffer = ""; + stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.controlvariant : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.program(13, data),"data":data}); + if (stack1 != null) { buffer += stack1; } + return buffer; +},"11":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "

" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"learnmore", "hash":{}, "data":data}) : helper))) - + "

\n"; -}, "3":function(depth0, helpers, partials, data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "

" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"learnmore", "hash":{}, "data":data}) : helper))) - + "

\n"; -}, "5":function(depth0, helpers, partials, data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "

" + + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper))) + + "\n

" - + escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox", "hash":{}, "data":data}) : helper))) - + "

\n"; -}, "7":function(depth0, helpers, partials, data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "

" - + escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox", "hash":{}, "data":data}) : helper))) - + "

\n

\n

" - + escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signupemail", "hash":{}, "data":data}) : helper))) - + "

\n"; -}, "compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "
\n
\n
\n

" - + escapeExpression(((helper = (helper = helpers.taglinestory_one || (depth0 != null ? depth0.taglinestory_one : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_one", "hash":{}, "data":data}) : helper))) - + "

\n
\n
\n
\n
\n
\n
\n

" - + escapeExpression(((helper = (helper = helpers.taglinestory_two || (depth0 != null ? depth0.taglinestory_two : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_two", "hash":{}, "data":data}) : helper))) - + "

\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if", "hash":{}, "fn":this.program(1, data), "inverse":this.program(3, data), "data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += "
\n
\n
\n
\n
\n

" - + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave", "hash":{}, "data":data}) : helper))) - + "

\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if", "hash":{}, "fn":this.program(5, data), "inverse":this.program(7, data), "data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + "

" - + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct", "hash":{}, "data":data}) : helper))) + + escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupemail","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) + " " - + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"loginnow", "hash":{}, "data":data}) : helper))) - + ".

\n
"; -}, "useData":true}); + + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) + + ".

\n"; +},"13":function(depth0,helpers,partials,data) { + var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "

" + + escapeExpression(((helper = (helper = helpers.tryitnow || (depth0 != null ? depth0.tryitnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tryitnow","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) + + " " + + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) + + ".

\n

"; + stack1 = ((helper = (helper = helpers.tos || (depth0 != null ? depth0.tos : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tos","hash":{},"data":data}) : helper)); + if (stack1 != null) { buffer += stack1; } + return buffer + "

\n"; +},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "
\n

Pocket

\n

" + + escapeExpression(((helper = (helper = helpers.tagline || (depth0 != null ? depth0.tagline : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tagline","hash":{},"data":data}) : helper))) + + "

\n"; + stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(6, data),"data":data}); + if (stack1 != null) { buffer += stack1; } + buffer += "
\n
\n
\n"; + stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.program(10, data),"data":data}); + if (stack1 != null) { buffer += stack1; } + return buffer + "
\n"; +},"useData":true}); +templates['signupstoryboard_shell'] = template({"1":function(depth0,helpers,partials,data) { + var stack1, buffer = ""; + stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.controlvariant : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}); + if (stack1 != null) { buffer += stack1; } + return buffer; +},"2":function(depth0,helpers,partials,data) { + var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + return "

" + + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) + + "

\n"; +},"4":function(depth0,helpers,partials,data) { + var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + return "

" + + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) + + "

\n"; +},"6":function(depth0,helpers,partials,data) { + var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + return "

" + + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) + + "

\n"; +},"8":function(depth0,helpers,partials,data) { + var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + return "

" + + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) + + " " + + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) + + ".

\n"; +},"10":function(depth0,helpers,partials,data) { + var stack1, buffer = ""; + stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.controlvariant : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.program(13, data),"data":data}); + if (stack1 != null) { buffer += stack1; } + return buffer; +},"11":function(depth0,helpers,partials,data) { + var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + return "

" + + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupemail","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) + + " " + + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) + + ".

\n"; +},"13":function(depth0,helpers,partials,data) { + var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "

" + + escapeExpression(((helper = (helper = helpers.tryitnow || (depth0 != null ? depth0.tryitnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tryitnow","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) + + " " + + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) + + ".

\n

"; + stack1 = ((helper = (helper = helpers.tos || (depth0 != null ? depth0.tos : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tos","hash":{},"data":data}) : helper)); + if (stack1 != null) { buffer += stack1; } + return buffer + "

\n"; +},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "
\n
\n
\n

" + + escapeExpression(((helper = (helper = helpers.taglinestory_one || (depth0 != null ? depth0.taglinestory_one : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_one","hash":{},"data":data}) : helper))) + + "

\n
\n
\n
\n
\n
\n
\n

" + + escapeExpression(((helper = (helper = helpers.taglinestory_two || (depth0 != null ? depth0.taglinestory_two : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_two","hash":{},"data":data}) : helper))) + + "

\n"; + stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(6, data),"data":data}); + if (stack1 != null) { buffer += stack1; } + buffer += "
\n
\n
\n
\n
\n"; + stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.program(10, data),"data":data}); + if (stack1 != null) { buffer += stack1; } + return buffer + "\n
\n"; +},"useData":true}); })(); diff --git a/browser/extensions/pocket/content/panels/tmpl/signup_shell.handlebars b/browser/extensions/pocket/content/panels/tmpl/signup_shell.handlebars index 6c60377f2fb9..8dddaef60e2b 100644 --- a/browser/extensions/pocket/content/panels/tmpl/signup_shell.handlebars +++ b/browser/extensions/pocket/content/panels/tmpl/signup_shell.handlebars @@ -2,19 +2,31 @@

{{tagline}}

{{#if showlearnmore}} -

{{learnmore}}

+ {{#if controlvariant}} +

{{learnmore}}

+ {{else}} +

{{learnmore}}

+ {{/if}} {{else}}

{{learnmore}}

{{/if}}
-

{{signuptosave}}

{{#if fxasignedin}} +

{{signuptosave}}

- {{else}} -

-

- {{/if}}

{{alreadyhaveacct}} {{loginnow}}.

-
\ No newline at end of file + {{else}} + {{#if controlvariant}} +

{{signuptosave}}

+

+

+

{{alreadyhaveacct}} {{loginnow}}.

+ {{else}} +

+

{{alreadyhaveacct}} {{loginnow}}.

+

{{{tos}}}

+ {{/if}} + {{/if}} + diff --git a/browser/extensions/pocket/content/panels/tmpl/signupstoryboard_shell.handlebars b/browser/extensions/pocket/content/panels/tmpl/signupstoryboard_shell.handlebars index ff5b40904722..8a181e23d132 100644 --- a/browser/extensions/pocket/content/panels/tmpl/signupstoryboard_shell.handlebars +++ b/browser/extensions/pocket/content/panels/tmpl/signupstoryboard_shell.handlebars @@ -10,7 +10,11 @@

{{taglinestory_two}}

{{#if showlearnmore}} -

{{learnmore}}

+ {{#if controlvariant}} +

{{learnmore}}

+ {{else}} +

{{learnmore}}

+ {{/if}} {{else}}

{{learnmore}}

{{/if}} @@ -19,12 +23,21 @@
-

{{signuptosave}}

{{#if fxasignedin}} +

{{signuptosave}}

- {{else}} -

-

- {{/if}}

{{alreadyhaveacct}} {{loginnow}}.

-
\ No newline at end of file + {{else}} + {{#if controlvariant}} +

{{signuptosave}}

+

+

+

{{alreadyhaveacct}} {{loginnow}}.

+ {{else}} +

+

{{alreadyhaveacct}} {{loginnow}}.

+

{{{tos}}}

+ {{/if}} + {{/if}} + + diff --git a/browser/extensions/pocket/content/pktApi.jsm b/browser/extensions/pocket/content/pktApi.jsm index 85b0f0b9bef3..b8bb946dc6b6 100644 --- a/browser/extensions/pocket/content/pktApi.jsm +++ b/browser/extensions/pocket/content/pktApi.jsm @@ -610,30 +610,33 @@ var pktApi = (function() { * Helper function to get current signup AB group the user is in */ function getSignupPanelTabTestVariant() { - return getSimpleTestOption('panelTab', 0.1, 'tab'); + return getMultipleTestOption('panelSignUp', {control: 2, v1: 7, v2: 1 }) } - function getSimpleTestOption(testName, threshold, testOptionName) { + function getMultipleTestOption(testName, testOptions) { // Get the test from preferences if we've already assigned the user to a test var settingName = 'test.' + testName; var assignedValue = getSetting(settingName); + var valArray = []; // If not assigned yet, pick and store a value if (!assignedValue) { - if (Math.random() <= threshold) { - assignedValue = testOptionName; - } - else { - assignedValue = 'control'; - } + // Get a weighted array of test variants from the testOptions object + Object.keys(testOptions).forEach(function(key) { + for (var i = 0; i < testOptions[key]; i++) { + valArray.push(key); + } + }); - setSetting('test.'+testName, assignedValue); + // Get a random test variant and set the user to it + assignedValue = valArray[Math.floor(Math.random() * valArray.length)]; + setSetting(settingName, assignedValue); } return assignedValue; - } + } /** * Public functions diff --git a/browser/extensions/pocket/locale/ar/pocket.properties b/browser/extensions/pocket/locale/ar/pocket.properties deleted file mode 100644 index a5dd193fbcf2..000000000000 --- a/browser/extensions/pocket/locale/ar/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = أضف وسوم -alreadyhaveacct = هل أنت مستخدم لبوكِت؟ -continueff = أكمل مع فَيَرفُكس -errorgeneric = حدث عطل أثناء محاولة الحفظ في بوكِت. -learnmore = اطّلع على المزيد -loginnow = لِج -maxtaglength = أقصى طول للوسم ٢٥ حرفًا -mustbeconnected = يجب أن تكون متصلًا بالإنترنت للحفظ في بوكِت. رجاء راجع اتصالك ثم أعِد المحاولة. -onlylinkssaved = لا يمكن حفظ إلا الوصلات -pagenotsaved = لم تُحفظ الصفحة -pageremoved = أزِيلت الصفحة -pagesaved = حُفِظت في بوكِت -processingremove = يُزيل الصفحة… -processingtags = يضيف الوسوم… -removepage = أزِل الصفحة -save = احفظ -saving = يحفظ… -signupemail = سجّل بالبريد الإلكتروني -signuptosave = سجل في بوكِت. مجانًا. -suggestedtags = الوسوم المقترحة -tagline = احفظ المقالات و الڤديو من فَيَرفُكس لعرضهم في بوكِت على أي جهاز و في أي وقت. -taglinestory_one = انقر على زر بوكِت لحفظ أي مقالة أو ڤديو أو صفحة من فَيَرفُكس. -taglinestory_two = اعرض في بوكِت على أي جهاز في أي وقت. -tagssaved = أُضيفت الوسوم -signinfirefox = لِج بفَيَرفُكس -signupfirefox = سجّل بفَيَرفُكس -viewlist = اعرض القائمة - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = بوكِت -pocket-button.tooltiptext = احفظ في بوكِت -saveToPocketCmd.label = احفظ الصفحة في بوكِت -saveToPocketCmd.accesskey = ت -saveLinkToPocketCmd.label = احفظ الوصلة في بوكِت -saveLinkToPocketCmd.accesskey = ص -pocketMenuitem.label = اعرض قائمة بوكِت diff --git a/browser/extensions/pocket/locale/ast/pocket.properties b/browser/extensions/pocket/locale/ast/pocket.properties index fc6cc0d05f5e..c32e53b54fe4 100644 --- a/browser/extensions/pocket/locale/ast/pocket.properties +++ b/browser/extensions/pocket/locale/ast/pocket.properties @@ -26,6 +26,8 @@ tagline = Guardar artículos y vídeos dende Firefox pa ver en Pocket o en cualq taglinestory_one = Fai clic nel botón de Pocket pa guardar cualquier artículu, videu o páxina dende Firefox. taglinestory_two = Ver en Pocker o en cualquier preséu, en cualquier momentu. tagssaved = Etiquetes amestaes +tos = Sigiuiendo, tas acordies colos Términos de Serviciu y la Política de privacidá de Pocket +tryitnow = Pruébalu agora signinfirefox = Anicia sesión con Firefox signupfirefox = Rexístrate con Firefox viewlist = Ver llista diff --git a/browser/extensions/pocket/locale/az/pocket.properties b/browser/extensions/pocket/locale/az/pocket.properties new file mode 100644 index 000000000000..a228ca026d67 --- /dev/null +++ b/browser/extensions/pocket/locale/az/pocket.properties @@ -0,0 +1,43 @@ +# 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/. + +addtags = Etiket əlavə et +alreadyhaveacct = Artıq Pocket istifadəçisisiniz? +continueff = Firefox ilə davam et +errorgeneric = Pocket-ə saxlarkən xəta baş verdi. +learnmore = Ətraflı Öyrən +loginnow = Daxil ol +maxtaglength = Etiketlər 25 simvol ilə limitlidir +mustbeconnected = Pocket-ə saxlamaq üçün internetə qoşulu olmalısınız. Lütfən internetə qoşulu olduğunuza əmin olub təkrar yoxlayın. +onlylinkssaved = Ancaq keçidlər saxlana bilər +pagenotsaved = Səhifə saxlanmadı +pageremoved = Səhifə silindi +pagesaved = Pocket-ə saxlandı +processingremove = Səhifə silinir… +processingtags = Etiketlər əlavə edilir… +removepage = Səhifəni sil +save = Saxla +saving = Saxlanır… +signupemail = E-poçt ilə qeyd ol +signuptosave = Pocket üçün qeyd ol. Bu pulsuzdur. +suggestedtags = Məsləhərli etiketlər +tagline = Firefoxdan məqalə və videoları Pocket-ə saxlayın, istədiyiniz vaxt, istədiyiniz yerdə baxın. +taglinestory_one = Firefoxda hər hansı bir məqalə, video və ya səhifəni saxlamaq üçün Pocket Düyməsinə klikləyin. +taglinestory_two = İstənilən cihazda, istənilən vaxt Pocket-də görün. +tagssaved = Etiketlər əlavə edildi +tos = Davam etməklə, Pocket-in İstifadə ŞərtləriMəxfilik Siyasəti ilə razılaşmış olursunuz +tryitnow = İndi Yoxlayın +signinfirefox = Firefox ilə daxil ol +signupfirefox = Firefox ilə qeyd ol +viewlist = Siyahını gör + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. +pocket-button.label = Pocket +pocket-button.tooltiptext = Pocket-ə Saxla +saveToPocketCmd.label = Səhifəni Pocket-ə Saxla +saveToPocketCmd.accesskey = k +saveLinkToPocketCmd.label = Keçidi Pocket-ə Saxla +saveLinkToPocketCmd.accesskey = o +pocketMenuitem.label = Pocket Siyahısını Gör diff --git a/browser/extensions/pocket/locale/bg/pocket.properties b/browser/extensions/pocket/locale/bg/pocket.properties index 18037692def4..ba86dd7f6d57 100644 --- a/browser/extensions/pocket/locale/bg/pocket.properties +++ b/browser/extensions/pocket/locale/bg/pocket.properties @@ -26,6 +26,8 @@ tagline = Запазвайте статии и видеота от Firefox и м taglinestory_one = Щракнете на бутона на Pocket за запазване на статия, видео или страница от Firefox. taglinestory_two = Преглеждайте в Pocket на всяко устройство и по всяко време. tagssaved = Етикетите са добавени +tos = Продължавайки, вие се съгласявате с Условията за ползване и Политиката за поверителност на Pocket +tryitnow = Опитайте сега signinfirefox = Вписване с Firefox signupfirefox = Регистриране с Firefox viewlist = Преглед на списъка diff --git a/browser/extensions/pocket/locale/bn-BD/pocket.properties b/browser/extensions/pocket/locale/bn-BD/pocket.properties index d6be83b36398..7a43edad17b1 100644 --- a/browser/extensions/pocket/locale/bn-BD/pocket.properties +++ b/browser/extensions/pocket/locale/bn-BD/pocket.properties @@ -26,6 +26,8 @@ tagline = Pocket এর মাধ্যমে যেকোন সময়, যে taglinestory_one = Firefox থেকে আর্টিকেল, ভিডিও বা পৃষ্ঠা সংরক্ষণ করার জন্য Pocket বাটন ক্লিক করুন। taglinestory_two = যেকোন সময়ে, যেকোন স্থানে Pocket এ দেখুন। tagssaved = ট্যাগ যোগ করা হয়েছে +tos = এটি অব্যহত রেখে, আপনি Pocket এর সেবার শর্তাবলী এবং গোপনীয়তা নীতিমালায় সম্মত হবেন। +tryitnow = এখনই ব্যবহার করুন signinfirefox = ফায়ারফক্স দিয়ে সাইন ইন করুন signupfirefox = ফায়ারফক্স দিয়ে সাইন আপ করুন viewlist = তালিকা দেখুন diff --git a/browser/extensions/pocket/locale/br/pocket.properties b/browser/extensions/pocket/locale/br/pocket.properties deleted file mode 100644 index 7213aefcdd80..000000000000 --- a/browser/extensions/pocket/locale/br/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Ouzhpennañ skritelligoù -alreadyhaveacct = Un arveriad Pocket oc'h endeo ? -continueff = Kenderc'hel gant Firefox -errorgeneric = Ur fazi a zo bet en ur enrollañ davet Pocket. -learnmore = Gouzout hiroc'h -loginnow = Kennaskañ -maxtaglength = Bevennet eo ar skritelligoù da 25 arouezenn -mustbeconnected = Ret eo deoc'h bezañ kennasket d'ar genrouedad evit bezañ gouest da enrollañ davet Pocket. Gwiriekait ho kennask ha klaskit en-dro. -onlylinkssaved = N'haller enrollañ ereoù nemetken -pagenotsaved = N'eo ket bet enrollet ar bajenn -pageremoved = Dilamet ar bajenn -pagesaved = Enrollet davet Pocket -processingremove = O tilemel ar bajenn... -processingtags = Oc'h ouzhpennañ skritelligoù... -removepage = Dilemel ar bajenn -save = Enrollañ -saving = Oc'h enrollañ… -signupemail = Krouiñ ur gont gant ar chomlec'h postel -signuptosave = Krouit ur gont Pocket. Digoust eo. -suggestedtags = Skritelligoù kinniget -tagline = Enrollit pennadoù ha videoioù adalek Firefox evit gwelet anezho war Pocket war forzh peseurt trevnad, p'ho peus c'hoant. -taglinestory_one = Klikit war an afell Pocket evit enrollañ ur pennad, video pe pajenn adalek Firefox. -taglinestory_two = Sellit anezhañ e Pocket war forzh peseurt trevnad, p'ho peus c'hoant. -tagssaved = Ouzhpennet ur skritellig -signinfirefox = Kennaskañ gant Firefox -signupfirefox = Krouiñ ur gont gant Firefox -viewlist = Gwelout ar roll - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Enrollañ davet Pocket -saveToPocketCmd.label = Enrollañ ar bajenn davet Pocket -saveToPocketCmd.accesskey = c -saveLinkToPocketCmd.label = Enrollañ an ere davet Pocket -saveLinkToPocketCmd.accesskey = v -pocketMenuitem.label = Gwelout ar roll Pocket diff --git a/browser/extensions/pocket/locale/bs/pocket.properties b/browser/extensions/pocket/locale/bs/pocket.properties deleted file mode 100644 index 83c456cbd189..000000000000 --- a/browser/extensions/pocket/locale/bs/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Dodaj tagove -alreadyhaveacct = Već ste Pocket korisnik? -continueff = Nastavi sa Firefoxom -errorgeneric = Došlo je do greške prilikom spašavanja u Pocket. -learnmore = Saznajte više -loginnow = Prijava -maxtaglength = Tagovi su ograničeni na 25 znakova -mustbeconnected = Trebate biti konektovani na Internet da biste spasili u Pocket. Molimo da provjerite vašu konekciju i pokušate ponovo. -onlylinkssaved = Jedino linkovi mogu biti spašeni -pagenotsaved = Stranica nije spašena -pageremoved = Stranica uklonjena -pagesaved = Spašeno u Pocket -processingremove = Uklanjam stranicu… -processingtags = Dodajem tagove… -removepage = Ukloni stranicu -save = Spasi -saving = Spašavam… -signupemail = Registrujte se pomoću emaila -signuptosave = Registrujte se na Pocket. Besplatan je. -suggestedtags = Preporučeni tagovi -tagline = Spasite članke i video klipove iz Firefoxa za pregled u Pocketu na bilo kojem uređaju u bilo koje vrijeme. -taglinestory_one = Kliknite Pocket dugme da spasite bilo koji članak, video ili stranicu iz Firefoxa. -taglinestory_two = Pregledajte u Pocketu na bilo kojem uređaju u bilo koje vrijeme. -tagssaved = Tagovi dodani -signinfirefox = Prijavite se pomoću Firefoxa -signupfirefox = Registrujte se pomoću Firefoxa -viewlist = Prikaži listu - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Spasi u Pocket -saveToPocketCmd.label = Spasi stranicu u Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Spasi link u Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Prikaži Pocket listu diff --git a/browser/extensions/pocket/locale/ca/pocket.properties b/browser/extensions/pocket/locale/ca/pocket.properties deleted file mode 100644 index e6d0253eeffb..000000000000 --- a/browser/extensions/pocket/locale/ca/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Afegeix etiquetes -alreadyhaveacct = Ja teniu un compte al Pocket? -continueff = Continua amb el Firefox -errorgeneric = S'ha produït un error en intentar desar al Pocket. -learnmore = Més informació -loginnow = Inicia la sessió -maxtaglength = Les etiquetes tenen un límit de 25 caràcters -mustbeconnected = Heu d'estar connectat a Internet per poder desar al Pocket. Comproveu la connexió i torneu-ho a provar. -onlylinkssaved = Només es poden desar enllaços -pagenotsaved = No s'ha desat la pàgina -pageremoved = S'ha eliminat la pàgina -pagesaved = S'ha desat al Pocket -processingremove = S'està eliminant la pàgina… -processingtags = S'estan afegint les etiquetes… -removepage = Elimina la pàgina -save = Desa -saving = S'està desant… -signupemail = Registre amb correu electrònic -signuptosave = Registreu-vos al Pocket. És gratuït. -suggestedtags = Etiquetes recomanades -tagline = Deseu articles i vídeos des del Firefox per veure'ls al Pocket en qualsevol dispositiu i a qualsevol hora. -taglinestory_one = Feu clic al botó del Pocket per desar un article, vídeo o pàgina des del Firefox. -taglinestory_two = Vegeu-lo al Pocket en qualsevol dispositiu, a qualsevol hora. -tagssaved = Etiquetes afegides -signinfirefox = Inicia la sessió amb el Firefox -signupfirefox = Registre amb el Firefox -viewlist = Mostra la llista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Desa al Pocket -saveToPocketCmd.label = Desa la pàgina al Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Desa l'enllaç al Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Mostra la llista del Pocket diff --git a/browser/extensions/pocket/locale/cs/pocket.properties b/browser/extensions/pocket/locale/cs/pocket.properties index a54095181580..619b0a01a086 100644 --- a/browser/extensions/pocket/locale/cs/pocket.properties +++ b/browser/extensions/pocket/locale/cs/pocket.properties @@ -26,6 +26,8 @@ tagline = Ukládejte si články a videa z Firefoxu pro zobrazení ve službě P taglinestory_one = Klepněte na tlačítko služby Pocket pro uložení jakéhokoliv článku, videa nebo stránky přímo z Firefoxu. taglinestory_two = Zobrazení ve službě Pocket kdykoliv a na jakémkoliv zařízení. tagssaved = Štítky přidány +tos = Pokračování souhlasíte s Podmínkami služby Pocket a Zásadami ochrany osobních údajů +tryitnow = Vyzkoušejte nyní signinfirefox = Přihlášení ve Firefoxu signupfirefox = Registrace ve Firefoxu viewlist = Zobrazit seznam diff --git a/browser/extensions/pocket/locale/cy/pocket.properties b/browser/extensions/pocket/locale/cy/pocket.properties deleted file mode 100644 index 2c85657feca3..000000000000 --- a/browser/extensions/pocket/locale/cy/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Ychwanegu Tagiau -alreadyhaveacct = Eisoes yn ddefnyddiwr Pocket? -continueff = Parhau gyda Firefox -errorgeneric = Bu gwall wrth geisio cadw i Pocket. -learnmore = Dysgu Rhagor -loginnow = Mewngofnodi -maxtaglength = Mae tagiau wedi eu cyfyngu i 25 nod -mustbeconnected = Rhaid eich bod wedi cysylltu i'r rhyngrwyd i gadw i Pocket. Gwiriwch eich cysylltiad a cheisiwch eto. -onlylinkssaved = Dim ond dolenni y mae modd eu cadw -pagenotsaved = Heb Gadw'r Dudalen -pageremoved = Tudalen wedi ei Thynnu -pagesaved = Cadwyd i Pocket -processingremove = Tynnu Tudalen… -processingtags = Ychwanegu tagiau… -removepage = Tynnu Tudalen -save = Cadw -saving = Cadw… -signupemail = Ymunwch drwy e-bost -signuptosave = Ymunwch â Pocket. Mae am ddim. -suggestedtags = Awgrymiadau o Dagiau -tagline = Cadw erthyglau a fideos o Firefox i'w gweld yn Pocket ar unrhyw ddyfais, ar unrhyw adeg. -taglinestory_one = Cliciwch Fotwm Pocket i gadw unrhyw erthygl, fideo neu dudalen o Firefox. -taglinestory_two = Gweld yn Pocket ar unrhyw ddyfais, ar unrhyw adeg. -tagssaved = Tagiau Ychwanegwyd -signinfirefox = Mewngofnodi gyda Firefox -signupfirefox = Ymuno drwy Firefox -viewlist = Gweld Rhestr - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Cadw i Pocket -saveToPocketCmd.label = Cadw Tudalen i Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Cadw Dolen i Pocket -saveLinkToPocketCmd.accesskey = i -pocketMenuitem.label = Edrych ar Rhestr Pocket diff --git a/browser/extensions/pocket/locale/da/pocket.properties b/browser/extensions/pocket/locale/da/pocket.properties index adf9b8c47d24..5e5438359637 100644 --- a/browser/extensions/pocket/locale/da/pocket.properties +++ b/browser/extensions/pocket/locale/da/pocket.properties @@ -26,6 +26,8 @@ tagline = Gemmer artikler og videoer fra Firefox i Pocket, så du senere kan se taglinestory_one = Klik på knappen Pocket for at gemme en artikel, video eller webside fra Firefox. taglinestory_two = Se i Pocket hvor og hvornår, du har lyst. tagssaved = Tags tilføjet +tos = Fortsætter du, accepterer du Pockets tjenestevilkår og privatlivspolitik +tryitnow = Prøv det nu signinfirefox = Log ind med Firefox signupfirefox = Meld dig til med Firefox viewlist = Vis liste diff --git a/browser/extensions/pocket/locale/de/pocket.properties b/browser/extensions/pocket/locale/de/pocket.properties index 6e7a175c0ea6..f02f5da05041 100644 --- a/browser/extensions/pocket/locale/de/pocket.properties +++ b/browser/extensions/pocket/locale/de/pocket.properties @@ -26,6 +26,8 @@ tagline = Speichern Sie Artikel und Videos aus Firefox bei Pocket, um sie jederz taglinestory_one = Klicken Sie auf die Pocket-Schaltfläche, um beliebige Artikel, Videos und Seiten aus Firefox zu speichern. taglinestory_two = Lesen Sie diese mit Pocket, jederzeit und auf jedem Gerät. tagssaved = Tags hinzugefügt +tos = Indem Sie fortfahren, akzeptieren Sie die Nutzungsbedingungen und die Datenschutzerklärung von Pocket. +tryitnow = Jetzt ausprobieren signinfirefox = Mit Firefox anmelden signupfirefox = Mit Firefox registrieren viewlist = Liste anzeigen diff --git a/browser/extensions/pocket/locale/dsb/pocket.properties b/browser/extensions/pocket/locale/dsb/pocket.properties new file mode 100644 index 000000000000..a878de329699 --- /dev/null +++ b/browser/extensions/pocket/locale/dsb/pocket.properties @@ -0,0 +1,43 @@ +# 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/. + +addtags = Wobznamjenja pśidaś +alreadyhaveacct = Sćo južo wužywaŕ Pocket? +continueff = Z Firefox pókšacowaś +errorgeneric = Pśi składowanju do Pocket jo zmólka nastała. +learnmore = Dalšne informacije +loginnow = Pśizjawiś +maxtaglength = Wobznamjenja su na 25 znamuškow wobgranicowane +mustbeconnected = Musyśo z internetom zwězany byś, aby do Pocket składował. Pšosym pśeglědajśo swój zwisk a wopytajśo hyšći raz. +onlylinkssaved = Jano wótkaze daju se składowaś +pagenotsaved = Bok njejo se składł +pageremoved = Bok jo se wótwónoźeł +pagesaved = Do Pocket skłaźony +processingremove = Bok se wótwónoźujo… +processingtags = Wobznamjenja se pśidawaju… +removepage = Bok wótwónoźeś +save = Składowaś +saving = Składujo se… +signupemail = Registrěrujśo se z mejlku +signuptosave = Registrěrujśo se za Pocket. Jo dermo. +suggestedtags = Naraźone wobznamjenja +tagline = Składujśo nastawki a wideo z Firefox, aby se je kuždy cas w Pocket na kuždem rěźe woglědał. +taglinestory_one = Klikniśo na tłocašk Pocket, aby nastawk, wideo abo bok z Firefox składował. +taglinestory_two = Se w Pocket na kuždem rěźee kuždy cas woglědaś. +tagssaved = Wobznamjenja su se pśidali +tos = Gaž pókšacujośo, zwólijośo do wužywarskich wuměnjenjow a pšawidłow priwatnosći Pocket +tryitnow = Wopytajśo to něnto +signinfirefox = Z Firefox pśizjawiś +signupfirefox = Z Firefox registrěrowaś +viewlist = Lisćinu pokazaś + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. +pocket-button.label = Pocket +pocket-button.tooltiptext = Do Pocket składowaś +saveToPocketCmd.label = Bok do Pocket składowaś +saveToPocketCmd.accesskey = b +saveLinkToPocketCmd.label = Wótkaz do Pocket składowaś +saveLinkToPocketCmd.accesskey = w +pocketMenuitem.label = Lisćinu Pocket pokazaś diff --git a/browser/extensions/pocket/locale/en-GB/pocket.properties b/browser/extensions/pocket/locale/en-GB/pocket.properties deleted file mode 100644 index 0e50ac8392c5..000000000000 --- a/browser/extensions/pocket/locale/en-GB/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Add Tags -alreadyhaveacct = Already a Pocket user? -continueff = Continue with Firefox -errorgeneric = There was an error when trying to save to Pocket. -learnmore = Learn More -loginnow = Log in -maxtaglength = Tags are limited to 25 characters -mustbeconnected = You must be connected to the Internet in order to save to Pocket. Please check your connection and try again. -onlylinkssaved = Only links can be saved -pagenotsaved = Page Not Saved -pageremoved = Page Removed -pagesaved = Saved to Pocket -processingremove = Removing Page… -processingtags = Adding tags… -removepage = Remove Page -save = Save -saving = Saving… -signupemail = Sign up with email -signuptosave = Sign up for Pocket. It’s free. -suggestedtags = Suggested Tags -tagline = Save articles and videos from Firefox to view in Pocket on any device, any time. -taglinestory_one = Click the Pocket Button to save any article, video or page from Firefox. -taglinestory_two = View in Pocket on any device, any time. -tagssaved = Tags Added -signinfirefox = Sign in with Firefox -signupfirefox = Sign up with Firefox -viewlist = View List - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Save to Pocket -saveToPocketCmd.label = Save Page to Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Save Link to Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = View Pocket List diff --git a/browser/extensions/pocket/locale/en-US/pocket.properties b/browser/extensions/pocket/locale/en-US/pocket.properties index 0e50ac8392c5..dee2681dc622 100644 --- a/browser/extensions/pocket/locale/en-US/pocket.properties +++ b/browser/extensions/pocket/locale/en-US/pocket.properties @@ -26,6 +26,8 @@ tagline = Save articles and videos from Firefox to view in Pocket on any device, taglinestory_one = Click the Pocket Button to save any article, video or page from Firefox. taglinestory_two = View in Pocket on any device, any time. tagssaved = Tags Added +tos = By continuing, you agree to Pocket's Terms of Service and Privacy Policy +tryitnow = Try It Now signinfirefox = Sign in with Firefox signupfirefox = Sign up with Firefox viewlist = View List diff --git a/browser/extensions/pocket/locale/en-ZA/pocket.properties b/browser/extensions/pocket/locale/en-ZA/pocket.properties deleted file mode 100644 index 0e50ac8392c5..000000000000 --- a/browser/extensions/pocket/locale/en-ZA/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Add Tags -alreadyhaveacct = Already a Pocket user? -continueff = Continue with Firefox -errorgeneric = There was an error when trying to save to Pocket. -learnmore = Learn More -loginnow = Log in -maxtaglength = Tags are limited to 25 characters -mustbeconnected = You must be connected to the Internet in order to save to Pocket. Please check your connection and try again. -onlylinkssaved = Only links can be saved -pagenotsaved = Page Not Saved -pageremoved = Page Removed -pagesaved = Saved to Pocket -processingremove = Removing Page… -processingtags = Adding tags… -removepage = Remove Page -save = Save -saving = Saving… -signupemail = Sign up with email -signuptosave = Sign up for Pocket. It’s free. -suggestedtags = Suggested Tags -tagline = Save articles and videos from Firefox to view in Pocket on any device, any time. -taglinestory_one = Click the Pocket Button to save any article, video or page from Firefox. -taglinestory_two = View in Pocket on any device, any time. -tagssaved = Tags Added -signinfirefox = Sign in with Firefox -signupfirefox = Sign up with Firefox -viewlist = View List - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Save to Pocket -saveToPocketCmd.label = Save Page to Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Save Link to Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = View Pocket List diff --git a/browser/extensions/pocket/locale/eo/pocket.properties b/browser/extensions/pocket/locale/eo/pocket.properties deleted file mode 100644 index 32ddcac0002a..000000000000 --- a/browser/extensions/pocket/locale/eo/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Aldoni langetojn -alreadyhaveacct = Ĉu vi jam estas uzanto de Pocket? -continueff = Daŭrigi per Firefox -errorgeneric = Okazis eraro dum la klopodo konservi en Pocket. -learnmore = Pli da informo -loginnow = Komenci seancon -maxtaglength = Etikedoj povas enhavi ĝis 25 signojn -mustbeconnected = Vi devas esti konektita al la interreto por povi konservi en Pocket. Bonvolu kontroli vian retaliron kaj provi denove. -onlylinkssaved = Nur ligiloj povas esti konservitaj -pagenotsaved = Paĝo ne konservita -pageremoved = Paĝo forigita -pagesaved = Konservita en Pocket -processingremove = Paĝo forigata… -processingtags = Etikedoj aldonataj… -removepage = Forigi paĝon -save = Konservi -saving = Konservo… -signupemail = Enskribiĝi per retpoŝto -signuptosave = Enskribiĝi al Pocket. Estas senpage. -suggestedtags = Sugestitaj etikedoj -tagline = Konservi artikolojn kaj filmetojn el Firefox por povi vidi en Pocket en iu ajn aparato, iam ajn. -taglinestory_one = Alklaku la butonon Pocket por konservi iun ajn artikolon, filmeton aŭ paĝon el Firefox. -taglinestory_two = Vidi Pocket en iu ajn aparato, iam ajn. -tagssaved = Etikedoj aldonitaj -signinfirefox = Komenci seancon per Firefox -signupfirefox = Enskribiĝi per Firefox -viewlist = Vidi liston - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Konservi en Pocket -saveToPocketCmd.label = Konservi paĝon en Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Konservi ligilon en Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Vidi liston de Pocket diff --git a/browser/extensions/pocket/locale/es-AR/pocket.properties b/browser/extensions/pocket/locale/es-AR/pocket.properties deleted file mode 100644 index 6a0e723287b0..000000000000 --- a/browser/extensions/pocket/locale/es-AR/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Agregar etiquetas -alreadyhaveacct = ¿Ya es un usuario de Pocket? -continueff = Continuar con Firefox -errorgeneric = Hubo un error al tratar de guardar en Pocket. -learnmore = Conocer más -loginnow = Ingresar -maxtaglength = Las etiquetas están limitadas a 25 caracteres -mustbeconnected = Debe estar conectado a Internet para poder guardar en Pocket. Verifique la conexión e intente nuevamente. -onlylinkssaved = Solamente pueden guardarle enlaces -pagenotsaved = Página no guardada -pageremoved = Página eliminada -pagesaved = Guardado en Pocket -processingremove = Eliminando página… -processingtags = Agregando etiquetas… -removepage = Eliminar página -save = Guardar -saving = Guardando… -signupemail = Ingresar con correo electrónico -signuptosave = Registrarse en Pocket. En grátis. -suggestedtags = Etiquetas sugeridas -tagline = Guardar artículos y videos desde Firefox para ver en Pocket en cualquier dispositivo en cualquier momento. -taglinestory_one = Clic en el botón Pocket para guardar cualquier artículo, video o página desde Firefox. -taglinestory_two = Ver en Pocket en cualquier dispositivo en cualquier momento. -tagssaved = Etiquetas agregadas -signinfirefox = Ingresar con Firefox -signupfirefox = Registrarse con Firefox -viewlist = Ver lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Guardar en Pocket -saveToPocketCmd.label = Guardar página en Pocket -saveToPocketCmd.accesskey = G -saveLinkToPocketCmd.label = Guardar enlace en Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Ver lista de Pocket diff --git a/browser/extensions/pocket/locale/es-CL/pocket.properties b/browser/extensions/pocket/locale/es-CL/pocket.properties index bf8c5af87d10..7a4e6872b300 100644 --- a/browser/extensions/pocket/locale/es-CL/pocket.properties +++ b/browser/extensions/pocket/locale/es-CL/pocket.properties @@ -26,6 +26,8 @@ tagline = Guarda artículos y videos desde Firefox para verlos en Pocket en cual taglinestory_one = Aprieta el botón Pocket para guardar cualquier artículo, video o página de Firefox. taglinestory_two = Mírala en Pocket en cualquier dispositivo y momento tagssaved = Etiquetas añadidas +tos = Al continuar, aceptas los Términos del servicio y la Política de privacidad de Pocket. +tryitnow = Probarlo ahora signinfirefox = Conectarse con Firefox signupfirefox = Registrarse con Firefox viewlist = Ver lista diff --git a/browser/extensions/pocket/locale/es-ES/pocket.properties b/browser/extensions/pocket/locale/es-ES/pocket.properties index d57ff145927d..f10a2052592d 100644 --- a/browser/extensions/pocket/locale/es-ES/pocket.properties +++ b/browser/extensions/pocket/locale/es-ES/pocket.properties @@ -26,13 +26,18 @@ tagline = Guarde artículos y vídeos desde Firefox para verlos en Pocket en cua taglinestory_one = Pulse el botón Pocket para guardar cualquier artículo, vídeo o página desde Firefox. taglinestory_two = Véalo en Pocket en cualquier dispositivo, en cualquier momento. tagssaved = Etiquetas añadidas +tos = Al continuar, aceptas los Términos del servicio y la Política de privacidad de Pocket +tryitnow = Pruébalo ahora signinfirefox = Iniciar sesión con Firefox signupfirefox = Registrarse con Firefox viewlist = Ver lista + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. pocket-button.label = Pocket pocket-button.tooltiptext = Guardar en Pocket saveToPocketCmd.label = Guardar página en Pocket saveToPocketCmd.accesskey = G -saveLinkToPocketCmd.label = Guardar enlace a Pocket +saveLinkToPocketCmd.label = Guardar enlace en Pocket saveLinkToPocketCmd.accesskey = P pocketMenuitem.label = Ver la lista de Pocket diff --git a/browser/extensions/pocket/locale/es-MX/pocket.properties b/browser/extensions/pocket/locale/es-MX/pocket.properties index cf3a03b5a822..4d2bb9c4f726 100644 --- a/browser/extensions/pocket/locale/es-MX/pocket.properties +++ b/browser/extensions/pocket/locale/es-MX/pocket.properties @@ -26,6 +26,8 @@ tagline = Guardar artículos y videos desde Firefox para ver en Pocket o en cual taglinestory_one = Haz clic en el botón de Pocket para guardar cualquier artículo, video o página desde Firefox. taglinestory_two = Ver en Pocker o en cualquier dispositivo, en cualquier momento. tagssaved = Etiquetas agregadas +tos = Al continuar, aceptas los Términos del servicio y la Política de privacidad de Pocket +tryitnow = Pruébalo ahora signinfirefox = Ingresa con Firefox signupfirefox = Regístrate con Firefox viewlist = Ver lista diff --git a/browser/extensions/pocket/locale/et/pocket.properties b/browser/extensions/pocket/locale/et/pocket.properties index 6e1b11bb8825..5f2d68f9c524 100644 --- a/browser/extensions/pocket/locale/et/pocket.properties +++ b/browser/extensions/pocket/locale/et/pocket.properties @@ -26,6 +26,8 @@ tagline = Salvesta Firefoxist artikleid ja videoid, et vaadata neid Pocketist k taglinestory_one = Artikli, video või lehe salvestamiseks klõpsa Pocketi nupul. taglinestory_two = Vaata Pocketist kõigil seadmeil just siis, kui ise soovid. tagssaved = Sildid on lisatud +tos = Jätkates nõustud Pocket'i kasutustingimuste ja privaatsuspoliitikaga. +tryitnow = Proovi kohe signinfirefox = Logi sisse Firefoxiga signupfirefox = Registreeru Firefoxiga viewlist = Vaata nimekirja diff --git a/browser/extensions/pocket/locale/eu/pocket.properties b/browser/extensions/pocket/locale/eu/pocket.properties deleted file mode 100644 index c515d7b942a5..000000000000 --- a/browser/extensions/pocket/locale/eu/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Gehitu etiketak -alreadyhaveacct = Pocket erabiltzailea zara jada? -continueff = Jarraitu Firefoxekin -errorgeneric = Errorea gertatu da Pocket-en gordetzen saiatzean. -learnmore = Argibide gehiago -loginnow = Hasi saioa -maxtaglength = Etiketak 25 karakterera daude mugatuta -mustbeconnected = Internetera konektatuta egon behar zara Pocket-en gorde ahal izateko. Egiaztatu zure konektagarritasuna eta saiatu berriro. -onlylinkssaved = Loturak gorde daitezke soilik -pagenotsaved = Ez da orria gorde -pageremoved = Orria kenduta -pagesaved = Pocket-en gordeta -processingremove = Orria kentzen… -processingtags = Etiketak gehitzen… -removepage = Kendu orria -save = Gorde -saving = Gordetzen… -signupemail = Eman izena posta elektronikoa erabiliz -signuptosave = Eman izena Pocket-en. Doakoa da. -suggestedtags = Iradokitako etiketak -tagline = Gorde Firefoxetik artikuluak eta bideoak edozein gailutan Pocket-en ikusteko, noiznahi. -taglinestory_one = Egin klik Pocket botoian Firefoxetik edozein artikulu, bideo edo orri gordetzeko. -taglinestory_two = Ikusi edozein gailutan Pocket-en, noiznahi. -tagssaved = Etiketak gehituta -signinfirefox = Hasi saioa Firefoxekin -signupfirefox = Eman izena Firefoxekin -viewlist = Ikusi zerrenda - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Gorde Pocket-en -saveToPocketCmd.label = Gorde orria Pocket-en -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Gorde lotura Pocket-en -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Ikusi Pocket zerrenda diff --git a/browser/extensions/pocket/locale/fa/pocket.properties b/browser/extensions/pocket/locale/fa/pocket.properties deleted file mode 100644 index d2eacef204b5..000000000000 --- a/browser/extensions/pocket/locale/fa/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = افزودن برچسب -alreadyhaveacct = از قبل کاربر Pocket هستید؟ -continueff = ادامه در فایرفاکس -errorgeneric = خطایی در هنگام تلاش برای ذخیره‌سازی در Pocket رخ داده است. -learnmore = بیشتر بدانید -loginnow = ورود به سیستم -maxtaglength = برچسب‌ها شامل محدودیت ۲۵ حرفی می‌باشند -mustbeconnected = جهت ذخیره‌سازی در Pocket بایستی به اینترنت متصل باشید. لطفا اتصال اینترنت خود را بررسی کنید و مجددا تلاش کنید. -onlylinkssaved = تنها لینک‌ها می توانند ذخیره شوند -pagenotsaved = صفحه ذخیره نشد -pageremoved = صفحه حذف شد -pagesaved = در ‌Pocket ذخیره شده -processingremove = در حال حذف صفحه… -processingtags = در حال اضافه کردن برچسب‌ها… -removepage = حذف صفحه -save = ذخیره -saving = در حال ذخیره… -signupemail = ثبت‌نام با ایمیل -signuptosave = در Pocket ثبت‌نام کنید. رایگان است. -suggestedtags = برچسب‌های پیشنهادی -tagline = مقاله‌ها و ویدئوها را با فایرفاکس ذخیره کنید و در هر زمان و دستگاهی به وسیله‌ی Pocket ببینید. -taglinestory_one = بر روی دکمه Pocket کلیک کنید تا مقاله، ویدئو یا صفحات را از طریق فایرفاکس ذخیره کنید. -taglinestory_two = نمایش در Pocket در هر دستگاه و در هر زمانی. -tagssaved = برچسب‌ها اضافه شد -signinfirefox = ورود از طریق فایرفاکس -signupfirefox = ثبت نام توسط فایرفاکس -viewlist = \u0020نمایش‌ فهرست - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = ذخیره‌سازی در Pocket -saveToPocketCmd.label = ذخیرهٔ صفحه در Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = ذخیرهٔ پیوند در Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = نمایش فهرست Pocket diff --git a/browser/extensions/pocket/locale/fi/pocket.properties b/browser/extensions/pocket/locale/fi/pocket.properties index 50c0398a08d0..3cd47e891a07 100644 --- a/browser/extensions/pocket/locale/fi/pocket.properties +++ b/browser/extensions/pocket/locale/fi/pocket.properties @@ -26,6 +26,8 @@ tagline = Tallenna artikkelit ja videot Firefoxista Pocket-palveluun katseltavik taglinestory_one = Napsauta Pocket-painiketta tallentaaksesi artikkelin, videon tai sivun Firefoxissa. taglinestory_two = Katsele Pocket-palvelussa millä tahansa laitteella, koska tahansa. tagssaved = Tunnisteet lisättiin +tos = Jatkamalla hyväksyt Pocketin käyttöehdot ja tietosuojakäytännön +tryitnow = Kokeile nyt signinfirefox = Kirjaudu sisään Firefox-tilillä signupfirefox = Rekisteröidy Firefox-tilillä viewlist = Näytä lista diff --git a/browser/extensions/pocket/locale/fr/pocket.properties b/browser/extensions/pocket/locale/fr/pocket.properties index e0cd736600de..cb9b0ca8f0ef 100644 --- a/browser/extensions/pocket/locale/fr/pocket.properties +++ b/browser/extensions/pocket/locale/fr/pocket.properties @@ -9,7 +9,7 @@ errorgeneric = Une erreur s’est produite lors de l’enregistrement dans Pocke learnmore = En savoir plus loginnow = Connectez-vous maxtaglength = Les étiquettes sont limitées à 25 caractères -mustbeconnected = Vous devez être connecté à Internet pour enregistrer des liens dans Pocket. Veuillez vérifier votre connexion puis réessayer. +mustbeconnected = Vous devez être connecté à Internet pour enregistrer des liens dans Pocket. Veuillez vérifier votre connexion puis réessayer. onlylinkssaved = Seuls les liens peuvent être enregistrés pagenotsaved = Page non enregistrée pageremoved = Page supprimée @@ -26,6 +26,8 @@ tagline = Enregistrez des articles et des vidéos depuis Firefox pour les visual taglinestory_one = Cliquez sur le bouton Pocket pour enregistrer depuis Firefox n’importe quel article, vidéo ou page. taglinestory_two = Affichez vos pages dans Pocket sur n’importe quel appareil, à tout moment. tagssaved = Étiquettes ajoutées +tos = En continuant, vous acceptez les conditions d’utilisation et la politique de confidentialité de Pocket +tryitnow = Essayer signinfirefox = Connexion via Firefox signupfirefox = S’inscrire avec Firefox viewlist = Afficher la liste diff --git a/browser/extensions/pocket/locale/fy-NL/pocket.properties b/browser/extensions/pocket/locale/fy-NL/pocket.properties index 8b21ab1b980e..5b41c652f77c 100644 --- a/browser/extensions/pocket/locale/fy-NL/pocket.properties +++ b/browser/extensions/pocket/locale/fy-NL/pocket.properties @@ -8,7 +8,7 @@ continueff = Trochgean mei Firefox errorgeneric = Der is in flater bard by it bewarjen nei Pocket. learnmore = Mear ynfo loginnow = Meld jo oan -maxtaglength = Labels binne beheint oant 25 tekens +maxtaglength = Labels binne beheint ta 25 tekens mustbeconnected = Jo moatte mei it ynternet ferbûn wêze om nei Pocket bewarje te kinnen. Kontrolearje jo ferbining en probearje it opnij. onlylinkssaved = Allinnich keppelingen kinne bewarre wurde pagenotsaved = Side net bewarre @@ -22,10 +22,12 @@ saving = Bewarje… signupemail = Registrearje mei e-mailadres signuptosave = Registrearje foar Pocket. It is fergees. suggestedtags = Foarstelde labels -tagline = Bewarje artikelen en fideo’s fanút Firefox foar werjaan yn Pocket op ferskate apparaten, wannear dan ek. -taglinestory_one = Klik op de Pocket-knop om artikelen, fideo’s of siden fanút Firefox te bewarjen. +tagline = Bewarje artikelen en fideo’s fan Firefox út foar werjaan yn Pocket op ferskate apparaten, wannear dan ek. +taglinestory_one = Klik op de Pocket-knop om artikelen, fideo’s of siden fan Firefox út te bewarjen. taglinestory_two = Besjoch se op ferskate apparaten, wannear dan ek. tagssaved = Labels tafoege +tos = Troch fierder te gean, geane jo akkoard mei de Tsjinstbetingsten en it Privacybelied fan Pocket +tryitnow = No probearje signinfirefox = Oanmelde mei Firefox signupfirefox = Registrearje mei Firefox viewlist = List werjaan diff --git a/browser/extensions/pocket/locale/ga-IE/pocket.properties b/browser/extensions/pocket/locale/ga-IE/pocket.properties deleted file mode 100644 index eb55a7fac0e4..000000000000 --- a/browser/extensions/pocket/locale/ga-IE/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Cuir Clibeanna Leis -alreadyhaveacct = An úsáideoir Pocket thú cheana? -continueff = Lean ort le Firefox -errorgeneric = Tharla earráid le linn na sábhála i bPocket. -learnmore = Tuilleadh Eolais -loginnow = Logáil isteach -maxtaglength = Ní cheadaítear níos mó ná 25 carachtar i gclib -mustbeconnected = Ní mór duit a bheith ceangailte leis an Idirlíon le nithe a shábháil i bPocket. Athnuaigh do cheangal agus bain triail eile as. -onlylinkssaved = Ní féidir ach nascanna a shábháil -pagenotsaved = Níor Sábháladh an Leathanach -pageremoved = Baineadh an Leathanach -pagesaved = Sábháilte i bPocket -processingremove = Leathanach á Bhaint… -processingtags = Clibeanna á gcur leis… -removepage = Bain Leathanach -save = Sábháil -saving = Á Sábháil… -signupemail = Cláraigh le do sheoladh ríomhphoist -signuptosave = Cláraigh le Pocket. Tá sé saor in aisce. -suggestedtags = Clibeanna Molta -tagline = Sábháil ailt agus físeáin ó Firefox chun breathnú orthu i bPocket ar aon ghléas, am ar bith. -taglinestory_one = Cliceáil an cnaipe Pocket chun aon alt, físeán, nó leathanach a shábháil ó Firefox. -taglinestory_two = Féach orthu i bPocket ar aon ghléas, am ar bith. -tagssaved = Clibeanna curtha leis -signinfirefox = Logáil isteach le Firefox -signupfirefox = Cláraigh trí Firefox -viewlist = Féach ar an Liosta - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Sábháil i bPocket -saveToPocketCmd.label = Sábháil an Leathanach i bPocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Sábháil an Nasc i bPocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Féach ar an Liosta Pocket diff --git a/browser/extensions/pocket/locale/gd/pocket.properties b/browser/extensions/pocket/locale/gd/pocket.properties deleted file mode 100644 index 2902dbfa4c24..000000000000 --- a/browser/extensions/pocket/locale/gd/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Cuir tagaichean ris -alreadyhaveacct = A bheil thu a’ cleachdadh Pocket mu thràth? -continueff = Lean ort ann am Firefox -errorgeneric = Thachair mearachd nuair a dh’fheuch sinn ri rud a shàbhaladh ann am Pocket. -learnmore = Barrachd fiosrachaidh -loginnow = Clàraich a-steach -maxtaglength = Chan fhaod taga a bhith nas fhaide na 25 caractar -mustbeconnected = Feumaidh ceangal ris an eadar-lìon a bhith agad mus urrainn dhut rud a shàbhaladh ann am Pocket. Thoir sùil air a’ cheangal agad is feuch ris a-rithist. -onlylinkssaved = Cha ghabh ach ceanglaichean a shàbhaladh -pagenotsaved = Cha deach an duilleag a shàbhaladh -pageremoved = Chaidh an duilleag a thoirt air falbh -pagesaved = Air a shàbhaladh ann am Pocket -processingremove = A’ toirt air falbh na duilleige… -processingtags = A’ cur ris nan tagaichean… -removepage = Thoir an duilleag air falbh -save = Sàbhail -saving = ’Ga shàbhaladh… -signupemail = Clàraich slighe puist-d -signuptosave = Cha chosg clàradh aig Pocket sgillinn. -suggestedtags = Tagaichean a mholar -tagline = Sàbhail artaigilean is videothan o Firefox ann am Pocket agus coimhead orra air uidheam sam bith, uair sam bith. -taglinestory_one = Briog air a’ phutan Pocket gus artaigeal, video no duilleag a shàbhaladh o Firefox. -taglinestory_two = Seall ann am Pocket air uidheam sam bith, uair sam bith. -tagssaved = Tagaichean air an cur ris -signinfirefox = Clàraich a-steach le Firefox -signupfirefox = Clàraich le Firefox -viewlist = Seall an liosta - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Sàbhail ann am Pocket -saveToPocketCmd.label = Sàbhail an duilleag ann am Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Sàbhail an ceangail ann am Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Seall liosta Pocket diff --git a/browser/extensions/pocket/locale/hi-IN/pocket.properties b/browser/extensions/pocket/locale/hi-IN/pocket.properties deleted file mode 100644 index 3fdc5b999a41..000000000000 --- a/browser/extensions/pocket/locale/hi-IN/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = टैग जोड़ें -alreadyhaveacct = पहले से Pocket के उपयोगकर्ता हैं? -continueff = Firefox के साथ जारी रखें -errorgeneric = पॉकेट में सहेजने की कोशिश करते समय त्रुटि हुई थी. -learnmore = और जानें -loginnow = लॉग इन -maxtaglength = टैग 25 वर्णों तक सीमीत है -mustbeconnected = Pocket में सहेजने के लिए आप इन्टरनेट से जुडें होना आवश्यक हैं. कृपया अपना कनेक्शन जॉंचे और फिरसे कोशिश करें. -onlylinkssaved = सिर्फ लिंक सहेजा जा सकता हैं -pagenotsaved = पेज सहेजा नही गया -pageremoved = पृष्ठ हटाया गया -pagesaved = Pocket में सहेजा -processingremove = पृष्ठ मिटा रहा है… -processingtags = टैग्स जोड़ रहे हैं... -removepage = पृष्ठ हटाएं -save = सहेजें -saving = सहेजा जा रहा है ... -signupemail = ईमेल के साथ साइन अप करें -signuptosave = पॉकेट के लिए साइन अप करें। यह मुफ़्त है।\u0020 -suggestedtags = सुझाये हुए टैग्स. -tagline = किसी भी समय, Pocket में कोई भी डिवाइस पर देखने के लिए Firefox से आलेख और वीडियो सहेजें. -taglinestory_one = Firefox से कोई भी आलेख, वीडियो या पृष्ठ को सहेजने के लिए Pocket बटन को क्लिक करे. -taglinestory_two = किसी भी समय, पॉकेट में कोई भी डिवाइस पर देखे. -tagssaved = टैग जोड़ा गया -signinfirefox = Firefox के साथ साइन इन करें -signupfirefox = Firefox के साथ साइन अप करें -viewlist = सूची देखें - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket में सहेजा -saveToPocketCmd.label = Pocket में पृष्ठ को सहेजे -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Pocket में लिंक को सहेजे -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket सूची देखे diff --git a/browser/extensions/pocket/locale/hr/pocket.properties b/browser/extensions/pocket/locale/hr/pocket.properties index 8606933ebc30..3b723499fe8d 100644 --- a/browser/extensions/pocket/locale/hr/pocket.properties +++ b/browser/extensions/pocket/locale/hr/pocket.properties @@ -26,6 +26,8 @@ tagline = Spremite članke, video snimke iz Firefoxa za prikaz u Pocketu, na bil taglinestory_one = Kliknite na Pocket tipku da biste snimili bilo koji članak, video ili stranicu iz Firefoxa. taglinestory_two = Pregledajte u Pocketu na bilo kojem uređaju, bilo kada. tagssaved = Oznake dodane +tos = Nastavljajući, prihvaćate Pocket Uvjete pružanja usluge i Izjavu o privatnosti +tryitnow = Isprobajte odmah signinfirefox = Prijava s Firefoxom signupfirefox = Registracija s Firefoxom viewlist = Prikaži popis diff --git a/browser/extensions/pocket/locale/hsb/pocket.properties b/browser/extensions/pocket/locale/hsb/pocket.properties new file mode 100644 index 000000000000..a5f5583e7903 --- /dev/null +++ b/browser/extensions/pocket/locale/hsb/pocket.properties @@ -0,0 +1,43 @@ +# 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/. + +addtags = Znački přidać +alreadyhaveacct = Sće hižo wužiwar Pocket? +continueff = Z Firefox pokročować +errorgeneric = Při składowanju do Pocket je zmylk wustupił. +learnmore = Dalše informacije +loginnow = Přizjewić +maxtaglength = Znački su na 25 znamješkow wobmjezowane +mustbeconnected = Dyrbiće z internetom zwjazany być, zo byšće do Pocket składował. Prošu přepruwujće swój zwisk a spytajće hišće raz. +onlylinkssaved = Jenož wotkazy dadźa so składować +pagenotsaved = Strona njeje so składowała +pageremoved = Strona je so wotstroniła +pagesaved = Do Pocket składowany +processingremove = Strona so wotstronja… +processingtags = Znački so přidawaja… +removepage = Stronu wotstronić +save = Składować +saving = Składuje so… +signupemail = Registrujće so z e-mejlku +signuptosave = Registrujće so za Pocket. Je darmo. +suggestedtags = Namjetowane znački +tagline = Składujće nastawki a wideja z Firefox, zo byšće sej je kóždy čas w Pocket na kóždym graće wobhladał. +taglinestory_one = Klikńće na tłóčatko Pocket, zo byšće nastawk, widejo abo stronu z Firefox składował. +taglinestory_two = Sej w Pocket na kóždym graće kóždy čas wobhladać. +tagssaved = Znački su so přidali +tos = Hdyž pokročujeće, zwoliće do wužiwarskich wuměnjenjow a prawidłow priwatnosće Pocket +tryitnow = Spytajće to nětko +signinfirefox = Z Firefox přizjewić +signupfirefox = Z Firefox registrować +viewlist = Lisćinu pokazać + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. +pocket-button.label = Pocket +pocket-button.tooltiptext = Do Pocket składować +saveToPocketCmd.label = Stronu do Pocket składować +saveToPocketCmd.accesskey = d +saveLinkToPocketCmd.label = Wotkaz do Pocket składować +saveLinkToPocketCmd.accesskey = o +pocketMenuitem.label = Lisćinu Pocket pokazać diff --git a/browser/extensions/pocket/locale/hu/pocket.properties b/browser/extensions/pocket/locale/hu/pocket.properties index c49af5851e4e..767638e82fea 100644 --- a/browser/extensions/pocket/locale/hu/pocket.properties +++ b/browser/extensions/pocket/locale/hu/pocket.properties @@ -26,6 +26,8 @@ tagline = Mentsen cikkeket és videókat a Firefoxból a Pocketen való megtekin taglinestory_one = Kattintson a Pocket gombra bármely cikk, videó vagy oldal mentéséhez a Firefoxból. taglinestory_two = Nézze meg a Pocketen bármely eszközön, bármikor. tagssaved = Címkék hozzáadva +tos = A folytatással elfogadja a Pocket Szolgáltatási feltételeit és az Adatvédelmi nyilatkozatot +tryitnow = Próbálja ki most signinfirefox = Bejelentkezés a Firefoxszal signupfirefox = Regisztráció a Firefoxszal viewlist = Lista megjelenítése diff --git a/browser/extensions/pocket/locale/hy-AM/pocket.properties b/browser/extensions/pocket/locale/hy-AM/pocket.properties deleted file mode 100644 index 3c5156af4990..000000000000 --- a/browser/extensions/pocket/locale/hy-AM/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Ավելացնել պիտակներ -alreadyhaveacct = Արդեն Pocket օգտվո՞ղ եք: -continueff = Շարունակել Firefox-ով -errorgeneric = Սխալ՝ Pocket-ում պահպանելիս: -learnmore = Իմանալ ավելին -loginnow = Մուտք գործել -maxtaglength = Պիտակը սահմանափակված է 25 գրանշանով -mustbeconnected = Պետք է մուտք ունենաք համացանց՝ պահելու համար Pocket-ում: Ստուգեք կապը և կրկին փորձեք: -onlylinkssaved = Միայն հղումները կարող են պահվել -pagenotsaved = Էջը չի պահպանվել -pageremoved = Էջը հեռացված է -pagesaved = Պահպանված է Pocket-ում -processingremove = Էջը հեռացվում է… -processingtags = Պիտակների հավելում… -removepage = Հեռացնել Էջը -save = Պահպանել -saving = Պահպանում... -signupemail = Մուտք գործել էլ. փոստով -signuptosave = Գրանցվեք Pocket-ի համար: Անվճար է: -suggestedtags = Առաջարկվող պիտակներ -tagline = Պահպանեք հոդվածներ և տեսանյութեր Firefox-ից՝ դրանք հետագայում ցանկացած սարքից, ցանկացած ժամանակ Pocket-ում դիտելու համար: -taglinestory_one = Սեղմեք Pocket կոճակը՝ պահպանելու համար Firefox-ից ցանկացած հոդված, տեսանյութ կամ էջ: -taglinestory_two = Դիտեք Pocket-ում ցանկացած սարքից, ցանկացած ժամանակ: -tagssaved = Պիտակները ավելացվել են -signinfirefox = Մուտք գործել Firefox-ով -signupfirefox = Գրանցվել Firefox-ով -viewlist = Դիտել ցանկը - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Պապանել Pocket-ում -saveToPocketCmd.label = Պահպանել էջը Pocket-ում -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Պահել էջը Pocket-ում -saveLinkToPocketCmd.accesskey = P -pocketMenuitem.label = Դիտել Pocket-ի ցանկը diff --git a/browser/extensions/pocket/locale/id/pocket.properties b/browser/extensions/pocket/locale/id/pocket.properties deleted file mode 100644 index 3edd38e029e1..000000000000 --- a/browser/extensions/pocket/locale/id/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Tambahkan Tag -alreadyhaveacct = Sudah menjadi pengguna Pocket? -continueff = Lanjutkan dengan Firefox -errorgeneric = Terjadi kesalahan saat mencoba menyimpan ke Pocket. -learnmore = Lebih Lanjut -loginnow = Masuk -maxtaglength = Panjang karakter maksimum tag adalah 25 karakter -mustbeconnected = Anda harus tersambung ke Internet untuk menyimpan ke Pocket. Periksa sambungan Anda lalu coba lagi. -onlylinkssaved = Hanya tautan yang dapat disimpan -pagenotsaved = Laman Tidak Disimpan -pageremoved = Laman Dihapus -pagesaved = Disimpan di Pocket -processingremove = Menghapus Laman… -processingtags = Menambahkan tag… -removepage = Hapus Laman -save = Simpan -saving = Menyimpan… -signupemail = Daftar dengan email -signuptosave = Daftar ke Pocket. Gratis. -suggestedtags = Saran Tag -tagline = Simpan artikel dan video dari Firefox untuk melihatnya lewat Pocket di berbagai perangkat, kapan saja. -taglinestory_one = Klik Tombol Pocket untuk menyimpan artikel, video, atau laman apa saja dari Firefox. -taglinestory_two = Tampilkan lewat Pocket di berbagai perangkat, kapan saja. -tagssaved = Tag Ditambahkan -signinfirefox = Masuk ke Firefox -signupfirefox = Daftar ke Firefox -viewlist = Tampilkan Daftar - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Simpan ke Pocket -saveToPocketCmd.label = Simpan Laman ke Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Simpan Tautan ke Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Tampilkan Daftar Pocket diff --git a/browser/extensions/pocket/locale/is/pocket.properties b/browser/extensions/pocket/locale/is/pocket.properties deleted file mode 100644 index b942fb01e8a4..000000000000 --- a/browser/extensions/pocket/locale/is/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Bæta við flokkum -alreadyhaveacct = Ertu þegar Pocket notandi? -continueff = Halda áfram með Firefox -errorgeneric = Upp kom villa við að vista á Pocket. -learnmore = Fræðast meira -loginnow = Innskráning -maxtaglength = Tög eru takmörkuð við 25 stafi -mustbeconnected = Þú verður að vera tengdur netinu til að vista Pocket. Athugaðu tengingu og reyndu aftur. -onlylinkssaved = Aðeins er hægt að vista tengla -pagenotsaved = Ekki tókst að vista síðu -pageremoved = Síða fjarlægð -pagesaved = Vistað í Pocket -processingremove = Fjarlægi síðu… -processingtags = Bæti við flokkum… -removepage = Fjarlægja síðu -save = Vista -saving = Vista… -signupemail = Skrá inn með tölvupóstfangi -signuptosave = Skrá sig inn með Pocket. Það er ókeypis. -suggestedtags = Flokkar sem mælt er með -tagline = Vista síður og myndbönd frá Firefox til að skoða í Pocket á hvaða tæki sem er, hvenær sem er. -taglinestory_one = Smelltu á Pocket hnappinn til að vista grein, myndband eða síðu frá Firefox. -taglinestory_two = Skoðaðu í Pocket á hvaða tæki sem er, hvenær sem er. -tagssaved = Bætti við flokkum -signinfirefox = Skrá sig inn með Firefox -signupfirefox = Skrá sig með Firefox -viewlist = Skoða lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Vista í Pocket -saveToPocketCmd.label = Vista síðu í Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Vista tengil í Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Skoða Pocket lista diff --git a/browser/extensions/pocket/locale/it/pocket.properties b/browser/extensions/pocket/locale/it/pocket.properties index 6c844d60b1b9..2105011eb344 100644 --- a/browser/extensions/pocket/locale/it/pocket.properties +++ b/browser/extensions/pocket/locale/it/pocket.properties @@ -26,9 +26,14 @@ tagline = Salva articoli e video da Firefox per visualizzarli in Pocket da qualu taglinestory_one = Fai clic sul pulsante Pocket per salvare qualunque articolo, video o pagina da Firefox. taglinestory_two = Visualizza in Pocket da qualunque dispositivo e in qualunque momento. tagssaved = Aggiunte etichette +tos = Proseguendo si accettano i termini di servizio e l’informativa sulla privacy +tryitnow = Provalo subito signinfirefox = Accedi con Firefox signupfirefox = Registrati con Firefox viewlist = Visualizza elenco + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. pocket-button.label = Pocket pocket-button.tooltiptext = Salva in Pocket saveToPocketCmd.label = Salva pagina in Pocket diff --git a/browser/extensions/pocket/locale/ja-JP-mac/pocket.properties b/browser/extensions/pocket/locale/ja-JP-mac/pocket.properties deleted file mode 100644 index 9b990fc1934d..000000000000 --- a/browser/extensions/pocket/locale/ja-JP-mac/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = タグを追加 -alreadyhaveacct = Pocket に登録済みですか? -continueff = Firefox で続行 -errorgeneric = Pocket への保存中にエラーがありました。 -learnmore = 詳細 -loginnow = ログイン -maxtaglength = タグは 25 文字までです -mustbeconnected = Pocket に保存するには、インターネット接続が必要です。接続状況を確認してから、試してみたください。 -onlylinkssaved = リンクのみ保存しました -pagenotsaved = ページを保存しませんでした -pageremoved = ページを削除しました -pagesaved = Pocket に保存しました -processingremove = ページを削除しています... -processingtags = タグを追加しています... -removepage = ページを削除 -save = 保存 -saving = 保存しています... -signupemail = メールアドレスで新規登録 -signuptosave = Pocket に新規登録します。無料です。 -suggestedtags = 提案タグ -tagline = Firefox で記事や動画を保存すると、いつでもどこでも Pocket で閲覧できます。 -taglinestory_one = Firefox で Pocket ボタンをクリックすると、様々な記事や動画やページを保存できます。 -taglinestory_two = Pocket でいつでもどこでも閲覧できます。 -tagssaved = タグを追加しました -signinfirefox = Firefox でログイン -signupfirefox = Firefox で新規登録 -viewlist = リストを表示 - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket に保存 -saveToPocketCmd.label = ページを Pocket に保存 -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = リンクを Pocket に保存 -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket のリストを表示 diff --git a/browser/extensions/pocket/locale/ja/pocket.properties b/browser/extensions/pocket/locale/ja/pocket.properties index 9b990fc1934d..1aef6bba1685 100644 --- a/browser/extensions/pocket/locale/ja/pocket.properties +++ b/browser/extensions/pocket/locale/ja/pocket.properties @@ -2,40 +2,42 @@ # 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/. -addtags = タグを追加 -alreadyhaveacct = Pocket に登録済みですか? -continueff = Firefox で続行 -errorgeneric = Pocket への保存中にエラーがありました。 -learnmore = 詳細 -loginnow = ログイン -maxtaglength = タグは 25 文字までです -mustbeconnected = Pocket に保存するには、インターネット接続が必要です。接続状況を確認してから、試してみたください。 -onlylinkssaved = リンクのみ保存しました -pagenotsaved = ページを保存しませんでした -pageremoved = ページを削除しました -pagesaved = Pocket に保存しました -processingremove = ページを削除しています... -processingtags = タグを追加しています... -removepage = ページを削除 -save = 保存 -saving = 保存しています... -signupemail = メールアドレスで新規登録 -signuptosave = Pocket に新規登録します。無料です。 -suggestedtags = 提案タグ -tagline = Firefox で記事や動画を保存すると、いつでもどこでも Pocket で閲覧できます。 -taglinestory_one = Firefox で Pocket ボタンをクリックすると、様々な記事や動画やページを保存できます。 -taglinestory_two = Pocket でいつでもどこでも閲覧できます。 -tagssaved = タグを追加しました -signinfirefox = Firefox でログイン -signupfirefox = Firefox で新規登録 -viewlist = リストを表示 +addtags = タグを追加 +alreadyhaveacct = Pocket に登録済みですか? +continueff = Firefox で続行 +errorgeneric = Pocket への保存中にエラーがありました。 +learnmore = 詳細 +loginnow = ログイン +maxtaglength = タグは 25 文字までです +mustbeconnected = Pocket に保存するには、インターネット接続が必要です。接続状況を確認してから、試してみたください。 +onlylinkssaved = リンクのみ保存しました +pagenotsaved = ページを保存しませんでした +pageremoved = ページを削除しました +pagesaved = Pocket に保存しました +processingremove = ページを削除しています... +processingtags = タグを追加しています... +removepage = ページを削除 +save = 保存 +saving = 保存しています... +signupemail = メールアドレスで新規登録 +signuptosave = Pocket に新規登録します。無料です。 +suggestedtags = 提案タグ +tagline = Firefox で記事や動画を保存すると、いつでもどこでも Pocket で閲覧できます。 +taglinestory_one = Firefox で Pocket ボタンをクリックすると、様々な記事や動画やページを保存できます。 +taglinestory_two = Pocket でいつでもどこでも閲覧できます。 +tagssaved = タグを追加しました +tos = 続けることで、Pocket の 利用規約プライバシーポリシー に同意したことになります +tryitnow = 今すぐ試す +signinfirefox = Firefox でログイン +signupfirefox = Firefox で新規登録 +viewlist = リストを表示 # LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): # "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket に保存 -saveToPocketCmd.label = ページを Pocket に保存 -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = リンクを Pocket に保存 -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket のリストを表示 +pocket-button.label = Pocket +pocket-button.tooltiptext = Pocket に保存 +saveToPocketCmd.label = ページを Pocket に保存 +saveToPocketCmd.accesskey = k +saveLinkToPocketCmd.label = リンクを Pocket に保存 +saveLinkToPocketCmd.accesskey = o +pocketMenuitem.label = Pocket のリストを表示 diff --git a/browser/extensions/pocket/locale/jar.mn b/browser/extensions/pocket/locale/jar.mn index 26a51940cbef..58d96357a219 100644 --- a/browser/extensions/pocket/locale/jar.mn +++ b/browser/extensions/pocket/locale/jar.mn @@ -6,23 +6,14 @@ # These are used for the big if statement, as the preprocessor can't handle # dashes. #define bn_BD bn-BD -#define en_GB en-GB #define en_US en-US -#define en_ZA en-ZA -#define es_AR es-AR #define es_CL es-CL #define es_ES es-ES #define es_MX es-MX #define fy_NL fy-NL -#define ga_IE ga-IE -#define hi_IN hi-IN -#define hy_AM hy-AM -#define ja_JP_mac ja-JP-mac -#define nb_NO nb-NO -#define ne_NP ne-NP #define nn_NO nn-NO -#define pa_IN pa-IN #define pt_BR pt-BR +#define pt_PT pt-PT #define sv_SE sv-SE #define zh_CN zh-CN #define zh_TW zh-TW @@ -32,7 +23,7 @@ # For locales we support, include the file from the locale's directory in the # source tree. # For other locales (and en-US) fallback to the en-US directory. -#if AB_CD == ar || AB_CD == ast || AB_CD == bg || AB_CD == bn_BD || AB_CD == br || AB_CD == bs || AB_CD == ca || AB_CD == cs || AB_CD == cy || AB_CD == da || AB_CD == de || AB_CD == en_GB || AB_CD == en_US || AB_CD == en_ZA || AB_CD == eo || AB_CD == es_AR || AB_CD == es_CL || AB_CD == es_ES || AB_CD == es_MX || AB_CD == et || AB_CD == eu || AB_CD == fa || AB_CD == fi || AB_CD == fr || AB_CD == fy_NL || AB_CD == ga_IE || AB_CD == gd || AB_CD == hi_IN || AB_CD == hr || AB_CD == hu || AB_CD == hy_AM || AB_CD == id || AB_CD == is || AB_CD == it || AB_CD == ja || AB_CD == ja_JP_mac || AB_CD == ka || AB_CD == kk || AB_CD == km || AB_CD == kn || AB_CD == ko || AB_CD == lt || AB_CD == lv || AB_CD == mr || AB_CD == my || AB_CD == nb_NO || AB_CD == ne_NP || AB_CD == nl || AB_CD == nn_NO || AB_CD == pa_IN || AB_CD == pt_BR || AB_CD == rm || AB_CD == ro || AB_CD == ru || AB_CD == sk || AB_CD == sl || AB_CD == son || AB_CD == sq || AB_CD == sr || AB_CD == sv_SE || AB_CD == te || AB_CD == th || AB_CD == tr || AB_CD == uk || AB_CD == xh || AB_CD == zh_CN || AB_CD == zh_TW +#if AB_CD == ast || AB_CD == az || AB_CD == bg || AB_CD == bn_BD || AB_CD == cs || AB_CD == da || AB_CD == de || AB_CD == dsb || AB_CD == en_US || AB_CD == es_CL || AB_CD == es_ES || AB_CD == es_MX || AB_CD == et || AB_CD == fi || AB_CD == fr || AB_CD == fy_NL || AB_CD == hr || AB_CD == hsb || AB_CD == hu || AB_CD == it || AB_CD == ja || AB_CD == kab || AB_CD == lv || AB_CD == nl || AB_CD == nn_NO || AB_CD == or || AB_CD == pt_BR || AB_CD == pt_PT || AB_CD == rm || AB_CD == ro || AB_CD == ru || AB_CD == sk || AB_CD == sl || AB_CD == sq || AB_CD == sr || AB_CD == sv_SE || AB_CD == te || AB_CD == th || AB_CD == tr || AB_CD == uk || AB_CD == zh_CN || AB_CD == zh_TW locale/@AB_CD@/ (@AB_CD@/*) #else locale/@AB_CD@/ (en-US/*) diff --git a/browser/extensions/pocket/locale/ka/pocket.properties b/browser/extensions/pocket/locale/ka/pocket.properties deleted file mode 100644 index 5dcc4baffdaa..000000000000 --- a/browser/extensions/pocket/locale/ka/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = იარლიყების დამატება -alreadyhaveacct = უკვე იყენებთ Pocket-ს? -continueff = Firefox-ით გაგრძელება -errorgeneric = Pocket-ში შენახვისას დაფიქსირდა შეცდომა. -learnmore = დაწვრილებით -loginnow = შესვლა -maxtaglength = იარლიყები შეზღუდულია 25 ასომდე -mustbeconnected = Pocket-ში შესანახად საჭიროა ინტერნეთთან კავშირი. გთხოვთ შეამოწმეთ თქვენი კავშირი და ხელახლა ცადეთ. -onlylinkssaved = შესაძლებელია მხოლოდ ბმულების შენახვა -pagenotsaved = გვერდი არ შეინახა -pageremoved = გვერდი წაიშალა -pagesaved = შეინახა Pocket-ში -processingremove = იშლება გვერდი… -processingtags = ემატება იარლიყები… -removepage = გვერდის წაშლა -save = შენახვა -saving = ინახება… -signupemail = რეგისტრაცია ელ-ფოსტით -signuptosave = დარეგისტრირდით Pocket-ზე. ეს უფასოა. -suggestedtags = შემოთავაზებული იარლიყები -tagline = შეინახეთ სტატიები და ვიდეობეი Firefox-იდან მათ Pocket-ში სანახავად ნებისმიერ მოწყობილობაზე, ნებისმიერ დროს. -taglinestory_one = Firefox-იდან ნებისმიერი სტატიის, ვიდეოს ან გვერდის შესანახად დააწკაპეთ Pocket-ის ღილაკს. -taglinestory_two = დაათვალიერეთ Pocket-ში ნებისმიერ მოწყობილობაზე, ნებისმიერ დროს. -tagssaved = იარლიყები დაემატა -signinfirefox = შესვლა Firefox-ით -signupfirefox = რეგისრაცია Firefox-ით -viewlist = სიის ნახვა - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket-ში შენახვა -saveToPocketCmd.label = გვერდის შენახვა Pocket-ში -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = ბმულის შენახვა Pocket-ში -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket სიის ნახვა diff --git a/browser/extensions/pocket/locale/kab/pocket.properties b/browser/extensions/pocket/locale/kab/pocket.properties new file mode 100644 index 000000000000..3f4cc642ae6b --- /dev/null +++ b/browser/extensions/pocket/locale/kab/pocket.properties @@ -0,0 +1,43 @@ +# 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/. + +addtags = Rnu tibzimin +alreadyhaveacct = Aseqdac yakan n Pocket? +continueff = Kemmel s Firefox +errorgeneric = Teḍra-d tuccḍa deg aɛraḍ n usekles ɣer Pocket. +learnmore = Issin ugar +loginnow = Kcem +maxtaglength = Tibzimin ɣur-sent talast n 25 n isekkilen +mustbeconnected = Yessefk ad tiliḍ teqqneḍ ɣer Internet akken ad tizmireḍ ad teskelseḍ ɣer Pocket. Ma ulac aɣilif, senqed tuqqna yinek sakin ɛreḍ tikelt nniḍen. +onlylinkssaved = Al iseɣwan i yezmren ad ttwakelsen +pagenotsaved = Asebter ur yettwakles ara +pageremoved = Asebter yettwakkes +pagesaved = Yettwakles ɣer Pocket +processingremove = Tukksa n isebtar… +processingtags = Timerna n tebzimin… +removepage = Kkes asebter +save = Sekles +saving = Asekles… +signupemail = Jerred s yimayl +signuptosave = Jerred ɣer Pocket. Baṭel. +suggestedtags = Tibzimin yettwasumren +tagline = Sekles imagraden akked tvidyutin si Firefox akken ad twaliḍ di Pocket ɣef yal ibenk, melmi tebɣiḍ. +taglinestory_one = Sit ɣef tqeffalt Pocket akken ad teskelseḍ yal amagrad, tavidyut neɣ asebter si Firefox. +taglinestory_two = Sken di Pocket ɣef yal ibenk yellan, melmi tebɣiḍ. +tagssaved = Tibzimin yettwarnan +tos = Ma tkemleḍ, ad tqebleḍ tiwtilin n useqdec akked tsertit tabaḍnit n Pocket +tryitnow = Ɛreḍ-it tura +signinfirefox = Kcem s Firefox +signupfirefox = Jerred s Firefox +viewlist = Sken tabdart + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. +pocket-button.label = Pocket +pocket-button.tooltiptext = Sekles ɣer Pocket +saveToPocketCmd.label = Sekles asebter ɣer Pocket +saveToPocketCmd.accesskey = k +saveLinkToPocketCmd.label = Sekles aseɣwen ɣer Pocket +saveLinkToPocketCmd.accesskey = o +pocketMenuitem.label = Sken tabdart n Pocket diff --git a/browser/extensions/pocket/locale/kk/pocket.properties b/browser/extensions/pocket/locale/kk/pocket.properties deleted file mode 100644 index 6992410b3274..000000000000 --- a/browser/extensions/pocket/locale/kk/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Тегтерді қосу -alreadyhaveacct = Pocket пайдаланушысыз ба? -continueff = Firefox көмегімен жалғастыру -errorgeneric = Pocket-ке сақтау талабы кезінде қате орын алды. -learnmore = Көбірек білу -loginnow = Кіру -maxtaglength = Тег 25 таңбамен шектелген -mustbeconnected = Pocket-ке сақтау үшін интернетпен байланыс болу тиіс. Байланысты тексеріп, қайталап көріңіз. -onlylinkssaved = Тек сілтемелерді сақтауға болады -pagenotsaved = Парақ сақталмаған -pageremoved = Парақ өшірілді -pagesaved = Pocket-ке сақталды -processingremove = Парақты өшіру… -processingtags = Тегтерді қосу… -removepage = Парақты өшіру -save = Сақтау -saving = Сақтау… -signupemail = Эл. поштамен кіру -signuptosave = Pocket-те тіркелгіні жасау. Бұл - тегін. -suggestedtags = Ұсынылатын тегтер -tagline = Firefox-тан мақалаларды және видеоларды Pocket-те кез-келген құрылғыда және уақытта қарай алу үшін сақтаңыз. -taglinestory_one = Firefox-тан кез-келген мақала, видео немесе парақты сақтау үшін Pocket батырмасына басыңыз. -taglinestory_two = Pocket-те кез-келген құрылғыда және уақытта қарай аласыз. -tagssaved = Тегтер қосылды -signinfirefox = Firefox-пен кіру -signupfirefox = Firefox-пен тіркелу -viewlist = Тізімді қарау - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket-ке сақтау -saveToPocketCmd.label = Бетті Pocket-ке сақтау -saveToPocketCmd.accesskey = с -saveLinkToPocketCmd.label = Сілтемені Pocket-ке сақтау -saveLinkToPocketCmd.accesskey = т -pocketMenuitem.label = Pocket тізімін қарау diff --git a/browser/extensions/pocket/locale/km/pocket.properties b/browser/extensions/pocket/locale/km/pocket.properties deleted file mode 100644 index bdc1af43a954..000000000000 --- a/browser/extensions/pocket/locale/km/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = បន្ថែម​ស្លាក -alreadyhaveacct = ជា​អ្នក​ប្រើប្រាស់ Pocket ហើយ? -continueff = បន្ត​ជាមួយ Firefox -errorgeneric = មាន​កំហុស ពេល​ព្យាយាម​រក្សាទុក​ទៅ​កាន់​ Pocket។ -learnmore = ស្វែងយល់​​បន្ថែម -loginnow = ចូល -maxtaglength = ស្លាក​ត្រូវ​បាន​កំណត់​ត្រឹមតែ 25 តួ​អក្សរ -mustbeconnected = អ្នកត្រូវតែ​ភ្ជាប់​អ៊ីនធឺណែត ដើម្បី​រក្សាទុកទៅ Pocket។ សូម​ពិនិត្យ​ការភ្ជាប់របស់​អ្នក និង​ព្យាយាម​ម្តង​ទៀត។​ -onlylinkssaved = អាច​រក្សាទុក​បាន​តែ​តំណភ្ជាប់​ប៉ុណ្ណោះ -pagenotsaved = ទំព័រ​មិន​ត្រូវបាន​រក្សាទុក -pageremoved = ទំព័រ​ត្រូវ​បាន​លុបចោល -pagesaved = បាន​រក្សាទុក​ទៅ Pocket -processingremove = កំពុង​លុប​ទំព័រ… -processingtags = កំពុង​បន្ថែម​ស្លាក... -removepage = លុប​ទំព័រ -save = រក្សាទុក​ -saving = កំពុង​រក្សាទុក… -signupemail = ចុះឈ្មោះ​​ដោយ​ប្រើ​​អ៊ីមែល -signuptosave = ចុះឈ្មោះ​គណនី Pocket ដោយ​មិន​គិត​ប្រាក់។ -suggestedtags = ស្លាកដែល​បាន​ណែនាំ -tagline = រក្សាទុក​អត្ថបទ​ និង​វីដេអូពី​ Firefox ដើម្បីមើល​នៅក្នុង Pocket សម្រាប់​​គ្រប់​ឧបករណ៍ ​និងគ្រប់ពេល។​ -taglinestory_one = ចុច​​ប៊ូតុង Pocket ដើម្បីរក្សា​ទុក​អត្ថបទ វីដេអូ ឬ​ទំព័រ​ពី Firefox។ -taglinestory_two = មើល​ក្នុង Pocket សម្រាប់​គ្រប់ឧបករណ៍ និង​គ្រប់ពេល។​ -tagssaved = បាន​បន្ថែម​ស្លាក -signinfirefox = ចូល​ជាមួយ Firefox -signupfirefox = ចុះឈ្មោះជាមួយ Firefox -viewlist = មើលបញ្ជី - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = រក្សាទុក​ទៅ Pocket -saveToPocketCmd.label = រក្សាទុក​ទំព័រ​ទៅ Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = រក្សាទុក​តំណ​ទៅ​ក្នុង Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = មើល​បញ្ជី Pocket diff --git a/browser/extensions/pocket/locale/kn/pocket.properties b/browser/extensions/pocket/locale/kn/pocket.properties deleted file mode 100644 index ceda070afc34..000000000000 --- a/browser/extensions/pocket/locale/kn/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = ಟ್ಯಾಗ್‌ಗಳನ್ನು ಸೇರಿಸು -alreadyhaveacct = ನೀವು ಈಗಾಗಲೇ ಪಾಕೆಟ್ ಬಳಕೆದಾರರೆ? -continueff = Firefox ಜೊತೆ ಮುಂದುವರೆಯಿರಿ -errorgeneric = ಪಾಕೆಟ್‌ನಲ್ಲಿ ಉಳಿಸಲು ಪ್ರಯತ್ನಿಸಿದಾಗ ದೋಷ ಉಂಟಾಗಿದೆ. -learnmore = ಇನ್ನಷ್ಟು ಅರಿತುಕೊಳ್ಳಿ -loginnow = ಪ್ರವೇಶಿಸು -maxtaglength = ಟ್ಯಾಗ್‌ಗಳು 25 ಅಕ್ಷರಗಳಿಗೆ ಸೀಮಿತವಾಗಿವೆ -mustbeconnected = ನೀವು Pocket ನಲ್ಲಿ ಉಳಿಸಲು ಅಂತರ್ಜಾಲಕ್ಕೆ ಸಂಪರ್ಕ ಹೊಂದಿರಬೇಕಾಗುತ್ತದೆ. ದಯವಿಟ್ಟು ಅಂತರಜಾಲಕ್ಕೆ ಸಂಪರ್ಕಿತಗೊಂಡಿದ್ದೀರಿ ಎಂದು ಪರೀಕ್ಷಿಸಿ ನಂತರ ಇನ್ನೊಮ್ಮೆ ಪ್ರಯತ್ನಿಸಿ. -onlylinkssaved = ಕೇವಲ ಕೊಂಡಿಗಳನ್ನು ಮಾತ್ರ ಉಳಿಸಬಹುದು -pagenotsaved = ಪುಟವನ್ನು ಉಳಿಸಲಾಗಲಿಲ್ಲ -pageremoved = ಪುಟವನ್ನು ತೆಗೆಯಲಾಗಿದೆ -pagesaved = ಪಾಕೆಟ್‌ನಲ್ಲಿ ಉಳಿಸಲಾಗಿದೆ -processingremove = ಪುಟವನ್ನು ತೆಗೆಯಲಾಗುತ್ತಿದೆ... -processingtags = ಟ್ಯಾಗ್‌ಗಳನ್ನು ಸೇರಿಸಲಾಗುತ್ತಿದೆ... -removepage = ಪುಟವನ್ನು ತೆಗೆದುಹಾಕು -save = ಉಳಿಸು -saving = ಉಳಿಸಲಾಗುತ್ತಿದೆ…‍ -signupemail = ಇಮೇಲ್‌ನಿಂದ ಸೈನ್ ಅಪ್ ಮಾಡಿ -signuptosave = ಪಾಕೆಟ್‌ಗೆ ಸೈನ್ ಅಪ್ ಆಗಿ. ಇದು ಉಚಿತ. -suggestedtags = ಸೂಚಿಸಿದ ಟ್ಯಾಗ್‌ಗಳು -tagline = Firefox ನಿಂದ ಲೇಖನಗಳು ಮತ್ತು ವೀಡಿಯೊಗಳನ್ನು ಉಳಿಸಿರಿ ಮತ್ತು ಅವನ್ನು ಯಾವುದೇ ಸಾಧನದಲ್ಲಿ, ಯಾವುದೇ ಸಮಯದಲ್ಲಿ ಪಾಕೆಟ್‌ನಿಂದ ನೋಡಿರಿ. -taglinestory_one = ಯಾವುದೇ ಲೇಖನ, ವೀಡಿಯೋ ಅಥವಾ ಪುಟವನ್ನು Firefox ನಿಂದ ಉಳಿಸಲು ಪಾಕೆಟ್ ಬಟನ್ ಮೇಲೆ ಕ್ಲಿಕ್ ಮಾಡಿ. -taglinestory_two = ಯಾವದೇ ಸಾಧನದಿಂದ, ಯಾವುದೇ ಸಮಯದಲಿ ಪಾಕೆಟ್‌ನಲ್ಲಿ ನೋಡಿರಿ. -tagssaved = ಸೇರಿಸಿದ ಟ್ಯಾಗ್‌ಗಳು‍ -signinfirefox = Firefox ಜೊತೆ ಸೈನ್ ಇನ್ ಆಗಿ -signupfirefox = Firefox ಜೊತೆ ಸೈನ್ ಅಪ್ ಆಗಿ -viewlist = ಪಟ್ಟಿಯನ್ನು ನೋಡಿ - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = ಪಾಕೆಟ್ -pocket-button.tooltiptext = ಪಾಕೆಟ್‌ನಲ್ಲಿ ಉಳಿಸಿ‍ -saveToPocketCmd.label = Pocketಗೆ ಪುಟವನ್ನು ಉಳಿಸಿ -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = ಕೊಂಡಿಯನ್ನು ಪಾಕೆಟ್‌ಗೆ ಉಳಿಸಿ -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = ಪಾಕೆಟ್ ಪಟ್ಟಿಯನ್ನು ನೋಡಿ diff --git a/browser/extensions/pocket/locale/ko/pocket.properties b/browser/extensions/pocket/locale/ko/pocket.properties deleted file mode 100644 index 0e9ef6695a31..000000000000 --- a/browser/extensions/pocket/locale/ko/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = 태그 추가 -alreadyhaveacct = 이미 Pocket을 쓰고 있습니까? -continueff = Firefox로 계속하기 -errorgeneric = Pocket에 저장하다 잘못되었습니다. -learnmore = 더 알아보기 -loginnow = 로그인 -maxtaglength = 태그는 25자를 넘으면 안됨 -mustbeconnected = Pocket에 저장하려면 인터넷에 연결되어 있어야 합니다. 연결을 확인하고 다시 시도해 주십시오. -onlylinkssaved = 링크만 저장할 수 있음 -pagenotsaved = 페이지를 저장하지 못했음 -pageremoved = 페이지가 삭제됨 -pagesaved = Pocket에 저장 -processingremove = 페이지를 삭제하는 중… -processingtags = 페이지를 추가하는 중… -removepage = 페이지 삭제 -save = 저장 -saving = 저장 중… -signupemail = 이메일로 가입 -signuptosave = Pocket에 가입하십시오. 무료입니다. -suggestedtags = 추천하는 태그 -tagline = Firefox에서 글과 동영상을 저장하면 모든 기기에서 아무 때나 보실 수 있습니다. -taglinestory_one = Pocket 단추를 누르면 Firefox에서 어떠한 글, 동영상, 또는 페이지도 저장합니다. -taglinestory_two = 모든 기기에서 아무 때나 Pocket에서 볼 수 있습니다. -tagssaved = 태그를 추가함 -signinfirefox = Firefox로 로그인 -signupfirefox = Firefox로 가입하기 -viewlist = 목록 보기 - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket에 저장 -saveToPocketCmd.label = Pocket에 페이지 저장 -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Pocket에 링크 저장 -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket의 목록 보기 diff --git a/browser/extensions/pocket/locale/lt/pocket.properties b/browser/extensions/pocket/locale/lt/pocket.properties deleted file mode 100644 index 7f8a26d21e27..000000000000 --- a/browser/extensions/pocket/locale/lt/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Pridėkite gairių -alreadyhaveacct = Jau naudojatės „Pocket“? -continueff = Tęsti su „Firefox“ -errorgeneric = Bandant išsaugoti į „Pocket“ įvyko klaida. -learnmore = Sužinokite daugiau -loginnow = Prisijungti -maxtaglength = Gaires gali sudaryti iki 25 simbolių -mustbeconnected = Norėdami saugoti į „Pocket“, turite būti prisijungę prie interneto. Prašome patikrinti savo ryšį ir bandyti vėl. -onlylinkssaved = Išsaugoti galima tik nuorodas -pagenotsaved = Tinklalapis neišsaugotas -pageremoved = Tinklalapis pašalintas -pagesaved = Išsaugota į „Pocket“ -processingremove = Šalinamas tinklalapis… -processingtags = Pridedamos gairės… -removepage = Pašalinti tinklalapį -save = Išsaugoti -saving = Išsaugoma… -signupemail = Prisijungti su el. paštu -signuptosave = Pradėkite naudotis „Pocket“. Tai nemokama. -suggestedtags = Siūlomos gairės -tagline = Išsaugokite straipsnius bei vaizdo įrašus iš „Firefox“ norėdami juos peržiūrėti bet kokiame įrenginyje su „Pocket“, bet kuriuo metu. -taglinestory_one = Spustelėkite „Pocket“ mygtuką norėdami išsaugoti bet kokį straipsnį, vaizdo įrašą ar tinklalapį iš „Firefox“. -taglinestory_two = Peržiūrėkite bet kokiame įrenginyje su „Pocket“, bet kuriuo metu. -tagssaved = Gairės pridėtos -signinfirefox = Prisijungti su „Firefox“ -signupfirefox = Prisijungti su „Firefox“ -viewlist = Peržiūrėti sąrašą - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Išsaugoti į „Pocket“ -saveToPocketCmd.label = Išsaugoti tinklalapį į „Pocket“ -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Išsaugoti saitą į „Pocket“ -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Peržiūrėti „Pocket“ sąrašą diff --git a/browser/extensions/pocket/locale/lv/pocket.properties b/browser/extensions/pocket/locale/lv/pocket.properties index bb6011e1ff14..40e3bb3670c9 100644 --- a/browser/extensions/pocket/locale/lv/pocket.properties +++ b/browser/extensions/pocket/locale/lv/pocket.properties @@ -26,6 +26,8 @@ tagline = Saglabājiet Firefox rakstu vai video, lai skatītos to ar Pocket jebk taglinestory_one = Klikšķiniet uz Pocket pogas, lai saglabātu Firefox rakstus, video vai lapas. taglinestory_two = Skatiet ar Pocket jebkurā ierīcē un jebkurā laikā. tagssaved = Birkas pievienotas +tos = Turpinot, tu piekrīti Pocket Noteikumiem un Privātuma politikai +tryitnow = Izmēģini tagad signinfirefox = Pieslēgties ar Firefox signupfirefox = Pierakstīties ar Firefox viewlist = Skatījumu saraksts diff --git a/browser/extensions/pocket/locale/mr/pocket.properties b/browser/extensions/pocket/locale/mr/pocket.properties deleted file mode 100644 index 9a2f08644710..000000000000 --- a/browser/extensions/pocket/locale/mr/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = टॅग जोडा -alreadyhaveacct = आधीपासून Pocket वापरताय? -continueff = Firefox सोबत पुढे चला -errorgeneric = Pocket मध्ये जतन करताना त्रुटी आली. -learnmore = अधिक जाणून घ्या -loginnow = लॉग इन -maxtaglength = टॅग्ज साठी 25 वर्णांची मर्यादा आहे -mustbeconnected = Pocket मध्ये साठविण्यासाठी आपले इंटरनेट चालू असणे आवश्यक आहे. कृपया आपली जोडणी तपासा आणि पुन्हा प्रयत्न करा. -onlylinkssaved = फक्त दुवे जतन केले जाऊ शकतात -pagenotsaved = पृष्ठ जतन झाले नाही -pageremoved = पृष्ठ काढले गेले -pagesaved = Pocket मध्ये जतन झाले -processingremove = पृष्ठ काढून टाकत आहे... -processingtags = टॅग्ज जोडत आहे… -removepage = पृष्ठ काढून टाका -save = जतन करा -saving = जतन करत आहे... -signupemail = ईमेलसह साईन अप करा -signuptosave = Pocket साठी साईन अप करा. हे मोफत आहे. -suggestedtags = सूचविलेले टॅग्स -tagline = Firefox मधील नोंदी आणि व्हिडीओ कुठल्याही साधनावर केंव्हाही Pocket मध्ये पाहण्यासाठी साठवा. -taglinestory_one = Firefox वरील कोणताही लेख, व्हिडिओ किंवा पृष्ठ जतन करण्यासाठी Pocket बटणावर क्लिक करा. -taglinestory_two = कधीही कुठल्याही साधनावर Pocket मध्ये पाहा. -tagssaved = टॅग्स जोडले -signinfirefox = Firefox सह साइन इन करा -signupfirefox = Firefox सह साईन अप करा -viewlist = यादी पहा - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket मध्ये जतन करा -saveToPocketCmd.label = पृष्ठ Pocket मध्ये जतन करा -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = दुवा Pocket मध्ये संकलित करा -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = पॉकेट सूची पहा diff --git a/browser/extensions/pocket/locale/my/pocket.properties b/browser/extensions/pocket/locale/my/pocket.properties deleted file mode 100644 index 08a376d8c0dc..000000000000 --- a/browser/extensions/pocket/locale/my/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = စာအမှတ်များ ထည့်ပါ -alreadyhaveacct = ပေါ့ကတ် အကောင့်ရှိပြီးပြီလား။ -continueff = မီးမြေခွေးကို အသုံးပြုပြီး ဆက်လက်လုပ်ဆောင်မည် -errorgeneric = ပေါ့ကတ်သို့ သိမ်းရန်ကြိုးစားရာတွင် ပြသာနာတစ်ခု တွေ့ရှိခဲ့သည်။ -learnmore = ဆက်လက်လေ့လာ -loginnow = ဝင်ပါ -maxtaglength = စာမှတ်များ၏ စာလုံးရေကန့်သတ်ချက်သည် ၂၅ လုံးဖြစ်သည် -mustbeconnected = ပေါ့ကတ်သို့သိမ်းဆည်းရန်အတွက် သင်အင်တာနက်သို့ ချိတ်ဆက်ထားရမည်ဖြစ်သည်။ ကျေးဇူးပြု၍ သင့် အင်တာနက်ကို ချိတ်ဆက်ပြီး ထပ်မံကြိုးစားကြည့်ပါ။ -onlylinkssaved = လင်ခ့်များကိုသာ သိမ်းထားနိုင်သည် -pagenotsaved = စာမျက်နှာကို မသိမ်းလိုက်ရပါ -pageremoved = စာမျက်နှာကို ဖယ်ရှားပြီး -pagesaved = ပေါ့ကတ်သို့သိမ်းပြီး -processingremove = စာမျက်နှာကို ဖယ်ရှားနေသည်… -processingtags = စာမှတ်များကို ထည့်နေသည်... -removepage = စာမျက်နှာကို ဖျက်ရန် -save = သိမ်းရန် -saving = သိမ်းဆည်းနေသည်… -signupemail = အီးမေးလ်ဖြင့် မှတ်ပုံတင်ပါ -signuptosave = ပေါ့ကတ်အတွက် မှတ်ပုံတင်ပါ။ အခမဲ့ဖြစ်ပါသည်။ -suggestedtags = အကြံပေးထားသော စာတိုများ -tagline = မည်သည့်ကိရိယာ၊ မည်သည့်အချိန်တွင်မဆို ပေါ့ကတ်ထဲတွင် ကြည့်ရန် မီးမြေခွေးမှ စာစုများနှင့် ဗွီဒီယိုများကို သိမ်းပါ။ -taglinestory_one = မီးမြေခွေးမှ မည်သည့်စာစု၊ ဗွီဒီယို သို့မဟုတ် စာမျက်နှာကို သိမ်းရန် ပေါ့ကတ်ခလုတ်ကို နှိပ်ပါ။ -taglinestory_two = မည်သည့် ကိရိယာ၊ မည်သည့် အချိန်တွင်မဆို ပေါ့ကတ်ထဲတွင် ကြည့်ပါ။ -tagssaved = စာမှတ်များ ထည့်ပြီး -signinfirefox = မီးမြေခွေးအကောင့်ဖြင့် ဝင်ရောက်ပါ -signupfirefox = မီးမြေခွေးအကောင့်ဖြင့် မှတ်ပုံတင်ပါ -viewlist = စာရင်းကို ကြည့်ရန် - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket သို့ သိမ်းရန် -saveToPocketCmd.label = စာမျက်နှာကို Pocket ထဲသို့ သိမ်းပါ -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = လင့်ခ်ကို Pocket ထဲသို့(o) သိမ်းပါ -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket စာရင်းကို ကြည့်ရန် diff --git a/browser/extensions/pocket/locale/nb-NO/pocket.properties b/browser/extensions/pocket/locale/nb-NO/pocket.properties deleted file mode 100644 index b6b9091ea5d3..000000000000 --- a/browser/extensions/pocket/locale/nb-NO/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Legg til etiketter -alreadyhaveacct = Allerede en Pocket-bruker? -continueff = Fortsett med Firefox -errorgeneric = Et problem oppstod ved lagring til Pocket. -learnmore = Les mer -loginnow = Logg inn -maxtaglength = Etiketter er begrenset til 25 tegn -mustbeconnected = Du må være koblet til nettet for å lagre til Pocket. Kontroller tilkoblingen og prøv igjen. -onlylinkssaved = Bare lenker kan lagres -pagenotsaved = Side ikke lagret -pageremoved = Side fjernet -pagesaved = Lagret til Pocket -processingremove = Fjerner side … -processingtags = Legger til side … -removepage = Fjern side -save = Lagre -saving = Lagrer … -signupemail = Logg inn med e-postadresse -signuptosave = Registrer deg i Pocket. Det er gratis. -suggestedtags = Foreslåtte etiketter -tagline = Lagre artikler og videoer fra Firefox for å vise dem i Pocket på hvilken som helst enhet, når som helst. -taglinestory_one = Trykk på Pocket-knappen for å lagre hvilken som helst artikkel, video eller side fra Firefox. -taglinestory_two = Vis i Pocket på hvilken som helst enhet, når som helst. -tagssaved = Etiketter lagt til -signinfirefox = Logg inn med Firefox -signupfirefox = Registrer deg med Firefox -viewlist = Vis liste - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Lagre til Pocket -saveToPocketCmd.label = Lagre siden i Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Lagre lenke til Pocket -saveLinkToPocketCmd.accesskey = l -pocketMenuitem.label = Vis Pocket-liste diff --git a/browser/extensions/pocket/locale/ne-NP/pocket.properties b/browser/extensions/pocket/locale/ne-NP/pocket.properties deleted file mode 100644 index 00a3b037c567..000000000000 --- a/browser/extensions/pocket/locale/ne-NP/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = ट्याग थप्नुहोस् -alreadyhaveacct = के तपाईँ पकेट प्रयोगकर्ता हो? -continueff = Firefox सँग जारी राख्नुहोस् -errorgeneric = Pocket मा सङ्ग्रह गर्न प्रयास गर्दा, एउटा त्रुटी भयो। -learnmore = अझ जान्नुहोस् -loginnow = लग इन -maxtaglength = ट्याग २५ अक्षर सम्म सिमित हुन्छन -mustbeconnected = तपाईँ Pocket मा सङ्ग्रह गर्न इन्टरनेटसँग जोडिएको हुनुपर्छ। आफ्नो जडान जाँच र फेरि प्रयास गर्नुहोस्। -onlylinkssaved = लिङ्कहरू मात्र सङ्ग्रह गर्न सकिन्छ -pagenotsaved = पृष्ठ सङ्ग्रह गरिएको छैन -pageremoved = पृष्ठ हटाइयो -pagesaved = Pocket मा सङ्ग्रह गरियो -processingremove = पृष्ठ हटाउँदै ... -processingtags = ट्यागहरू थप्दै… -removepage = पृष्ठ हटाउनुहोस् -save = सङ्ग्रह गर्नुहोस् -saving = सङ्ग्रह गरिँदै… -signupemail = इमेल प्रयोग गरेर साइन अप गर्नुहोस् -signuptosave = Pocket मा साइन अप गर्नुहोस् । यो निःशुल्क छ ।\u0020 -suggestedtags = सिफारिस गरिएका ट्यागहरू -tagline = कुनै पनि उपकरणमा, कुनै पनि समयमा Pocket हेर्न Firefox बाट लेख र भिडियो सङ्ग्रह गर्नुहोस्। -taglinestory_one = Firefox बाट कुनै पनि लेख, भिडियो वा पृष्ठ सङ्ग्रह गर्न Pocket Button थिच्नुहोस्। -taglinestory_two = कुनै पनि उपकरण, कुनै पनि समय Pocket मा हेर्नुहोस्। -tagssaved = ट्यागहरू थिपियो -signinfirefox = Firefox प्रयोग गरेर साइन इन गर्नुहोस् -signupfirefox = Firefox प्रयोग गरेर साइन अप गर्नुहोस् -viewlist = सुची हेर्नुहोस् - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket मा सङ्ग्र गर्नुहोस् -saveToPocketCmd.label = पृष्ठलाई Pocket मा सङ्ग्रह गर्नुहोस् -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Pocket मा लिङ्क सङ्ग्रह गर्नुहोस् -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Poket को सुची हेर्नुहोस् diff --git a/browser/extensions/pocket/locale/nl/pocket.properties b/browser/extensions/pocket/locale/nl/pocket.properties index 819cbe87b401..3abe14491cb0 100644 --- a/browser/extensions/pocket/locale/nl/pocket.properties +++ b/browser/extensions/pocket/locale/nl/pocket.properties @@ -26,6 +26,8 @@ tagline = Sla artikelen en video’s vanuit Firefox op voor weergeven in Pocket taglinestory_one = Klik op de Pocket-knop om artikelen, video’s of pagina’s vanuit Firefox op te slaan. taglinestory_two = Bekijk ze op diverse apparaten, wanneer dan ook. tagssaved = Labels toegevoegd +tos = Door verder te gaan, gaat u akkoord met de Servicevoorwaarden en het Privacybeleid van Pocket +tryitnow = Nu proberen signinfirefox = Aanmelden met Firefox signupfirefox = Registreren met Firefox viewlist = Lijst weergeven diff --git a/browser/extensions/pocket/locale/nn-NO/pocket.properties b/browser/extensions/pocket/locale/nn-NO/pocket.properties index 2f90e62c22e4..3f3dc971e685 100644 --- a/browser/extensions/pocket/locale/nn-NO/pocket.properties +++ b/browser/extensions/pocket/locale/nn-NO/pocket.properties @@ -26,6 +26,8 @@ tagline = Lagra artiklar og videoar frå Firefox for å visa dei i Pocket på kv taglinestory_one = Trykk på Pocket-knappen for å lagra kva som helst artikkel, video eller side frå Firefox. taglinestory_two = Vis i Pocket, på kva som helst eining, når som helst. tagssaved = Merkelapp-stikkord lagt til +tos = Ved å fortsetta godtek du Pocket sine tenestevilkår og personvernpraksis +tryitnow = Prøv no signinfirefox = Logg inn med Firefox signupfirefox = Registrer deg med Firefox viewlist = Vis liste diff --git a/browser/extensions/pocket/locale/or/pocket.properties b/browser/extensions/pocket/locale/or/pocket.properties new file mode 100644 index 000000000000..d2616e484ac0 --- /dev/null +++ b/browser/extensions/pocket/locale/or/pocket.properties @@ -0,0 +1,43 @@ +# 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/. + +addtags = ଟ୍ୟାଗ ଯୋଡ଼ନ୍ତୁ +alreadyhaveacct = ଆଗରୁ Pocket ବ୍ୟବହାର କରୁଛନ୍ତି? +continueff = Firefox ଦେଇ ଆଗକୁ ଯିବେ +errorgeneric = Pocketରେ ସାଇତିବା ବେଳେ ଅସୁବିଧାଟିଏ ହେଲା । +learnmore = ଅଧିକ ଶିଖନ୍ତୁ +loginnow = ଲଗ ଇନ +maxtaglength = ଟ୍ୟାଗ 25 ଟି ଅକ୍ଷରରେ ସୀମିତ +mustbeconnected = Pocketରେ ସାଇତିବା ପାଇଁ ଆପଣ ଇଣ୍ଟରନେଟ ସହ ସଂଯୁକ୍ତ ହୋଇଥିବା ଲୋଡ଼ା । ଦୟାକରି ନିଜ ସଂଯୋଗ ପରଖି ଆଉଥରେ ଚେଷ୍ଟାକରନ୍ତୁ । +onlylinkssaved = କେବଳ ଲିଙ୍କ ସାଇତାଯାଇପାରିବ +pagenotsaved = ପୃଷ୍ଠା ସାଇତା ଯାଇନାହିଁ +pageremoved = ପୃଷ୍ଠାଟି ହଟାଗଲା +pagesaved = Pocketରେ ସାଇତାଗଲା +processingremove = ପୃଷ୍ଠା ହଟାଯାଉଛି… +processingtags = ଟ୍ୟାଗ ଯୋଡ଼ାଯାଉଛି… +removepage = ପୃଷ୍ଠା ହଟାନ୍ତୁ +save = ସାଇତିବେ +saving = ସାଇତୁଛି… +signupemail = ଇମେଲରେ ସାଇନ ଅପ +signuptosave = Pocket ପାଇଁ ସାଇନ ଅପ । ଏହା ମାଗଣା । +suggestedtags = ପ୍ରସ୍ତାବିତ ଟ୍ୟାଗ +tagline = ଯେତେବେଳେ ଲୋଡ଼ା କୌଣସି ଏକ ଡିଭାଇସରୁ Pocketରେ ଦେଖିବା ପାଇଁ Firefoxରୁ ପ୍ରସଙ୍ଗ ଓ ଭିଡ଼ିଓ ସାଇତିପାରିବେ । +taglinestory_one = କୌଣସି ପ୍ରସଙ୍ଗ, ଭିଡ଼ିଓ ବା ପୃଷ୍ଠା ସାଇତିବା ପାଇଁ Pocket Button ଟିପନ୍ତୁ । +taglinestory_two = ଯେତେବେଳେ ଲୋଡ଼ା ସବୁ ଡିଭାଇସରୁ Pocketରେ ଦେଖନ୍ତୁ । +tagssaved = ଟ୍ୟାଗ ଯୋଡ଼ାଗଲା +tos = ଆଗକୁ ବଢ଼ିବା ଯୋଗୁ ଆପଣ Pocketର ନୀତି ନିୟମଗୋପନୀୟତା ନୀତିବଳୀ ମାନୁଛନ୍ତି ବୋଲି ଜାଣିରଖିବେ +tryitnow = ଏବେ ଏହା ଚେଷ୍ଟାକରନ୍ତୁ +signinfirefox = Firefoxରେ ସାଇନ ଇନ କରନ୍ତୁ +signupfirefox = Firefoxରେ ସାଇନ ଅପ କରନ୍ତୁ +viewlist = ତାଲିକା ଦେଖନ୍ତୁ + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. +pocket-button.label = Pocket +pocket-button.tooltiptext = Pocketରେ ସାଇତନ୍ତୁ +saveToPocketCmd.label = Pocketରେ ପୃଷ୍ଠା ସାଇତନ୍ତୁ +saveToPocketCmd.accesskey = k +saveLinkToPocketCmd.label = Pocketରେ ଲିଙ୍କ ସାଇତନ୍ତୁ +saveLinkToPocketCmd.accesskey = o +pocketMenuitem.label = Pocket ତାଲିକା ଦେଖନ୍ତୁ diff --git a/browser/extensions/pocket/locale/pa-IN/pocket.properties b/browser/extensions/pocket/locale/pa-IN/pocket.properties deleted file mode 100644 index 3ae0d7234a1f..000000000000 --- a/browser/extensions/pocket/locale/pa-IN/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = ਟੈਗ ਨੂੰ ਜੋੜੋ -alreadyhaveacct = ਪਹਿਲਾਂ ਹੀ ਪਾਕੇਟ (Pocket) ਵਰਤੋਂਕਾਰ ਹੋ? -continueff = ਫਾਇਰਫਾਕਸ ਨਾਲ ਜਾਰੀ ਰੱਖੋ -errorgeneric = ਪਾਕੇਟ ਵਿੱਚ ਸੰਭਾਲਣ ਦੀ ਕੋਸ਼ਿਸ਼ ਦੌਰਾਨ ਗਲਤੀ ਸੀ। -learnmore = ਹੋਰ ਜਾਣੋ -loginnow = ਲਾਗਇਨ -maxtaglength = ਟੈਗ 25 ਅੱਖਰਾਂ ਤੱਕ ਸੀਮਿਤ ਹਨ -mustbeconnected = ਪਾਕੇਟ ਵਿੱਚ ਸੰਭਾਲਣ ਲਈ ਤੁਸੀਂ ਇੰਟਰਨੈੱਟ ਨਾਲ ਕਨੈਕਟ ਹੋਣੇ ਚਾਹੀਦੇ ਹੋ। ਆਪਣੇ ਕਨੈਕਸ਼ਨ ਦੀ ਜਾਂਚ ਕਰੋ ਅਤੇ ਮੁੜ ਕੋਸ਼ਿਸ਼ ਕਰੋ। -onlylinkssaved = ਕੇਵਲ ਲਿੰਕਾਂ ਨੂੰ ਹੀ ਸੰਭਾਲਿਆ ਜਾ ਸਕਦਾ ਹੈ -pagenotsaved = ਸਫ਼ੇ ਨੂੰ ਨਹੀਂ ਸੰਭਾਲਿਆ ਗਿਆ -pageremoved = ਸਫ਼ੇ ਨੂੰ ਹਟਾਇਆ ਗਿਆ -pagesaved = ਪਾਕੇਟ ਵਿੱਚ ਸੰਭਾਲਿਆ -processingremove = …ਸਫ਼ੇ ਨੂੰ ਹਟਾਇਆ ਜਾ ਰਿਹਾ ਹੈ -processingtags = …ਟੈਗ ਨੂੰ ਜੋੜਿਆ ਜਾ ਰਿਹਾ ਹੈ -removepage = ਸਫ਼ੇ ਨੂੰ ਹਟਾਓ -save = ਸੰਭਾਲੋ -saving = …ਸੰਭਾਲਿਆ ਜਾ ਰਿਹਾ ਹੈ -signupemail = ਈਮੇਲ ਨਾਲ ਸਾਈਨ ਅੱਪ ਕਰੋ -signuptosave = ਪਾਕੇਟ ਲਈ ਸਾਈਨ ਅੱਪ ਕਰੋ। ਇਹ ਮੁਫ਼ਤ ਹੈ। -suggestedtags = ਸੁਝਾਏ ਗਏ ਟੈਗ -tagline = ਫਾਇਰਫਾਕਸ ਤੋਂ ਲੇਖਾਂ ਅਤੇ ਵੀਡੀਓ ਨੂੰ ਪਾਕੇਟ ਵਿੱਚ ਸੰਭਾਲੋ ਤਾਂ ਕਿ ਕਿਸੇ ਵੀ ਡਿਵਾਈਸ, ਕਿਸੇ ਵੀ ਸਮੇਂ ਵੇਖਿਆ ਜਾ ਸਕਦਾ ਹੈ। -taglinestory_one = ਕਿਸੇ ਵੀ ਲੇਖ, ਵੀਡੀਓ ਜਾਂ ਸਫ਼ੇ ਨੂੰ ਫਾਇਰਫਾਕਸ ਤੋਂ ਸੰਭਾਲਣ ਲਈ Pocket ਬਟਨ ਉੱਤੇ ਕਲਿੱਕ ਕਰੋ। -taglinestory_two = ਕਿਸੇ ਵੀ ਡਿਵਾਈਸ, ਕਿਸੇ ਵੀ ਸਮੇਂ ਪਾਕੇਟ ਵਿੱਚ ਦੇਖੋ। -tagssaved = ਟੈਗ ਨੂੰ ਜੋੜਿਆ -signinfirefox = ਫਾਇਰਫਾਕਸ ਨਾਲ ਸਾਇਨ ਇਨ ਕਰੋ -signupfirefox = ਫਾਇਰਫਾਕਸ ਨਾਲ ਸਾਇਨ ਅੱਪ ਕਰੋ -viewlist = ਸੂਚੀ ਨੂੰ ਵੇਖੋ - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket ਵਿੱਚ ਸੰਭਾਲੋ -saveToPocketCmd.label = ਸਫ਼ੇ ਨੂੰ Pocket ਵਿੱਚ ਸੰਭਾਲੋ -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = ਲਿੰਕ ਨੂੰ Pocket ਵਿੱਚ ਸੰਭਾਲੋ -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket ਦੀ ਸੂਚੀ ਦੇਖੋ diff --git a/browser/extensions/pocket/locale/pt-BR/pocket.properties b/browser/extensions/pocket/locale/pt-BR/pocket.properties index c377fb481062..a637aea29bef 100644 --- a/browser/extensions/pocket/locale/pt-BR/pocket.properties +++ b/browser/extensions/pocket/locale/pt-BR/pocket.properties @@ -26,8 +26,10 @@ tagline = Salve os artigos e vídeos do Firefox no Pocket para vê-los mais tard taglinestory_one = Clique no botão Pocket para salvar um artigo, vídeo ou página do Firefox. taglinestory_two = Ver no Pocket em qualquer dispositivo, a qualquer hora. tagssaved = Etiquetas adicionadas +tos = Continuando, você concorda com os Termos de serviço e Política de privacidade do Pocket +tryitnow = Experimente-o agora signinfirefox = Entrar com o Firefox -signupfirefox = Registrar com o Firefox +signupfirefox = Cadastre-se com o Firefox viewlist = Ver lista # LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): diff --git a/browser/extensions/pocket/locale/pt-PT/pocket.properties b/browser/extensions/pocket/locale/pt-PT/pocket.properties new file mode 100644 index 000000000000..90eafe77fca2 --- /dev/null +++ b/browser/extensions/pocket/locale/pt-PT/pocket.properties @@ -0,0 +1,43 @@ +# 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/. + +addtags = Adicionar etiquetas +alreadyhaveacct = Já é um utilizador do Pocket? +continueff = Continuar com o Firefox +errorgeneric = Ocorreu um erro ao tentar guardar no Pocket. +learnmore = Saber mais +loginnow = Iniciar sessão +maxtaglength = As etiquetas estão limitadas a 25 caracteres +mustbeconnected = É necessária uma ligação à Internet para poder guardar no Pocket. Por favor, verifique a sua ligação à Internet e tente novamente. +onlylinkssaved = Só podem ser guardadas ligações +pagenotsaved = Página não guardada +pageremoved = Página removida +pagesaved = Guardado no Pocket +processingremove = A remover página… +processingtags = A adicionar etiquetas… +removepage = Remover página +save = Guardar +saving = A guardar… +signupemail = Registar com email +signuptosave = Registe-se no Pocket. É gratuito. +suggestedtags = Etiquetas sugeridas +tagline = Guardar artigos e vídeos do Firefox para os ver no Pocket em qualquer dispositivo, em qualquer altura. +taglinestory_one = Clique no botão Pocket para guardar qualquer artigo, vídeo ou página a partir Firefox. +taglinestory_two = Ver no Pocket em qualquer dispositivo, a qualquer altura. +tagssaved = Etiquetas adicionadas +tos = Ao continuar, concorda com os termos do serviço e política de privacidade do Pocket +tryitnow = Experimente-o agora +signinfirefox = Iniciar sessão com Firefox +signupfirefox = Registar com Firefox +viewlist = Ver lista + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. +pocket-button.label = Pocket +pocket-button.tooltiptext = Guardar no Pocket +saveToPocketCmd.label = Guardar página no Pocket +saveToPocketCmd.accesskey = k +saveLinkToPocketCmd.label = Guardar ligação no Pocket +saveLinkToPocketCmd.accesskey = o +pocketMenuitem.label = Ver lista do Pocket diff --git a/browser/extensions/pocket/locale/rm/pocket.properties b/browser/extensions/pocket/locale/rm/pocket.properties index ba3c8b6a15d0..803277b2140e 100644 --- a/browser/extensions/pocket/locale/rm/pocket.properties +++ b/browser/extensions/pocket/locale/rm/pocket.properties @@ -26,6 +26,8 @@ tagline = Memorisescha artitgels e videos ord Firefox per als vesair en Pocket, taglinestory_one = Clicca sin il buttun da Pocket per memorisar directamain ord Firefox tge artitgel, video u pagina ch'i saja. taglinestory_two = Vesair en Pocket sin mintga apparat, da tut temp. tagssaved = Tags agiuntads +tos = Cun cuntinuar accepteschas ti il Contract da licenza e las Directivas per la protecziun da datas da Pocket +tryitnow = Emprova ussa signinfirefox = S'annunziar cun Firefox signupfirefox = Sa registrar cun Firefox viewlist = Mussar la glista diff --git a/browser/extensions/pocket/locale/ro/pocket.properties b/browser/extensions/pocket/locale/ro/pocket.properties index 088ff4b50a41..eedb756f91b5 100644 --- a/browser/extensions/pocket/locale/ro/pocket.properties +++ b/browser/extensions/pocket/locale/ro/pocket.properties @@ -5,7 +5,7 @@ addtags = Adaugă etichete alreadyhaveacct = Ești deja un utilizator Pocket? continueff = Continuă cu Firefox -errorgeneric = A apărut o eroare la încercarea de a salva în Pocket. +errorgeneric = A apărut o eroare la încercarea de salvare în Pocket. learnmore = Află mai multe loginnow = Autentificare maxtaglength = Etichetele sunt limitate la 25 de caractere @@ -26,6 +26,8 @@ tagline = Salvează articole și videoclipuri din Firefox pentru a le vedea în taglinestory_one = Clic pe butonul Pocket pentru a salva orice articol, videoclip sau pagină din Firefox. taglinestory_two = Vezi în Pocket de pe orice dispozitiv, oricând. tagssaved = Etichete adăugate +tos = Continuând, ești de acord cu termenii de utilizare a serviciului și politica de confidențialitate a Pocket +tryitnow = Încearcă acum signinfirefox = Autentificare în Firefox signupfirefox = Înregistrare în Firefox viewlist = Vezi lista diff --git a/browser/extensions/pocket/locale/ru/pocket.properties b/browser/extensions/pocket/locale/ru/pocket.properties index 8a85aa76d4dc..0da716e8a61b 100644 --- a/browser/extensions/pocket/locale/ru/pocket.properties +++ b/browser/extensions/pocket/locale/ru/pocket.properties @@ -26,9 +26,14 @@ tagline = Сохраняйте статьи и видео из Firefox для п taglinestory_one = Щёлкните по кнопке Pocket, чтобы сохранить любую статью, видео или страницу из Firefox. taglinestory_two = Просматривайте их в Pocket на любом устройстве, в любой момент. tagssaved = Теги добавлены +tos = Продолжая, вы принимаете Условия службы и Политику приватности Pocket +tryitnow = Попробовать сейчас signinfirefox = Войти через Firefox signupfirefox = Регистрация через Firefox viewlist = Просмотреть список + +# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): +# "Pocket" is a brand name. pocket-button.label = Pocket pocket-button.tooltiptext = Сохранить в Pocket saveToPocketCmd.label = Сохранить страницу в Pocket diff --git a/browser/extensions/pocket/locale/sk/pocket.properties b/browser/extensions/pocket/locale/sk/pocket.properties index 361254c6115c..57327365c685 100644 --- a/browser/extensions/pocket/locale/sk/pocket.properties +++ b/browser/extensions/pocket/locale/sk/pocket.properties @@ -26,6 +26,8 @@ tagline = Ukladajte si články a videá z Firefoxu a majte ich dostupné kdeko taglinestory_one = Kliknutím na tlačidlo Pocket vo Firefoxe uložíte akýkoľvek článok, video alebo stránku. taglinestory_two = Tieto sú potom so službou Pocket dostupné kdekoľvek a na akomkoľvek zariadení. tagssaved = Značky boli pridané +tos = Pokračovaním vyjadrujete súhlas s podmienkami používania služby Pocket a so zásadami ochrany osobných údajov +tryitnow = Vyskúšajte to hneď teraz signinfirefox = Prihlásiť sa pomocou Firefoxu signupfirefox = Zaregistrovať sa pomocou Firefoxu viewlist = Zobraziť zoznam diff --git a/browser/extensions/pocket/locale/sl/pocket.properties b/browser/extensions/pocket/locale/sl/pocket.properties index 561ed362e5e9..e0451d72b87e 100644 --- a/browser/extensions/pocket/locale/sl/pocket.properties +++ b/browser/extensions/pocket/locale/sl/pocket.properties @@ -26,6 +26,8 @@ tagline = Shranite članke in videe v Firefoxu in si jih oglejte na Pocketu iz k taglinestory_one = Kliknite gumb Pocket v Firefoxu in shranite članek, video ali stran. taglinestory_two = Oglejte si v Pocketu na kateri koli napravi. tagssaved = Oznake dodane +tos = Če nadaljujete, sprejemate Pogoje uporabe in Politiko zasebnosti storitve Pocket +tryitnow = Preizkusite ga zdaj signinfirefox = Prijavite se s Firefoxom signupfirefox = Registrirajte se s Firefoxom viewlist = Ogled seznama diff --git a/browser/extensions/pocket/locale/son/pocket.properties b/browser/extensions/pocket/locale/son/pocket.properties deleted file mode 100644 index b7ba33af174a..000000000000 --- a/browser/extensions/pocket/locale/son/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Kanjiyaŋ tonton -alreadyhaveacct = War ga goy nda Pocket? -continueff = Koyjine nda Firefox -errorgeneric = Firka foo bangay kaŋ war ceeci ka gaabu Pocket ga. -learnmore = Bay ka tonton -loginnow = Huru -maxtaglength = Kanji hinnaa ma ši bisa harfu 25 -mustbeconnected = War ga hima ka dobu interneti ga ka gaabu Pocket ga. War interneti doboo koroši ka ceeci koyne. -onlylinkssaved = Dobey hinne ma hin ka gaabundi -pagenotsaved = Moɲoo mana gaabundi -pageremoved = Moɲoo hun -pagesaved = Gaabundi Pocket ga -processingremove = Goo ma moɲoo kaa… -processingtags = Goo ma kanjey tonton… -removepage = Moɲoo kaa -save = Gaabu -saving = Goo ma gaabu… -signupemail = Maa-hantum nda bataga -signuptosave = Maa-hantum nda Pocket. Forba no. -suggestedtags = Kanji honnantey -tagline = Alhabar hantumey nda widewey zaa Firefox ga k'i guna Pocket ra jinay dumi kul ga, waati kul. -taglinestory_one = Pocket butoŋoo naagu k'alhabar hantum, widewo wala moo kul zaa Firefox ga. -taglinestory_two = Guna Pocket ra jinay kul ga, waati kul. -tagssaved = Kanji tontonantey -signinfirefox = Maa-hantum nda Firefox -signupfirefox = Maa-hantum nda Firefox -viewlist = Maašeede guna - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Gaabu Pocket ga -saveToPocketCmd.label = Moɲoo gaabu Pocket ga -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Doboo gaabu Pocket do -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket maašeede guna diff --git a/browser/extensions/pocket/locale/sq/pocket.properties b/browser/extensions/pocket/locale/sq/pocket.properties index d4a36abe2643..b8b17ad22671 100644 --- a/browser/extensions/pocket/locale/sq/pocket.properties +++ b/browser/extensions/pocket/locale/sq/pocket.properties @@ -26,6 +26,8 @@ tagline = Ruani që nga Firefoxc-i artikuj dhe video për t’i parë në Pocket taglinestory_one = Klikoni butonin Pocket që të ruani që nga Firefox-i çfarëdo artikulli, video ose faqe. taglinestory_two = Shihini në Pocket, në çfarëdo pajisje, kurdo. tagssaved = Etiketat u Shtuan +tos = Duke vazhduar, pajtoheni me Kushtet e Shërbimit dhe Rregullat e Privatësisë për Pocket-in +tryitnow = Provojeni Që Tani signinfirefox = Hyni me Firefox signupfirefox = Regjistrohuni me Firefox viewlist = Shihni Listën diff --git a/browser/extensions/pocket/locale/sr/pocket.properties b/browser/extensions/pocket/locale/sr/pocket.properties index d1daecbe129c..c3dbf2ecee07 100644 --- a/browser/extensions/pocket/locale/sr/pocket.properties +++ b/browser/extensions/pocket/locale/sr/pocket.properties @@ -26,6 +26,8 @@ tagline = Снимите чланке и видео снимке из Firefox-а taglinestory_one = Кликните на Pocket дугме да бисте снимили чланак, видео или страницу из Firefox-а. taglinestory_two = Погледајте садржај у Pocket-у на било ком уређају било када. tagssaved = Ознаке додате +tos = Настављањем прихватате услове коришћења и полису приватности Pocket-а +tryitnow = Покушајте сада signinfirefox = Пријави се signupfirefox = Региструј се viewlist = Прикажи листу diff --git a/browser/extensions/pocket/locale/sv-SE/pocket.properties b/browser/extensions/pocket/locale/sv-SE/pocket.properties index 7a65de7dc9f5..e01ac7373c15 100644 --- a/browser/extensions/pocket/locale/sv-SE/pocket.properties +++ b/browser/extensions/pocket/locale/sv-SE/pocket.properties @@ -26,6 +26,8 @@ tagline = Spara artiklar och videor från Firefox för att visa i Pocket på vil taglinestory_one = Klicka på Pocket knappen för att spara vilken artikel, video eller sida som helst från Firefox.\u0020 taglinestory_two = Visa i Pocket på vilken enhet som helst, när som helst.\u0020 tagssaved = Etiketter Tillagda +tos = Genom att fortsätta godkänner du Pocket's användarvillkor och sekretesspolicy +tryitnow = Prova nu signinfirefox = Logga in med Firefox\u0020 signupfirefox = Registrera dig med Firefox\u0020 viewlist = Visa lista diff --git a/browser/extensions/pocket/locale/te/pocket.properties b/browser/extensions/pocket/locale/te/pocket.properties index 2d3b990fca0e..2e955279339e 100644 --- a/browser/extensions/pocket/locale/te/pocket.properties +++ b/browser/extensions/pocket/locale/te/pocket.properties @@ -26,6 +26,8 @@ tagline = ఏ పరికరం, ఏ సమయం లో పాకెట్ వ taglinestory_one = ఫైర్ఫాక్సు నుండి ఒక వ్యాసం, వీడియో లేదా పేజీ సేవ్ పాకెట్ బటన్ క్లిక్ చేయండి. taglinestory_two = ఏ పరికరంలో అయినా, ఏ సమయంలో అయినా పాకెట్ లో చూడండి. tagssaved = టాగ్లు చేర్చబడింది +tos = కొనసాగించడం ద్వారా, మీరు పాకెట్ యొక్క సేవా నిబంధనలు మరియు గోప్యతా విధానము ను అంగీకరిచబడుతారు +tryitnow = దీన్ని ఇప్పుడు ప్రయత్నించండి signinfirefox = ఫైర్ఫాక్సుకు ప్రవేశించండి signupfirefox = ఫైర్ఫాక్సుకు ప్రవేశించండి viewlist = జాబితాను చూడండి diff --git a/browser/extensions/pocket/locale/th/pocket.properties b/browser/extensions/pocket/locale/th/pocket.properties index 6fb9c5f48d02..6cdf1c9ecc8a 100644 --- a/browser/extensions/pocket/locale/th/pocket.properties +++ b/browser/extensions/pocket/locale/th/pocket.properties @@ -26,6 +26,8 @@ tagline = บันทึกบทความและวิดีโอจา taglinestory_one = คลิกปุ่ม Pocket เพื่อบันทึกบทความ วิดีโอ หรือหน้าจาก Firefox taglinestory_two = ดูใน Pocket บนอุปกรณ์ต่าง ๆ เวลาไหนก็ได้ tagssaved = ป้ายกำกับถูกเพิ่มแล้ว +tos = หากตกลง หมายความว่า คุณยอมรับเงื่อนไขการให้บริการ และนโยบายความเป็นส่วนตัวของ Pocket +tryitnow = ลองเลย signinfirefox = ลงชื่อเข้าด้วย Firefox signupfirefox = ลงทะเบียนกับ Firefox viewlist = ดูรายการ diff --git a/browser/extensions/pocket/locale/tr/pocket.properties b/browser/extensions/pocket/locale/tr/pocket.properties index 1b46a83c2f10..ea1970a7d466 100644 --- a/browser/extensions/pocket/locale/tr/pocket.properties +++ b/browser/extensions/pocket/locale/tr/pocket.properties @@ -26,6 +26,8 @@ tagline = İstediğiniz cihazda, istediğiniz zaman görmek istediğiniz yazı v taglinestory_one = Firefox’ta istediğiniz yazıyı, videoyu veya sayfayı kaydetmek için Pocket düğmesine tıklayın. taglinestory_two = İstediğiniz cihazda, istediğiniz zaman Pocket’tan bakın. tagssaved = Etiketler eklendi +tos = Devam ederseniz Pocket'ın Kullanım Koşullarını ve Gizlilik İlkelerini kabul etmiş sayılırsınız +tryitnow = Hemen deneyin signinfirefox = Firefox ile giriş yap signupfirefox = Firefox ile kaydol viewlist = Listeyi göster diff --git a/browser/extensions/pocket/locale/uk/pocket.properties b/browser/extensions/pocket/locale/uk/pocket.properties index a8ab31662f85..d15049b2cafe 100644 --- a/browser/extensions/pocket/locale/uk/pocket.properties +++ b/browser/extensions/pocket/locale/uk/pocket.properties @@ -26,6 +26,8 @@ tagline = Зберігайте статті та відео з Firefox, щоб taglinestory_one = Натисніть кнопку Pocket для збереження будь-якої статті, відео чи сторінки з Firefox. taglinestory_two = Переглядайте в Pocket на будь-якому пристрої та в будь-який час. tagssaved = Мітки додано +tos = Продовжуючи, ви погоджуєтесь з Умовами використання і Політикою приватності +tryitnow = Спробувати зараз signinfirefox = Увійти через Firefox signupfirefox = Реєстрація через Firefox viewlist = Перегляд списку diff --git a/browser/extensions/pocket/locale/xh/pocket.properties b/browser/extensions/pocket/locale/xh/pocket.properties deleted file mode 100644 index ce70901fae45..000000000000 --- a/browser/extensions/pocket/locale/xh/pocket.properties +++ /dev/null @@ -1,41 +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/. - -addtags = Faka Iithegi -alreadyhaveacct = Sele ingumsebenzisi wePokotho? -continueff = Qhubeka ne-Firefox -errorgeneric = Kuye kwabakho impazamo xa ibizama ukugcina kwiPokotho. -learnmore = Funda Ngakumbi -loginnow = Loga ungene -maxtaglength = Iithegi zilinganiselwe kwiimpawu ezingama-25 -mustbeconnected = Kufuneka uqhagamshele kwi-intanethi ukuze ugcine kwiPokotho. Nceda ukhangele uqhagamshelo lwakho ze uzame kwakhona. -onlylinkssaved = Ziilinki zodwa ezinokugcinwa -pagenotsaved = Iphepha Aligcinwanga -pageremoved = Iphepha Lisusiwe -pagesaved = Igcinwe kwiPokotho -processingremove = Isusa Iphepha... -processingtags = Idibanisa iithegi... -removepage = Susa Iphepha -save = Gcina -saving = Iyagcina… -signupemail = Sayina ungene nge-imeyile -signuptosave = Sayina ungene ukulungiselela iPokotho. Kusimahla.\u0020 -suggestedtags = Iithegi Ezicetyisiweyo -tagline = Gcina amanqaku kunye neevidiyo ezivela kwi-Firefox ukuze ujonge iPokotho kwisixhobo, nangaliphi na ixesha. -taglinestory_one = Cofa iQhosha lePokotho ukugcina naliphi na inqaku, ividiyo okanye iphepha elivela kwi-Firefox. -taglinestory_two = Yijonge kwiPokotho nakwesiphi na isixhobo, nangaliphi na ixesha.\u0020 -tagssaved = Iithegi Ezongezelelweyo -signinfirefox = Sayina ungene ngeFirefox -signupfirefox = Sayina ungene ngeFirefox -viewlist = Bona Uluhlu - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = IPokotho -pocket-button.tooltiptext = Gcina kwiPokotho -saveToPocketCmd.label = Gcina Iphepha kwiPokotho -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Gcina KwiLinki KwiPokotho -saveLinkToPocketCmd.accesskey = P -pocketMenuitem.label = Bona Uluhlu lwePokotho diff --git a/browser/extensions/pocket/locale/zh-CN/pocket.properties b/browser/extensions/pocket/locale/zh-CN/pocket.properties index 0ea3d4a9aef9..e913887b8d68 100644 --- a/browser/extensions/pocket/locale/zh-CN/pocket.properties +++ b/browser/extensions/pocket/locale/zh-CN/pocket.properties @@ -26,6 +26,8 @@ tagline = 在 Firefox 上保存文章和视频,以供在任何时间、任何 taglinestory_one = 点击 Pocket 按钮保存 Firefox 上的任何文章、视频或页面。 taglinestory_two = 在任何时间、任何设备上的 Pocket 中查看。 tagssaved = 标签已添加 +tos = 继续则表示您同意 Pocket 的服务条款隐私政策 +tryitnow = 立即尝试 signinfirefox = 使用 Firefox 登录 signupfirefox = 使用 Firefox 注册 viewlist = 查看列表 diff --git a/browser/extensions/pocket/locale/zh-TW/pocket.properties b/browser/extensions/pocket/locale/zh-TW/pocket.properties index b0fa79071d21..02cf5223baa9 100644 --- a/browser/extensions/pocket/locale/zh-TW/pocket.properties +++ b/browser/extensions/pocket/locale/zh-TW/pocket.properties @@ -26,6 +26,8 @@ tagline = 隨時隨地在任何裝置上的 Firefox 來儲存文章與影片, taglinestory_one = 在 Firefox 中點擊 Pocket 按鈕來儲存任何文章、影片或網頁。 taglinestory_two = 隨時隨地在任何裝置上用 Pocket 檢視。 tagssaved = 已新增標籤 +tos = 繼續使用就代表您同意 Pocket 的 服務條款隱私權保護政策 +tryitnow = 立刻試試 signinfirefox = 使用 Firefox 登入 signupfirefox = 使用 Firefox 註冊 viewlist = 檢視清單 @@ -39,4 +41,3 @@ saveToPocketCmd.accesskey = k saveLinkToPocketCmd.label = 將鏈結儲存至 Pocket saveLinkToPocketCmd.accesskey = o pocketMenuitem.label = 檢視 Pocket 清單 - From c82aa62cec1f98b03a1ec125be372da5f07b3410 Mon Sep 17 00:00:00 2001 From: Iris Hsiao Date: Wed, 21 Sep 2016 14:24:26 +0800 Subject: [PATCH 101/101] Backed out changeset cf43cacdb262 (bug 1294232) for XPCShell failures CLOSED TREE --- toolkit/xre/glxtest.cpp | 65 +------ widget/GfxDriverInfo.cpp | 5 - widget/GfxDriverInfo.h | 14 +- widget/GfxInfoBase.cpp | 15 +- widget/GfxInfoBase.h | 4 - widget/GfxInfoX11.cpp | 359 ++++++++++++++++++++------------------- widget/GfxInfoX11.h | 17 +- 7 files changed, 202 insertions(+), 277 deletions(-) diff --git a/toolkit/xre/glxtest.cpp b/toolkit/xre/glxtest.cpp index 5f608935d53c..519a5e68be9b 100644 --- a/toolkit/xre/glxtest.cpp +++ b/toolkit/xre/glxtest.cpp @@ -62,20 +62,6 @@ typedef uint32_t GLenum; #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 -// GLX_MESA_query_renderer -#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 -#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 -#define GLX_RENDERER_VERSION_MESA 0x8185 -#define GLX_RENDERER_ACCELERATED_MESA 0x8186 -#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 -#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 -#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 -#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A -#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B -#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C -#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D -#define GLX_RENDERER_ID_MESA 0x818E - namespace mozilla { namespace widget { // the read end of the pipe, which will be used by GfxInfo @@ -266,14 +252,13 @@ void glxtest() void* glXBindTexImageEXT = glXGetProcAddress("glXBindTexImageEXT"); ///// Get GL vendor/renderer/versions strings ///// - enum { bufsize = 2048 }; + enum { bufsize = 1024 }; char buf[bufsize]; + const GLubyte *vendorString = glGetString(GL_VENDOR); + const GLubyte *rendererString = glGetString(GL_RENDERER); + const GLubyte *versionString = glGetString(GL_VERSION); - const GLubyte* versionString = glGetString(GL_VERSION); - const GLubyte* vendorString = glGetString(GL_VENDOR); - const GLubyte* rendererString = glGetString(GL_RENDERER); - - if (!versionString || !vendorString || !rendererString) + if (!vendorString || !rendererString || !versionString) fatal_error("glGetString returned null"); int length = snprintf(buf, bufsize, @@ -285,46 +270,6 @@ void glxtest() if (length >= bufsize) fatal_error("GL strings length too large for buffer size"); - // If GLX_MESA_query_renderer is available, populate additional data. - typedef Bool (*PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); - PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESAProc = - cast(glXGetProcAddress("glXQueryCurrentRendererIntegerMESA")); - if (glXQueryCurrentRendererIntegerMESAProc) { - unsigned int vendorId, deviceId, accelerated, videoMemoryMB; - glXQueryCurrentRendererIntegerMESAProc(GLX_RENDERER_VENDOR_ID_MESA, &vendorId); - glXQueryCurrentRendererIntegerMESAProc(GLX_RENDERER_DEVICE_ID_MESA, &deviceId); - glXQueryCurrentRendererIntegerMESAProc(GLX_RENDERER_ACCELERATED_MESA, &accelerated); - glXQueryCurrentRendererIntegerMESAProc(GLX_RENDERER_VIDEO_MEMORY_MESA, &videoMemoryMB); - - // Truncate IDs to 4 digits- that's all PCI IDs are. - vendorId &= 0xFFFF; - deviceId &= 0xFFFF; - - length += snprintf(buf + length, bufsize, - "MESA_VENDOR_ID\n0x%04x\n" - "MESA_DEVICE_ID\n0x%04x\n" - "MESA_ACCELERATED\n%s\n" - "MESA_VRAM\n%dMB\n", - vendorId, deviceId, accelerated ? "TRUE" : "FALSE", - videoMemoryMB); - - if (length >= bufsize) - fatal_error("GL strings length too large for buffer size"); - } - - // From Mesa's GL/internal/dri_interface.h, to be used by DRI clients. - typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (Display *dpy, int scrNum); - PFNGLXGETSCREENDRIVERPROC glXGetScreenDriverProc = - cast(glXGetProcAddress("glXGetScreenDriver")); - if (glXGetScreenDriverProc) { - const char* driDriver = glXGetScreenDriverProc(dpy, DefaultScreen(dpy)); - if (driDriver) { - length += snprintf(buf + length, bufsize, "DRI_DRIVER\n%s\n", driDriver); - if (length >= bufsize) - fatal_error("GL strings length too large for buffer size"); - } - } - ///// Clean up. Indeed, the parent process might fail to kill us (e.g. if it doesn't need to check GL info) ///// so we might be staying alive for longer than expected, so it's important to consume as little memory as ///// possible. Also we want to check that we're able to do that too without generating X errors. diff --git a/widget/GfxDriverInfo.cpp b/widget/GfxDriverInfo.cpp index ff60b2b75630..6f9a74a4f45d 100644 --- a/widget/GfxDriverInfo.cpp +++ b/widget/GfxDriverInfo.cpp @@ -306,11 +306,6 @@ const nsAString& GfxDriverInfo::GetDeviceVendor(DeviceVendor id) DECLARE_VENDOR_ID(VendorAMD, "0x1022"); DECLARE_VENDOR_ID(VendorATI, "0x1002"); DECLARE_VENDOR_ID(VendorMicrosoft, "0x1414"); - DECLARE_VENDOR_ID(VendorMesaAll, "mesa/all"); - DECLARE_VENDOR_ID(VendorMesaLLVMPipe, "mesa/llvmpipe"); - DECLARE_VENDOR_ID(VendorMesaSoftPipe, "mesa/softpipe"); - DECLARE_VENDOR_ID(VendorMesaSWRast, "mesa/swrast"); - DECLARE_VENDOR_ID(VendorMesaUnknown, "mesa/unknown"); // Suppress a warning. DECLARE_VENDOR_ID(DeviceVendorMax, ""); } diff --git a/widget/GfxDriverInfo.h b/widget/GfxDriverInfo.h index 5b2a9a1f2826..99d560b81992 100644 --- a/widget/GfxDriverInfo.h +++ b/widget/GfxDriverInfo.h @@ -106,18 +106,6 @@ enum DeviceVendor { VendorAMD, VendorATI, VendorMicrosoft, - - // Wildcard for all Mesa drivers. - VendorMesaAll, - // Note that the following list of Mesa drivers is not comprehensive; we pull - // the DRI driver at runtime. These drivers are provided for convenience when - // populating the local blocklist. - VendorMesaLLVMPipe, - VendorMesaSoftPipe, - VendorMesaSWRast, - // A generic ID to be provided when we can't determine the DRI driver on Mesa. - VendorMesaUnknown, - DeviceVendorMax }; @@ -271,7 +259,7 @@ ParseDriverVersion(const nsAString& aVersion, uint64_t *aNumericVersion) { *aNumericVersion = 0; -#if defined(XP_WIN) || defined(MOZ_X11) +#if defined(XP_WIN) int a, b, c, d; char aStr[8], bStr[8], cStr[8], dStr[8]; /* honestly, why do I even bother */ diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index e63036d4217a..e53db69c59ea 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -694,12 +694,13 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray& info, } } -#if defined(XP_WIN) || defined(ANDROID) || defined(MOZ_X11) +#if defined(XP_WIN) || defined(ANDROID) uint64_t driverVersion; ParseDriverVersion(adapterDriverVersionString, &driverVersion); #endif - if (!DoesVendorMatch(info[i].mAdapterVendor, adapterVendorID)) { + if (!info[i].mAdapterVendor.Equals(GfxDriverInfo::GetDeviceVendor(VendorAll), nsCaseInsensitiveStringComparator()) && + !info[i].mAdapterVendor.Equals(adapterVendorID, nsCaseInsensitiveStringComparator())) { continue; } @@ -732,7 +733,7 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray& info, continue; } -#if defined(XP_WIN) || defined(ANDROID) || defined(MOZ_X11) +#if defined(XP_WIN) || defined(ANDROID) switch (info[i].mComparisonOp) { case DRIVER_LESS_THAN: match = driverVersion < info[i].mDriverVersion; @@ -839,14 +840,6 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray& info, return status; } -bool -GfxInfoBase::DoesVendorMatch(const nsAString& aBlocklistVendor, - const nsAString& aAdapterVendor) -{ - return aBlocklistVendor.Equals(aAdapterVendor, nsCaseInsensitiveStringComparator()) || - aBlocklistVendor.Equals(GfxDriverInfo::GetDeviceVendor(VendorAll), nsCaseInsensitiveStringComparator()); -} - nsresult GfxInfoBase::GetFeatureStatusImpl(int32_t aFeature, int32_t* aStatus, diff --git a/widget/GfxInfoBase.h b/widget/GfxInfoBase.h index cb89b93a3f0c..6d30f1b719ac 100644 --- a/widget/GfxInfoBase.h +++ b/widget/GfxInfoBase.h @@ -106,10 +106,6 @@ protected: virtual const nsTArray& GetGfxDriverInfo() = 0; virtual void DescribeFeatures(JSContext* aCx, JS::Handle obj); - - virtual bool DoesVendorMatch(const nsAString& aBlocklistVendor, - const nsAString& aAdapterVendor); - bool InitFeatureObject( JSContext* aCx, JS::Handle aContainer, diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 3e834ab007e2..d79be5f0119b 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -12,8 +12,6 @@ #include #include "nsCRTGlue.h" #include "prenv.h" -#include "nsPrintfCString.h" -#include "nsWhitespaceTokenizer.h" #include "GfxInfoX11.h" @@ -37,10 +35,17 @@ nsresult GfxInfo::Init() { mGLMajorVersion = 0; - mGLMinorVersion = 0; - mHasTextureFromPixmap = false; + mMajorVersion = 0; + mMinorVersion = 0; + mRevisionVersion = 0; mIsMesa = false; - mIsAccelerated = true; + mIsNVIDIA = false; + mIsFGLRX = false; + mIsNouveau = false; + mIsIntel = false; + mIsOldSwrast = false; + mIsLlvmpipe = false; + mHasTextureFromPixmap = false; return GfxInfoBase::Init(); } @@ -101,18 +106,7 @@ GfxInfo::GetData() bool error = waiting_for_glxtest_process_failed || exited_with_error_code || received_signal; - nsCString glVendor; - nsCString glRenderer; - nsCString glVersion; - nsCString textureFromPixmap; - - // Available if GLX_MESA_query_renderer is supported. - nsCString mesaVendor; - nsCString mesaDevice; - nsCString mesaAccelerated; - // Available if using a DRI-based libGL stack. - nsCString driDriver; - + nsCString textureFromPixmap; nsCString *stringToFill = nullptr; char *bufptr = buf; if (!error) { @@ -125,23 +119,13 @@ GfxInfo::GetData() stringToFill = nullptr; } else if(!strcmp(line, "VENDOR")) - stringToFill = &glVendor; + stringToFill = &mVendor; else if(!strcmp(line, "RENDERER")) - stringToFill = &glRenderer; + stringToFill = &mRenderer; else if(!strcmp(line, "VERSION")) - stringToFill = &glVersion; + stringToFill = &mVersion; else if(!strcmp(line, "TFP")) stringToFill = &textureFromPixmap; - else if(!strcmp(line, "MESA_VENDOR_ID")) - stringToFill = &mesaVendor; - else if(!strcmp(line, "MESA_DEVICE_ID")) - stringToFill = &mesaDevice; - else if(!strcmp(line, "MESA_ACCELERATED")) - stringToFill = &mesaAccelerated; - else if(!strcmp(line, "MESA_VRAM")) - stringToFill = &mAdapterRAM; - else if(!strcmp(line, "DRI_DRIVER")) - stringToFill = &driDriver; } } @@ -159,13 +143,13 @@ GfxInfo::GetData() const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR"); if (spoofedVendor) - glVendor.Assign(spoofedVendor); + mVendor.Assign(spoofedVendor); const char *spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER"); if (spoofedRenderer) - glRenderer.Assign(spoofedRenderer); + mRenderer.Assign(spoofedRenderer); const char *spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION"); if (spoofedVersion) - glVersion.Assign(spoofedVersion); + mVersion.Assign(spoofedVersion); const char *spoofedOS = PR_GetEnv("MOZ_GFX_SPOOF_OS"); if (spoofedOS) mOS.Assign(spoofedOS); @@ -174,9 +158,9 @@ GfxInfo::GetData() mOSRelease.Assign(spoofedOSRelease); if (error || - glVendor.IsEmpty() || - glRenderer.IsEmpty() || - glVersion.IsEmpty() || + mVendor.IsEmpty() || + mRenderer.IsEmpty() || + mVersion.IsEmpty() || mOS.IsEmpty() || mOSRelease.IsEmpty()) { @@ -198,135 +182,94 @@ GfxInfo::GetData() return; } - // Scan the GL_VERSION string for the GL and driver versions. - nsCWhitespaceTokenizer tokenizer(glVersion); - while (tokenizer.hasMoreTokens()) { - nsCString token(tokenizer.nextToken()); - unsigned int major = 0, minor = 0, revision = 0, patch = 0; - if (sscanf(token.get(), "%u.%u.%u.%u", - &major, &minor, &revision, &patch) >= 2) - { - // A survey of GL_VENDOR strings indicates that the first version is - // always the GL version, the second is usually the driver version. - if (mGLMajorVersion == 0) { - mGLMajorVersion = major; - mGLMinorVersion = minor; - } else { - mDriverVersion = nsPrintfCString("%u.%u.%u.%u", major, minor, revision, patch); - } - } - } - - if (mGLMajorVersion == 0) { - NS_WARNING("Failed to parse GL version!"); - return; - } - - // Mesa always exposes itself in the GL_VERSION string, but not always the - // GL_VENDOR string. - mIsMesa = glVersion.Find("Mesa") != -1; - - // We need to use custom vendor IDs for mesa so we can treat them - // differently than the proprietary drivers. - if (mIsMesa) { - mIsAccelerated = !mesaAccelerated.Equals("FALSE"); - // Process software rasterizers before the DRI driver string; we may be - // forcing software rasterization on a DRI-accelerated X server by using - // LIBGL_ALWAYS_SOFTWARE or a similar restriction. - if (strcasestr(glRenderer.get(), "llvmpipe")) { - CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorMesaLLVMPipe), mVendorId); - mIsAccelerated = false; - } else if (strcasestr(glRenderer.get(), "softpipe")) { - CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorMesaSoftPipe), mVendorId); - mIsAccelerated = false; - } else if (strcasestr(glRenderer.get(), "software rasterizer") || - !mIsAccelerated) { - // Fallback to reporting swrast if GLX_MESA_query_renderer tells us - // we're using an unaccelerated context. - CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorMesaSWRast), mVendorId); - mIsAccelerated = false; - } else if (!driDriver.IsEmpty()) { - mVendorId = nsPrintfCString("mesa/%s", driDriver.get()); - } else { - // Some other mesa configuration where we couldn't get enough info. - NS_WARNING("Failed to detect Mesa driver being used!"); - CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorMesaUnknown), mVendorId); - } - - if (!mesaDevice.IsEmpty()) { - mDeviceId = mesaDevice; - } else { - NS_WARNING("Failed to get Mesa device ID! GLX_MESA_query_renderer unsupported?"); - } - } else if (glVendor.EqualsLiteral("NVIDIA Corporation")) { - CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), mVendorId); - // TODO: Use NV-CONTROL X11 extension to query Device ID and VRAM. - } else if (glVendor.EqualsLiteral("ATI Technologies Inc.")) { - CopyUTF16toUTF8(GfxDriverInfo::GetDeviceVendor(VendorATI), mVendorId); - // TODO: Look into ways to find the device ID on FGLRX. - } else { - NS_WARNING("Failed to detect GL vendor!"); - } - - // Fallback to GL_VENDOR and GL_RENDERER. - if (mVendorId.IsEmpty()) - mVendorId.Assign(glVendor.get()); - if (mDeviceId.IsEmpty()) - mDeviceId.Assign(glRenderer.get()); - - mAdapterDescription.Assign(glRenderer); + mAdapterDescription.Append(mVendor); + mAdapterDescription.AppendLiteral(" -- "); + mAdapterDescription.Append(mRenderer); nsAutoCString note; - note.AppendLiteral("\nOpenGL: "); - note.Append(glRenderer); + note.AppendLiteral("OpenGL: "); + note.Append(mAdapterDescription); note.AppendLiteral(" -- "); - note.Append(glVersion); + note.Append(mVersion); if (mHasTextureFromPixmap) note.AppendLiteral(" -- texture_from_pixmap"); note.Append('\n'); #ifdef MOZ_CRASHREPORTER CrashReporter::AppendAppNotesToCrashReport(note); #endif + + // determine the major OpenGL version. That's the first integer in the version string. + mGLMajorVersion = strtol(mVersion.get(), 0, 10); + + // determine driver type (vendor) and where in the version string + // the actual driver version numbers should be expected to be found (whereToReadVersionNumbers) + const char *whereToReadVersionNumbers = nullptr; + const char *Mesa_in_version_string = strstr(mVersion.get(), "Mesa"); + if (Mesa_in_version_string) { + mIsMesa = true; + // with Mesa, the version string contains "Mesa major.minor" and that's all the version information we get: + // there is no actual driver version info. + whereToReadVersionNumbers = Mesa_in_version_string + strlen("Mesa"); + if (strcasestr(mVendor.get(), "nouveau")) + mIsNouveau = true; + if (strcasestr(mRenderer.get(), "intel")) // yes, intel is in the renderer string + mIsIntel = true; + if (strcasestr(mRenderer.get(), "llvmpipe")) + mIsLlvmpipe = true; + if (strcasestr(mRenderer.get(), "software rasterizer")) + mIsOldSwrast = true; + } else if (strstr(mVendor.get(), "NVIDIA Corporation")) { + mIsNVIDIA = true; + // with the NVIDIA driver, the version string contains "NVIDIA major.minor" + // note that here the vendor and version strings behave differently, that's why we don't put this above + // alongside Mesa_in_version_string. + const char *NVIDIA_in_version_string = strstr(mVersion.get(), "NVIDIA"); + if (NVIDIA_in_version_string) + whereToReadVersionNumbers = NVIDIA_in_version_string + strlen("NVIDIA"); + } else if (strstr(mVendor.get(), "ATI Technologies Inc")) { + mIsFGLRX = true; + // with the FGLRX driver, the version string only gives a OpenGL version :/ so let's return that. + // that can at least give a rough idea of how old the driver is. + whereToReadVersionNumbers = mVersion.get(); + } + + // read major.minor version numbers of the driver (not to be confused with the OpenGL version) + if (whereToReadVersionNumbers) { + // copy into writable buffer, for tokenization + strncpy(buf, whereToReadVersionNumbers, buf_size); + bufptr = buf; + + // now try to read major.minor version numbers. In case of failure, gracefully exit: these numbers have + // been initialized as 0 anyways + char *token = NS_strtok(".", &bufptr); + if (token) { + mMajorVersion = strtol(token, 0, 10); + token = NS_strtok(".", &bufptr); + if (token) { + mMinorVersion = strtol(token, 0, 10); + token = NS_strtok(".", &bufptr); + if (token) + mRevisionVersion = strtol(token, 0, 10); + } + } + } +} + +static inline uint64_t version(uint32_t major, uint32_t minor, uint32_t revision = 0) +{ + return (uint64_t(major) << 32) + (uint64_t(minor) << 16) + uint64_t(revision); } const nsTArray& GfxInfo::GetGfxDriverInfo() { - if (!mDriverInfo->Length()) { - // Mesa 10.0 provides the GLX_MESA_query_renderer extension, which allows us - // to query device IDs backing a GL context for blacklisting. - APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, - (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorMesaAll), GfxDriverInfo::allDevices, - GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_LESS_THAN, V(10,0,0,0), "FEATURE_FAILURE_OLD_MESA", "Mesa 10.0"); - - // NVIDIA baseline (ported from old blocklist) - APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, - (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices, - GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_LESS_THAN, V(257,21,0,0), "FEATURE_FAILURE_OLD_NVIDIA", "NVIDIA 257.21"); - - // fglrx baseline (chosen arbitrarily as 2013-07-22 release). - APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, - (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorATI), GfxDriverInfo::allDevices, - GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_LESS_THAN, V(13,15,100,1), "FEATURE_FAILURE_OLD_FGLRX", "fglrx 13.15.100.1"); - } + // Nothing here yet. + //if (!mDriverInfo->Length()) { + // + //} return *mDriverInfo; } -bool -GfxInfo::DoesVendorMatch(const nsAString& aBlocklistVendor, - const nsAString& aAdapterVendor) -{ - if (mIsMesa && aBlocklistVendor.Equals(GfxDriverInfo::GetDeviceVendor(VendorMesaAll), - nsCaseInsensitiveStringComparator())) - { - return true; - } - return GfxInfoBase::DoesVendorMatch(aBlocklistVendor, aAdapterVendor); -} - nsresult GfxInfo::GetFeatureStatusImpl(int32_t aFeature, int32_t *aStatus, @@ -345,13 +288,6 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature, if (aOS) *aOS = os; - if (mGLMajorVersion == 0) { - // If we failed to get a GL version, glxtest failed. - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; - aFailureId = "FEATURE_FAILURE_GLXTEST_FAILED"; - return NS_OK; - } - if (mGLMajorVersion == 1) { // We're on OpenGL 1. In most cases that indicates really old hardware. // We better block them, rather than rely on them to fail gracefully, because they don't! @@ -361,15 +297,95 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature, return NS_OK; } - // Blacklist software GL implementations from using layers acceleration. - // On the test infrastructure, we'll force-enable layers acceleration. - if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && - !mIsAccelerated && - !PR_GetEnv("MOZ_LAYERS_ALLOW_SOFTWARE_GL")) - { - *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; - aFailureId = "FEATURE_FAILURE_SOFTWARE_GL"; - return NS_OK; + // Don't evaluate any special cases if we're checking the downloaded blocklist. + if (!aDriverInfo.Length()) { + // Blacklist software GL implementations from using layers acceleration. + // On the test infrastructure, we'll force-enable layers acceleration. + if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && + (mIsLlvmpipe || mIsOldSwrast) && + !PR_GetEnv("MOZ_LAYERS_ALLOW_SOFTWARE_GL")) + { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; + aFailureId = "FEATURE_FAILURE_SOFTWARE_GL"; + return NS_OK; + } + + // Only check features relevant to Linux. + if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS || + aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL || + aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) { + + // whitelist the linux test slaves' current configuration. + // this is necessary as they're still using the slightly outdated 190.42 driver. + // this isn't a huge risk, as at least this is the exact setting in which we do continuous testing, + // and this only affects GeForce 9400 cards on linux on this precise driver version, which is very few users. + // We do the same thing on Windows XP, see in widget/windows/GfxInfo.cpp + if (mIsNVIDIA && + !strcmp(mRenderer.get(), "GeForce 9400/PCI/SSE2") && + !strcmp(mVersion.get(), "3.2.0 NVIDIA 190.42")) + { + *aStatus = nsIGfxInfo::FEATURE_STATUS_OK; + return NS_OK; + } + + if (mIsMesa) { + if (mIsNouveau && version(mMajorVersion, mMinorVersion) < version(8,0)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aFailureId = "FEATURE_FAILURE_MESA_1"; + aSuggestedDriverVersion.AssignLiteral("Mesa 8.0"); + } + else if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aFailureId = "FEATURE_FAILURE_MESA_2"; + aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3"); + } + else if (mIsOldSwrast) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aFailureId = "FEATURE_FAILURE_SW_RAST"; + } + else if (mIsLlvmpipe && version(mMajorVersion, mMinorVersion) < version(9, 1)) { + // bug 791905, Mesa bug 57733, fixed in Mesa 9.1 according to + // https://bugs.freedesktop.org/show_bug.cgi?id=57733#c3 + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aFailureId = "FEATURE_FAILURE_MESA_3"; + } + else if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) + { + if (mIsIntel && version(mMajorVersion, mMinorVersion) < version(8,1)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aFailureId = "FEATURE_FAILURE_MESA_4"; + aSuggestedDriverVersion.AssignLiteral("Mesa 8.1"); + } + } + + } else if (mIsNVIDIA) { + if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(257,21)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aFailureId = "FEATURE_FAILURE_OLD_NV"; + aSuggestedDriverVersion.AssignLiteral("NVIDIA 257.21"); + } + } else if (mIsFGLRX) { + // FGLRX does not report a driver version number, so we have the OpenGL version instead. + // by requiring OpenGL 3, we effectively require recent drivers. + if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(3, 0)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aFailureId = "FEATURE_FAILURE_OLD_FGLRX"; + aSuggestedDriverVersion.AssignLiteral(""); + } + // Bug 724640: FGLRX + Linux 2.6.32 is a crashy combo + bool unknownOS = mOS.IsEmpty() || mOSRelease.IsEmpty(); + bool badOS = mOS.Find("Linux", true) != -1 && + mOSRelease.Find("2.6.32") != -1; + if (unknownOS || badOS) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION; + aFailureId = "FEATURE_FAILURE_OLD_OS"; + } + } else { + // like on windows, let's block unknown vendors. Think of virtual machines. + // Also, this case is hit whenever the GLXtest probe failed to get driver info or crashed. + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; + } + } } return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, &os); @@ -417,8 +433,7 @@ GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription) NS_IMETHODIMP GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM) { - GetData(); - CopyUTF8toUTF16(mAdapterRAM, aAdapterRAM); + aAdapterRAM.Truncate(); return NS_OK; } @@ -445,7 +460,7 @@ NS_IMETHODIMP GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion) { GetData(); - CopyUTF8toUTF16(mDriverVersion, aAdapterDriverVersion); + CopyASCIItoUTF16(mVersion, aAdapterDriverVersion); return NS_OK; } @@ -472,7 +487,7 @@ NS_IMETHODIMP GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID) { GetData(); - CopyUTF8toUTF16(mVendorId, aAdapterVendorID); + CopyUTF8toUTF16(mVendor, aAdapterVendorID); return NS_OK; } @@ -486,7 +501,7 @@ NS_IMETHODIMP GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID) { GetData(); - CopyUTF8toUTF16(mDeviceId, aAdapterDeviceID); + CopyUTF8toUTF16(mRenderer, aAdapterDeviceID); return NS_OK; } @@ -521,19 +536,19 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString & aVendorID) { - CopyUTF16toUTF8(aVendorID, mVendorId); + CopyUTF16toUTF8(aVendorID, mVendor); return NS_OK; } NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString & aDeviceID) { - CopyUTF16toUTF8(aDeviceID, mDeviceId); + CopyUTF16toUTF8(aDeviceID, mRenderer); return NS_OK; } NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString & aDriverVersion) { - CopyUTF16toUTF8(aDriverVersion, mDriverVersion); + CopyUTF16toUTF8(aDriverVersion, mVersion); return NS_OK; } diff --git a/widget/GfxInfoX11.h b/widget/GfxInfoX11.h index af361c96ce2d..0fd036f46b21 100644 --- a/widget/GfxInfoX11.h +++ b/widget/GfxInfoX11.h @@ -9,7 +9,6 @@ #define __GfxInfoX11_h__ #include "GfxInfoBase.h" -#include "nsString.h" namespace mozilla { namespace widget { @@ -65,22 +64,16 @@ protected: OperatingSystem* aOS = nullptr) override; virtual const nsTArray& GetGfxDriverInfo() override; -protected: - virtual bool DoesVendorMatch(const nsAString& aBlocklistVendor, - const nsAString& aAdapterVendor) override; - private: - nsCString mVendorId; - nsCString mDeviceId; - nsCString mDriverVersion; + nsCString mVendor; + nsCString mRenderer; + nsCString mVersion; nsCString mAdapterDescription; - nsCString mAdapterRAM; nsCString mOS; nsCString mOSRelease; + bool mIsMesa, mIsNVIDIA, mIsFGLRX, mIsNouveau, mIsIntel, mIsOldSwrast, mIsLlvmpipe; bool mHasTextureFromPixmap; - unsigned int mGLMajorVersion, mGLMinorVersion; - bool mIsMesa; - bool mIsAccelerated; + int mGLMajorVersion, mMajorVersion, mMinorVersion, mRevisionVersion; void AddCrashReportAnnotations(); };