Skip to content

Commit

Permalink
Merge autoland to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabal committed Aug 31, 2018
2 parents 5ddcd7b + f832b40 commit 4a29900
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 26 deletions.
6 changes: 3 additions & 3 deletions browser/base/content/tabbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3502,7 +3502,7 @@ window._gBrowser = {
* to a new browser window, unless it is (they are) already the only tab(s)
* in the current window, in which case this will do nothing.
*/
replaceTabsWithWindow(contextTab) {
replaceTabsWithWindow(contextTab, aOptions) {
let tabs;
if (contextTab.multiselected) {
tabs = this.selectedTabs;
Expand All @@ -3515,7 +3515,7 @@ window._gBrowser = {
}

if (tabs.length == 1) {
return this.replaceTabWithWindow(tabs[0]);
return this.replaceTabWithWindow(tabs[0], aOptions);
}

// The order of the tabs is reserved.
Expand Down Expand Up @@ -3553,7 +3553,7 @@ window._gBrowser = {
winVisibleTabs[winTabLength - 1]);
}, { once: true });

win = this.replaceTabWithWindow(firstInactiveTab);
win = this.replaceTabWithWindow(firstInactiveTab, aOptions);
return win;
},

Expand Down
17 changes: 10 additions & 7 deletions browser/base/content/test/urlbar/browser_urlbarAddonIframe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable mozilla/no-arbitrary-setTimeout */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// The purpose of this test is to test the urlbar popup's add-on iframe. It has
Expand Down Expand Up @@ -133,13 +135,14 @@ add_task(async function() {
// urlbar.setPanelHeight
let newHeight = height + 100;
await promiseUrlbarFunctionCall("setPanelHeight", newHeight);
await new Promise(resolve => {
// The height change is animated, so give it time to complete. Again, wait
// a sec to be safe.
setTimeout(resolve, 1000);
// The height change is animated, so give it time to complete.
await TestUtils.waitForCondition(
() => Math.round(iframe.getBoundingClientRect().height) == newHeight,
"Wait for panel height change after setPanelHeight"
).catch(ex => {
info("Last detected height: " + Math.round(iframe.getBoundingClientRect().height));
throw ex;
});
Assert.equal(iframe.getBoundingClientRect().height, newHeight,
"setPanelHeight");
});

function promiseIframeLoad() {
Expand Down
61 changes: 49 additions & 12 deletions browser/base/content/urlbarBindings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
this.inputField.addEventListener("overflow", this);
this.inputField.addEventListener("underflow", this);
this.inputField.addEventListener("scrollend", this);
window.addEventListener("resize", this);

var textBox = document.getAnonymousElementByAttribute(this,
"anonid", "moz-input-box");
Expand Down Expand Up @@ -158,6 +159,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
this.inputField.removeEventListener("overflow", this);
this.inputField.removeEventListener("underflow", this);
this.inputField.removeEventListener("scrollend", this);
window.removeEventListener("resize", this);

if (this._deferredKeyEventTimeout) {
clearTimeout(this._deferredKeyEventTimeout);
Expand Down Expand Up @@ -511,26 +513,41 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
</method>

<field name="_formattingEnabled">true</field>

<!--
If the input value is a URL, the input is not focused, and formatting is
enabled, this method highlights the domain, and if mixed content is
present, it crosses out the https scheme. It also ensures that the host
is visible (not scrolled out of sight). Otherwise it removes formatting.
@param onlyEnsureFormattedHostVisible
Pass true to skip formatting and instead only ensure that the
host is visible.
-->
<method name="formatValue">
<parameter name="onlyEnsureFormattedHostVisible"/>
<body><![CDATA[
// Used to avoid re-entrance in async callbacks.
let instance = this._formattingInstance = {};

if (!this.editor)
return;

// Cleanup previously set styles.
this.scheme.value = "";
let controller, strikeOut, selection;
if (this._formattingEnabled) {
controller = this.editor.selectionController;
strikeOut = controller.getSelection(controller.SELECTION_URLSTRIKEOUT);
strikeOut.removeAllRanges();
selection = controller.getSelection(controller.SELECTION_URLSECONDARY);
selection.removeAllRanges();
this.formatScheme(controller.SELECTION_URLSTRIKEOUT, true);
this.formatScheme(controller.SELECTION_URLSECONDARY, true);
this.inputField.style.setProperty("--urlbar-scheme-size", "0px");

if (!onlyEnsureFormattedHostVisible) {
// Cleanup previously set styles.
this.scheme.value = "";
if (this._formattingEnabled) {
controller = this.editor.selectionController;
strikeOut = controller.getSelection(controller.SELECTION_URLSTRIKEOUT);
strikeOut.removeAllRanges();
selection = controller.getSelection(controller.SELECTION_URLSECONDARY);
selection.removeAllRanges();
this.formatScheme(controller.SELECTION_URLSTRIKEOUT, true);
this.formatScheme(controller.SELECTION_URLSECONDARY, true);
this.inputField.style.setProperty("--urlbar-scheme-size", "0px");
}
}

let textNode = this.editor.rootElement.firstChild;
Expand Down Expand Up @@ -599,7 +616,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
}
});

if (!this._formattingEnabled)
if (onlyEnsureFormattedHostVisible || !this._formattingEnabled)
return;

this.formatScheme(controller.SELECTION_URLSECONDARY);
Expand Down Expand Up @@ -1439,6 +1456,26 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Ensure to clear those internal caches when switching tabs.
this.controller.resetInternalState();
break;
case "resize":
if (aEvent.target == window) {
// Close the popup since it would be wrongly sized, we'll
// recalculate a proper size on reopening. For example, this may
// happen when using special OS resize functions like Win+Arrow.
this.closePopup();

// Make sure the host remains visible in the input field (via
// formatValue) when the window is resized. We don't want to
// hurt resize performance though, so do this only after resize
// events have stopped and a small timeout has elapsed.
if (this._resizeThrottleTimeout) {
clearTimeout(this._resizeThrottleTimeout);
}
this._resizeThrottleTimeout = setTimeout(() => {
this._resizeThrottleTimeout = null;
this.formatValue(true);
}, 100);
}
break;
}
]]></body>
</method>
Expand Down
1 change: 1 addition & 0 deletions dom/base/Selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Selection)
// Unlink the selection listeners *before* we do RemoveAllRanges since
// we don't want to notify the listeners during JS GC (they could be
// in JS!).
tmp->mNotifyAutoCopy = false;
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSelectionListeners)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCachedRange)
tmp->RemoveAllRanges(IgnoreErrors());
Expand Down
7 changes: 4 additions & 3 deletions js/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,10 @@ with only_when('--enable-compile-environment'):

@depends(enable_fuzzing,
enable_aflfuzzer,
c_compiler)
def enable_libfuzzer(fuzzing, afl, c_compiler):
if fuzzing and not afl and c_compiler.type == 'clang':
c_compiler,
target)
def enable_libfuzzer(fuzzing, afl, c_compiler, target):
if fuzzing and not afl and c_compiler.type == 'clang' and target.os != 'Android':
return True

@depends(enable_fuzzing,
Expand Down
51 changes: 51 additions & 0 deletions taskcluster/ci/build/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,57 @@ android-x86/opt:
- linux64-sccache
- linux64-node

android-x86-fuzzing/debug:
description: "Android x86 Fuzzing Debug"
index:
product: mobile
job-name: android-x86-fuzzing-debug
treeherder:
platform: android-4-2-x86/debug
symbol: Bf
worker-type: aws-provisioner-v1/gecko-{level}-b-android
worker:
docker-image: {in-tree: android-build}
max-run-time: 7200
env:
GRADLE_USER_HOME: "/builds/worker/workspace/build/src/mobile/android/gradle/dotgradle-offline"
TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
artifacts:
- name: public/android/R
path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/R
type: directory
- name: public/android/maven
path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/geckoview/maven/
type: directory
- name: public/build/geckoview-androidTest.apk
path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/geckoview/outputs/apk/androidTest/officialWithGeckoBinariesNoMinApi/debug/geckoview-official-withGeckoBinaries-noMinApi-debug-androidTest.apk
type: file
- name: public/build/geckoview_example.apk
path: /builds/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/geckoview_example/outputs/apk/officialWithGeckoBinariesNoMinApi/debug/geckoview_example-official-withGeckoBinaries-noMinApi-debug.apk
type: file
- name: public/build
path: /builds/worker/artifacts/
type: directory
run:
using: mozharness
actions: [get-secrets build multi-l10n update]
config:
- builds/releng_base_android_64_builds.py
script: "mozharness/scripts/fx_desktop_build.py"
secrets: true
custom-build-variant-cfg: x86-fuzzing-debug
tooltool-downloads: internal
toolchains:
- android-gradle-dependencies
- android-ndk-linux
- android-sdk-linux
- linux64-clang
- linux64-rust-android
- linux64-rust-size
- linux64-cbindgen
- linux64-sccache
- linux64-node

android-x86-nightly/opt:
description: "Android 4.2 x86 Nightly"
attributes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ class BuildOptionParser(object):
'rusttests-debug': 'builds/releng_sub_%s_configs/%s_rusttests_debug.py',
'x86': 'builds/releng_sub_%s_configs/%s_x86.py',
'x86-artifact': 'builds/releng_sub_%s_configs/%s_x86_artifact.py',
'x86-fuzzing-debug': 'builds/releng_sub_%s_configs/%s_x86_fuzzing_debug.py',
'api-16-partner-sample1': 'builds/releng_sub_%s_configs/%s_api_16_partner_sample1.py',
'aarch64': 'builds/releng_sub_%s_configs/%s_aarch64.py',
'android-test': 'builds/releng_sub_%s_configs/%s_test.py',
Expand Down
2 changes: 1 addition & 1 deletion tools/fuzzing/faulty/Faulty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Faulty::MaybeCollectAndClosePipe(int aPipe, unsigned int aProbability)
}

if (aPipe > -1) {
FAULTY_LOG("Collecting pipe %d to bucket of pipes (count: %ld)",
FAULTY_LOG("Collecting pipe %d to bucket of pipes (count: %zu)",
aPipe, mFds.size());
mFds.insert(aPipe);
}
Expand Down

0 comments on commit 4a29900

Please sign in to comment.