This commit is contained in:
Phil Ringnalda 2014-02-15 10:19:28 -08:00
Родитель 932ee98958 89c3345063
Коммит 61c9f360fb
399 изменённых файлов: 7607 добавлений и 2594 удалений

Просмотреть файл

@ -1761,28 +1761,6 @@ HyperTextAccessible::GetDOMPointByFrameOffset(nsIFrame* aFrame, int32_t aOffset,
return NS_OK;
}
// HyperTextAccessible
nsresult
HyperTextAccessible::RangeBoundToHypertextOffset(nsRange* aRange,
bool aIsStartBound,
bool aIsStartHTOffset,
int32_t* aOffset)
{
nsINode* node = nullptr;
int32_t nodeOffset = 0;
if (aIsStartBound) {
node = aRange->GetStartParent();
nodeOffset = aRange->StartOffset();
} else {
node = aRange->GetEndParent();
nodeOffset = aRange->EndOffset();
}
*aOffset = DOMPointToOffset(node, nodeOffset);
return NS_OK;
}
// HyperTextAccessible
nsresult
HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
@ -1825,11 +1803,9 @@ HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
int32_t startOffset = range->StartOffset();
if (nsContentUtils::ComparePoints(startNode, startOffset, aNode,
aNodeOffset) <= 0) {
rv = RangeBoundToHypertextOffset(range, true, true, &startHTOffset);
NS_ENSURE_SUCCESS(rv, rv);
startHTOffset = DOMPointToOffset(startNode, startOffset);
rv = RangeBoundToHypertextOffset(range, false, false, &endHTOffset);
NS_ENSURE_SUCCESS(rv, rv);
endHTOffset = DOMPointToOffset(endNode, endOffset);
if (startHTOffset > *aHTStartOffset)
*aHTStartOffset = startHTOffset;
@ -1846,13 +1822,12 @@ HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
}
// This range came after the point.
rv = RangeBoundToHypertextOffset(range, true, false, &endHTOffset);
NS_ENSURE_SUCCESS(rv, rv);
endHTOffset = DOMPointToOffset(startNode, startOffset);
if (idx > 0) {
rv = RangeBoundToHypertextOffset(domSel->GetRangeAt(idx - 1), false,
true, &startHTOffset);
NS_ENSURE_SUCCESS(rv, rv);
nsRange* prevRange = domSel->GetRangeAt(idx - 1);
startHTOffset = DOMPointToOffset(prevRange->GetEndParent(),
prevRange->EndOffset());
}
if (startHTOffset > *aHTStartOffset)
@ -1868,9 +1843,9 @@ HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
// the point is not in a range, that we do not need to compute an end offset,
// and that we should use the end offset of the last range to compute the
// start offset of the text attribute range.
rv = RangeBoundToHypertextOffset(domSel->GetRangeAt(rangeCount - 1), false,
true, &startHTOffset);
NS_ENSURE_SUCCESS(rv, rv);
nsRange* prevRange = domSel->GetRangeAt(rangeCount - 1);
startHTOffset = DOMPointToOffset(prevRange->GetEndParent(),
prevRange->EndOffset());
if (startHTOffset > *aHTStartOffset)
*aHTStartOffset = startHTOffset;

Просмотреть файл

@ -473,25 +473,6 @@ protected:
Accessible* aAccessible,
mozilla::a11y::DOMPoint* aPoint);
/**
* Return hyper text offset for the specified bound of the given DOM range.
* If the bound is outside of the hyper text then offset value is either
* 0 or number of characters of hyper text, it depends on type of requested
* offset. The method is a wrapper for DOMPointToOffset.
*
* @param aRange [in] the given range
* @param aIsStartBound [in] specifies whether the required range bound is
* start bound
* @param aIsStartOffset [in] the offset type, used when the range bound is
* outside of hyper text
* @param aHTOffset [out] the result offset
*/
nsresult RangeBoundToHypertextOffset(nsRange *aRange,
bool aIsStartBound,
bool aIsStartOffset,
int32_t *aHTOffset);
/**
* Set 'misspelled' text attribute and return range offsets where the
* attibute is stretched. If the text is not misspelled at the given offset

Просмотреть файл

@ -879,7 +879,6 @@ var Input = {
JSON.stringify({ type: 'ToggleChrome:Focus' }));
break;
case aEvent.DOM_VK_RETURN:
case aEvent.DOM_VK_ENTER:
if (this.editState.editing)
return;
this.activateCurrent();

Просмотреть файл

@ -69,7 +69,7 @@
this.invoke = function openSubMenu_invoke()
{
synthesizeKey("VK_ENTER", { });
synthesizeKey("VK_RETURN", { });
}
this.finalCheck = function openSubMenu_finalCheck(aEvent)

Просмотреть файл

@ -69,8 +69,12 @@ let devtoolsWidgetPanel = {
Services.obs.addObserver(this, 'in-process-browser-or-app-frame-shown', false);
Services.obs.addObserver(this, 'message-manager-disconnect', false);
let systemapp = document.querySelector('#systemapp').contentWindow;
let frames = systemapp.document.querySelectorAll('iframe[mozapp]');
let systemapp = document.querySelector('#systemapp');
let manifestURL = systemapp.getAttribute("mozapp");
this.trackApp(manifestURL);
let frames =
systemapp.contentWindow.document.querySelectorAll('iframe[mozapp]');
for (let frame of frames) {
let manifestURL = frame.getAttribute("mozapp");
this.trackApp(manifestURL);

Просмотреть файл

@ -235,6 +235,10 @@ SettingsListener.observe('devtools.overlay', false, (value) => {
}
});
SettingsListener.observe('devtools.eventlooplag.threshold', 100, function(value) {
Services.prefs.setIntPref('devtools.eventlooplag.threshold', value);
});
// =================== Debugger / ADB ====================
#ifdef MOZ_WIDGET_GONK
@ -678,11 +682,11 @@ SettingsListener.observe('apz.force-enable', false, function(value) {
SettingsListener.observe('apz.displayport.heuristics', 'default', function(value) {
// first reset everything to default
Services.prefs.setCharPref('apz.velocity_bias', '1.0');
Services.prefs.setBoolPref('apz.use_paint_duration', true);
Services.prefs.setCharPref('apz.x_skate_size_multiplier', '1.5');
Services.prefs.setCharPref('apz.y_skate_size_multiplier', '2.5');
Services.prefs.setBoolPref('apz.allow-checkerboarding', true);
Services.prefs.clearUserPref('apz.velocity_bias');
Services.prefs.clearUserPref('apz.use_paint_duration');
Services.prefs.clearUserPref('apz.x_skate_size_multiplier');
Services.prefs.clearUserPref('apz.y_skate_size_multiplier');
Services.prefs.clearUserPref('apz.allow-checkerboarding');
// and then set the things that we want to change
switch (value) {
case 'default':

Просмотреть файл

@ -8,8 +8,6 @@ const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
const PDF_CONTENT_TYPE = "application/pdf";
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");

Просмотреть файл

@ -564,6 +564,11 @@
@BINPATH@/components/MozKeyboard.js
@BINPATH@/components/InputMethod.manifest
#ifdef MOZ_DEBUG
@BINPATH@/components/TestInterfaceJS.js
@BINPATH@/components/TestInterfaceJS.manifest
#endif
; Modules
@BINPATH@/modules/*

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1391730565000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1392162665000">
<emItems>
<emItem blockID="i454" id="sqlmoz@facebook.com">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -761,7 +761,7 @@
</prefs>
</emItem>
<emItem blockID="i507" id="4zffxtbr-bs@VideoDownloadConverter_4z.com">
<versionRange minVersion="0" maxVersion="*" severity="3">
<versionRange minVersion="0" maxVersion="5.75.3.25126" severity="1">
</versionRange>
<prefs>
</prefs>

Просмотреть файл

@ -1360,6 +1360,9 @@ pref("network.disable.ipc.security", true);
// CustomizableUI debug logging.
pref("browser.uiCustomization.debug", false);
// CustomizableUI state of the browser's user interface
pref("browser.uiCustomization.state", "");
// The URL where remote content that composes the UI for Firefox Accounts should
// be fetched. Must use HTTPS.
pref("identity.fxaccounts.remote.uri", "https://accounts.firefox.com/?service=sync&context=fx_desktop_v1");

Просмотреть файл

@ -50,9 +50,6 @@
<command id="cmd_findPrevious"
oncommand="gFindBar.onFindAgainCommand(true);"
observes="isImage"/>
#ifdef XP_MACOSX
<command id="cmd_findSelection" oncommand="gFindBar.onFindSelectionCommand();"/>
#endif
<!-- work-around bug 392512 -->
<command id="Browser:AddBookmarkAs"
oncommand="PlacesCommandHook.bookmarkCurrentPage(true, PlacesUtils.bookmarksMenuFolderId);"/>
@ -353,9 +350,6 @@
<key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
<key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
<key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
#ifdef XP_MACOSX
<key id="key_findSelection" key="&findSelectionCmd.commandkey;" command="cmd_findSelection" modifiers="accel"/>
#endif
<key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
<key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/>

Просмотреть файл

@ -4238,6 +4238,7 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
while (toolbarItem && toolbarItem.parentNode) {
let parent = toolbarItem.parentNode;
if ((parent.classList && parent.classList.contains("customization-target")) ||
parent.getAttribute("overflowfortoolbar") || // Needs to work in the overflow list as well.
parent.localName == "toolbarpaletteitem" ||
parent.localName == "toolbar")
break;

Просмотреть файл

@ -269,7 +269,14 @@
class="customize-context-removeFromToolbar"/>
<menuseparator/>
<menuseparator id="viewToolbarsMenuSeparator"/>
<menuitem command="cmd_CustomizeToolbars"
<!-- XXXgijs: we're using oncommand handler here to avoid the event being
redirected to the command element, thus preventing
listeners on the menupopup or further up the tree from
seeing the command event pass by. The observes attribute is
here so that the menuitem is still disabled and re-enabled
correctly. -->
<menuitem oncommand="BrowserCustomizeToolbar()"
observes="cmd_CustomizeToolbars"
class="viewCustomizeToolbar"
label="&viewCustomizeToolbar.label;"
accesskey="&viewCustomizeToolbar.accesskey;"/>

Просмотреть файл

@ -11,9 +11,6 @@ let texts = [
"To err is human; to forgive is not company policy."
];
let Clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
let HasFindClipboard = Clipboard.supportsFindClipboard();
function addTabWithText(aText, aCallback) {
let newTab = gBrowser.addTab("data:text/html,<h1 id='h1'>" + aText + "</h1>");
tabs.push(newTab);
@ -64,9 +61,7 @@ function continueTests1() {
// Confirm the first tab is still correct, ensure re-hiding works as expected
gBrowser.selectedTab = tabs[0];
ok(!gFindBar.hidden, "First tab shows find bar!");
// When the Find Clipboard is supported, this test not relevant.
if (!HasFindClipboard)
is(gFindBar._findField.value, texts[0], "First tab persists find value!");
is(gFindBar._findField.value, texts[0], "First tab persists find value!");
ok(gFindBar.getElement("highlight").checked,
"Highlight button state persists!");
@ -99,8 +94,7 @@ function continueTests2() {
ok(gFindBar.hidden, "Fourth tab doesn't show find bar!");
is(gFindBar, gBrowser.getFindBar(), "Find bar is right one!");
gFindBar.open();
let toTest = HasFindClipboard ? texts[2] : texts[1];
is(gFindBar._findField.value, toTest,
is(gFindBar._findField.value, texts[1],
"Fourth tab has second tab's find value!");
newWindow = gBrowser.replaceTabWithWindow(tabs.pop());
@ -110,8 +104,7 @@ function continueTests2() {
// Test that findbar gets restored when a tab is moved to a new window.
function checkNewWindow() {
ok(!newWindow.gFindBar.hidden, "New window shows find bar!");
let toTest = HasFindClipboard ? texts[2] : texts[1];
is(newWindow.gFindBar._findField.value, toTest,
is(newWindow.gFindBar._findField.value, texts[1],
"New window find bar has correct find value!");
ok(!newWindow.gFindBar.getElement("find-next").disabled,
"New window findbar has enabled buttons!");

Просмотреть файл

@ -2,10 +2,7 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
const {Ci: interfaces, Cc: classes} = Components;
let Clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
let HasFindClipboard = Clipboard.supportsFindClipboard();
let Ci = Components.interfaces;
function test() {
waitForExplicitFinish();
@ -40,10 +37,7 @@ function onFocus(win) {
let findBar = win.gFindBar;
selectText(win.content);
findBar.onFindCommand();
// When the OS supports the Find Clipboard (OSX), the find field value is
// persisted across Fx sessions, thus not useful to test.
if (!HasFindClipboard)
is(findBar._findField.value, "Select Me", "Findbar is initialized with selection");
is(findBar._findField.value, "Select Me", "Findbar is initialized with selection");
findBar.close();
win.close();
finish();

Просмотреть файл

@ -1152,7 +1152,7 @@ function triggerSecondaryCommand(popup, index) {
EventUtils.synthesizeKey("VK_DOWN", {});
// Activate
EventUtils.synthesizeKey("VK_ENTER", {});
EventUtils.synthesizeKey("VK_RETURN", {});
}, false);
// One down event to open the popup

Просмотреть файл

@ -1871,7 +1871,6 @@
<handlers>
<!-- The _accept method checks for .defaultPrevented so that if focus is in a button,
enter activates the button and not this default action -->
<handler event="keypress" keycode="VK_ENTER" group="system" action="this._accept(event);"/>
<handler event="keypress" keycode="VK_RETURN" group="system" action="this._accept(event);"/>
</handlers>
</binding>

Просмотреть файл

@ -95,7 +95,7 @@ static RedirEntry kRedirMap[] = {
nsIAboutModule::ALLOW_SCRIPT },
{ "app-manager", "chrome://browser/content/devtools/app-manager/index.xul",
nsIAboutModule::ALLOW_SCRIPT },
{ "customizing", "chrome://browser/content/customizableui/aboutCustomizing.xhtml",
{ "customizing", "chrome://browser/content/customizableui/aboutCustomizing.xul",
nsIAboutModule::ALLOW_SCRIPT },
};
static const int kRedirTotal = ArrayLength(kRedirMap);

Просмотреть файл

@ -1,25 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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/. -->
<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
%htmlDTD;
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml"
disablefastfind="true">
<head>
<title>&customizeMode.tabTitle;</title>
<link rel="icon" type="image/x-icon"
href="chrome://browser/skin/customizableui/customizeFavicon.ico"/>
</head>
<body></body>
</html>
<window id="aboutCustomizingWindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="&customizeMode.tabTitle;">
<html:head>
<html:link rel="icon" type="image/x-icon"
href="chrome://browser/skin/customizableui/customizeFavicon.ico"/>
</html:head>
</window>

Просмотреть файл

@ -30,7 +30,7 @@
<menupopup id="customization-toolbar-menu" onpopupshowing="onViewToolbarsPopupShowing(event)"/>
</button>
<spacer flex="1"/>
<button id="customization-undo-reset"
<button id="customization-undo-reset-button"
class="customizationmode-button"
hidden="true"
oncommand="gCustomizeMode.undoReset();"

Просмотреть файл

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar:
content/browser/customizableui/aboutCustomizing.xhtml
content/browser/customizableui/aboutCustomizing.xul
content/browser/customizableui/panelUI.css
* content/browser/customizableui/panelUI.js
content/browser/customizableui/panelUI.xml

Просмотреть файл

@ -222,8 +222,10 @@
role="group"
type="arrow"
level="top"
context="toolbar-context-menu"
hidden="true">
<vbox id="widget-overflow-scroller">
<vbox id="widget-overflow-list" class="widget-overflow-list"/>
<vbox id="widget-overflow-list" class="widget-overflow-list"
overflowfortoolbar="nav-bar"/>
</vbox>
</panel>

Просмотреть файл

@ -36,6 +36,7 @@ const kSpecialWidgetPfx = "customizableui-special-";
const kPrefCustomizationState = "browser.uiCustomization.state";
const kPrefCustomizationAutoAdd = "browser.uiCustomization.autoAdd";
const kPrefCustomizationDebug = "browser.uiCustomization.debug";
const kPrefDrawInTitlebar = "browser.tabs.drawInTitlebar";
/**
* The keys are the handlers that are fired when the event type (the value)
@ -128,7 +129,10 @@ let gGroupWrapperCache = new Map();
let gSingleWrapperCache = new WeakMap();
let gListeners = new Set();
let gUIStateBeforeReset = null;
let gUIStateBeforeReset = {
uiCustomizationState: null,
drawInTitlebar: null,
};
let gModuleName = "[CustomizableUI]";
#include logging.js
@ -697,7 +701,7 @@ let CustomizableUIInternal = {
this.insertNode(aWidgetId, aArea, aPosition, true);
if (!gResetting) {
gUIStateBeforeReset = null;
this._clearPreviousUIState();
}
},
@ -756,19 +760,19 @@ let CustomizableUIInternal = {
}
}
if (!gResetting) {
gUIStateBeforeReset = null;
this._clearPreviousUIState();
}
},
onWidgetMoved: function(aWidgetId, aArea, aOldPosition, aNewPosition) {
this.insertNode(aWidgetId, aArea, aNewPosition);
if (!gResetting) {
gUIStateBeforeReset = null;
this._clearPreviousUIState();
}
},
onCustomizeEnd: function(aWindow) {
gUIStateBeforeReset = null;
this._clearPreviousUIState();
},
registerBuildArea: function(aArea, aNode) {
@ -1333,8 +1337,7 @@ let CustomizableUIInternal = {
maybeAutoHidePanel: function(aEvent) {
if (aEvent.type == "keypress") {
if (aEvent.keyCode != aEvent.DOM_VK_ENTER &&
aEvent.keyCode != aEvent.DOM_VK_RETURN) {
if (aEvent.keyCode != aEvent.DOM_VK_RETURN) {
return;
}
// If the user hit enter/return, we don't check preventDefault - it makes sense
@ -2076,10 +2079,12 @@ let CustomizableUIInternal = {
_resetUIState: function() {
try {
gUIStateBeforeReset = Services.prefs.getCharPref(kPrefCustomizationState);
gUIStateBeforeReset.drawInTitlebar = Services.prefs.getBoolPref(kPrefDrawInTitlebar);
gUIStateBeforeReset.uiCustomizationState = Services.prefs.getCharPref(kPrefCustomizationState);
} catch(e) { }
Services.prefs.clearUserPref(kPrefCustomizationState);
Services.prefs.clearUserPref(kPrefDrawInTitlebar);
LOG("State reset");
// Reset placements to make restoring default placements possible.
@ -2114,17 +2119,31 @@ let CustomizableUIInternal = {
* Undoes a previous reset, restoring the state of the UI to the state prior to the reset.
*/
undoReset: function() {
if (!gUIStateBeforeReset) {
if (gUIStateBeforeReset.uiCustomizationState == null ||
gUIStateBeforeReset.drawInTitlebar == null) {
return;
}
Services.prefs.setCharPref(kPrefCustomizationState, gUIStateBeforeReset);
let uiCustomizationState = gUIStateBeforeReset.uiCustomizationState;
let drawInTitlebar = gUIStateBeforeReset.drawInTitlebar;
// Need to clear the previous state before setting the prefs
// because pref observers may check if there is a previous UI state.
this._clearPreviousUIState();
Services.prefs.setCharPref(kPrefCustomizationState, uiCustomizationState);
Services.prefs.setBoolPref(kPrefDrawInTitlebar, drawInTitlebar);
this.loadSavedState();
for (let areaId of Object.keys(gSavedState.placements)) {
let placements = gSavedState.placements[areaId];
gPlacements.set(areaId, placements);
}
this._rebuildRegisteredAreas();
gUIStateBeforeReset = null;
},
_clearPreviousUIState: function() {
Object.getOwnPropertyNames(gUIStateBeforeReset).forEach((prop) => {
gUIStateBeforeReset[prop] = null;
});
},
/**
@ -2271,6 +2290,11 @@ let CustomizableUIInternal = {
}
}
if (Services.prefs.prefHasUserValue(kPrefDrawInTitlebar)) {
LOG(kPrefDrawInTitlebar + " pref is non-default");
return false;
}
return true;
}
};
@ -2894,7 +2918,8 @@ this.CustomizableUI = {
* Restore Defaults can be performed.
*/
get canUndoReset() {
return !!gUIStateBeforeReset;
return gUIStateBeforeReset.uiCustomizationState != null ||
gUIStateBeforeReset.drawInTitlebar != null;
},
/**
@ -3396,7 +3421,11 @@ OverflowableToolbar.prototype = {
this._onResize(aEvent);
break;
case "command":
this._onClickChevron(aEvent);
if (aEvent.target == this._chevron) {
this._onClickChevron(aEvent);
} else {
this._panel.hidePopup();
}
break;
case "popuphiding":
this._onPanelHiding(aEvent);
@ -3431,11 +3460,13 @@ OverflowableToolbar.prototype = {
},
_onClickChevron: function(aEvent) {
if (this._chevron.open)
if (this._chevron.open) {
this._panel.hidePopup();
else {
} else {
let doc = aEvent.target.ownerDocument;
this._panel.hidden = false;
let contextMenu = doc.getElementById(this._panel.getAttribute("context"));
gELS.addSystemEventListener(contextMenu, 'command', this, true);
let anchor = doc.getAnonymousElementByAttribute(this._chevron, "class", "toolbarbutton-icon");
this._panel.openPopup(anchor || this._chevron, "bottomcenter topright");
}
@ -3444,6 +3475,9 @@ OverflowableToolbar.prototype = {
_onPanelHiding: function(aEvent) {
this._chevron.open = false;
let doc = aEvent.target.ownerDocument;
let contextMenu = doc.getElementById(this._panel.getAttribute("context"));
gELS.removeSystemEventListener(contextMenu, 'command', this, true);
},
onOverflow: function(aEvent) {

Просмотреть файл

@ -497,12 +497,34 @@ CustomizeMode.prototype = {
},
_getCustomizableChildForNode: function(aNode) {
let area = this._getCustomizableParent(aNode);
area = area.customizationTarget || area;
while (aNode && aNode.parentNode != area) {
aNode = aNode.parentNode;
// NB: adjusted from _getCustomizableParent to keep that method fast
// (it's used during drags), and avoid multiple DOM loops
let areas = CustomizableUI.areas;
// Caching this length is important because otherwise we'll also iterate
// over items we add to the end from within the loop.
let numberOfAreas = areas.length;
for (let i = 0; i < numberOfAreas; i++) {
let area = areas[i];
let areaNode = aNode.ownerDocument.getElementById(area);
let customizationTarget = areaNode && areaNode.customizationTarget;
if (customizationTarget && customizationTarget != areaNode) {
areas.push(customizationTarget.id);
}
let overflowTarget = areaNode.getAttribute("overflowtarget");
if (overflowTarget) {
areas.push(overflowTarget);
}
}
return aNode;
areas.push(kPaletteId);
while (aNode && aNode.parentNode) {
let parent = aNode.parentNode;
if (areas.indexOf(parent.id) != -1) {
return aNode;
}
aNode = parent;
}
return null;
},
addToToolbar: function(aNode) {
@ -999,8 +1021,8 @@ CustomizeMode.prototype = {
},
_updateUndoResetButton: function() {
let undoReset = this.document.getElementById("customization-undo-reset");
undoReset.hidden = !CustomizableUI.canUndoReset;
let undoResetButton = this.document.getElementById("customization-undo-reset-button");
undoResetButton.hidden = !CustomizableUI.canUndoReset;
},
handleEvent: function(aEvent) {
@ -1052,7 +1074,9 @@ CustomizeMode.prototype = {
observe: function(aSubject, aTopic, aData) {
switch (aTopic) {
case "nsPref:changed":
this._updateResetButton();
this._updateTitlebarButton();
this._updateUndoResetButton();
break;
}
},

Просмотреть файл

@ -11,6 +11,8 @@ support-files =
[browser_878452_drag_to_panel.js]
[browser_880164_customization_context_menus.js]
[browser_880382_drag_wide_widgets_in_panel.js]
[browser_884402_customize_from_overflow.js]
skip-if = os == "linux"
[browser_885052_customize_mode_observers_disabed.js]
# Bug 951403 - Disabled on OSX for frequent failures
skip-if = os == "mac"

Просмотреть файл

@ -305,58 +305,3 @@ add_task(function() {
yield hiddenPromise;
});
function contextMenuShown(aContextMenu) {
let deferred = Promise.defer();
let win = aContextMenu.ownerDocument.defaultView;
let timeoutId = win.setTimeout(() => {
deferred.reject("Context menu (" + aContextMenu.id + ") did not show within 20 seconds.");
}, 20000);
function onPopupShown(e) {
aContextMenu.removeEventListener("popupshown", onPopupShown);
win.clearTimeout(timeoutId);
deferred.resolve();
};
aContextMenu.addEventListener("popupshown", onPopupShown);
return deferred.promise;
}
function contextMenuHidden(aContextMenu) {
let deferred = Promise.defer();
let win = aContextMenu.ownerDocument.defaultView;
let timeoutId = win.setTimeout(() => {
deferred.reject("Context menu (" + aContextMenu.id + ") did not hide within 20 seconds.");
}, 20000);
function onPopupHidden(e) {
win.clearTimeout(timeoutId);
aContextMenu.removeEventListener("popuphidden", onPopupHidden);
deferred.resolve();
};
aContextMenu.addEventListener("popuphidden", onPopupHidden);
return deferred.promise;
}
// This is a simpler version of the context menu check that
// exists in contextmenu_common.js.
function checkContextMenu(aContextMenu, aExpectedEntries, aWindow=window) {
let childNodes = aContextMenu.childNodes;
for (let i = 0; i < childNodes.length; i++) {
let menuitem = childNodes[i];
try {
if (aExpectedEntries[i][0] == "---") {
is(menuitem.localName, "menuseparator", "menuseparator expected");
continue;
}
let selector = aExpectedEntries[i][0];
ok(menuitem.mozMatchesSelector(selector), "menuitem should match " + selector + " selector");
let commandValue = menuitem.getAttribute("command");
let relatedCommand = commandValue ? aWindow.document.getElementById(commandValue) : null;
let menuItemDisabled = relatedCommand ?
relatedCommand.getAttribute("disabled") == "true" :
menuitem.getAttribute("disabled") == "true";
is(menuItemDisabled, !aExpectedEntries[i][1], "disabled state for " + selector);
} catch (e) {
ok(false, "Exception when checking context menu: " + e);
}
}
}

Просмотреть файл

@ -0,0 +1,78 @@
"use strict";
let overflowPanel = document.getElementById("widget-overflow");
const isOSX = (Services.appinfo.OS === "Darwin");
let originalWindowWidth;
registerCleanupFunction(function() {
window.resizeTo(originalWindowWidth, window.outerHeight);
});
// Right-click on an item within the overflow panel should
// show a context menu with options to move it.
add_task(function() {
originalWindowWidth = window.outerWidth;
let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
let oldChildCount = navbar.customizationTarget.childElementCount;
window.resizeTo(400, window.outerHeight);
yield waitForCondition(() => navbar.hasAttribute("overflowing"));
ok(navbar.hasAttribute("overflowing"), "Should have an overflowing toolbar.");
let chevron = document.getElementById("nav-bar-overflow-button");
let shownPanelPromise = promisePanelElementShown(window, overflowPanel);
chevron.click();
yield shownPanelPromise;
let contextMenu = document.getElementById("toolbar-context-menu");
let shownContextPromise = contextMenuShown(contextMenu);
let homeButton = document.getElementById("home-button");
ok(homeButton, "home-button was found");
ok(homeButton.classList.contains("overflowedItem"), "Home button is overflowing");
EventUtils.synthesizeMouse(homeButton, 2, 2, {type: "contextmenu", button: 2});
yield shownContextPromise;
is(overflowPanel.state, "open", "The widget overflow panel should still be open.");
let expectedEntries = [
[".customize-context-moveToPanel", true],
[".customize-context-removeFromToolbar", true],
["---"]
];
if (!isOSX) {
expectedEntries.push(["#toggle_toolbar-menubar", true]);
}
expectedEntries.push(
["#toggle_PersonalToolbar", true],
["---"],
[".viewCustomizeToolbar", true]
);
checkContextMenu(contextMenu, expectedEntries);
let hiddenContextPromise = contextMenuHidden(contextMenu);
let hiddenPromise = promisePanelElementHidden(window, overflowPanel);
let moveToPanel = contextMenu.querySelector(".customize-context-moveToPanel");
if (moveToPanel) {
moveToPanel.click();
}
contextMenu.hidePopup();
yield hiddenContextPromise;
yield hiddenPromise;
let homeButtonPlacement = CustomizableUI.getPlacementOfWidget("home-button");
ok(homeButtonPlacement, "Home button should still have a placement");
is(homeButtonPlacement && homeButtonPlacement.area, "PanelUI-contents", "Home button should be in the panel now");
CustomizableUI.reset();
// In some cases, it can take a tick for the navbar to overflow again. Wait for it:
yield waitForCondition(() => navbar.hasAttribute("overflowing"));
ok(navbar.hasAttribute("overflowing"), "Should have an overflowing toolbar.");
let homeButtonPlacement = CustomizableUI.getPlacementOfWidget("home-button");
ok(homeButtonPlacement, "Home button should still have a placement");
is(homeButtonPlacement && homeButtonPlacement.area, "nav-bar", "Home button should be back in the navbar now");
ok(homeButton.classList.contains("overflowedItem"), "Home button should still be overflowed");
});

Просмотреть файл

@ -11,18 +11,18 @@ add_task(function() {
yield startCustomizing();
ok(!CustomizableUI.inDefaultState, "Not in default state to begin with");
is(CustomizableUI.getPlacementOfWidget(homeButtonId), null, "Home button is in palette");
let undoReset = document.getElementById("customization-undo-reset");
is(undoReset.hidden, true, "The undo button is hidden before reset");
let undoResetButton = document.getElementById("customization-undo-reset-button");
is(undoResetButton.hidden, true, "The undo button is hidden before reset");
yield gCustomizeMode.reset();
ok(CustomizableUI.inDefaultState, "In default state after reset");
is(undoReset.hidden, false, "The undo button is visible after reset");
is(undoResetButton.hidden, false, "The undo button is visible after reset");
undoReset.click();
undoResetButton.click();
yield waitForCondition(function() !gCustomizeMode.resetting);
ok(!CustomizableUI.inDefaultState, "Not in default state after reset-undo");
is(undoReset.hidden, true, "The undo button is hidden after clicking on the undo button");
is(undoResetButton.hidden, true, "The undo button is hidden after clicking on the undo button");
is(CustomizableUI.getPlacementOfWidget(homeButtonId), null, "Home button is in palette");
yield gCustomizeMode.reset();
@ -34,29 +34,71 @@ add_task(function() {
CustomizableUI.removeWidgetFromArea(homeButtonId);
ok(!CustomizableUI.inDefaultState, "Not in default state to begin with");
is(CustomizableUI.getPlacementOfWidget(homeButtonId), null, "Home button is in palette");
let undoReset = document.getElementById("customization-undo-reset");
is(undoReset.hidden, true, "The undo button is hidden before reset");
let undoResetButton = document.getElementById("customization-undo-reset-button");
is(undoResetButton.hidden, true, "The undo button is hidden before reset");
yield gCustomizeMode.reset();
ok(CustomizableUI.inDefaultState, "In default state after reset");
is(undoReset.hidden, false, "The undo button is visible after reset");
is(undoResetButton.hidden, false, "The undo button is visible after reset");
CustomizableUI.addWidgetToArea(homeButtonId, CustomizableUI.AREA_PANEL);
is(undoReset.hidden, true, "The undo button is hidden after another change");
is(undoResetButton.hidden, true, "The undo button is hidden after another change");
});
// "Restore defaults", exiting customize, and re-entering shouldn't show the Undo button
add_task(function() {
let undoReset = document.getElementById("customization-undo-reset");
is(undoReset.hidden, true, "The undo button is hidden before a reset");
let undoResetButton = document.getElementById("customization-undo-reset-button");
is(undoResetButton.hidden, true, "The undo button is hidden before a reset");
ok(!CustomizableUI.inDefaultState, "The browser should not be in default state");
yield gCustomizeMode.reset();
is(undoReset.hidden, false, "The undo button is hidden after a reset");
is(undoResetButton.hidden, false, "The undo button is visible after a reset");
yield endCustomizing();
yield startCustomizing();
is(undoReset.hidden, true, "The undo reset button should be hidden after entering customization mode");
is(undoResetButton.hidden, true, "The undo reset button should be hidden after entering customization mode");
});
// Bug 971626 - Restore Defaults should collapse the Title Bar
add_task(function() {
if (Services.appinfo.OS != "WINNT" &&
Services.appinfo.OS != "Darwin") {
return;
}
let prefName = "browser.tabs.drawInTitlebar";
let defaultValue = Services.prefs.getBoolPref(prefName);
let restoreDefaultsButton = document.getElementById("customization-reset-button");
let titleBarButton = document.getElementById("customization-titlebar-visibility-button");
let undoResetButton = document.getElementById("customization-undo-reset-button");
ok(CustomizableUI.inDefaultState, "Should be in default state at start of test");
ok(restoreDefaultsButton.disabled, "Restore defaults button should be disabled when in default state");
is(titleBarButton.hasAttribute("checked"), !defaultValue, "Title bar button should reflect pref value");
is(undoResetButton.hidden, true, "Undo reset button should be hidden at start of test");
Services.prefs.setBoolPref(prefName, !defaultValue);
ok(!restoreDefaultsButton.disabled, "Restore defaults button should be enabled when pref changed");
is(titleBarButton.hasAttribute("checked"), defaultValue, "Title bar button should reflect changed pref value");
ok(!CustomizableUI.inDefaultState, "With titlebar flipped, no longer default");
is(undoResetButton.hidden, true, "Undo reset button should be hidden after pref change");
yield gCustomizeMode.reset();
ok(restoreDefaultsButton.disabled, "Restore defaults button should be disabled after reset");
is(titleBarButton.hasAttribute("checked"), !defaultValue, "Title bar button should reflect default value after reset");
is(Services.prefs.getBoolPref(prefName), defaultValue, "Reset should reset drawInTitlebar");
ok(CustomizableUI.inDefaultState, "In default state after titlebar reset");
is(undoResetButton.hidden, false, "Undo reset button should be visible after reset");
ok(!undoResetButton.disabled, "Undo reset button should be enabled after reset");
yield gCustomizeMode.undoReset();
ok(!restoreDefaultsButton.disabled, "Restore defaults button should be enabled after undo-reset");
is(titleBarButton.hasAttribute("checked"), defaultValue, "Title bar button should reflect undo-reset value");
ok(!CustomizableUI.inDefaultState, "No longer in default state after undo");
is(Services.prefs.getBoolPref(prefName), !defaultValue, "Undo-reset goes back to previous pref value");
is(undoResetButton.hidden, true, "Undo reset button should be hidden after undo-reset clicked");
Services.prefs.clearUserPref(prefName);
ok(CustomizableUI.inDefaultState, "In default state after pref cleared");
is(undoResetButton.hidden, true, "Undo reset button should be hidden at end of test");
});
add_task(function asyncCleanup() {

Просмотреть файл

@ -376,3 +376,60 @@ function promiseTabHistoryNavigation(aDirection = -1, aConditionFn) {
return deferred.promise;
}
function contextMenuShown(aContextMenu) {
let deferred = Promise.defer();
let win = aContextMenu.ownerDocument.defaultView;
let timeoutId = win.setTimeout(() => {
deferred.reject("Context menu (" + aContextMenu.id + ") did not show within 20 seconds.");
}, 20000);
function onPopupShown(e) {
aContextMenu.removeEventListener("popupshown", onPopupShown);
win.clearTimeout(timeoutId);
deferred.resolve();
};
aContextMenu.addEventListener("popupshown", onPopupShown);
return deferred.promise;
}
function contextMenuHidden(aContextMenu) {
let deferred = Promise.defer();
let win = aContextMenu.ownerDocument.defaultView;
let timeoutId = win.setTimeout(() => {
deferred.reject("Context menu (" + aContextMenu.id + ") did not hide within 20 seconds.");
}, 20000);
function onPopupHidden(e) {
win.clearTimeout(timeoutId);
aContextMenu.removeEventListener("popuphidden", onPopupHidden);
deferred.resolve();
};
aContextMenu.addEventListener("popuphidden", onPopupHidden);
return deferred.promise;
}
// This is a simpler version of the context menu check that
// exists in contextmenu_common.js.
function checkContextMenu(aContextMenu, aExpectedEntries, aWindow=window) {
let childNodes = aContextMenu.childNodes;
for (let i = 0; i < childNodes.length; i++) {
let menuitem = childNodes[i];
try {
if (aExpectedEntries[i][0] == "---") {
is(menuitem.localName, "menuseparator", "menuseparator expected");
continue;
}
let selector = aExpectedEntries[i][0];
ok(menuitem.mozMatchesSelector(selector), "menuitem should match " + selector + " selector");
let commandValue = menuitem.getAttribute("command");
let relatedCommand = commandValue ? aWindow.document.getElementById(commandValue) : null;
let menuItemDisabled = relatedCommand ?
relatedCommand.getAttribute("disabled") == "true" :
menuitem.getAttribute("disabled") == "true";
is(menuItemDisabled, !aExpectedEntries[i][1], "disabled state for " + selector);
} catch (e) {
ok(false, "Exception when checking context menu: " + e);
}
}
}

Просмотреть файл

@ -957,8 +957,7 @@ const DownloadsView = {
return;
}
if (aEvent.keyCode == KeyEvent.DOM_VK_ENTER ||
aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
goDoCommand("downloadsCmd_doDefault");
}
},
@ -1648,7 +1647,6 @@ const DownloadsSummary = {
onKeyDown: function DS_onKeyDown(aEvent)
{
if (aEvent.charCode == " ".charCodeAt(0) ||
aEvent.keyCode == KeyEvent.DOM_VK_ENTER ||
aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
DownloadsPanel.showDownloadsHistory();
}

Просмотреть файл

@ -400,10 +400,10 @@ var gAdvancedPane = {
*/
clearCache: function ()
{
var cacheService = Components.classes["@mozilla.org/network/cache-service;1"]
.getService(Components.interfaces.nsICacheService);
var cache = Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Components.interfaces.nsICacheStorageService);
try {
cacheService.evictEntries(Components.interfaces.nsICache.STORE_ANYWHERE);
cache.clear();
} catch(ex) {}
this.updateActualCacheSize();
},

Просмотреть файл

@ -118,8 +118,7 @@ function GroupItem(listOfEls, options) {
var handleKeyPress = function (e) {
if (e.keyCode == KeyEvent.DOM_VK_ESCAPE ||
e.keyCode == KeyEvent.DOM_VK_RETURN ||
e.keyCode == KeyEvent.DOM_VK_ENTER) {
e.keyCode == KeyEvent.DOM_VK_RETURN) {
(self.$title)[0].blur();
self.$title
.addClass("transparentBorder")

Просмотреть файл

@ -470,9 +470,8 @@ let Search = {
let matcher = this.createSearchTabMatcher();
let matches = matcher.matched();
let others = matcher.matchedTabsFromOtherWindows();
if ((event.keyCode == event.DOM_VK_RETURN ||
event.keyCode == event.DOM_VK_ENTER) &&
(matches.length > 0 || others.length > 0)) {
if (event.keyCode == event.DOM_VK_RETURN &&
(matches.length > 0 || others.length > 0)) {
this.hide(event);
if (matches.length > 0)
matches[0].zoomIn();

Просмотреть файл

@ -16,7 +16,7 @@ function test() {
let groupItem = cw.GroupItems.groupItems[0];
let shield = groupItem.$titleShield[0];
let keys = ["RETURN", "ENTER", "ESCAPE"];
let keys = ["RETURN", "ESCAPE"];
ok(win.TabView.isVisible(), "tabview is visible");

Просмотреть файл

@ -32,10 +32,10 @@ function test() {
finish();
});
EventUtils.synthesizeKey("VK_ENTER", {}, contentWindow);
EventUtils.synthesizeKey("VK_RETURN", {}, contentWindow);
});
});
EventUtils.synthesizeKey("VK_ENTER", {}, contentWindow);
EventUtils.synthesizeKey("VK_RETURN", {}, contentWindow);
});
}

Просмотреть файл

@ -126,7 +126,7 @@ function cleanup(contentWindow) {
});
}
window.addEventListener("tabviewhidden", onTabViewHidden, false);
EventUtils.synthesizeKey("VK_ENTER", {});
EventUtils.synthesizeKey("VK_RETURN", {});
}
function whenWindowObservesOnce(win, topic, func) {

Просмотреть файл

@ -128,5 +128,5 @@ function cleanup(contentWindow) {
finish();
}
window.addEventListener("tabviewhidden", onTabViewHidden, false);
EventUtils.synthesizeKey("VK_ENTER", {});
EventUtils.synthesizeKey("VK_RETURN", {});
}

Просмотреть файл

@ -1099,7 +1099,6 @@ let UI = {
self.exit();
break;
case KeyEvent.DOM_VK_RETURN:
case KeyEvent.DOM_VK_ENTER:
activeGroupItem = GroupItems.getActiveGroupItem();
if (activeGroupItem) {
activeTab = self.getActiveTab();

Просмотреть файл

@ -911,7 +911,7 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
* The keypress listener for the breakpoints conditional expression textbox.
*/
_onConditionalTextboxKeyPress: function(e) {
if (e.keyCode == e.DOM_VK_RETURN || e.keyCode == e.DOM_VK_ENTER) {
if (e.keyCode == e.DOM_VK_RETURN) {
this._hideConditionalPopup();
}
},
@ -2268,7 +2268,6 @@ WatchExpressionsView.prototype = Heritage.extend(WidgetMethods, {
_onKeyPress: function(e) {
switch(e.keyCode) {
case e.DOM_VK_RETURN:
case e.DOM_VK_ENTER:
case e.DOM_VK_ESCAPE:
e.stopPropagation();
DebuggerView.editor.focus();

Просмотреть файл

@ -953,7 +953,6 @@ FilterView.prototype = {
// the escape key switches focus from the search container.
else switch (e.keyCode) {
case e.DOM_VK_RETURN:
case e.DOM_VK_ENTER:
var isReturnKey = true;
// If the shift key is pressed, focus on the previous result
actionToPerform = e.shiftKey ? "selectPrev" : "selectNext";

Просмотреть файл

@ -47,6 +47,7 @@ support-files =
doc_frame-parameters.html
doc_function-display-name.html
doc_function-search.html
doc_global-method-override.html
doc_iframes.html
doc_included-script.html
doc_inline-debugger-statement.html
@ -122,6 +123,7 @@ support-files =
[browser_dbg_event-listeners.js]
[browser_dbg_file-reload.js]
[browser_dbg_function-display-name.js]
[browser_dbg_global-method-override.js]
[browser_dbg_globalactor.js]
[browser_dbg_host-layout.js]
[browser_dbg_iframes.js]

Просмотреть файл

@ -0,0 +1,20 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that scripts that override properties of the global object, like
* toString don't break the debugger. The test page used to cause the debugger
* to throw when trying to attach to the thread actor.
*/
const TAB_URL = EXAMPLE_URL + "doc_global-method-override.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
let gDebugger = aPanel.panelWin;
ok(gDebugger, "Should have a debugger available.");
is(gDebugger.gThreadClient.state, "attached", "Debugger should be attached.");
closeDebuggerAndFinish(aPanel);
});
}

Просмотреть файл

@ -118,7 +118,7 @@ function performTest() {
ok(isCaretPos(gPanel, 26, 11 + token.length),
"The editor didn't jump to the correct token (4).");
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
is(gFiltering.searchData.toSource(), '["#", ["", "debugger"]]',
"The searchbox data wasn't parsed correctly.");
ok(isCaretPos(gPanel, 8, 12 + token.length),
@ -222,7 +222,7 @@ function performTest() {
ok(isCaretPos(gPanel, 8, 12 + token.length),
"The editor shouldn't jump to another token (20).");
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
is(gFiltering.searchData.toSource(), '["", [""]]',
"The searchbox data wasn't parsed correctly.");
ok(isCaretPos(gPanel, 8, 12 + token.length),
@ -259,7 +259,7 @@ function performTest() {
ok(isCaretPos(gPanel, 26, 11 + token.length),
"The editor didn't jump to the correct token (26).");
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
is(gFiltering.searchData.toSource(), '["#", ["#don\'t#find#me#instead#find", "debugger"]]',
"The searchbox data wasn't parsed correctly.");
ok(isCaretPos(gPanel, 8, 12 + token.length),

Просмотреть файл

@ -436,13 +436,13 @@ function showSource(aLabel) {
function saveSearch() {
let finished = once(gDebugger, "popuphidden");
// Either by pressing RETURN, ENTER, or clicking on an item in the popup,
// Either by pressing RETURN or clicking on an item in the popup,
// the popup should hide and the item should become selected.
let random = Math.random();
if (random >= 0.33) {
EventUtils.sendKey("RETURN", gDebugger);
} else if (random >= 0.66) {
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
} else {
EventUtils.sendMouseEvent({ type: "click" },
gFilteredFunctions.selectedItem.target,

Просмотреть файл

@ -90,11 +90,11 @@ function performTest() {
is(gVariablesView._parent.scrollTop, 0,
"The 'variables' view shouldn't scroll when pressing the UP key.");
// Part 2: Make sure that ENTER/ESCAPE toggle input elements.
// Part 2: Make sure that RETURN/ESCAPE toggle input elements.
yield synthesizeKeyAndWaitForElement("VK_ENTER", {}, ".element-value-input", true);
yield synthesizeKeyAndWaitForElement("VK_RETURN", {}, ".element-value-input", true);
yield synthesizeKeyAndWaitForElement("VK_ESCAPE", {}, ".element-value-input", false);
yield synthesizeKeyAndWaitForElement("VK_ENTER", { shiftKey: true }, ".element-name-input", true);
yield synthesizeKeyAndWaitForElement("VK_RETURN", { shiftKey: true }, ".element-name-input", true);
yield synthesizeKeyAndWaitForElement("VK_ESCAPE", {}, ".element-name-input", false);
// Part 3: Test simple navigation.

Просмотреть файл

@ -32,7 +32,7 @@ function test() {
is(value.hidden, false,
"The value element should not be hidden.");
for (let key of ["ESCAPE", "ENTER"]) {
for (let key of ["ESCAPE", "RETURN"]) {
EventUtils.sendMouseEvent({ type: "dblclick" }, name, win);
is(separator.hidden, true,

Просмотреть файл

@ -57,7 +57,7 @@ function testVariablesAndPropertiesFiltering() {
},
function() {
assertExpansion([true, false, false, false]);
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
},
function() {
assertExpansion([true, false, false, false]);
@ -73,7 +73,7 @@ function testVariablesAndPropertiesFiltering() {
},
function() {
assertExpansion([true, true, true, true]);
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
},
function() {
assertExpansion([true, true, true, true]);
@ -89,7 +89,7 @@ function testVariablesAndPropertiesFiltering() {
},
function() {
assertExpansion([true, true, true, true]);
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
},
function() {
assertExpansion([true, true, true, true]);
@ -108,7 +108,7 @@ function testVariablesAndPropertiesFiltering() {
},
function() {
assertExpansion([false, false, false, false]);
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
},
function() {
assertExpansion([false, false, false, false]);
@ -125,7 +125,7 @@ function testVariablesAndPropertiesFiltering() {
},
function() {
assertExpansion([true, true, true, true]);
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
},
function() {
assertExpansion([true, true, true, true]);
@ -141,7 +141,7 @@ function testVariablesAndPropertiesFiltering() {
},
function() {
assertExpansion([true, true, true, true]);
EventUtils.sendKey("ENTER", gDebugger);
EventUtils.sendKey("RETURN", gDebugger);
},
function() {
assertExpansion([true, true, true, true]);

Просмотреть файл

@ -0,0 +1,16 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Debugger global method override test page</title>
</head>
<body>
<script type="text/javascript">
console.log( "Error: " + toString( { x: 0, y: 0 } ) );
function toString(v) { return "[ " + v.x + ", " + v.y + " ]"; }
</script>
</body>
</html>

Просмотреть файл

@ -276,7 +276,6 @@ SelectorSearch.prototype = {
_onSearchKeypress: function SelectorSearch__onSearchKeypress(aEvent) {
let query = this.searchBox.value;
switch(aEvent.keyCode) {
case aEvent.DOM_VK_ENTER:
case aEvent.DOM_VK_RETURN:
if (query == this._lastSearched && this._searchResults) {
this._searchIndex = (this._searchIndex + 1) % this._searchResults.length;
@ -351,7 +350,6 @@ SelectorSearch.prototype = {
*/
_onListBoxKeypress: function SelectorSearch__onListBoxKeypress(aEvent) {
switch(aEvent.keyCode || aEvent.button) {
case aEvent.DOM_VK_ENTER:
case aEvent.DOM_VK_RETURN:
case aEvent.DOM_VK_TAB:
case 0: // left mouse button

Просмотреть файл

@ -19,7 +19,7 @@ function test()
["i", "b1", false],
["v", "d1", true],
["VK_DOWN", "d2", true],
["VK_ENTER", "d1", true],
["VK_RETURN", "d1", true],
[".", "d1", false],
["c", "d1", false],
["1", "d2", true],

Просмотреть файл

@ -60,7 +60,10 @@ const EVENTS = {
// When the html response preview is displayed in the UI.
RESPONSE_HTML_PREVIEW_DISPLAYED: "NetMonitor:ResponseHtmlPreviewAvailable",
// When `onTabSelect` is fired and subsequently rendered.
// When the image response thumbnail is displayed in the UI.
RESPONSE_IMAGE_THUMBNAIL_DISPLAYED: "NetMonitor:ResponseImageThumbnailAvailable",
// When a tab is selected in the NetworkDetailsView and subsequently rendered.
TAB_UPDATED: "NetMonitor:TabUpdated",
// Fired when Sidebar has finished being populated.
@ -105,6 +108,7 @@ const require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devt
const promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
const EventEmitter = require("devtools/shared/event-emitter");
const Editor = require("devtools/sourceeditor/editor");
const {Tooltip} = require("devtools/shared/widgets/Tooltip");
XPCOMUtils.defineLazyModuleGetter(this, "Chart",
"resource:///modules/devtools/Chart.jsm");

Просмотреть файл

@ -11,6 +11,8 @@ const SOURCE_SYNTAX_HIGHLIGHT_MAX_FILE_SIZE = 102400; // 100 KB in bytes
const RESIZE_REFRESH_RATE = 50; // ms
const REQUESTS_REFRESH_RATE = 50; // ms
const REQUESTS_HEADERS_SAFE_BOUNDS = 30; // px
const REQUESTS_TOOLTIP_POSITION = "topcenter bottomleft";
const REQUESTS_TOOLTIP_IMAGE_MAX_DIM = 400; // px
const REQUESTS_WATERFALL_SAFE_BOUNDS = 90; // px
const REQUESTS_WATERFALL_HEADER_TICKS_MULTIPLE = 5; // ms
const REQUESTS_WATERFALL_HEADER_TICKS_SPACING_MIN = 60; // px
@ -318,7 +320,9 @@ function RequestsMenuView() {
dumpn("RequestsMenuView was instantiated");
this._flushRequests = this._flushRequests.bind(this);
this._onHover = this._onHover.bind(this);
this._onSelect = this._onSelect.bind(this);
this._onSwap = this._onSwap.bind(this);
this._onResize = this._onResize.bind(this);
this._byFile = this._byFile.bind(this);
this._byDomain = this._byDomain.bind(this);
@ -345,6 +349,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
this.widget.autoscrollWithAppendedItems = true;
this.widget.addEventListener("select", this._onSelect, false);
this.widget.addEventListener("swap", this._onSwap, false);
this._splitter.addEventListener("mousemove", this._onResize, false);
window.addEventListener("resize", this._onResize, false);
@ -390,6 +395,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
Prefs.filters = this._activeFilters;
this.widget.removeEventListener("select", this._onSelect, false);
this.widget.removeEventListener("swap", this._onSwap, false);
this._splitter.removeEventListener("mousemove", this._onResize, false);
window.removeEventListener("resize", this._onResize, false);
@ -463,11 +469,21 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
}
});
// Create a tooltip for the newly appended network request item.
let requestTooltip = requestItem.attachment.tooltip = new Tooltip(document, {
closeOnEvents: [{
emitter: $("#requests-menu-contents"),
event: "scroll",
useCapture: true
}]
});
$("#details-pane-toggle").disabled = false;
$("#requests-menu-empty-notice").hidden = true;
this.refreshSummary();
this.refreshZebra();
this.refreshTooltip(requestItem);
if (aId == this._preferredItemId) {
this.selectedItem = requestItem;
@ -497,6 +513,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
copyImageAsDataUri: function() {
let selected = this.selectedItem.attachment;
let { mimeType, text, encoding } = selected.responseContent.content;
gNetwork.getString(text).then(aString => {
let data = "data:" + mimeType + ";" + encoding + "," + aString;
clipboardHelper.copyString(data, document);
@ -922,6 +939,19 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
}
},
/**
* Refreshes the toggling anchor for the specified item's tooltip.
*
* @param object aItem
* The network request item in this container.
*/
refreshTooltip: function(aItem) {
let tooltip = aItem.attachment.tooltip;
tooltip.hide();
tooltip.startTogglingOnHover(aItem.target, this._onHover);
tooltip.defaultPosition = REQUESTS_TOOLTIP_POSITION;
},
/**
* Schedules adding additional information to a network request.
*
@ -1010,13 +1040,14 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
this.updateMenuView(requestItem, key, value);
break;
case "responseContent":
requestItem.attachment.responseContent = value;
// If there's no mime type available when the response content
// is received, assume text/plain as a fallback.
if (!requestItem.attachment.mimeType) {
requestItem.attachment.mimeType = "text/plain";
this.updateMenuView(requestItem, "mimeType", "text/plain");
}
requestItem.attachment.responseContent = value;
this.updateMenuView(requestItem, key, value);
break;
case "totalTime":
requestItem.attachment.totalTime = value;
@ -1112,9 +1143,9 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
let nameWithQuery = this._getUriNameWithQuery(uri);
let hostPort = this._getUriHostPort(uri);
let node = $(".requests-menu-file", target);
node.setAttribute("value", nameWithQuery);
node.setAttribute("tooltiptext", nameWithQuery);
let file = $(".requests-menu-file", target);
file.setAttribute("value", nameWithQuery);
file.setAttribute("tooltiptext", nameWithQuery);
let domain = $(".requests-menu-domain", target);
domain.setAttribute("value", hostPort);
@ -1148,6 +1179,21 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
node.setAttribute("tooltiptext", aValue);
break;
}
case "responseContent": {
let { mimeType } = aItem.attachment;
let { text, encoding } = aValue.content;
if (mimeType.contains("image/")) {
gNetwork.getString(text).then(aString => {
let node = $(".requests-menu-icon", aItem.target);
node.src = "data:" + mimeType + ";" + encoding + "," + aString;
node.setAttribute("type", "thumbnail");
node.removeAttribute("hidden");
window.emit(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
});
}
break;
}
case "totalTime": {
let node = $(".requests-menu-timings-total", target);
let text = L10N.getFormatStr("networkMenu.totalMS", aValue); // integer
@ -1425,6 +1471,49 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
}
},
/**
* The swap listener for this container.
* Called when two items switch places, when the contents are sorted.
*/
_onSwap: function({ detail: [firstItem, secondItem] }) {
// Sorting will create new anchor nodes for all the swapped request items
// in this container, so it's necessary to refresh the Tooltip instances.
this.refreshTooltip(firstItem);
this.refreshTooltip(secondItem);
},
/**
* The predicate used when deciding whether a popup should be shown
* over a request item or not.
*
* @param nsIDOMNode aTarget
* The element node currently being hovered.
* @param object aTooltip
* The current tooltip instance.
*/
_onHover: function(aTarget, aTooltip) {
let requestItem = this.getItemForElement(aTarget);
if (!requestItem || !requestItem.attachment.responseContent) {
return;
}
let hovered = requestItem.attachment;
let { url } = hovered;
let { mimeType, text, encoding } = hovered.responseContent.content;
if (mimeType && mimeType.contains("image/") && (
aTarget.classList.contains("requests-menu-icon") ||
aTarget.classList.contains("requests-menu-file")))
{
return gNetwork.getString(text).then(aString => {
let anchor = $(".requests-menu-icon", requestItem.target);
let src = "data:" + mimeType + ";" + encoding + "," + aString;
aTooltip.setImageContent(src, { maxDim: REQUESTS_TOOLTIP_IMAGE_MAX_DIM });
return anchor;
});
}
},
/**
* The resize listener for this container's window.
*/
@ -1626,7 +1715,7 @@ SidebarView.prototype = {
NetMonitorView.NetworkDetails;
return view.populate(aData).then(() => {
$("#details-pane").selectedIndex = isCustom ? 0 : 1
$("#details-pane").selectedIndex = isCustom ? 0 : 1;
window.emit(EVENTS.SIDEBAR_POPULATED);
});
}
@ -1906,6 +1995,7 @@ NetworkDetailsView.prototype = {
}
populated[tab] = true;
window.emit(EVENTS.TAB_UPDATED);
NetMonitorView.RequestsMenu.ensureSelectedItemIsVisible();
});
},

Просмотреть файл

@ -60,7 +60,7 @@
-moz-box-flex: 1;
}
#network-table[domain-overflows] .requests-menu-file {
#network-table[domain-overflows] .requests-menu-icon-and-file {
-moz-box-flex: 1;
}
}

Просмотреть файл

@ -68,8 +68,8 @@
flex="1">
</button>
</hbox>
<hbox id="requests-menu-file-header-box"
class="requests-menu-header requests-menu-file"
<hbox id="requests-menu-icon-and-file-header-box"
class="requests-menu-header requests-menu-icon-and-file"
align="center">
<button id="requests-menu-file-button"
class="requests-menu-header-button requests-menu-file"
@ -152,8 +152,13 @@
crop="end"
flex="1"/>
</hbox>
<label class="plain requests-menu-subitem requests-menu-file"
crop="end"/>
<hbox class="requests-menu-subitem requests-menu-icon-and-file"
align="center">
<image class="requests-menu-icon" hidden="true"/>
<label class="plain requests-menu-file"
crop="end"
flex="1"/>
</hbox>
<label class="plain requests-menu-subitem requests-menu-domain"
crop="end"/>
<label class="plain requests-menu-subitem requests-menu-type"

Просмотреть файл

@ -47,6 +47,8 @@ support-files =
[browser_net_filter-03.js]
[browser_net_footer-summary.js]
[browser_net_html-preview.js]
[browser_net_icon-preview.js]
[browser_net_image-tooltip.js]
[browser_net_json-long.js]
[browser_net_json-malformed.js]
[browser_net_json_custom_mime.js]

Просмотреть файл

@ -138,8 +138,6 @@ function test() {
"The text shown in the source editor is incorrect.");
is(aEditor.getMode(), Editor.modes[aEditorMode],
"The mode active in the source editor is incorrect.");
teardown(aMonitor).then(finish);
});
}

Просмотреть файл

@ -14,13 +14,11 @@ function test() {
RequestsMenu.lazyUpdate = false;
let imageDataUri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==";
waitForNetworkEvents(aMonitor, 6).then(() => {
let requestItem = RequestsMenu.getItemAtIndex(5);
RequestsMenu.selectedItem = requestItem;
waitForClipboard(imageDataUri, function setup() {
waitForClipboard(TEST_IMAGE_DATA_URI, function setup() {
RequestsMenu.copyImageAsDataUri();
}, function onSuccess() {
ok(true, "Clipboard contains the currently selected image as data uri.");

Просмотреть файл

@ -9,7 +9,7 @@ function test() {
initNetMonitor(CONTENT_TYPE_URL).then(([aTab, aDebuggee, aMonitor]) => {
info("Starting test... ");
let { $, document, NetMonitorView } = aMonitor.panelWin;
let { $, document, EVENTS, NetMonitorView } = aMonitor.panelWin;
let { RequestsMenu } = NetMonitorView;
RequestsMenu.lazyUpdate = false;
@ -35,8 +35,7 @@ function test() {
is($("#preview-tabpanel").hidden, false,
"The preview tabpanel should be visible now.");
let RESPONSE_HTML_PREVIEW_DISPLAYED = aMonitor.panelWin.EVENTS.RESPONSE_HTML_PREVIEW_DISPLAYED;
waitFor(aMonitor.panelWin, RESPONSE_HTML_PREVIEW_DISPLAYED).then(() => {
waitFor(aMonitor.panelWin, EVENTS.RESPONSE_HTML_PREVIEW_DISPLAYED).then(() => {
let iframe = $("#response-preview");
ok(iframe,
"There should be a response preview iframe available.");

Просмотреть файл

@ -0,0 +1,61 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if image responses show a thumbnail in the requests menu.
*/
function test() {
initNetMonitor(CONTENT_TYPE_WITHOUT_CACHE_URL).then(([aTab, aDebuggee, aMonitor]) => {
info("Starting test... ");
let { $, $all, EVENTS, ACTIVITY_TYPE, NetMonitorView, NetMonitorController } = aMonitor.panelWin;
let { RequestsMenu } = NetMonitorView;
promise.all([
waitForNetworkEvents(aMonitor, 6),
waitFor(aMonitor.panelWin, EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED)
]).then(() => {
info("Checking the image thumbnail when all items are shown.");
checkImageThumbnail();
RequestsMenu.sortBy("size");
info("Checking the image thumbnail when all items are sorted.");
checkImageThumbnail();
RequestsMenu.filterOn("images");
info("Checking the image thumbnail when only images are shown.");
checkImageThumbnail();
info("Reloading the debuggee and performing all requests again...");
reloadAndPerformRequests();
return promise.all([
waitForNetworkEvents(aMonitor, 7), // 6 + 1
waitFor(aMonitor.panelWin, EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED)
]);
}).then(() => {
info("Checking the image thumbnail after a reload.");
checkImageThumbnail();
teardown(aMonitor).then(finish);
});
function reloadAndPerformRequests() {
NetMonitorController.triggerActivity(ACTIVITY_TYPE.RELOAD.WITH_CACHE_ENABLED).then(() => {
aDebuggee.performRequests();
});
}
function checkImageThumbnail() {
is($all(".requests-menu-icon[type=thumbnail]").length, 1,
"There should be only one image request with a thumbnail displayed.");
is($(".requests-menu-icon[type=thumbnail]").src, TEST_IMAGE_DATA_URI,
"The image requests-menu-icon thumbnail is displayed correctly.");
is($(".requests-menu-icon[type=thumbnail]").hidden, false,
"The image requests-menu-icon thumbnail should not be hidden.");
}
aDebuggee.performRequests();
});
}

Просмотреть файл

@ -0,0 +1,76 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if image responses show a popup in the requests menu when hovered.
*/
function test() {
initNetMonitor(CONTENT_TYPE_WITHOUT_CACHE_URL).then(([aTab, aDebuggee, aMonitor]) => {
info("Starting test... ");
let { $, EVENTS, ACTIVITY_TYPE, NetMonitorView, NetMonitorController } = aMonitor.panelWin;
let { RequestsMenu } = NetMonitorView;
promise.all([
waitForNetworkEvents(aMonitor, 6),
waitFor(aMonitor.panelWin, EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED)
]).then(() => {
info("Checking the image thumbnail after a few requests were made...");
let requestItem = RequestsMenu.items[5];
let requestTooltip = requestItem.attachment.tooltip;
ok(requestTooltip, "There should be a tooltip instance for the image request.");
let anchor = $(".requests-menu-file", requestItem.target);
return showTooltipOn(requestTooltip, anchor);
}).then(aTooltip => {
ok(true,
"An tooltip was successfully opened for the image request.");
is(aTooltip.content.querySelector("image").src, TEST_IMAGE_DATA_URI,
"The tooltip's image content is displayed correctly.");
info("Reloading the debuggee and performing all requests again...");
reloadAndPerformRequests();
return promise.all([
waitForNetworkEvents(aMonitor, 7), // 6 + 1
waitFor(aMonitor.panelWin, EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED)
]);
}).then(() => {
info("Checking the image thumbnail after a reload.");
let requestItem = RequestsMenu.items[6];
let requestTooltip = requestItem.attachment.tooltip;
ok(requestTooltip, "There should be a tooltip instance for the image request.");
let anchor = $(".requests-menu-file", requestItem.target);
return showTooltipOn(requestTooltip, anchor);
}).then(aTooltip => {
ok(true,
"An tooltip was successfully opened for the image request.");
is(aTooltip.content.querySelector("image").src, TEST_IMAGE_DATA_URI,
"The tooltip's image content is displayed correctly.");
teardown(aMonitor).then(finish);
});
function reloadAndPerformRequests() {
NetMonitorController.triggerActivity(ACTIVITY_TYPE.RELOAD.WITH_CACHE_ENABLED).then(() => {
aDebuggee.performRequests();
});
}
function showTooltipOn(aTooltip, aTarget) {
let deferred = promise.defer();
aTooltip.panel.addEventListener("popupshown", function onEvent() {
aTooltip.panel.removeEventListener("popupshown", onEvent, true);
deferred.resolve(aTooltip);
}, true);
aTooltip._showOnHover(aTarget);
return deferred.promise;
}
aDebuggee.performRequests();
});
}

Просмотреть файл

@ -40,6 +40,7 @@ const STATUS_CODES_SJS = EXAMPLE_URL + "sjs_status-codes-test-server.sjs";
const SORTING_SJS = EXAMPLE_URL + "sjs_sorting-test-server.sjs";
const TEST_IMAGE = EXAMPLE_URL + "test-image.png";
const TEST_IMAGE_DATA_URI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==";
// All tests are asynchronous.
waitForExplicitFinish();

Просмотреть файл

@ -32,7 +32,7 @@ const BORDER_RE = /^border(-(top|bottom|left|right))?$/ig;
const XHTML_NS = "http://www.w3.org/1999/xhtml";
const SPECTRUM_FRAME = "chrome://browser/content/devtools/spectrum-frame.xhtml";
const ESCAPE_KEYCODE = Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE;
const ENTER_KEYCODE = Ci.nsIDOMKeyEvent.DOM_VK_RETURN;
const RETURN_KEYCODE = Ci.nsIDOMKeyEvent.DOM_VK_RETURN;
const POPUP_EVENTS = ["shown", "hidden", "showing", "hiding"];
/**
@ -399,12 +399,12 @@ Tooltip.prototype = {
_showOnHover: function(target) {
let res = this._targetNodeCb(target, this);
let show = arg => this.show(arg instanceof Ci.nsIDOMNode ? arg : target);
if (res && res.then) {
res.then(() => {
this.show(target);
});
res.then(show);
} else if (res) {
this.show(target);
show(res);
}
},
@ -762,7 +762,7 @@ function SwatchBasedEditorTooltip(doc) {
// It will also close on <escape> and <enter>
this.tooltip = new Tooltip(doc, {
consumeOutsideClick: true,
closeOnKeys: [ESCAPE_KEYCODE, ENTER_KEYCODE],
closeOnKeys: [ESCAPE_KEYCODE, RETURN_KEYCODE],
noAutoFocus: false
});
@ -771,7 +771,7 @@ function SwatchBasedEditorTooltip(doc) {
this._onTooltipKeypress = (event, code) => {
if (code === ESCAPE_KEYCODE) {
this.revert();
} else if (code === ENTER_KEYCODE) {
} else if (code === RETURN_KEYCODE) {
this.commit();
}
};

Просмотреть файл

@ -512,7 +512,6 @@ VariablesView.prototype = {
_onSearchboxKeyPress: function(e) {
switch(e.keyCode) {
case e.DOM_VK_RETURN:
case e.DOM_VK_ENTER:
this._onSearchboxInput();
return;
case e.DOM_VK_ESCAPE:
@ -861,7 +860,6 @@ VariablesView.prototype = {
return;
case e.DOM_VK_RETURN:
case e.DOM_VK_ENTER:
// Start editing the value or name of the Variable or Property.
if (item instanceof Variable) {
if (e.metaKey || e.altKey || e.shiftKey) {
@ -3941,7 +3939,6 @@ Editable.prototype = {
this._next();
break;
case e.DOM_VK_RETURN:
case e.DOM_VK_ENTER:
this._save();
break;
case e.DOM_VK_ESCAPE:

Просмотреть файл

@ -769,6 +769,13 @@ this.WidgetMethods = {
this.ensureItemIsVisible(this.getItemAtIndex(aIndex));
},
/**
* Sugar for ensuring the selected item is visible in this container.
*/
ensureSelectedItemIsVisible: function() {
this.ensureItemIsVisible(this.selectedItem);
},
/**
* If supported by the widget, the label string temporarily added to this
* container when there are no child items present.
@ -896,6 +903,9 @@ this.WidgetMethods = {
} else if (selectedIndex == j) {
this._widget.selectedItem = aSecond._target;
}
// 6. Let the outside world know that these two items were swapped.
ViewHelpers.dispatchEvent(aFirst.target, "swap", [aSecond, aFirst]);
},
/**

Просмотреть файл

@ -172,7 +172,6 @@ function onEditorKeypress(ed, event) {
case event.DOM_VK_END:
case event.DOM_VK_BACK_SPACE:
case event.DOM_VK_DELETE:
case event.DOM_VK_ENTER:
case event.DOM_VK_RETURN:
private.doNotAutocomplete = true;
private.popup.hidePopup();

Просмотреть файл

@ -180,12 +180,12 @@ function testPressingEnterCommitsChanges() {
cPicker.tooltip.once("hidden", () => {
is(contentWin.getComputedStyle(contentDoc.body).borderLeftColor,
"rgba(0, 255, 0, 0.5)", "The element's border was kept after ENTER");
"rgba(0, 255, 0, 0.5)", "The element's border was kept after RETURN");
is(swatch.style.backgroundColor, "rgba(0, 255, 0, 0.5)",
"The color swatch's background was kept after ENTER");
"The color swatch's background was kept after RETURN");
is(getRuleViewProperty("border").valueSpan.textContent,
"2em solid rgba(0, 255, 0, 0.5)",
"The text of the border css property was kept after ENTER");
"The text of the border css property was kept after RETURN");
endTests();
});

Просмотреть файл

@ -25,7 +25,7 @@ function testCompletion(hud) {
EventUtils.synthesizeKey(";", {});
is(input.value, "var d = 5;", "var d = 5;");
is(jsterm.completeNode.value, "", "no completion");
EventUtils.synthesizeKey("VK_ENTER", {});
EventUtils.synthesizeKey("VK_RETURN", {});
is(jsterm.completeNode.value, "", "clear completion on execute()");
// Test typing 'var a = d' and press RETURN
@ -33,7 +33,7 @@ function testCompletion(hud) {
EventUtils.synthesizeKey("d", {});
is(input.value, "var a = d", "var a = d");
is(jsterm.completeNode.value, "", "no completion");
EventUtils.synthesizeKey("VK_ENTER", {});
EventUtils.synthesizeKey("VK_RETURN", {});
is(jsterm.completeNode.value, "", "clear completion on execute()");
jsterm = input = null;

Просмотреть файл

@ -750,10 +750,10 @@ function updateVariablesViewProperty(aOptions)
switch (aOptions.field) {
case "name":
EventUtils.synthesizeKey("VK_ENTER", { shiftKey: true }, view.window);
EventUtils.synthesizeKey("VK_RETURN", { shiftKey: true }, view.window);
break;
case "value":
EventUtils.synthesizeKey("VK_ENTER", {}, view.window);
EventUtils.synthesizeKey("VK_RETURN", {}, view.window);
break;
default:
throw new Error("options.field is incorrect");
@ -771,7 +771,7 @@ function updateVariablesViewProperty(aOptions)
aOptions.webconsole.jsterm.once("variablesview-fetched", aOptions.callback);
}
EventUtils.synthesizeKey("VK_ENTER", {}, view.window);
EventUtils.synthesizeKey("VK_RETURN", {}, view.window);
if (!aOptions.webconsole) {
executeSoon(aOptions.callback);

Просмотреть файл

@ -583,6 +583,11 @@
@BINPATH@/components/MozKeyboard.js
@BINPATH@/components/InputMethod.manifest
#ifdef MOZ_DEBUG
@BINPATH@/components/TestInterfaceJS.js
@BINPATH@/components/TestInterfaceJS.manifest
#endif
; Modules
@BINPATH@/browser/modules/*
@BINPATH@/modules/*

Просмотреть файл

@ -614,7 +614,6 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY findAgainCmd.accesskey "g">
<!ENTITY findAgainCmd.commandkey "g">
<!ENTITY findAgainCmd.commandkey2 "VK_F3">
<!ENTITY findSelectionCmd.commandkey "e">
<!ENTITY spellAddDictionaries.label "Add Dictionaries…">
<!ENTITY spellAddDictionaries.accesskey "A">

Просмотреть файл

@ -30,8 +30,6 @@ var APZCObserver = {
let os = Services.obs;
os.addObserver(this, "apzc-transform-begin", false);
// Fired by ContentAreaObserver
window.addEventListener("SizeChanged", this, true);
Elements.tabList.addEventListener("TabSelect", this, true);
Elements.browsers.addEventListener("pageshow", this, true);
messageManager.addMessageListener("Content:ZoomToRect", this);
@ -45,7 +43,6 @@ var APZCObserver = {
let os = Services.obs;
os.removeObserver(this, "apzc-transform-begin");
window.removeEventListener("SizeChanged", this, true);
Elements.tabList.removeEventListener("TabSelect", this, true);
Elements.browsers.removeEventListener("pageshow", this, true);
messageManager.removeMessageListener("Content:ZoomToRect", this);
@ -53,7 +50,6 @@ var APZCObserver = {
handleEvent: function APZC_handleEvent(aEvent) {
switch (aEvent.type) {
case "SizeChanged":
case 'TabSelect':
this._resetDisplayPort();
break;

Просмотреть файл

@ -1386,6 +1386,4 @@ Desktop browser's sync prefs.
</vbox>
</box>
</stack>
<!-- XXX: Expose feedback string to SettingsCharm.js -->
<label value="&helpFeedbackPage.label;" id="feedback-label" href="https://input.mozilla.org/feedback/metrofirefox" hidden="true"/>
</window>

Просмотреть файл

@ -54,11 +54,9 @@ var SettingsCharm = {
// Feedback
this.addEntry({
// feedbackLabel is a temporary measure to expose this string
// from the baseMenuOverlay.dtd
label: Elements.feedbackLabel.value,
label: Strings.browser.GetStringFromName("feedbackCharm"),
onselected: function() {
let url = Elements.feedbackLabel.getAttribute("href");
let url = Services.urlFormatter.formatURLPref("app.support.inputURL");
BrowserUI.addAndShowTab(url, Browser.selectedTab);
}
});

Просмотреть файл

@ -46,6 +46,7 @@ clearPrivateData.message3=This will permanently delete the private data you have
aboutCharm1=About
optionsCharm=Options
searchCharm=Search
feedbackCharm=Feedback (online)
helpOnlineCharm=Help (online)
# General

Просмотреть файл

@ -39,8 +39,6 @@
@AB_CD@.jar:
relativesrcdir browser/locales:
locale/browser/syncBrand.dtd (%chrome/browser/syncBrand.dtd)
# Temporary hack to provide a 'feedback' string
locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd)
locale/browser/netError.dtd (%chrome/overrides/netError.dtd)
% override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd
locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties)

Просмотреть файл

@ -434,6 +434,7 @@ pref("breakpad.reportURL", "https://crash-stats.mozilla.com/report/index/");
// TODO: This is not the correct article for metro!!!
pref("app.sync.tutorialURL", "https://support.mozilla.org/kb/sync-firefox-between-desktop-and-mobile");
pref("app.support.baseURL", "https://support.mozilla.org/1/touch/%VERSION%/%OS%/%LOCALE%/");
pref("app.support.inputURL", "https://input.mozilla.org/feedback/metrofirefox");
pref("app.privacyURL", "http://www.mozilla.org/%LOCALE%/legal/privacy/firefox.html");
pref("app.creditsURL", "http://www.mozilla.org/credits/");
pref("app.channelURL", "http://www.mozilla.org/%LOCALE%/firefox/channel/");

Просмотреть файл

@ -459,7 +459,7 @@ function triggerSecondaryCommand(popup, index) {
EventUtils.synthesizeKey("VK_DOWN", {});
// Activate
EventUtils.synthesizeKey("VK_ENTER", {});
EventUtils.synthesizeKey("VK_RETURN", {});
}, false);
// One down event to open the popup

Просмотреть файл

@ -1176,6 +1176,7 @@ toolbar .toolbarbutton-1:not([type="menu-button"]),
-moz-image-region: rect(0px, 192px, 32px, 160px);
}
#PanelUI-fxa-status > .toolbarbutton-icon,
#PanelUI-quit > .toolbarbutton-icon,
#PanelUI-customize > .toolbarbutton-icon,
#PanelUI-help > .toolbarbutton-icon {

Просмотреть файл

@ -83,6 +83,10 @@
-moz-appearance: none;
}
.customizationmode-button[disabled="true"] {
opacity: .5;
}
#customization-titlebar-visibility-button {
list-style-image: url("chrome://browser/skin/customizableui/customize-titleBar-toggle.png");
-moz-image-region: rect(0, 24px, 24px, 0);
@ -104,7 +108,7 @@
inset 0 1px rgb(196, 196, 196);
}
#customization-undo-reset {
#customization-undo-reset-button {
-moz-margin-end: 10px;
}

Просмотреть файл

@ -126,11 +126,31 @@
font-weight: 600;
}
.requests-menu-file {
.requests-menu-icon-and-file {
width: 20vw;
min-width: 4em;
}
.requests-menu-icon {
background: #fff;
width: calc(1em + 4px);
height: calc(1em + 4px);
margin: -4px 0px;
-moz-margin-end: 4px;
}
.theme-dark .requests-menu-icon {
outline: 1px solid @table_itemDarkStartBorder@;
}
.theme-light .requests-menu-icon {
outline: 1px solid @table_itemLightStartBorder@;
}
.requests-menu-file {
text-align: start;
}
.requests-menu-domain {
width: 14vw;
min-width: 10em;
@ -288,8 +308,6 @@ box.requests-menu-status {
-moz-padding-end: 4px;
background-repeat: repeat-y; /* Background created on a <canvas> in js. */
background-position: -1px center;
margin-top: -1px; /* Compensate borders. */
margin-bottom: -1px;
}
.requests-menu-subitem.requests-menu-waterfall:-moz-locale-dir(rtl) {
@ -771,7 +789,10 @@ box.requests-menu-status {
width: 16vw;
}
.requests-menu-file,
.requests-menu-icon-and-file {
width: 30vw;
}
.requests-menu-domain {
width: 30vw;
}
@ -797,7 +818,7 @@ box.requests-menu-status {
right border and box-shadow of "Domain" column should be hidden. */
}
#network-table[domain-overflows] .requests-menu-file {
#network-table[domain-overflows] .requests-menu-icon-and-file {
border-width: 0 !important;
box-shadow: none !important;
/* The "Domain" header is not visible anymore, and thus the

Просмотреть файл

@ -176,8 +176,14 @@ Files referenced by manifests are automatically installed into the object
directory into paths defined in
:py:func:`mozbuild.frontend.emitter.TreeMetadataEmitter._process_test_manifest`.
Referenced files in the manifest not in the same directory tree as the manifest
file are **not** installed.
Relative paths resolving to parent directory (e.g.
``support-files = ../foo.txt`` have special behavior.
For ``support-files``, the file will be installed to the default destination
for that manifest. Only the file's base name is used to construct the final
path: directories are irrelevant.
For all other entry types, the file installation is skipped.
.. _reftest_manifests:

Просмотреть файл

@ -2364,8 +2364,8 @@ Element::PostHandleEventForLinks(nsEventChainPostVisitor& aVisitor)
if (shell) {
// single-click
nsEventStatus status = nsEventStatus_eIgnore;
InternalUIEvent actEvent(mouseEvent->mFlags.mIsTrusted,
NS_UI_ACTIVATE, 1);
InternalUIEvent actEvent(mouseEvent->mFlags.mIsTrusted, NS_UI_ACTIVATE);
actEvent.detail = 1;
rv = shell->HandleDOMEventWithTarget(this, &actEvent, &status);
if (NS_SUCCEEDED(rv)) {

Просмотреть файл

@ -115,6 +115,7 @@ support-files =
file_report_uri_missing_in_report_only_header.html^headers^
[test_CSP.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_CSP_bug663567.html]
[test_CSP_bug802872.html]
[test_CSP_bug885433.html]
@ -122,13 +123,17 @@ support-files =
[test_CSP_bug916446.html]
[test_CSP_evalscript.html]
[test_CSP_evalscript_getCRMFRequest.html]
skip-if = toolkit == 'android' #bug 824652
[test_CSP_frameancestors.html]
skip-if = toolkit == 'android'
[test_CSP_inlinescript.html]
skip-if = toolkit == 'android'
[test_CSP_inlinestyle.html]
[test_bothCSPheaders.html]
[test_bug836922_npolicies.html]
[test_bug886164.html]
[test_csp_redirects.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_CSP_bug910139.html]
[test_CSP_bug909029.html]
[test_policyuri_regression_from_multipolicy.html]

Просмотреть файл

@ -226,8 +226,11 @@ support-files =
wholeTexty-helper.xml
[test_CrossSiteXHR.html]
skip-if = toolkit == 'android'
[test_CrossSiteXHR_cache.html]
skip-if = toolkit == 'android'
[test_CrossSiteXHR_origin.html]
skip-if = toolkit == 'android'
[test_DOMException.html]
[test_EventSource_redirects.html]
[test_NodeIterator_basics_filters.xhtml]
@ -247,6 +250,7 @@ support-files =
[test_base.xhtml]
[test_blobconstructor.html]
[test_bug166235.html]
skip-if = toolkit == 'android'
[test_bug199959.html]
[test_bug218236.html]
[test_bug218277.html]
@ -272,6 +276,7 @@ support-files =
[test_bug337631.html]
[test_bug338541.xhtml]
[test_bug338583.html]
skip-if = toolkit == 'android'
[test_bug338679.html]
[test_bug339494.html]
[test_bug339494.xhtml]
@ -379,6 +384,7 @@ support-files =
[test_bug461735.html]
[test_bug465767.html]
[test_bug466080.html]
skip-if = toolkit == 'android'
[test_bug466409.html]
[test_bug466751.xhtml]
[test_bug469020.html]
@ -386,7 +392,9 @@ support-files =
[test_bug473162-1.html]
[test_bug473162-2.html]
[test_bug475156.html]
skip-if = toolkit == 'android' #bug 855762
[test_bug482935.html]
skip-if = toolkit == 'android' #bug 855762
[test_bug484396.html]
[test_bug493881.html]
[test_bug493881.js]
@ -397,8 +405,11 @@ support-files =
[test_bug499656.xhtml]
[test_bug500937.html]
[test_bug503481.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug503481b.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug505783.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug51034.html]
[test_bug513194.html]
[test_bug5141.html]
@ -431,6 +442,7 @@ support-files =
[test_bug587931.html]
[test_bug588990.html]
[test_bug590812.html]
skip-if = toolkit == 'android' #bug 687032
[test_bug590870.html]
[test_bug592366.html]
[test_bug592829.html]
@ -509,6 +521,7 @@ support-files =
[test_bug819051.html]
[test_bug820909.html]
[test_bug827160.html]
skip-if = toolkit == 'android' #needs plugin support
[test_bug840098.html]
[test_bug868999.html]
[test_bug869000.html]
@ -526,7 +539,9 @@ support-files =
[test_caretPositionFromPoint.html]
[test_classList.html]
[test_copypaste.html]
skip-if = toolkit == 'android' #bug 904183
[test_copypaste.xhtml]
skip-if = toolkit == 'android' #bug 904183
[test_createHTMLDocument.html]
[test_declare_stylesheet_obsolete.html]
[test_domparser_null_char.html]
@ -534,6 +549,7 @@ support-files =
[test_elementTraversal.html]
[test_fileapi.html]
[test_fileapi_slice.html]
skip-if = toolkit == 'android' #bug 775227
[test_getElementById.html]
[test_html_colors_quirks.html]
[test_html_colors_standards.html]
@ -549,17 +565,26 @@ support-files =
[test_meta_viewport5.html]
[test_meta_viewport6.html]
[test_mixed_content_blocker.html]
skip-if = toolkit == 'android' #TIMED_OUT, SSL_REQUIRED
[test_mixed_content_blocker_bug803225.html]
skip-if = toolkit == 'android' #TIMED_OUT, SSL_REQUIRED
[test_mixed_content_blocker_frameNavigation.html]
skip-if = toolkit == 'android' #TIMED_OUT, SSL_REQUIRED
[test_mozfiledataurl.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_mutationobservers.html]
[test_nodelist_holes.html]
[test_object.html]
skip-if = toolkit == 'android'
[test_plugin_freezing.html]
skip-if = toolkit == 'android' #CLICK_TO_PLAY
[test_processing_instruction_update_stylesheet.xhtml]
[test_range_bounds.html]
skip-if = toolkit == 'android'
[test_reentrant_flush.html]
skip-if = toolkit == 'android' #RANDOM
[test_sync_xhr_timer.xhtml]
skip-if = toolkit == 'android' #RANDOM
[test_text_wholeText.html]
[test_textnode_normalize_in_selection.html]
[test_textnode_split_in_selection.html]
@ -570,13 +595,19 @@ support-files =
[test_w3element_traversal.xhtml]
[test_w3element_traversal_svg.html]
[test_websocket.html]
skip-if = toolkit == 'android'
[test_websocket_basic.html]
skip-if = toolkit == 'android'
[test_websocket_hello.html]
skip-if = toolkit == 'android'
[test_x-frame-options.html]
skip-if = toolkit == 'android'
[test_xbl_userdata.xhtml]
[test_xhr_abort_after_load.html]
skip-if = toolkit == 'android'
[test_xhr_forbidden_headers.html]
[test_xhr_progressevents.html]
skip-if = toolkit == 'android'
[test_xhr_send_readystate.html]
[test_xhr_withCredentials.html]
[test_file_from_blob.html]

Просмотреть файл

@ -4,6 +4,10 @@ support-files =
file_check-binary-messages_wsh.py
[test_receive-arraybuffer.html]
skip-if = toolkit == 'android'
[test_receive-blob.html]
skip-if = toolkit == 'android'
[test_send-arraybuffer.html]
skip-if = toolkit == 'android'
[test_send-blob.html]
skip-if = toolkit == 'android'

Просмотреть файл

@ -280,6 +280,17 @@ WebGLContext::DestroyResourcesAndContext()
gl->fDeleteBuffers(1, &mFakeVertexAttrib0BufferObject);
}
// disable all extensions except "WEBGL_lose_context". see bug #927969
// spec: http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
for (size_t i = 0; i < size_t(WebGLExtensionID_max); ++i) {
WebGLExtensionID extension = WebGLExtensionID(i);
if (!IsExtensionEnabled(extension) || (extension == WEBGL_lose_context))
continue;
mExtensions[extension] = nullptr;
}
// We just got rid of everything, so the context had better
// have been going away.
#ifdef DEBUG

Просмотреть файл

@ -1975,6 +1975,7 @@ WebGLContext::Hint(GLenum target, GLenum mode)
if (!isValid)
return ErrorInvalidEnum("hint: invalid hint");
MakeContextCurrent();
gl->fHint(target, mode);
}
@ -3380,6 +3381,7 @@ WebGLContext::CompressedTexImage2D(GLenum target, GLint level, GLenum internalfo
return;
}
MakeContextCurrent();
gl->fCompressedTexImage2D(target, level, internalformat, width, height, border, byteLength, view.Data());
tex->SetImageInfo(target, level, width, height, internalformat, LOCAL_GL_UNSIGNED_BYTE,
WebGLImageDataStatus::InitializedImageData);
@ -3484,6 +3486,7 @@ WebGLContext::CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
tex->DoDeferredImageInitialization(target, level);
}
MakeContextCurrent();
gl->fCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, byteLength, view.Data());
return;

Просмотреть файл

@ -229,8 +229,11 @@ HTMLButtonElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
if (aVisitor.mEventStatus != nsEventStatus_eConsumeNoDefault) {
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent && mouseEvent->IsLeftClickEvent()) {
// XXX Activating actually occurs even if it's caused by untrusted event.
// Therefore, shouldn't this be always trusted event?
InternalUIEvent actEvent(aVisitor.mEvent->mFlags.mIsTrusted,
NS_UI_ACTIVATE, 1);
NS_UI_ACTIVATE);
actEvent.detail = 1;
nsCOMPtr<nsIPresShell> shell = aVisitor.mPresContext->GetPresShell();
if (shell) {

Просмотреть файл

@ -3760,8 +3760,11 @@ HTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent && mouseEvent->IsLeftClickEvent() &&
!ShouldPreventDOMActivateDispatch(aVisitor.mEvent->originalTarget)) {
// XXX Activating actually occurs even if it's caused by untrusted event.
// Therefore, shouldn't this be always trusted event?
InternalUIEvent actEvent(aVisitor.mEvent->mFlags.mIsTrusted,
NS_UI_ACTIVATE, 1);
NS_UI_ACTIVATE);
actEvent.detail = 1;
nsCOMPtr<nsIPresShell> shell = aVisitor.mPresContext->GetPresShell();
if (shell) {
@ -3993,8 +3996,7 @@ HTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
*/
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
(keyEvent->keyCode == NS_VK_RETURN ||
keyEvent->keyCode == NS_VK_ENTER) &&
keyEvent->keyCode == NS_VK_RETURN &&
(IsSingleLineTextControl(false, mType) ||
mType == NS_FORM_INPUT_NUMBER ||
IsExperimentalMobileType(mType))) {
@ -6909,17 +6911,12 @@ HTMLInputElement::IsValidEmailAddress(const nsAString& aValue)
uint32_t atPos;
nsAutoCString value;
// This call also checks whether aValue contains a correctly-placed '@' sign.
if (!PunycodeEncodeEmailAddress(aValue, value, &atPos)) {
return false;
}
uint32_t length = value.Length();
// Email addresses must contain a '@', but can't begin or end with it.
if (atPos == (uint32_t)kNotFound || atPos == 0 || atPos == length - 1) {
return false;
}
uint32_t i = 0;
// Parsing the username.

Просмотреть файл

@ -99,7 +99,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=722599
for (var i = 0; i < textInputTypes.length; ++i) {
input = document.getElementById("input_" + textInputTypes[i]);
input.focus();
synthesizeKey("VK_ENTER", {});
synthesizeKey("VK_RETURN", {});
is(textInputChange[i], 0, "Change event shouldn't be dispatched on " + textInputTypes[i] + " input element");
synthesizeKey("m", {});

Просмотреть файл

@ -77,7 +77,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=851780
for (var i = 0; i < textTypes.length; ++i) {
input = document.getElementById("input_" + textTypes[i]);
input.focus();
synthesizeKey("VK_ENTER", {});
synthesizeKey("VK_RETURN", {});
is(textInput[i], 0, "input event shouldn't be dispatched on " + textTypes[i] + " input element");
synthesizeKey("m", {});

Просмотреть файл

@ -171,6 +171,7 @@ support-files =
[test_bug182279.html]
[test_bug2082.html]
[test_bug209275.xhtml]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug237071.html]
[test_bug242709.html]
[test_bug24958.html]
@ -237,8 +238,10 @@ support-files =
[test_bug458037.xhtml]
[test_bug460568.html]
[test_bug481335.xhtml]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug500885.html]
[test_bug514856.html]
skip-if = toolkit == 'android'
[test_bug518122.html]
[test_bug519987.html]
[test_bug523771.html]
@ -254,6 +257,7 @@ support-files =
[test_bug556645.html]
[test_bug557087-1.html]
[test_bug557087-2.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug557087-3.html]
[test_bug557087-4.html]
[test_bug557087-5.html]
@ -306,11 +310,13 @@ support-files =
[test_bug610687.html]
[test_bug611189.html]
[test_bug612730.html]
skip-if = toolkit == 'android'
[test_bug613113.html]
[test_bug613722.html]
[test_bug613979.html]
[test_bug615595.html]
[test_bug615833.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug617528.html]
[test_bug618948.html]
[test_bug619278.html]
@ -387,18 +393,23 @@ support-files =
[test_embed_attributes_reflection.html]
[test_formData.html]
[test_formSubmission.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_formSubmission2.html]
skip-if = toolkit == 'android'
[test_formelements.html]
[test_fullscreen-api.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_hidden.html]
[test_html_attributes_reflection.html]
[test_htmlcollection.html]
[test_iframe_sandbox_general.html]
[test_iframe_sandbox_inheritance.html]
[test_iframe_sandbox_modal.html]
skip-if = toolkit == 'android' #modal tests fail on android
[test_iframe_sandbox_navigation.html]
[test_iframe_sandbox_navigation2.html]
[test_iframe_sandbox_plugins.html]
skip-if = toolkit == 'android'
[test_iframe_sandbox_popups.html]
[test_iframe_sandbox_popups_inheritance.html]
[test_iframe_sandbox_same_origin.html]
@ -414,6 +425,7 @@ support-files =
[test_nested_invalid_fieldsets.html]
[test_object_attributes_reflection.html]
[test_object_plugin_nav.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_ol_attributes_reflection.html]
[test_option_defaultSelected.html]
[test_option_selected_state.html]
@ -429,6 +441,7 @@ support-files =
[test_ul_attributes_reflection.html]
[test_undoManager.html]
[test_video_wakelock.html]
skip-if = toolkit == 'android' #bug 871015
[test_input_files_not_nsIFile.html]
[test_ignoreuserfocus.html]
[test_fragment_form_pointer.html]

Просмотреть файл

@ -26,6 +26,7 @@ support-files =
[test_bug57600.html]
[test_bug196523.html]
[test_bug199692.html]
skip-if = toolkit == 'android' #bug 811644
[test_bug172261.html]
[test_bug255820.html]
[test_bug259332.html]
@ -36,8 +37,10 @@ support-files =
[test_bug340017.xhtml]
[test_bug359657.html]
[test_bug369370.html]
skip-if = toolkit == 'android'
[test_bug380383.html]
[test_bug391777.html]
skip-if = toolkit == 'android'
[test_bug402680.html]
[test_bug403868.html]
[test_bug403868.xhtml]
@ -50,8 +53,9 @@ skip-if = true # Disabled for timeouts.
[test_document-element-inserted.html]
[test_document.watch.html]
[test_bug445004.html]
skip-if = true # Disabled permanently (bug 559932).
skip-if = true || toolkit == 'android' # Disabled permanently (bug 559932).
[test_bug446483.html]
skip-if = toolkit == 'android'
[test_bug448564.html]
[test_bug478251.html]
[test_bug481440.html]
@ -65,6 +69,7 @@ skip-if = true # Disabled permanently (bug 559932).
[test_bug677495.html]
[test_bug677495-1.html]
[test_bug741266.html]
skip-if = toolkit == 'android'
[test_non-ascii-cookie.html]
[test_bug765780.html]
[test_bug871161.html]

Просмотреть файл

@ -79,8 +79,8 @@ TextTrackCue::TextTrackCue(nsISupports* aGlobal,
}
}
/** Save a reference to our creating document so it's available
* even when unlinked during discard/teardown.
/** Save a reference to our creating document so we don't have to
* keep getting it from our window.
*/
nsresult
TextTrackCue::StashDocument(nsISupports* aGlobal)
@ -99,7 +99,11 @@ TextTrackCue::StashDocument(nsISupports* aGlobal)
already_AddRefed<DocumentFragment>
TextTrackCue::GetCueAsHTML()
{
MOZ_ASSERT(mDocument);
// mDocument may be null during cycle collector shutdown.
// See bug 941701.
if (!mDocument) {
return nullptr;
}
if (!sParserWrapper) {
nsresult rv;

Просмотреть файл

@ -67,13 +67,19 @@ TextTrackList::AddTextTrack(TextTrackKind aKind,
const nsAString& aLanguage)
{
nsRefPtr<TextTrack> track = new TextTrack(mGlobal, this, aKind, aLabel, aLanguage);
if (mTextTracks.AppendElement(track)) {
CreateAndDispatchTrackEventRunner(track, NS_LITERAL_STRING("addtrack"));
}
AddTextTrack(track);
return track.forget();
}
void
TextTrackList::AddTextTrack(TextTrack* aTextTrack)
{
if (mTextTracks.AppendElement(aTextTrack)) {
aTextTrack->SetTextTrackList(this);
CreateAndDispatchTrackEventRunner(aTextTrack, NS_LITERAL_STRING("addtrack"));
}
}
TextTrack*
TextTrackList::GetTrackById(const nsAString& aId)
{

Просмотреть файл

@ -51,10 +51,7 @@ public:
const nsAString& aLanguage);
TextTrack* GetTrackById(const nsAString& aId);
void AddTextTrack(TextTrack* aTextTrack) {
mTextTracks.AppendElement(aTextTrack);
aTextTrack->SetTextTrackList(this);
}
void AddTextTrack(TextTrack* aTextTrack);
void RemoveTextTrack(TextTrack* aTrack);
void DidSeek();

Просмотреть файл

@ -81,7 +81,8 @@ GStreamerReader::GStreamerReader(AbstractMediaDecoder* aDecoder)
mVideoSinkBufferCount(0),
mAudioSinkBufferCount(0),
mGstThreadsMonitor("media.gst.threads"),
mReachedEos(false),
mReachedAudioEos(false),
mReachedVideoEos(false),
#if GST_VERSION_MAJOR >= 1
mConfigureAlignment(true),
#endif
@ -534,7 +535,8 @@ nsresult GStreamerReader::ResetDecode()
mVideoSinkBufferCount = 0;
mAudioSinkBufferCount = 0;
mReachedEos = false;
mReachedAudioEos = false;
mReachedVideoEos = false;
#if GST_VERSION_MAJOR >= 1
mConfigureAlignment = true;
#endif
@ -553,7 +555,7 @@ bool GStreamerReader::DecodeAudioData()
{
ReentrantMonitorAutoEnter mon(mGstThreadsMonitor);
if (mReachedEos) {
if (mReachedAudioEos && !mAudioSinkBufferCount) {
return false;
}
@ -637,7 +639,7 @@ bool GStreamerReader::DecodeVideoFrame(bool &aKeyFrameSkip,
{
ReentrantMonitorAutoEnter mon(mGstThreadsMonitor);
if (mReachedEos) {
if (mReachedVideoEos && !mVideoSinkBufferCount) {
return false;
}
@ -691,7 +693,7 @@ bool GStreamerReader::DecodeVideoFrame(bool &aKeyFrameSkip,
"frame has invalid timestamp");
timestamp = GST_TIME_AS_USECONDS(timestamp);
int64_t duration;
int64_t duration = 0;
if (GST_CLOCK_TIME_IS_VALID(GST_BUFFER_DURATION(buffer)))
duration = GST_TIME_AS_USECONDS(GST_BUFFER_DURATION(buffer));
else if (fpsNum && fpsDen)
@ -709,7 +711,7 @@ bool GStreamerReader::DecodeVideoFrame(bool &aKeyFrameSkip,
if (!buffer)
/* no more frames */
return false;
return true;
#if GST_VERSION_MAJOR >= 1
if (mConfigureAlignment && buffer->pool) {
@ -1060,16 +1062,24 @@ void GStreamerReader::NewAudioBuffer()
void GStreamerReader::EosCb(GstAppSink* aSink, gpointer aUserData)
{
GStreamerReader* reader = reinterpret_cast<GStreamerReader*>(aUserData);
reader->Eos();
reader->Eos(aSink);
}
void GStreamerReader::Eos()
void GStreamerReader::Eos(GstAppSink* aSink)
{
/* We reached the end of the stream */
{
ReentrantMonitorAutoEnter mon(mGstThreadsMonitor);
/* Potentially unblock DecodeVideoFrame and DecodeAudioData */
mReachedEos = true;
if (aSink == mVideoAppSink) {
mReachedVideoEos = true;
} else if (aSink == mAudioAppSink) {
mReachedAudioEos = true;
} else {
// Assume this is an error causing an EOS.
mReachedAudioEos = true;
mReachedVideoEos = true;
}
mon.NotifyAll();
}

Просмотреть файл

@ -154,7 +154,10 @@ private:
/* Called at end of stream, when decoding has finished */
static void EosCb(GstAppSink* aSink, gpointer aUserData);
void Eos();
/* Notifies that a sink will no longer receive any more data. If nullptr
* is passed to this, we'll assume all streams have reached EOS (for example
* an error has occurred). */
void Eos(GstAppSink* aSink = nullptr);
/* Called when an element is added inside playbin. We use it to find the
* decodebin instance.
@ -221,7 +224,8 @@ private:
/* bool used to signal when gst has detected the end of stream and
* DecodeAudioData and DecodeVideoFrame should not expect any more data
*/
bool mReachedEos;
bool mReachedAudioEos;
bool mReachedVideoEos;
#if GST_VERSION_MAJOR >= 1
bool mConfigureAlignment;
#endif

Просмотреть файл

@ -23,7 +23,7 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
var trackList = video.textTracks;
is(trackList.length, 0, "Length should be 0.");
var evtTextTrack, numOfCalls = 0;
var evtTextTrack, numOfCalls = 0, tt;
trackList.onaddtrack = function(event) {
ok(event instanceof TrackEvent, "Fired event from onaddtrack should be a TrackEvent");
is(event.type, "addtrack", "Event type should be addtrack");
@ -32,26 +32,37 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
ok(!event.cancelable, "Event shouldn't be cancelable!");
evtTextTrack = event.track;
ok(textTrack[numOfCalls] === evtTextTrack, "Text tracks should be the same");
tt = textTrack[numOfCalls].track || textTrack[numOfCalls];
ok(tt === evtTextTrack, "Text tracks should be the same");
is(evtTextTrack.label, label[numOfCalls], "Label should be set to "+ label[numOfCalls]);
is(evtTextTrack.language, language[numOfCalls], "Language should be " + language[numOfCalls]);
is(evtTextTrack.kind, kind[numOfCalls], "Kind should be " + kind[numOfCalls]);
if (++numOfCalls == 3) {
if (++numOfCalls == 4) {
SimpleTest.finish();
}
};
var label = ["Oasis", "Coldplay", "t.A.T.u"];
language = ["en-CA", "en-GB", "ru" ];
kind = ["subtitles", "captions", "chapters"];
var label = ["Oasis", "Coldplay", "t.A.T.u", ""];
language = ["en-CA", "en-GB", "ru", ""];
kind = ["subtitles", "captions", "chapters", "subtitles"];
var textTrack = new Array(3);
var textTrack = new Array(4);
for (var i = 0; i < 3; ++i) {
textTrack[i] = video.addTextTrack(kind[i], label[i], language[i]);
is(trackList.length, i + 1, "Length should be " + (i+1));
}
video.src = "seek.webm";
video.preload = "auto";
var trackElement = document.createElement("track");
trackElement.src = "basic.vtt";
textTrack[3] = trackElement;
document.getElementById("content").appendChild(video);
video.appendChild(trackElement);
//TODO: Tests for removetrack event to be added along with bug 882677
}
);

Просмотреть файл

@ -8,6 +8,7 @@ support-files =
[test_audio_capture_error.html]
[test_call_start_from_end_handler.html]
[test_nested_eventloop.html]
skip-if = toolkit == 'android'
[test_preference_enable.html]
[test_recognition_service_error.html]
[test_success_without_recognition_service.html]

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше