Skip to content

Commit

Permalink
merge fx-team to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Aug 5, 2016
2 parents b3a05a3 + c1569ef commit 99002c6
Show file tree
Hide file tree
Showing 43 changed files with 1,161 additions and 1,301 deletions.
4 changes: 2 additions & 2 deletions browser/base/content/browser-ctrlTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ var ctrlTab = {

handleEvent: function ctrlTab_handleEvent(event) {
switch (event.type) {
case "SSWindowStateReady":
case "SSWindowRestored":
this._initRecentlyUsedTabs();
break;
case "TabAttrModified":
Expand Down Expand Up @@ -531,7 +531,7 @@ var ctrlTab = {
_init: function ctrlTab__init(enable) {
var toggleEventListener = enable ? "addEventListener" : "removeEventListener";

window[toggleEventListener]("SSWindowStateReady", this, false);
window[toggleEventListener]("SSWindowRestored", this, false);

var tabContainer = gBrowser.tabContainer;
tabContainer[toggleEventListener]("TabOpen", this, false);
Expand Down
20 changes: 13 additions & 7 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1118,9 +1118,9 @@
if (!this._previewMode) {
this._recordTabAccess(this.mCurrentTab);
this.mCurrentTab.lastAccessed = Infinity;
this.mCurrentTab.updateLastAccessed();
this.mCurrentTab.removeAttribute("unread");
oldTab.lastAccessed = Date.now();
oldTab.updateLastAccessed();
let oldFindBar = oldTab._findBar;
if (oldFindBar &&
Expand Down Expand Up @@ -2020,7 +2020,6 @@
var position = this.tabs.length - 1;
t._tPos = position;
t.lastAccessed = Date.now();
t.permanentKey = {};
this.tabContainer._setPositionalAttributes();
Expand Down Expand Up @@ -4479,7 +4478,6 @@
this.mCurrentTab.permanentKey = this.mCurrentBrowser.permanentKey;
this.mCurrentTab._tPos = 0;
this.mCurrentTab._fullyOpen = true;
this.mCurrentTab.lastAccessed = Infinity;
this.mCurrentTab.cachePosition = 0;
this.mCurrentTab.linkedBrowser = this.mCurrentBrowser;
this.mCurrentTab.hasBrowser = true;
Expand Down Expand Up @@ -6282,6 +6280,11 @@
</content>

<implementation>
<constructor><![CDATA[
if (!("_lastAccessed" in this)) {
this.updateLastAccessed();
}
]]></constructor>

<property name="_visuallySelected">
<setter>
Expand Down Expand Up @@ -6357,10 +6360,13 @@
<getter>
return this._lastAccessed == Infinity ? Date.now() : this._lastAccessed;
</getter>
<setter>
this._lastAccessed = val;
</setter>
</property>
<method name="updateLastAccessed">
<parameter name="aDate"/>
<body><![CDATA[
this._lastAccessed = this.selected ? Infinity : (aDate || Date.now());
]]></body>
</method>

<field name="cachePosition">Infinity</field>

Expand Down
23 changes: 15 additions & 8 deletions browser/base/content/test/general/browser_ctrlTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,22 @@ add_task(function* () {
checkTabs(3);
yield ctrlTabTest([2, 1, 0], 7, 1);

gBrowser.addTab();
checkTabs(4);
{ // test for bug 1292049
let tabToClose = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:buildconfig");
checkTabs(4);
selectTabs([0, 1, 2, 3]);

yield BrowserTestUtils.removeTab(tabToClose);
checkTabs(3);
undoCloseTab();
checkTabs(4);
is(gBrowser.tabContainer.selectedIndex, 3, "tab is selected after closing and restoring it");

yield ctrlTabTest([], 1, 2);
}

{ // test for bug 445369
checkTabs(4);
selectTabs([1, 2, 0]);

let selectedTab = gBrowser.selectedTab;
Expand Down Expand Up @@ -127,12 +139,7 @@ add_task(function* () {
}

function checkTabs(aTabs) {
var tabs = gBrowser.tabs.length;
if (tabs != aTabs) {
while (gBrowser.tabs.length > 1)
gBrowser.removeCurrentTab();
throw "expected " + aTabs + " open tabs, got " + tabs;
}
is(gBrowser.tabs.length, aTabs, "number of open tabs should be " + aTabs);
}

function selectTabs(tabs) {
Expand Down
15 changes: 14 additions & 1 deletion browser/components/sessionstore/SessionStore.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -3073,6 +3073,8 @@ var SessionStoreInternal = {

this._setWindowStateReady(aWindow);

this._sendWindowRestoredNotification(aWindow);

Services.obs.notifyObservers(aWindow, NOTIFY_SINGLE_WINDOW_RESTORED, "");

this._sendRestoreCompletedNotifications();
Expand Down Expand Up @@ -3255,7 +3257,7 @@ var SessionStoreInternal = {
}

if (tabData.lastAccessed) {
tab.lastAccessed = tabData.lastAccessed;
tab.updateLastAccessed(tabData.lastAccessed);
}

if ("attributes" in tabData) {
Expand Down Expand Up @@ -4098,6 +4100,17 @@ var SessionStoreInternal = {
aWindow.dispatchEvent(event);
},

/**
* Dispatch the SSWindowRestored event for the given window.
* @param aWindow
* The window which has been restored
*/
_sendWindowRestoredNotification(aWindow) {
let event = aWindow.document.createEvent("Events");
event.initEvent("SSWindowRestored", true, false);
aWindow.dispatchEvent(event);
},

/**
* Dispatch the SSTabRestored event for the given tab.
* @param aTab
Expand Down
Binary file modified devtools/client/aboutdebugging/test/addons/bug1273184.xpi
Binary file not shown.
2 changes: 1 addition & 1 deletion devtools/client/inspector/breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ HTMLBreadcrumbs.prototype = {
} else if (event.type == "mouseover") {
this.handleMouseOver(event);
} else if (event.type == "mouseout") {
this.handleMouseLeave(event);
this.handleMouseOut(event);
} else if (event.type == "focus") {
this.handleFocus(event);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ add_task(function* () {
ok((yield testActor.assertHighlightedNode("body")),
"The highlighter highlights the right node");

let onNodeUnhighlighted = toolbox.once("node-unhighlight");
// move outside of the breadcrumb trail to trigger unhighlight
EventUtils.synthesizeMouseAtCenter(inspector.addNodeButton,
{type: "mousemove"},
inspector.addNodeButton.ownerDocument.defaultView);
yield onNodeUnhighlighted;

onNodeHighlighted = toolbox.once("node-highlight");
button = bcButtons.childNodes[2];
EventUtils.synthesizeMouseAtCenter(button, {type: "mousemove"},
Expand Down
9 changes: 5 additions & 4 deletions devtools/client/shared/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,11 @@ module.exports = createClass({

// Inner el is useful for achieving ellipsis on the left and correct LTR/RTL
// ordering. See CSS styles for frame-link-source-[inner] and bug 1290056.
let sourceInnerEl = dom.span({ className: "frame-link-source-inner" },
sourceElements);
let sourceInnerEl = dom.span({
className: "frame-link-source-inner",
title: isLinkable ?
l10n.getFormatStr("frame.viewsourceindebugger", tooltip) : tooltip,
}, sourceElements);

// If source is not a URL (self-hosted, eval, etc.), don't make
// it an anchor link, as we can't link to it.
Expand All @@ -224,12 +227,10 @@ module.exports = createClass({
href: source,
className: "frame-link-source",
draggable: false,
title: l10n.getFormatStr("frame.viewsourceindebugger", tooltip)
}, sourceInnerEl);
} else {
sourceEl = dom.span({
className: "frame-link-source",
title: tooltip,
}, sourceInnerEl);
}
elements.push(sourceEl);
Expand Down
3 changes: 2 additions & 1 deletion devtools/client/shared/components/test/mochitest/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@ function checkFrameString({ frame, file, line, column, source, functionName, sho

let $func = $(".frame-link-function-display-name");
let $source = $(".frame-link-source");
let $sourceInner = $(".frame-link-source-inner");
let $filename = $(".frame-link-filename");
let $line = $(".frame-link-line");

is($filename.textContent, file, "Correct filename");
is(el.getAttribute("data-line"), line ? `${line}` : null, "Expected `data-line` found");
is(el.getAttribute("data-column"), column ? `${column}` : null, "Expected `data-column` found");
is($source.getAttribute("title"), tooltip, "Correct tooltip");
is($sourceInner.getAttribute("title"), tooltip, "Correct tooltip");
is($source.tagName, shouldLink ? "A" : "SPAN", "Correct linkable status");
if (shouldLink) {
is($source.getAttribute("href"), source, "Correct source");
Expand Down
8 changes: 6 additions & 2 deletions devtools/client/themes/computed.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}

.property-view {
padding: 2px 0 2px 17px;
padding: 2px 17px;
display: flex;
flex-wrap: wrap;
}
Expand Down Expand Up @@ -133,7 +133,11 @@
/* From skin */
.expander {
visibility: hidden;
margin-left: -12px !important;
margin-inline-start: -12px !important;
}

.expander:-moz-locale-dir(rtl) {
transform: scaleX(-1);
}

.expandable {
Expand Down
8 changes: 6 additions & 2 deletions devtools/client/themes/toolbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,19 @@
}

#command-button-frames {
background: url("chrome://devtools/skin/images/dropmarker.svg") no-repeat right;
background: url("chrome://devtools/skin/images/dropmarker.svg") no-repeat;

/* Override background-size from the command-button.
The drop down arrow is smaller */
background-size: 8px 4px !important;
min-width: 32px;
}

#command-button-frames:-moz-dir(rtl) {
#command-button-frames:-moz-locale-dir(ltr) {
background-position: right;
}

#command-button-frames:-moz-locale-dir(rtl) {
background-position: left;
}

Expand Down
72 changes: 70 additions & 2 deletions dom/gamepad/android/AndroidGamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,86 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "GeneratedJNIWrappers.h"
#include "GeneratedJNINatives.h"
#include "nsThreadUtils.h"

namespace mozilla {
namespace dom {

class AndroidGamepadManager final
: public java::AndroidGamepadManager::Natives<AndroidGamepadManager>
, public jni::UsesNativeCallProxy
{
AndroidGamepadManager() = delete;

public:
template<class Functor>
static void OnNativeCall(Functor&& aCall)
{
NS_DispatchToMainThread(NS_NewRunnableFunction(Move(aCall)));
}

static void
OnGamepadChange(int32_t aID, bool aAdded)
{
RefPtr<GamepadPlatformService> service =
GamepadPlatformService::GetParentService();
if (!service) {
return;
}

if (aAdded) {
const int svc_id = service->AddGamepad(
"android", GamepadMappingType::Standard,
kStandardGamepadButtons, kStandardGamepadAxes);
java::AndroidGamepadManager::OnGamepadAdded(aID, svc_id);

} else {
service->RemoveGamepad(aID);
}
}

static void
OnButtonChange(int32_t aID, int32_t aButton, bool aPressed, float aValue)
{
RefPtr<GamepadPlatformService> service =
GamepadPlatformService::GetParentService();
if (!service) {
return;
}

service->NewButtonEvent(aID, aButton, aPressed, aValue);
}

static void
OnAxisChange(int32_t aID, jni::BooleanArray::Param aValid,
jni::FloatArray::Param aValues)
{
RefPtr<GamepadPlatformService> service =
GamepadPlatformService::GetParentService();
if (!service) {
return;
}

const auto& valid = aValid->GetElements();
const auto& values = aValues->GetElements();
MOZ_ASSERT(valid.Length() == values.Length());

for (size_t i = 0; i < values.Length(); i++) {
service->NewAxisMoveEvent(aID, i, values[i]);
}
}
};

void StartGamepadMonitoring()
{
java::GeckoAppShell::StartMonitoringGamepad();
AndroidGamepadManager::Init();
java::AndroidGamepadManager::Start();
}

void StopGamepadMonitoring()
{
java::GeckoAppShell::StopMonitoringGamepad();
java::AndroidGamepadManager::Stop();
}

} // namespace dom
Expand Down
Loading

0 comments on commit 99002c6

Please sign in to comment.