diff --git a/browser/components/payments/docs/index.rst b/browser/components/payments/docs/index.rst index 4cda6753d970..df34dd213b74 100644 --- a/browser/components/payments/docs/index.rst +++ b/browser/components/payments/docs/index.rst @@ -4,6 +4,11 @@ WebPayments UI User Interface for the WebPayments `Payment Request API `_ and `Payment Handler API `_. + + `Project Wiki `_ | + `#payments on IRC `_ | + `File a bug `_ + JSDoc style comments are used within the JS files of the component. This document will focus on higher-level and shared concepts. .. toctree:: @@ -13,6 +18,8 @@ JSDoc style comments are used within the JS files of the component. This documen Debugging/Development ===================== +Relevant preferences: ``dom.payments.*`` + Must Have Electrolysis ---------------------- @@ -25,10 +32,10 @@ Set the pref ``dom.payments.loglevel`` to "Debug" to increase the verbosity of c Unprivileged UI Development --------------------------- -During development of the unprivileged custom elements, you can load the dialog from a -local server without even requiring a build. Simply run `./mach python browser/components/payments/server.py` -then load `http://localhost:8000/paymentRequest.xhtml?debug=1` in the browser. -Use the debugging console to load sample data. +During development of the unprivileged custom elements, you can load the dialog in a tab with +the url `resource://payments/paymentRequest.xhtml`. +You can then use the debugging console to load sample data. Autofill add/edit form strings +will not appear when developing this way until they are converted to FTL. Debugging Console ----------------- @@ -43,16 +50,9 @@ Debugging the unprivileged frame with the developer tools To open a debugger in the context of the remote payment frame, click the "Debug frame" button in the debugging console. -Use the `tabs` variable in the Browser Content Toolbox's console to access the frame contents. +Use the ``tabs`` variable in the Browser Content Toolbox's console to access the frame contents. There can be multiple frames loaded in the same process so you will need to find the correct tab -in the array by checking the file name is `paymentRequest.xhtml` (e.g. `tabs[0].content.location`). - - -Communication with the DOM -========================== - -Communication from the DOM to the UI happens via the `paymentUIService.js` (implementing ``nsIPaymentUIService``). -The UI talks to the DOM code via the ``nsIPaymentRequestService`` interface. +in the array by checking the file name is `paymentRequest.xhtml` (e.g. ``tabs[0].content.location``). Dialog Architecture @@ -70,12 +70,30 @@ Instead, all communication across the privileged/unprivileged boundary is done v These events are converted to/from message manager messages of the same name to communicate to the other process. The purpose of `paymentDialogFrameScript.js` is to simply convert unprivileged DOM events to/from messages from the other process. +The dialog depends on the add/edit forms and storage from :doc:`Form Autofill ` for addresses and credit cards. + +Communication with the DOM +-------------------------- + +Communication from the DOM to the UI happens via the `paymentUIService.js` (implementing ``nsIPaymentUIService``). +The UI talks to the DOM code via the ``nsIPaymentRequestService`` interface. + + Custom Elements --------------- -The Payment Request UI uses Custom Elements for the UI components. +The Payment Request UI uses `Custom Elements `_ for the UI components. Some guidelines: + +* There are some `mixins `_ + to provide commonly needed functionality to a custom element. +* `res/containers/ `_ + contains elements that react to application state changes, + `res/components/ `_ + contains elements that aren't connected to the state directly. +* Elements should avoid having their own internal/private state and should react to state changes. + Containers primarily use the application state (``requestStore``) while components primarily use attributes. * If you're overriding a lifecycle callback, don't forget to call that method on ``super`` from the implementation to ensure that mixins and ancestor classes work properly. diff --git a/browser/extensions/formautofill/docs/index.rst b/browser/extensions/formautofill/docs/index.rst index a3871a177c20..d728578d96e2 100644 --- a/browser/extensions/formautofill/docs/index.rst +++ b/browser/extensions/formautofill/docs/index.rst @@ -1,9 +1,9 @@ Form Autofill ============= -[`Wiki `_] | -[IRC `#formfill `_] | -[Mailing list `autofill@lists.mozilla.org `_] +`Wiki `_ | +`IRC: #formfill `_ | +Mailing List: `autofill@lists.mozilla.org `_ Introduction ------------ diff --git a/gfx/layers/wr/WebRenderScrollData.cpp b/gfx/layers/wr/WebRenderScrollData.cpp index 8c24bbc6e529..4cb69b201c75 100644 --- a/gfx/layers/wr/WebRenderScrollData.cpp +++ b/gfx/layers/wr/WebRenderScrollData.cpp @@ -69,9 +69,12 @@ WebRenderLayerScrollData::Initialize(WebRenderScrollData& aOwner, aOwner.GetManager(), aItem->ReferenceFrame(), Nothing(), nullptr); asr->mScrollableFrame->NotifyApzTransaction(); - MOZ_ASSERT(metadata); - MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId); - mScrollIds.AppendElement(aOwner.AddMetadata(metadata.ref())); + if (metadata) { + MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId); + mScrollIds.AppendElement(aOwner.AddMetadata(metadata.ref())); + } else { + MOZ_ASSERT_UNREACHABLE("Expected scroll metadata to be available!"); + } } asr = asr->mParent; } diff --git a/js/src/builtin/intl/CurrencyDataGenerated.js b/js/src/builtin/intl/CurrencyDataGenerated.js index c63e45620303..210aa2978b81 100644 --- a/js/src/builtin/intl/CurrencyDataGenerated.js +++ b/js/src/builtin/intl/CurrencyDataGenerated.js @@ -1,5 +1,5 @@ // Generated by make_intl_data.py. DO NOT EDIT. -// Version: 2018-01-01 +// Version: 2018-08-29 /** * Mapping from currency codes to the number of decimal digits used for them. @@ -47,8 +47,10 @@ var currencyDigits = { TND: 3, // Uganda Shilling (UGANDA) UGX: 0, - // Uruguay Peso en Unidades Indexadas (URUIURUI) (URUGUAY) + // Uruguay Peso en Unidades Indexadas (UI) (URUGUAY) UYI: 0, + // Unidad Previsional (URUGUAY) + UYW: 4, // Dong (VIET NAM) VND: 0, // Vatu (VANUATU) diff --git a/js/src/builtin/intl/DateTimeFormat.cpp b/js/src/builtin/intl/DateTimeFormat.cpp index 3e6e7bf26a59..549ab1ba19d4 100644 --- a/js/src/builtin/intl/DateTimeFormat.cpp +++ b/js/src/builtin/intl/DateTimeFormat.cpp @@ -969,7 +969,8 @@ js::intl_FormatDateTime(JSContext* cx, unsigned argc, Value* vp) ClippedTime x = TimeClip(args[1].toNumber()); if (!x.isValid()) { - JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DATE_NOT_FINITE); + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DATE_NOT_FINITE, + "DateTimeFormat"); return false; } diff --git a/js/src/builtin/intl/RelativeTimeFormat.js b/js/src/builtin/intl/RelativeTimeFormat.js index badbac84e356..6ba7ab14759f 100644 --- a/js/src/builtin/intl/RelativeTimeFormat.js +++ b/js/src/builtin/intl/RelativeTimeFormat.js @@ -186,6 +186,12 @@ function Intl_RelativeTimeFormat_format(value, unit) { // Step 4. let u = ToString(unit); + // PartitionRelativeTimePattern, step 4. + if (!Number_isFinite(t)) { + ThrowRangeError(JSMSG_DATE_NOT_FINITE, "RelativeTimeFormat"); + } + + // PartitionRelativeTimePattern, step 5. switch (u) { case "second": case "seconds": diff --git a/js/src/jit/BaselineJIT.cpp b/js/src/jit/BaselineJIT.cpp index b53764476f60..40c3ddee8899 100644 --- a/js/src/jit/BaselineJIT.cpp +++ b/js/src/jit/BaselineJIT.cpp @@ -1206,8 +1206,8 @@ GetStubEnteredCount(ICStub* stub, uint32_t* count) return false; } -static void -DumpICInfo(JSScript* script) +void +jit::JitSpewBaselineICStats(JSScript* script, const char* dumpReason) { MOZ_ASSERT(script->hasBaselineScript()); BaselineScript* blScript = script->baselineScript(); @@ -1218,19 +1218,23 @@ DumpICInfo(JSScript* script) Fprinter& out = JitSpewPrinter(); - const char* filename = script->filename() ? script->filename() : "unknown"; - out.printf("Dumping IC info for %s:%d\n", filename, - PCToLineNumber(script, script->code())); + out.printf("[BaselineICStats] Dumping IC info for %s script %s:%d:%d\n", + dumpReason, script->filename(), script->lineno(), + script->column()); for (size_t i = 0; i < blScript->numICEntries(); i++) { ICEntry& entry = blScript->icEntry(i); - unsigned column; + uint32_t pcOffset = entry.pcOffset(); jsbytecode* pc = entry.pc(script); + + unsigned column; unsigned int line = PCToLineNumber(script, pc, &column); - out.printf("\t%s:%u:%u (%s) \t", filename, line, column, CodeName[*pc]); + out.printf("[BaselineICStats] %s - pc=%u line=%u col=%u\n", + CodeName[*pc], pcOffset, line, column); ICStub* stub = entry.firstStub(); + out.printf("[BaselineICStats] "); while (stub) { uint32_t count; if (GetStubEnteredCount(stub, &count)) { @@ -1238,7 +1242,7 @@ DumpICInfo(JSScript* script) } else if (stub->isFallback()) { out.printf("(fb) %u", stub->toFallbackStub()->enteredCount()); } else { - out.printf(" -> "); + out.printf(" ?? -> "); } stub = stub->next(); } @@ -1255,10 +1259,6 @@ jit::FinishDiscardBaselineScript(FreeOp* fop, JSScript* script) return; } -#ifdef JS_JITSPEW - DumpICInfo(script); -#endif - if (script->baselineScript()->active()) { // Script is live on the stack. Keep the BaselineScript, but destroy // stubs allocated in the optimized stub space. diff --git a/js/src/jit/BaselineJIT.h b/js/src/jit/BaselineJIT.h index 411cab6a8058..6c6270542b57 100644 --- a/js/src/jit/BaselineJIT.h +++ b/js/src/jit/BaselineJIT.h @@ -763,6 +763,11 @@ MarkActiveBaselineScripts(Zone* zone); MethodStatus BaselineCompile(JSContext* cx, JSScript* script, bool forceDebugInstrumentation = false); +#ifdef JS_JITSPEW +void +JitSpewBaselineICStats(JSScript* script, const char* dumpReason); +#endif + static const unsigned BASELINE_MAX_ARGS_LENGTH = 20000; } // namespace jit diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 733e2a401267..40ec03bba31d 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -779,6 +779,14 @@ IonBuilder::init() AbortReasonOr IonBuilder::build() { + // Spew IC info for inlined script, but only when actually compiling, + // not when analyzing it. +#ifdef JS_JITSPEW + if (!info().isAnalysis()) { + JitSpewBaselineICStats(script(), "To-Be-Compiled"); + } +#endif + MOZ_TRY(init()); if (script()->hasBaselineScript()) { @@ -972,6 +980,14 @@ IonBuilder::buildInline(IonBuilder* callerBuilder, MResumePoint* callerResumePoi { inlineCallInfo_ = &callInfo; + // Spew IC info for inlined script, but only when actually compiling, + // not when analyzing it. +#ifdef JS_JITSPEW + if (!info().isAnalysis()) { + JitSpewBaselineICStats(script(), "To-Be-Inlined"); + } +#endif + MOZ_TRY(init()); JitSpew(JitSpew_IonScripts, "Inlining script %s:%u:%u (%p)", diff --git a/js/src/js.msg b/js/src/js.msg index 8973a8069a04..41a1e5cfcfba 100644 --- a/js/src/js.msg +++ b/js/src/js.msg @@ -510,7 +510,7 @@ MSG_DEF(JSMSG_TESTING_SCRIPTS_ONLY, 0, JSEXN_TYPEERR, "only works on scripts") MSG_DEF(JSMSG_TRACELOGGER_ENABLE_FAIL, 1, JSEXN_ERR, "enabling tracelogger failed: {0}") // Intl -MSG_DEF(JSMSG_DATE_NOT_FINITE, 0, JSEXN_RANGEERR, "date value is not finite in DateTimeFormat.format()") +MSG_DEF(JSMSG_DATE_NOT_FINITE, 1, JSEXN_RANGEERR, "date value is not finite in {0}.format()") MSG_DEF(JSMSG_INTERNAL_INTL_ERROR, 0, JSEXN_ERR, "internal error while computing Intl data") MSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 3, JSEXN_TYPEERR, "Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}") MSG_DEF(JSMSG_INVALID_CURRENCY_CODE, 1, JSEXN_RANGEERR, "invalid currency code in NumberFormat(): {0}") diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list index 94cc5eb6bf88..127d0999995d 100644 --- a/js/src/tests/jstests.list +++ b/js/src/tests/jstests.list @@ -397,9 +397,7 @@ skip-if(!xulRuntime.shell) script test262/built-ins/Atomics/wake/wake-one.js skip-if(!xulRuntime.shell) script test262/built-ins/Atomics/wake/wake-all-on-loc.js # https://bugzilla.mozilla.org/show_bug.cgi?id=1346081 -skip script test262/intl402/NumberFormat/prototype/format/format-fraction-digits.js skip script test262/intl402/NumberFormat/prototype/format/format-fraction-digits-precision.js -skip script test262/intl402/NumberFormat/prototype/format/format-significant-digits.js skip script test262/intl402/NumberFormat/prototype/format/format-significant-digits-precision.js # Hoisted block-level function named "arguments" not initialized with undefined per B.3.3.1 @@ -431,14 +429,6 @@ skip script test262/annexB/language/function-code/block-decl-nested-blocks-with- # https://bugzilla.mozilla.org/show_bug.cgi?id=1406171 skip script test262/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js -# https://bugzilla.mozilla.org/show_bug.cgi?id=1291407 -skip script test262/intl402/ListFormat/prototype/toStringTag/toString.js -skip script test262/intl402/ListFormat/prototype/toStringTag/toStringTag.js - -# https://bugzilla.mozilla.org/show_bug.cgi?id=1473228 -skip script test262/intl402/Segmenter/prototype/toStringTag/toString.js -skip script test262/intl402/Segmenter/prototype/toStringTag/toStringTag.js - # https://bugzilla.mozilla.org/show_bug.cgi?id=1473229 skip include test262/intl402/RelativeTimeFormat/prototype/formatToParts/jstests.list @@ -450,12 +440,9 @@ skip script test262/intl402/RelativeTimeFormat/prototype/format/pl-pl-style-long skip script test262/intl402/RelativeTimeFormat/prototype/format/pl-pl-style-narrow.js skip script test262/intl402/RelativeTimeFormat/prototype/format/pl-pl-style-short.js -# https://bugzilla.mozilla.org/show_bug.cgi?id=1473230 +# https://bugzilla.mozilla.org/show_bug.cgi?id=1473588 skip script test262/intl402/RelativeTimeFormat/prototype/format/unit-plural.js -# https://bugzilla.mozilla.org/show_bug.cgi?id=1483548 -skip script test262/intl402/RelativeTimeFormat/prototype/format/value-non-finite.js - # https://bugzilla.mozilla.org/show_bug.cgi?id=1499933 skip script test262/intl402/DateTimeFormat/prototype/resolvedOptions/order.js skip script test262/intl402/PluralRules/prototype/resolvedOptions/order.js diff --git a/js/src/tests/non262/Intl/RelativeTimeFormat/format.js b/js/src/tests/non262/Intl/RelativeTimeFormat/format.js index 55819b7b87d0..89365e79e1a0 100644 --- a/js/src/tests/non262/Intl/RelativeTimeFormat/format.js +++ b/js/src/tests/non262/Intl/RelativeTimeFormat/format.js @@ -111,10 +111,10 @@ assertEq(rtf.format(1, "day"), "غدًا"); rtf = new Intl.RelativeTimeFormat("en-US"); -assertEq(rtf.format(Infinity, "year"), "in ∞ years"); -assertEq(rtf.format(-Infinity, "year"), "∞ years ago"); var weirdValueCases = [ + Infinity, + -Infinity, NaN, "word", [0,2], @@ -122,7 +122,7 @@ var weirdValueCases = [ ]; for (let c of weirdValueCases) { - assertEq(rtf.format(c, "year"), "in NaN years"); + assertThrowsInstanceOf(() => rtf.format(c, "year"), RangeError); }; var weirdUnitCases = [ @@ -137,7 +137,7 @@ var weirdUnitCases = [ ]; for (let u of weirdUnitCases) { - assertThrows(function() { + assertThrowsInstanceOf(function() { var rtf = new Intl.RelativeTimeFormat("en-US"); rtf.format(1, u); }, RangeError); diff --git a/mobile/android/config/mozconfigs/android-aarch64/nightly b/mobile/android/config/mozconfigs/android-aarch64/nightly index ad10f428b6ec..aa0bf9798a5c 100644 --- a/mobile/android/config/mozconfigs/android-aarch64/nightly +++ b/mobile/android/config/mozconfigs/android-aarch64/nightly @@ -10,7 +10,10 @@ export AR="$topsrcdir/clang/bin/llvm-ar" export NM="$topsrcdir/clang/bin/llvm-nm" export RANLIB="$topsrcdir/clang/bin/llvm-ranlib" -ac_add_options --enable-lto +# Enable LTO if the NDK is available. +if [ -z "$NO_NDK" ]; then + ac_add_options --enable-lto +fi export MOZILLA_OFFICIAL=1 export MOZ_TELEMETRY_REPORTING=1 diff --git a/mobile/android/config/mozconfigs/android-api-16/nightly b/mobile/android/config/mozconfigs/android-api-16/nightly index 6a1721ecde82..098ba91b6254 100644 --- a/mobile/android/config/mozconfigs/android-api-16/nightly +++ b/mobile/android/config/mozconfigs/android-api-16/nightly @@ -20,6 +20,9 @@ export AR="$topsrcdir/clang/bin/llvm-ar" export NM="$topsrcdir/clang/bin/llvm-nm" export RANLIB="$topsrcdir/clang/bin/llvm-ranlib" -ac_add_options --enable-lto +# Enable LTO if the NDK is available. +if [ -z "$NO_NDK" ]; then + ac_add_options --enable-lto +fi . "$topsrcdir/mobile/android/config/mozconfigs/common.override" diff --git a/mobile/android/config/mozconfigs/android-x86/nightly b/mobile/android/config/mozconfigs/android-x86/nightly index f7776364dba7..8c3a10b0c1c7 100644 --- a/mobile/android/config/mozconfigs/android-x86/nightly +++ b/mobile/android/config/mozconfigs/android-x86/nightly @@ -18,6 +18,9 @@ export AR="$topsrcdir/clang/bin/llvm-ar" export NM="$topsrcdir/clang/bin/llvm-nm" export RANLIB="$topsrcdir/clang/bin/llvm-ranlib" -ac_add_options --enable-lto +# Enable LTO if the NDK is available. +if [ -z "$NO_NDK" ]; then + ac_add_options --enable-lto +fi . "$topsrcdir/mobile/android/config/mozconfigs/common.override" diff --git a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/CrashTest.kt b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/CrashTest.kt index 78217350892c..e240f16bbd1f 100644 --- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/CrashTest.kt +++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/CrashTest.kt @@ -23,8 +23,8 @@ import java.io.File @MediumTest class CrashTest { companion object { - val DEFAULT_X86_EMULATOR_TIMEOUT_MILLIS = 30000L - val DEFAULT_X86_DEVICE_TIMEOUT_MILLIS = 30000L + val DEFAULT_X86_EMULATOR_TIMEOUT_MILLIS = 90000L + val DEFAULT_X86_DEVICE_TIMEOUT_MILLIS = 60000L val DEFAULT_ARM_EMULATOR_TIMEOUT_MILLIS = 180000L val DEFAULT_ARM_DEVICE_TIMEOUT_MILLIS = 60000L } @@ -87,4 +87,4 @@ class CrashTest { messenger.send(Message.obtain(null, RemoteGeckoService.CMD_CRASH_CONTENT_NATIVE)) assertCrashIntent(CrashTestHandler.queue.take(), false) } -} \ No newline at end of file +} diff --git a/toolkit/mozapps/handling/content/dialog.js b/toolkit/mozapps/handling/content/dialog.js index 64a865dd708d..c2fb7e8730ac 100644 --- a/toolkit/mozapps/handling/content/dialog.js +++ b/toolkit/mozapps/handling/content/dialog.js @@ -154,7 +154,7 @@ var dialog = { let gIOSvc = Cc["@mozilla.org/gio-service;1"] .getService(Ci.nsIGIOService); var gioApps = gIOSvc.getAppsForURIScheme(this._URI.scheme); - for (let handler of gioApps.enumerate()) { + for (let handler of gioApps.enumerate(Ci.nsIHandlerApp)) { // OS handler share the same name, it's most likely the same app, skipping... if (handler.name == this._handlerInfo.defaultDescription) { continue;