MozReview-Commit-ID: KlkboTscjR5
This commit is contained in:
Wes Kocher 2016-04-18 15:14:45 -07:00
Родитель 32bc4f6864 c4afaf3404
Коммит 37ca6a6eeb
32 изменённых файлов: 201 добавлений и 118 удалений

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

@ -29,8 +29,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry",
"resource://gre/modules/UITelemetry.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
"resource:///modules/BrowserUITelemetry.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Metrics",
"resource://gre/modules/Metrics.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",

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

@ -33,8 +33,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "TelemetryUtils",
"resource://gre/modules/TelemetryUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
"resource://services-common/utils.js");
XPCOMUtils.defineLazyModuleGetter(this, "Metrics",
"resource://gre/modules/Metrics.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter",
"@mozilla.org/xre/app-info;1",

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

@ -62,6 +62,10 @@ STUB_HOOK = $(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)'; \
endif
SEARCHPLUGINS_NAMES = $(shell cat $(call MERGE_FILE,/searchplugins/list.txt)) ddg
ifeq (,$(filter-out en-US ru be kk tr uk zh-CN zh-TW,$(AB_CD)))
SEARCHPLUGINS_NAMES := $(subst google,google:hidden,$(SEARCHPLUGINS_NAMES))
SEARCHPLUGINS_NAMES += google-nocodes
endif
SEARCHPLUGINS_FILENAMES = $(subst :hidden,,$(SEARCHPLUGINS_NAMES))
SEARCHPLUGINS_PATH := .deps/generated_$(AB_CD)
SEARCHPLUGINS_TARGET := libs searchplugins

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

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

@ -12,5 +12,7 @@
<Param name="q" value="{searchTerms}"/>
<Param name="ie" value="utf-8"/>
<Param name="oe" value="utf-8"/>
<Param name="client" value="firefox-b"/>
<MozParam name="client" condition="purpose" purpose="keyword" value="firefox-b-ab"/>
</Url>
</SearchPlugin>

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

@ -1959,7 +1959,12 @@ notification.pluginVulnerable > .notification-inner > .messageCloseButton:not(:h
width: 16px;
}
/**
* Override the --panel-arrowcontent-padding so the background extends
* to the sides and bottom of the panel.
*/
#UITourTooltipButtons {
margin-left: -10px;
margin-bottom: -10px;
}

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

@ -27,21 +27,16 @@
#UITourTooltipBody {
-moz-margin-end: 14px;
}
#UITourTooltipBody > vbox {
padding-top: 4px;
}
#UITourTooltipIconContainer {
-moz-margin-start: -16px;
-moz-margin-start: 14px;
margin-top: -16px;
margin-bottom: 8px;
}
#UITourTooltipIcon {
width: 48px;
height: 48px;
-moz-margin-start: 28px;
-moz-margin-end: 28px;
-moz-margin-start: 14px;
-moz-margin-end: 14px;
}
#UITourTooltipTitle,
@ -53,8 +48,10 @@
font-size: 1.45rem;
font-weight: bold;
-moz-margin-start: 0;
-moz-margin-end: 0;
margin: 0 0 9px 0;
/* Avoid the title overlapping the close button */
-moz-margin-end: 14px;
margin-top: 0;
margin-bottom: 9px;
}
#UITourTooltipDescription {
@ -66,6 +63,7 @@
}
#UITourTooltipClose {
position: relative;
-moz-appearance: none;
border: none;
background-color: transparent;
@ -82,7 +80,7 @@
-moz-box-pack: end;
background-color: hsla(210,4%,10%,.07);
border-top: 1px solid hsla(210,4%,10%,.14);
margin: 24px -16px -16px;
margin: 10px -16px -16px;
padding: 2em 15px;
}

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

@ -264,17 +264,31 @@ var openNewTabAndToolbox = Task.async(function*(url, toolId, hostType) {
return openToolboxForTab(tab, toolId, hostType)
});
/**
* Close a tab and if necessary, the toolbox that belongs to it
* @param {Tab} tab The tab to close.
* @return {Promise} Resolves when the toolbox and tab have been destroyed and
* closed.
*/
var closeTabAndToolbox = Task.async(function*(tab = gBrowser.selectedTab) {
let target = TargetFactory.forTab(gBrowser.selectedTab);
if (target) {
yield gDevTools.closeToolbox(target);
}
yield removeTab(gBrowser.selectedTab);
});
/**
* Close a toolbox and the current tab.
* @param {Toolbox} toolbox The toolbox to close.
* @return {Promise} Resolves when the toolbox and tab have been destroyed and
* closed.
*/
function closeToolboxAndTab(toolbox) {
return toolbox.destroy().then(function() {
gBrowser.removeCurrentTab();
});
}
var closeToolboxAndTab = Task.async(function*(toolbox) {
yield toolbox.destroy();
yield removeTab(gBrowser.selectedTab);
});
/**
* Waits until a predicate returns true.

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

@ -36,7 +36,7 @@ function* testClickOnSelectorEditorInput(view) {
info("Click inside the editor input");
let onClick = once(editorInput, "click");
EventUtils.synthesizeMouse(editor.input, 1, 1, {}, view.styleWindow);
EventUtils.synthesizeMouse(editor.input, 2, 1, {}, view.styleWindow);
yield onClick;
is(editor.input, view.styleDocument.activeElement,
"The editor input should still be focused");
@ -44,7 +44,7 @@ function* testClickOnSelectorEditorInput(view) {
info("Doubleclick inside the editor input");
let onDoubleClick = once(editorInput, "dblclick");
EventUtils.synthesizeMouse(editor.input, 1, 1, { clickCount: 2 },
EventUtils.synthesizeMouse(editor.input, 2, 1, { clickCount: 2 },
view.styleWindow);
yield onDoubleClick;
is(editor.input, view.styleDocument.activeElement,

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

@ -130,7 +130,7 @@ module.exports = createClass({
),
dom.div({
className: "h-split-box-splitter",
className: "devtools-side-splitter",
onMouseDown: this._onMouseDown,
}),

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

@ -9,6 +9,7 @@ Basic tests for the HSplitBox component.
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript "src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<link rel="stylesheet" href="chrome://devtools/skin/splitters.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/skin/components-h-split-box.css" type="text/css"/>
<style>
html {
@ -77,7 +78,7 @@ window.onload = Task.async(function* () {
// Send a mouse down on the splitter, and then move the mouse a couple
// times. Now we should get resizes.
const splitter = document.querySelector(".h-split-box-splitter");
const splitter = document.querySelector(".devtools-side-splitter");
ok(splitter, "Should get our splitter");
synthesizeMouseAtCenter(splitter, { button: 0, type: "mousedown" }, window);

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

@ -1680,7 +1680,7 @@ EditableFieldsEngine.prototype = {
return;
}
target.scrollIntoView();
target.scrollIntoView(false);
target.focus();
if (!target.matches(this.selectors.join(","))) {

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

@ -843,7 +843,7 @@ function waitForContextMenu(popup, button, onShown, onHidden) {
info("wait for the context menu to open");
button.scrollIntoView();
let eventDetails = {type: "contextmenu", button: 2};
EventUtils.synthesizeMouse(button, 2, 2, eventDetails,
EventUtils.synthesizeMouse(button, 5, 2, eventDetails,
button.ownerDocument.defaultView);
return deferred.promise;
}

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

@ -22,10 +22,3 @@
flex-direction: row;
flex: 1;
}
.h-split-box-splitter {
-moz-border-end: 1px solid var(--theme-splitter-color);
cursor: ew-resize;
width: 3px;
-moz-margin-start: -3px;
}

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

@ -2,7 +2,24 @@
* 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/. */
/* This file is loaded by both browser.xul and toolbox.xul. Therefore, rules
defined here can not rely on toolbox.xul variables. */
/* Splitters */
:root {
/* Define the widths of the draggable areas on each side of a splitter. top
and bottom widths are used for horizontal splitters, inline-start and
inline-end for side splitters.*/
--devtools-splitter-top-width: 2px;
--devtools-splitter-bottom-width: 2px;
/* Small draggable area on inline-start to avoid overlaps on scrollbars.*/
--devtools-splitter-inline-start-width: 1px;
--devtools-splitter-inline-end-width: 4px;
}
:root[devtoolstheme="light"] {
/* These variables are used in browser.xul but inside the toolbox they are overridden by --theme-splitter-color */
--devtools-splitter-color: #dde1e4;
@ -12,28 +29,47 @@
--devtools-splitter-color: #42484f;
}
.devtools-horizontal-splitter {
-moz-appearance: none;
background-image: none;
background-color: transparent;
border: 0;
border-bottom: 1px solid var(--devtools-splitter-color);
min-height: 3px;
height: 3px;
margin-top: -3px;
position: relative;
}
.devtools-horizontal-splitter,
.devtools-side-splitter {
-moz-appearance: none;
background-image: none;
background-color: transparent;
border: 0;
-moz-border-end: 1px solid var(--devtools-splitter-color);
min-width: 3px;
width: 3px;
-moz-margin-start: -3px;
border-style: solid;
border-color: transparent;
background-color: var(--devtools-splitter-color);
background-clip: content-box;
position: relative;
box-sizing: border-box;
/* Positive z-index positions the splitter on top of its siblings and makes
it clickable on both sides. */
z-index: 1;
}
.devtools-horizontal-splitter {
min-height: calc(var(--devtools-splitter-top-width) +
var(--devtools-splitter-bottom-width) + 1px);
border-top-width: var(--devtools-splitter-top-width);
border-bottom-width: var(--devtools-splitter-bottom-width);
margin-top: calc(-1 * var(--devtools-splitter-top-width) - 1px);
margin-bottom: calc(-1 * var(--devtools-splitter-bottom-width));
cursor: n-resize;
}
.devtools-side-splitter {
min-width: calc(var(--devtools-splitter-inline-start-width) +
var(--devtools-splitter-inline-end-width) + 1px);
border-inline-start-width: var(--devtools-splitter-inline-start-width);
border-inline-end-width: var(--devtools-splitter-inline-end-width);
margin-inline-start: calc(-1 * var(--devtools-splitter-inline-start-width) - 1px);
margin-inline-end: calc(-1 * var(--devtools-splitter-inline-end-width));
cursor: e-resize;
}

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

@ -980,17 +980,15 @@
.devtools-invisible-splitter {
border-color: transparent;
background-color: transparent;
}
.devtools-horizontal-splitter {
border-bottom: 1px solid var(--theme-splitter-color);
}
.devtools-horizontal-splitter,
.devtools-side-splitter {
-moz-border-end: 1px solid var(--theme-splitter-color);
border-color: var(--theme-splitter-color); /* Needed for responsive container at low width. */
background-color: var(--theme-splitter-color);
}
/* Throbbers */
.devtools-throbber::before {
content: "";

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

@ -64,17 +64,19 @@
.devtools-responsive-container > .devtools-side-splitter {
/* This is a normally vertical splitter, but we have turned it horizontal
due to the smaller resolution */
min-height: 3px;
height: 3px;
margin-top: -3px;
min-height: calc(var(--devtools-splitter-top-width) +
var(--devtools-splitter-bottom-width) + 1px);
border-top-width: var(--devtools-splitter-top-width);
border-bottom-width: var(--devtools-splitter-bottom-width);
margin-top: calc(-1 * var(--devtools-splitter-top-width) - 1px);
margin-bottom: calc(-1 * var(--devtools-splitter-bottom-width));
/* Reset the vertical splitter styles */
border-width: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
-moz-margin-start: 0;
width: auto;
min-width: 0;
border-inline-end-width: 0;
border-inline-start-width: 0;
margin-inline-end: 0;
margin-inline-start: 0;
/* In some edge case the cursor is not changed to n-resize */
cursor: n-resize;
@ -1123,7 +1125,7 @@
/* Table body */
.table-widget-body > .devtools-side-splitter {
border: none;
background-color: transparent;
}
.table-widget-body {

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

@ -21,6 +21,14 @@ const TEST_DATA_REQUEST_PREDICATE =
({ request }) => request.url.endsWith("test-data.json");
add_task(function* testPageLoad() {
// Enable logging in the UI. Not needed to pass test but makes it easier
// to debug interactively.
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set":
[["devtools.webconsole.filter.networkinfo", true]
]}, resolve);
});
let finishedRequest = waitForFinishedRequest(PAGE_REQUEST_PREDICATE);
let hud = yield loadPageAndGetHud(TEST_NETWORK_REQUEST_URI);
let request = yield finishedRequest;
@ -40,6 +48,8 @@ add_task(function* testPageLoad() {
"Request body was not discarded");
is(responseContent.content.text.indexOf("<!DOCTYPE HTML>"), 0,
"Response body's beginning is okay");
yield closeTabAndToolbox();
});
add_task(function* testXhrGet() {
@ -62,6 +72,8 @@ add_task(function* testXhrGet() {
"Request body was not discarded");
is(responseContent.content.text, TEST_DATA_JSON_CONTENT,
"Response is correct");
yield closeTabAndToolbox();
});
add_task(function* testXhrPost() {
@ -82,6 +94,8 @@ add_task(function* testXhrPost() {
is(postData.postData.text, "Hello world!", "Request body was logged");
is(responseContent.content.text, TEST_DATA_JSON_CONTENT,
"Response is correct");
yield closeTabAndToolbox();
});
add_task(function* testFormSubmission() {
@ -117,4 +131,6 @@ add_task(function* testFormSubmission() {
.indexOf("name=foo+bar&age=144"), -1, "Form data is correct");
is(responseContent.content.text.indexOf("<!DOCTYPE HTML>"), 0,
"Response body's beginning is okay");
yield closeTabAndToolbox();
});

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

@ -283,7 +283,7 @@ function waitForContextMenu(popup, button, onShown, onHidden) {
info("wait for the context menu to open");
let eventDetails = {type: "contextmenu", button: 2};
EventUtils.synthesizeMouse(button, 2, 2, eventDetails,
EventUtils.synthesizeMouse(button, 5, 2, eventDetails,
button.ownerDocument.defaultView);
return deferred.promise;
}

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

@ -68,7 +68,6 @@ public class AppConstants {
public static final boolean preJBMR2 = MAX_SDK_VERSION < 18 || (MIN_SDK_VERSION < 18 && Build.VERSION.SDK_INT < 18);
public static final boolean preJBMR1 = MAX_SDK_VERSION < 17 || (MIN_SDK_VERSION < 17 && Build.VERSION.SDK_INT < 17);
public static final boolean preJB = MAX_SDK_VERSION < 16 || (MIN_SDK_VERSION < 16 && Build.VERSION.SDK_INT < 16);
public static final boolean preICS = MAX_SDK_VERSION < 14 || (MIN_SDK_VERSION < 14 && Build.VERSION.SDK_INT < 14);
}
/**

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

@ -3212,8 +3212,7 @@ public class BrowserApp extends GeckoApp
// or if the user has explicitly enabled the clear on shutdown pref.
// (We check the pref last to save the pref read.)
// In ICS+, it's easy to kill an app through the task switcher.
final boolean visible = Versions.preICS ||
HardwareUtils.isTelevision() ||
final boolean visible = HardwareUtils.isTelevision() ||
!PrefUtils.getStringSet(GeckoSharedPrefs.forProfile(this),
ClearOnShutdownPref.PREF,
new HashSet<String>()).isEmpty();

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

@ -328,11 +328,6 @@ public class DoorHangerPopup extends AnchoredPopup
}
show();
if (Versions.preICS) {
// Make the popup focusable for keyboard accessibility.
setFocusable(true);
}
}
//Show all inter-DoorHanger dividers (ie. Dividers on all visible DoorHangers except the last one)

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

@ -1409,14 +1409,6 @@ public abstract class GeckoApp
mDoorHangerPopup = new DoorHangerPopup(this);
mPluginContainer = (AbsoluteLayout) findViewById(R.id.plugin_container);
mFormAssistPopup = (FormAssistPopup) findViewById(R.id.form_assist_popup);
if (mCameraView == null) {
// Pre-ICS devices need the camera surface in a visible layout.
if (Versions.preICS) {
mCameraView = new SurfaceView(this);
((SurfaceView)mCameraView).getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
}
}
/**
@ -2700,10 +2692,6 @@ public abstract class GeckoApp
}
private void setSystemUiVisible(final boolean visible) {
if (Versions.preICS) {
return;
}
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {

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

@ -5,7 +5,6 @@
package org.mozilla.gecko;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.db.BrowserContract;
import org.mozilla.gecko.favicons.Favicons;
@ -92,11 +91,6 @@ class MemoryMonitor extends BroadcastReceiver {
public void onTrimMemory(int level) {
Log.d(LOGTAG, "onTrimMemory() notification received with level " + level);
if (Versions.preICS) {
// This won't even get called pre-ICS.
return;
}
if (level == ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
// We seem to get this just by entering the task switcher or hitting the home button.
// Seems bogus, because we are the foreground app, or at least not at the end of the LRU list.

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

@ -4,7 +4,6 @@
package org.mozilla.gecko.menu;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.R;
import org.mozilla.gecko.widget.GeckoActionProvider;
@ -117,10 +116,6 @@ public class GeckoMenuItem implements MenuItem {
}
public boolean hasActionProvider() {
if (Versions.preICS) {
return false;
}
return (mActionProvider != null);
}

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

@ -1465,12 +1465,7 @@ OnSharedPreferenceChangeListener
@Override
public void prefValue(String prefName, final boolean value) {
final Preference pref = getField(prefName);
final CheckBoxPrefSetter prefSetter;
if (Versions.preICS) {
prefSetter = new CheckBoxPrefSetter();
} else {
prefSetter = new TwoStatePrefSetter();
}
final CheckBoxPrefSetter prefSetter = new TwoStatePrefSetter();
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {

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

@ -8,13 +8,9 @@ package org.mozilla.gecko.util;
import android.content.Context;
import android.content.Intent;
import android.speech.RecognizerIntent;
import org.mozilla.gecko.AppConstants.Versions;
public class InputOptionsUtils {
public static boolean supportsVoiceRecognizer(Context context, String prompt) {
if (Versions.preICS) {
return false;
}
final Intent intent = createVoiceRecognizerIntent(prompt);
return intent.resolveActivity(context.getPackageManager()) != null;
}

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

@ -877,9 +877,15 @@ var BrowserApp = {
UITelemetry.addEvent("action.1", "contextmenu", null, "web_save_image");
UITelemetry.addEvent("save.1", "contextmenu", null, "image");
ContentAreaUtils.saveImageURL(aTarget.currentURI.spec, null, "SaveImageTitle",
false, true, aTarget.ownerDocument.documentURIObject,
aTarget.ownerDocument);
RuntimePermissions.waitForPermissions(RuntimePermissions.WRITE_EXTERNAL_STORAGE).then(function(permissionGranted) {
if (!permissionGranted) {
return;
}
ContentAreaUtils.saveImageURL(aTarget.currentURI.spec, null, "SaveImageTitle",
false, true, aTarget.ownerDocument.documentURIObject,
aTarget.ownerDocument);
});
});
NativeWindow.contextmenus.add(stringGetter("contextmenu.setImageAs"),

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

@ -83,7 +83,11 @@ public class AppMenuComponent extends BaseComponent {
super(testContext);
}
private void assertMenuIsNotOpen() {
public void assertMenuIsOpen() {
fAssertTrue("Menu is open", isMenuOpen());
}
public void assertMenuIsNotOpen() {
fAssertFalse("Menu is not open", isMenuOpen());
}
@ -271,7 +275,7 @@ public class AppMenuComponent extends BaseComponent {
return (menuItemView != null) && (menuItemView.getVisibility() == View.VISIBLE);
}
private void waitForMenuOpen() {
public void waitForMenuOpen() {
WaitHelper.waitFor("menu to open", new Condition() {
@Override
public boolean isSatisfied() {
@ -279,4 +283,13 @@ public class AppMenuComponent extends BaseComponent {
}
});
}
public void waitForMenuClose() {
WaitHelper.waitFor("menu to close", new Condition() {
@Override
public boolean isSatisfied() {
return !isMenuOpen();
}
});
}
}

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

@ -10,6 +10,8 @@ import org.mozilla.gecko.tests.components.AppMenuComponent;
import org.mozilla.gecko.tests.helpers.GeckoHelper;
import org.mozilla.gecko.tests.helpers.NavigationHelper;
import com.robotium.solo.Solo;
/**
* Set of tests to test UI App menu and submenus the user interact with.
*/
@ -22,9 +24,22 @@ public class testAppMenuPathways extends UITest {
public void testAppMenuPathways() {
GeckoHelper.blockForReady();
_testHardwareMenuKeyOpenClose();
_testSaveAsPDFPathway();
}
public void _testHardwareMenuKeyOpenClose() {
mAppMenu.assertMenuIsNotOpen();
mSolo.sendKey(Solo.MENU);
mAppMenu.waitForMenuOpen();
mAppMenu.assertMenuIsOpen();
mSolo.sendKey(Solo.MENU);
mAppMenu.waitForMenuClose();
mAppMenu.assertMenuIsNotOpen();
}
public void _testSaveAsPDFPathway() {
// Page menu should be disabled in about:home.
mAppMenu.assertMenuItemIsDisabledAndVisible(AppMenuComponent.PageMenuItem.SAVE_AS_PDF);

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

@ -28,16 +28,17 @@ input {
font-weight: bold;
background-color: #f5f5f5;
border-bottom: 2px solid;
-moz-border-bottom-colors: #ff9100 #f27900;
-moz-border-bottom-colors: #FF9500;
display: flex;
flex-direction: row;
align-items: center;
height: 48px;
}
.header > div {
flex: 1;
padding: 1em;
-moz-padding-start: 1.5em;
padding: 10px;
-moz-padding-start: 16px;
}
#header-button {

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

@ -35,7 +35,14 @@ body {
}
.toolbar-buttons {
display: flex;
align-items: center;
justify-content: center;
list-style: none;
margin: 0px;
padding: 0px;
height: 48px;
width: 48px;
}
.toolbar-buttons > li {
@ -44,7 +51,6 @@ body {
background-repeat: no-repeat;
height: 20px;
width: 20px;
margin: 0 15px;
}
#filter-input-container {