зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-i to m-c, a=merge
MozReview-Commit-ID: AYBlGJan6UL
This commit is contained in:
Коммит
e6458e1fee
|
@ -1,15 +1,12 @@
|
|||
[DEFAULT]
|
||||
skip-if = (!e10s || !crashreporter)
|
||||
support-files =
|
||||
head.js
|
||||
[browser_shown.js]
|
||||
skip-if = !e10s || !crashreporter
|
||||
[browser_clearEmail.js]
|
||||
skip-if = !e10s || !crashreporter
|
||||
[browser_showForm.js]
|
||||
skip-if = !e10s || !crashreporter
|
||||
[browser_withoutDump.js]
|
||||
skip-if = !e10s || !crashreporter
|
||||
|
||||
[browser_autoSubmitRequest.js]
|
||||
skip-if = !e10s || !crashreporter
|
||||
[browser_clearEmail.js]
|
||||
[browser_noPermanentKey.js]
|
||||
skip-if = !e10s || !crashreporter || (os == "linux" && bits == 32 && debug) # Bug 1383315
|
||||
skip-if = (os == "linux" && bits == 32 && debug) # Bug 1383315
|
||||
[browser_showForm.js]
|
||||
[browser_shown.js]
|
||||
[browser_withoutDump.js]
|
||||
|
|
|
@ -250,7 +250,7 @@ var gPrivacyPane = {
|
|||
this.initSubmitHealthReport();
|
||||
setEventListener("submitHealthReportBox", "command",
|
||||
gPrivacyPane.updateSubmitHealthReport);
|
||||
|
||||
this._initA11yState();
|
||||
let bundlePrefs = document.getElementById("bundlePreferences");
|
||||
let signonBundle = document.getElementById("signonBundle");
|
||||
let pkiBundle = document.getElementById("pkiBundle");
|
||||
|
@ -1598,4 +1598,31 @@ var gPrivacyPane = {
|
|||
break;
|
||||
}
|
||||
},
|
||||
|
||||
// Accessibility checkbox helpers
|
||||
_initA11yState() {
|
||||
this._initA11yString();
|
||||
let checkbox = document.getElementById("a11yPrivacyCheckbox");
|
||||
switch (Services.prefs.getIntPref("accessibility.force_disabled")) {
|
||||
case 1: // access blocked
|
||||
checkbox.checked = true;
|
||||
break;
|
||||
case -1: // a11y is forced on for testing
|
||||
case 0: // access allowed
|
||||
checkbox.checked = false;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_initA11yString() {
|
||||
let a11yLearnMoreLink =
|
||||
Services.urlFormatter.formatURLPref("app.support.baseURL") +
|
||||
"accessibility";
|
||||
document.getElementById("a11yLearnMoreLink")
|
||||
.setAttribute("href", a11yLearnMoreLink);
|
||||
},
|
||||
|
||||
updateA11yPrefs(checked) {
|
||||
Services.prefs.setIntPref("accessibility.force_disabled", checked ? 1 : 0);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -666,6 +666,16 @@
|
|||
&button.ok.label;"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
||||
<vbox id="a11yPermissionsBox">
|
||||
<description flex="1">
|
||||
<checkbox id="a11yPrivacyCheckbox" label="&a11yPrivacy.checkbox.label;"
|
||||
accesskey="&a11yPrivacy.checkbox.accesskey;"
|
||||
oncommand="return gPrivacyPane.updateA11yPrefs(this.checked)"/>
|
||||
<label id="a11yLearnMoreLink" class="learnMore text-link"
|
||||
value="&a11yPrivacy.learnmore.label;"></label>
|
||||
</description>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
<hbox id="dataCollectionCategory"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
This is the PDF.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 1.9.456
|
||||
Current extension version is: 1.9.476
|
||||
|
||||
Taken from upstream commit: cb10c03d
|
||||
Taken from upstream commit: 26c45369
|
||||
|
|
|
@ -376,3 +376,4 @@ var PdfJs = {
|
|||
this._registered = false;
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -1226,6 +1226,7 @@ MessageHandler.prototype = {
|
|||
if (this.isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.isCancelled = true;
|
||||
sendStreamRequest({ stream: 'close' });
|
||||
delete self.streamSinks[streamId];
|
||||
},
|
||||
|
@ -2977,7 +2978,7 @@ class LoopbackPort {
|
|||
cloned.set(value, result);
|
||||
return result;
|
||||
}
|
||||
result = (0, _util.isArray)(value) ? [] : {};
|
||||
result = Array.isArray(value) ? [] : {};
|
||||
cloned.set(value, result);
|
||||
for (var i in value) {
|
||||
var desc,
|
||||
|
@ -3845,8 +3846,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
|
|||
}();
|
||||
var version, build;
|
||||
{
|
||||
exports.version = version = '1.9.456';
|
||||
exports.build = build = 'cb10c03d';
|
||||
exports.version = version = '1.9.476';
|
||||
exports.build = build = '26c45369';
|
||||
}
|
||||
exports.getDocument = getDocument;
|
||||
exports.LoopbackPort = LoopbackPort;
|
||||
|
@ -4902,8 +4903,8 @@ if (!_global_scope2.default.PDFJS) {
|
|||
}
|
||||
var PDFJS = _global_scope2.default.PDFJS;
|
||||
{
|
||||
PDFJS.version = '1.9.456';
|
||||
PDFJS.build = 'cb10c03d';
|
||||
PDFJS.version = '1.9.476';
|
||||
PDFJS.build = '26c45369';
|
||||
}
|
||||
PDFJS.pdfBug = false;
|
||||
if (PDFJS.verbosity !== undefined) {
|
||||
|
@ -10469,8 +10470,8 @@ exports.PDFDataTransportStream = PDFDataTransportStream;
|
|||
"use strict";
|
||||
|
||||
|
||||
var pdfjsVersion = '1.9.456';
|
||||
var pdfjsBuild = 'cb10c03d';
|
||||
var pdfjsVersion = '1.9.476';
|
||||
var pdfjsBuild = '26c45369';
|
||||
var pdfjsSharedUtil = __w_pdfjs_require__(0);
|
||||
var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
|
||||
var pdfjsDisplayAPI = __w_pdfjs_require__(4);
|
||||
|
|
|
@ -1226,6 +1226,7 @@ MessageHandler.prototype = {
|
|||
if (this.isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.isCancelled = true;
|
||||
sendStreamRequest({ stream: 'close' });
|
||||
delete self.streamSinks[streamId];
|
||||
},
|
||||
|
@ -4482,18 +4483,17 @@ var Parser = function ParserClosure() {
|
|||
}
|
||||
return buf1;
|
||||
},
|
||||
findDefaultInlineStreamEnd: function Parser_findDefaultInlineStreamEnd(stream) {
|
||||
var E = 0x45,
|
||||
I = 0x49,
|
||||
SPACE = 0x20,
|
||||
LF = 0xA,
|
||||
CR = 0xD;
|
||||
var startPos = stream.pos,
|
||||
findDefaultInlineStreamEnd(stream) {
|
||||
const E = 0x45,
|
||||
I = 0x49,
|
||||
SPACE = 0x20,
|
||||
LF = 0xA,
|
||||
CR = 0xD,
|
||||
n = 5;
|
||||
let startPos = stream.pos,
|
||||
state = 0,
|
||||
ch,
|
||||
i,
|
||||
n,
|
||||
followingBytes;
|
||||
maybeEIPos;
|
||||
while ((ch = stream.getByte()) !== -1) {
|
||||
if (state === 0) {
|
||||
state = ch === E ? 1 : 0;
|
||||
|
@ -4502,9 +4502,9 @@ var Parser = function ParserClosure() {
|
|||
} else {
|
||||
(0, _util.assert)(state === 2);
|
||||
if (ch === SPACE || ch === LF || ch === CR) {
|
||||
n = 5;
|
||||
followingBytes = stream.peekBytes(n);
|
||||
for (i = 0; i < n; i++) {
|
||||
maybeEIPos = stream.pos;
|
||||
let followingBytes = stream.peekBytes(n);
|
||||
for (let i = 0; i < n; i++) {
|
||||
ch = followingBytes[i];
|
||||
if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) {
|
||||
state = 0;
|
||||
|
@ -4519,6 +4519,13 @@ var Parser = function ParserClosure() {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (ch === -1) {
|
||||
(0, _util.warn)('findDefaultInlineStreamEnd: ' + 'Reached the end of the stream without finding a valid EI marker');
|
||||
if (maybeEIPos) {
|
||||
(0, _util.warn)('... trying to recover by using the last "EI" occurrence.');
|
||||
stream.skip(-(stream.pos - maybeEIPos));
|
||||
}
|
||||
}
|
||||
return stream.pos - 4 - startPos;
|
||||
},
|
||||
findDCTDecodeInlineStreamEnd: function Parser_findDCTDecodeInlineStreamEnd(stream) {
|
||||
|
@ -22519,9 +22526,16 @@ var XRef = function XRefClosure() {
|
|||
},
|
||||
readXRef: function XRef_readXRef(recoveryMode) {
|
||||
var stream = this.stream;
|
||||
let startXRefParsedCache = Object.create(null);
|
||||
try {
|
||||
while (this.startXRefQueue.length) {
|
||||
var startXRef = this.startXRefQueue[0];
|
||||
if (startXRefParsedCache[startXRef]) {
|
||||
(0, _util.warn)('readXRef - skipping XRef table since it was already parsed.');
|
||||
this.startXRefQueue.shift();
|
||||
continue;
|
||||
}
|
||||
startXRefParsedCache[startXRef] = true;
|
||||
stream.pos = startXRef + stream.start;
|
||||
var parser = new _parser.Parser(new _parser.Lexer(stream), true, this);
|
||||
var obj = parser.getObj();
|
||||
|
@ -40037,8 +40051,8 @@ exports.Type1Parser = Type1Parser;
|
|||
"use strict";
|
||||
|
||||
|
||||
var pdfjsVersion = '1.9.456';
|
||||
var pdfjsBuild = 'cb10c03d';
|
||||
var pdfjsVersion = '1.9.476';
|
||||
var pdfjsBuild = '26c45369';
|
||||
var pdfjsCoreWorker = __w_pdfjs_require__(17);
|
||||
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
|
||||
|
||||
|
|
|
@ -1222,8 +1222,7 @@ let PDFViewerApplication = {
|
|||
return this.open(file, args);
|
||||
});
|
||||
}
|
||||
let parameters = Object.create(null),
|
||||
scale;
|
||||
let parameters = Object.create(null);
|
||||
if (typeof file === 'string') {
|
||||
this.setTitleUsingUrl(file);
|
||||
parameters.url = file;
|
||||
|
@ -1236,14 +1235,11 @@ let PDFViewerApplication = {
|
|||
parameters.docBaseUrl = this.baseUrl;
|
||||
if (args) {
|
||||
for (let prop in args) {
|
||||
if (prop === 'length') {
|
||||
this.pdfDocumentProperties.setFileSize(args[prop]);
|
||||
}
|
||||
parameters[prop] = args[prop];
|
||||
}
|
||||
if (args.scale) {
|
||||
scale = args.scale;
|
||||
}
|
||||
if (args.length) {
|
||||
this.pdfDocumentProperties.setFileSize(args.length);
|
||||
}
|
||||
}
|
||||
let loadingTask = (0, _pdfjsLib.getDocument)(parameters);
|
||||
this.pdfLoadingTask = loadingTask;
|
||||
|
@ -1256,7 +1252,7 @@ let PDFViewerApplication = {
|
|||
};
|
||||
loadingTask.onUnsupportedFeature = this.fallback.bind(this);
|
||||
return loadingTask.promise.then(pdfDocument => {
|
||||
this.load(pdfDocument, scale);
|
||||
this.load(pdfDocument);
|
||||
}, exception => {
|
||||
let message = exception && exception.message;
|
||||
let loadingErrorMessage;
|
||||
|
@ -1350,8 +1346,7 @@ let PDFViewerApplication = {
|
|||
}
|
||||
}
|
||||
},
|
||||
load(pdfDocument, scale) {
|
||||
scale = scale || _ui_utils.UNKNOWN_SCALE;
|
||||
load(pdfDocument) {
|
||||
this.pdfDocument = pdfDocument;
|
||||
pdfDocument.getDownloadInfo().then(() => {
|
||||
this.downloadComplete = true;
|
||||
|
@ -1417,10 +1412,7 @@ let PDFViewerApplication = {
|
|||
sidebarView
|
||||
};
|
||||
}).then(({ hash, sidebarView }) => {
|
||||
this.setInitialView(hash, {
|
||||
sidebarView,
|
||||
scale
|
||||
});
|
||||
this.setInitialView(hash, { sidebarView });
|
||||
initialParams.hash = hash;
|
||||
if (!this.isViewerEmbedded) {
|
||||
pdfViewer.focus();
|
||||
|
@ -1533,8 +1525,7 @@ let PDFViewerApplication = {
|
|||
});
|
||||
});
|
||||
},
|
||||
setInitialView(storedHash, options = {}) {
|
||||
let { scale = 0, sidebarView = _pdf_sidebar.SidebarView.NONE } = options;
|
||||
setInitialView(storedHash, { sidebarView } = {}) {
|
||||
this.isInitialViewSet = true;
|
||||
this.pdfSidebar.setInitialView(sidebarView);
|
||||
if (this.initialDestination) {
|
||||
|
@ -1546,9 +1537,6 @@ let PDFViewerApplication = {
|
|||
this.initialBookmark = null;
|
||||
} else if (storedHash) {
|
||||
this.pdfLinkService.setHash(storedHash);
|
||||
} else if (scale) {
|
||||
this.pdfViewer.currentScaleValue = scale;
|
||||
this.page = 1;
|
||||
}
|
||||
this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel);
|
||||
this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber);
|
||||
|
@ -5684,7 +5672,7 @@ class PDFSidebar {
|
|||
get isAttachmentsViewVisible() {
|
||||
return this.isOpen && this.active === SidebarView.ATTACHMENTS;
|
||||
}
|
||||
setInitialView(view) {
|
||||
setInitialView(view = SidebarView.NONE) {
|
||||
if (this.isInitialViewSet) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -113,3 +113,7 @@
|
|||
<!ENTITY browserContainersEnabled.accesskey "n">
|
||||
<!ENTITY browserContainersSettings.label "Settings…">
|
||||
<!ENTITY browserContainersSettings.accesskey "i">
|
||||
|
||||
<!ENTITY a11yPrivacy.checkbox.label "Prevent accessibility services from accessing your browser">
|
||||
<!ENTITY a11yPrivacy.checkbox.accesskey "a">
|
||||
<!ENTITY a11yPrivacy.learnmore.label "Learn more">
|
||||
|
|
|
@ -73,7 +73,7 @@ rule.selectorHighlighter.tooltip=Highlight all elements matching this selector
|
|||
|
||||
# LOCALIZATION NOTE (rule.colorSwatch.tooltip): Text displayed in a tooltip
|
||||
# when the mouse is over a color swatch in the rule view.
|
||||
rule.colorSwatch.tooltip=Click to open the color picker, shift+click to change the color format
|
||||
rule.colorSwatch.tooltip=Click to open the color picker, Shift+click to change the color format
|
||||
|
||||
# LOCALIZATION NOTE (rule.bezierSwatch.tooltip): Text displayed in a tooltip
|
||||
# when the mouse is over a cubic-bezier swatch in the rule view.
|
||||
|
|
|
@ -15,7 +15,14 @@
|
|||
#include "GMPLog.h"
|
||||
#include "mozilla/Move.h"
|
||||
|
||||
#ifndef XP_WIN
|
||||
#ifdef XP_WIN
|
||||
#include "WinUtils.h"
|
||||
#include "nsWindowsDllInterceptor.h"
|
||||
#include <windows.h>
|
||||
#include <strsafe.h>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
@ -27,8 +34,16 @@ extern const GMPPlatformAPI* sPlatform;
|
|||
|
||||
namespace mozilla {
|
||||
|
||||
#ifdef XP_WIN
|
||||
static void
|
||||
InitializeHooks();
|
||||
#endif
|
||||
|
||||
ChromiumCDMAdapter::ChromiumCDMAdapter(nsTArray<Pair<nsCString, nsCString>>&& aHostPathPairs)
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
InitializeHooks();
|
||||
#endif
|
||||
PopulateHostFiles(Move(aHostPathPairs));
|
||||
}
|
||||
|
||||
|
@ -169,6 +184,99 @@ ChromiumCDMAdapter::Supports(int32_t aModuleVersion,
|
|||
aHostVersion == cdm::Host_8::kVersion;
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
|
||||
static WindowsDllInterceptor sKernel32Intercept;
|
||||
|
||||
typedef DWORD(WINAPI* QueryDosDeviceWFnPtr)(_In_opt_ LPCWSTR lpDeviceName,
|
||||
_Out_ LPWSTR lpTargetPath,
|
||||
_In_ DWORD ucchMax);
|
||||
|
||||
static QueryDosDeviceWFnPtr sOriginalQueryDosDeviceWFnPtr = nullptr;
|
||||
|
||||
static std::unordered_map<std::wstring, std::wstring>* sDeviceNames = nullptr;
|
||||
|
||||
DWORD WINAPI
|
||||
QueryDosDeviceWHook(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
|
||||
{
|
||||
if (!sDeviceNames) {
|
||||
return 0;
|
||||
}
|
||||
std::wstring name = std::wstring(lpDeviceName);
|
||||
auto iter = sDeviceNames->find(name);
|
||||
if (iter == sDeviceNames->end()) {
|
||||
return 0;
|
||||
}
|
||||
const std::wstring& device = iter->second;
|
||||
if (device.size() + 1 > ucchMax) {
|
||||
return 0;
|
||||
}
|
||||
PodCopy(lpTargetPath, device.c_str(), device.size());
|
||||
lpTargetPath[device.size()] = 0;
|
||||
GMP_LOG("QueryDosDeviceWHook %S -> %S", lpDeviceName, lpTargetPath);
|
||||
return name.size();
|
||||
}
|
||||
|
||||
static std::vector<std::wstring>
|
||||
GetDosDeviceNames()
|
||||
{
|
||||
std::vector<std::wstring> v;
|
||||
std::vector<wchar_t> buf;
|
||||
buf.resize(1024);
|
||||
DWORD rv = GetLogicalDriveStringsW(buf.size(), buf.data());
|
||||
if (rv == 0 || rv > buf.size()) {
|
||||
return v;
|
||||
}
|
||||
|
||||
// buf will be a list of null terminated strings, with the last string
|
||||
// being 0 length.
|
||||
const wchar_t* p = buf.data();
|
||||
const wchar_t* end = &buf.back();
|
||||
size_t l;
|
||||
while (p < end && (l = wcsnlen_s(p, end - p)) > 0) {
|
||||
// The string is of the form "C:\". We need to strip off the trailing
|
||||
// backslash.
|
||||
std::wstring drive = std::wstring(p, p + l);
|
||||
if (drive.back() == '\\') {
|
||||
drive.erase(drive.end() - 1);
|
||||
}
|
||||
v.push_back(move(drive));
|
||||
p += l + 1;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
static std::wstring
|
||||
GetDeviceMapping(const std::wstring& aDosDeviceName)
|
||||
{
|
||||
wchar_t buf[MAX_PATH] = { 0 };
|
||||
DWORD rv = QueryDosDeviceW(aDosDeviceName.c_str(), buf, MAX_PATH);
|
||||
if (rv == 0) {
|
||||
return std::wstring(L"");
|
||||
}
|
||||
return std::wstring(buf, buf + rv);
|
||||
}
|
||||
|
||||
static void
|
||||
InitializeHooks()
|
||||
{
|
||||
static bool initialized = false;
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
initialized = true;
|
||||
sDeviceNames = new std::unordered_map<std::wstring, std::wstring>();
|
||||
for (const std::wstring& name : GetDosDeviceNames()) {
|
||||
sDeviceNames->emplace(name, GetDeviceMapping(name));
|
||||
}
|
||||
|
||||
sKernel32Intercept.Init("kernelbase.dll");
|
||||
sKernel32Intercept.AddHook("QueryDosDeviceW",
|
||||
reinterpret_cast<intptr_t>(QueryDosDeviceWHook),
|
||||
(void**)(&sOriginalQueryDosDeviceWFnPtr));
|
||||
}
|
||||
#endif
|
||||
|
||||
HostFile::HostFile(HostFile&& aOther)
|
||||
: mPath(aOther.mPath)
|
||||
, mFile(aOther.TakePlatformFile())
|
||||
|
|
|
@ -689,6 +689,18 @@ Layer::GetEffectiveMixBlendMode()
|
|||
return mSimpleAttrs.MixBlendMode();
|
||||
}
|
||||
|
||||
Matrix4x4
|
||||
Layer::ComputeTransformToPreserve3DRoot()
|
||||
{
|
||||
Matrix4x4 transform = GetLocalTransform();
|
||||
for (Layer* layer = GetParent();
|
||||
layer && layer->Extend3DContext();
|
||||
layer = layer->GetParent()) {
|
||||
transform = transform * layer->GetLocalTransform();
|
||||
}
|
||||
return transform;
|
||||
}
|
||||
|
||||
void
|
||||
Layer::ComputeEffectiveTransformForMaskLayers(const gfx::Matrix4x4& aTransformToSurface)
|
||||
{
|
||||
|
|
|
@ -1682,6 +1682,15 @@ public:
|
|||
return mEffectiveTransform;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the current layers participates in a preserve-3d
|
||||
* context (returns true for Combines3DTransformWithAncestors),
|
||||
* returns the combined transform up to the preserve-3d (nearest
|
||||
* ancestor that doesn't Extend3DContext()). Otherwise returns
|
||||
* the local transform.
|
||||
*/
|
||||
gfx::Matrix4x4 ComputeTransformToPreserve3DRoot();
|
||||
|
||||
/**
|
||||
* @param aTransformToSurface the composition of the transforms
|
||||
* from the parent layer (if any) to the destination pixel grid.
|
||||
|
|
|
@ -723,6 +723,74 @@ ContainerLayerComposite::CleanupResources()
|
|||
}
|
||||
}
|
||||
|
||||
static LayerIntRect
|
||||
TransformRect(const LayerIntRect& aRect, const Matrix4x4& aTransform)
|
||||
{
|
||||
if (aRect.IsEmpty()) {
|
||||
return LayerIntRect();
|
||||
}
|
||||
|
||||
Rect rect(aRect.x, aRect.y, aRect.width, aRect.height);
|
||||
rect = aTransform.TransformAndClipBounds(rect, Rect::MaxIntRect());
|
||||
rect.RoundOut();
|
||||
|
||||
IntRect intRect;
|
||||
if (!gfxUtils::GfxRectToIntRect(ThebesRect(rect), &intRect)) {
|
||||
return LayerIntRect();
|
||||
}
|
||||
|
||||
return ViewAs<LayerPixel>(intRect);
|
||||
}
|
||||
|
||||
static void
|
||||
AddTransformedRegion(LayerIntRegion& aDest, const LayerIntRegion& aSource, const Matrix4x4& aTransform)
|
||||
{
|
||||
for (auto iter = aSource.RectIter(); !iter.Done(); iter.Next()) {
|
||||
aDest.Or(aDest, TransformRect(iter.Get(), aTransform));
|
||||
}
|
||||
aDest.SimplifyOutward(20);
|
||||
}
|
||||
|
||||
// Async animations can move child layers without updating our visible region.
|
||||
// PostProcessLayers will recompute visible regions for layers with an intermediate
|
||||
// surface, but otherwise we need to do it now.
|
||||
void
|
||||
ComputeVisibleRegionForChildren(ContainerLayer* aContainer, LayerIntRegion& aResult)
|
||||
{
|
||||
for (Layer* l = aContainer->GetFirstChild(); l; l = l->GetNextSibling()) {
|
||||
if (l->Extend3DContext()) {
|
||||
MOZ_ASSERT(l->AsContainerLayer());
|
||||
ComputeVisibleRegionForChildren(l->AsContainerLayer(), aResult);
|
||||
} else {
|
||||
AddTransformedRegion(aResult,
|
||||
l->GetLocalVisibleRegion(),
|
||||
l->ComputeTransformToPreserve3DRoot());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const LayerIntRegion&
|
||||
ContainerLayerComposite::GetShadowVisibleRegion()
|
||||
{
|
||||
if (!UseIntermediateSurface()) {
|
||||
mShadowVisibleRegion.SetEmpty();
|
||||
ComputeVisibleRegionForChildren(this, mShadowVisibleRegion);
|
||||
}
|
||||
|
||||
return mShadowVisibleRegion;
|
||||
}
|
||||
|
||||
const LayerIntRegion&
|
||||
RefLayerComposite::GetShadowVisibleRegion()
|
||||
{
|
||||
if (!UseIntermediateSurface()) {
|
||||
mShadowVisibleRegion.SetEmpty();
|
||||
ComputeVisibleRegionForChildren(this, mShadowVisibleRegion);
|
||||
}
|
||||
|
||||
return mShadowVisibleRegion;
|
||||
}
|
||||
|
||||
RefLayerComposite::RefLayerComposite(LayerManagerComposite* aManager)
|
||||
: RefLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
|
|
|
@ -88,6 +88,8 @@ public:
|
|||
DefaultComputeEffectiveTransforms(aTransformToSurface);
|
||||
}
|
||||
|
||||
virtual const LayerIntRegion& GetShadowVisibleRegion() override;
|
||||
|
||||
virtual void CleanupResources() override;
|
||||
|
||||
virtual HostLayer* AsHostLayer() override { return this; }
|
||||
|
@ -183,6 +185,8 @@ public:
|
|||
DefaultComputeEffectiveTransforms(aTransformToSurface);
|
||||
}
|
||||
|
||||
virtual const LayerIntRegion& GetShadowVisibleRegion() override;
|
||||
|
||||
virtual void Cleanup() override;
|
||||
|
||||
virtual void CleanupResources() override;
|
||||
|
|
|
@ -262,21 +262,6 @@ bool ShouldProcessLayer(Layer* aLayer)
|
|||
return aLayer->AsContainerLayer()->UseIntermediateSurface();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get accumulated transform of from the context creating layer to the
|
||||
* given layer.
|
||||
*/
|
||||
static Matrix4x4
|
||||
GetAccTransformIn3DContext(Layer* aLayer) {
|
||||
Matrix4x4 transform = aLayer->GetLocalTransform();
|
||||
for (Layer* layer = aLayer->GetParent();
|
||||
layer && layer->Extend3DContext();
|
||||
layer = layer->GetParent()) {
|
||||
transform = transform * layer->GetLocalTransform();
|
||||
}
|
||||
return transform;
|
||||
}
|
||||
|
||||
void
|
||||
LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
||||
nsIntRegion& aOpaqueRegion,
|
||||
|
@ -307,7 +292,7 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
// that it can later be intersected with our visible region.
|
||||
// If our transform is a perspective, there's no meaningful insideClip rect
|
||||
// we can compute (it would need to be a cone).
|
||||
Matrix4x4 localTransform = GetAccTransformIn3DContext(aLayer);
|
||||
Matrix4x4 localTransform = aLayer->ComputeTransformToPreserve3DRoot();
|
||||
if (!localTransform.HasPerspectiveComponent() && localTransform.Invert()) {
|
||||
LayerRect insideClipFloat =
|
||||
UntransformBy(ViewAs<ParentLayerToLayerMatrix4x4>(localTransform),
|
||||
|
@ -327,6 +312,13 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
Some(ViewAs<ParentLayerPixel>(*insideClip, PixelCastJustification::MovingDownToChildren));
|
||||
}
|
||||
|
||||
nsIntRegion dummy;
|
||||
nsIntRegion& opaqueRegion = aOpaqueRegion;
|
||||
if (aLayer->Extend3DContext() ||
|
||||
aLayer->Combines3DTransformWithAncestors()) {
|
||||
opaqueRegion = dummy;
|
||||
}
|
||||
|
||||
if (!ShouldProcessLayer(aLayer)) {
|
||||
MOZ_ASSERT(aLayer->AsContainerLayer() && !aLayer->AsContainerLayer()->UseIntermediateSurface());
|
||||
// For layers participating 3D rendering context, their visible
|
||||
|
@ -345,7 +337,7 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
renderTargetClip = IntersectMaybeRects(renderTargetClip, Some(clip));
|
||||
}
|
||||
|
||||
PostProcessLayers(child, aOpaqueRegion, aVisibleRegion,
|
||||
PostProcessLayers(child, opaqueRegion, aVisibleRegion,
|
||||
renderTargetClip, ancestorClipForChildren);
|
||||
}
|
||||
return;
|
||||
|
@ -363,7 +355,7 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
if (transform.Is2D(&transform2d)) {
|
||||
if (transform2d.IsIntegerTranslation()) {
|
||||
integerTranslation = Some(IntPoint::Truncate(transform2d.GetTranslation()));
|
||||
localOpaque = aOpaqueRegion;
|
||||
localOpaque = opaqueRegion;
|
||||
localOpaque.MoveBy(-*integerTranslation);
|
||||
}
|
||||
}
|
||||
|
@ -431,7 +423,7 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
if (aRenderTargetClip) {
|
||||
localOpaque.AndWith(aRenderTargetClip->ToUnknownRect());
|
||||
}
|
||||
aOpaqueRegion.OrWith(localOpaque);
|
||||
opaqueRegion.OrWith(localOpaque);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -607,12 +607,11 @@ public:
|
|||
// These getters can be used anytime.
|
||||
float GetShadowOpacity() { return mShadowOpacity; }
|
||||
const Maybe<ParentLayerIntRect>& GetShadowClipRect() { return mShadowClipRect; }
|
||||
const LayerIntRegion& GetShadowVisibleRegion() const { return mShadowVisibleRegion; }
|
||||
virtual const LayerIntRegion& GetShadowVisibleRegion() { return mShadowVisibleRegion; }
|
||||
const gfx::Matrix4x4& GetShadowBaseTransform() { return mShadowTransform; }
|
||||
gfx::Matrix4x4 GetShadowTransform();
|
||||
bool GetShadowTransformSetByAnimation() { return mShadowTransformSetByAnimation; }
|
||||
bool GetShadowOpacitySetByAnimation() { return mShadowOpacitySetByAnimation; }
|
||||
LayerIntRegion&& GetShadowVisibleRegion() { return Move(mShadowVisibleRegion); }
|
||||
|
||||
protected:
|
||||
HostLayerManager* mCompositorManager;
|
||||
|
|
|
@ -6304,7 +6304,10 @@ Parser<ParseHandler, CharT>::forStatement(YieldHandling yieldHandling)
|
|||
}
|
||||
}
|
||||
|
||||
MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_AFTER_FOR);
|
||||
MUST_MATCH_TOKEN_MOD_WITH_REPORT(TOK_LP, TokenStream::None,
|
||||
error((token == TOK_AWAIT && !pc->isAsync())
|
||||
? JSMSG_FOR_AWAIT_OUTSIDE_ASYNC
|
||||
: JSMSG_PAREN_AFTER_FOR));
|
||||
|
||||
// PNK_FORHEAD, PNK_FORIN, or PNK_FOROF depending on the loop type.
|
||||
ParseNodeKind headKind;
|
||||
|
|
|
@ -188,7 +188,7 @@ MSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG, 0, JSEXN_INTERNALERR, "array initializer
|
|||
MSG_DEF(JSMSG_AS_AFTER_IMPORT_STAR, 0, JSEXN_SYNTAXERR, "missing keyword 'as' after import *")
|
||||
MSG_DEF(JSMSG_AS_AFTER_RESERVED_WORD, 1, JSEXN_SYNTAXERR, "missing keyword 'as' after reserved word '{0}'")
|
||||
MSG_DEF(JSMSG_AWAIT_IN_DEFAULT, 0, JSEXN_SYNTAXERR, "await can't be used in default expression")
|
||||
MSG_DEF(JSMSG_AWAIT_OUTSIDE_ASYNC, 0, JSEXN_SYNTAXERR, "await is only valid in async functions")
|
||||
MSG_DEF(JSMSG_AWAIT_OUTSIDE_ASYNC, 0, JSEXN_SYNTAXERR, "await is only valid in async functions and async generators")
|
||||
MSG_DEF(JSMSG_BAD_ARROW_ARGS, 0, JSEXN_SYNTAXERR, "invalid arrow-function arguments (parentheses around the arrow-function may help)")
|
||||
MSG_DEF(JSMSG_BAD_BINDING, 1, JSEXN_SYNTAXERR, "redefining {0} is deprecated")
|
||||
MSG_DEF(JSMSG_BAD_CONST_DECL, 0, JSEXN_SYNTAXERR, "missing = in const declaration")
|
||||
|
@ -263,6 +263,7 @@ MSG_DEF(JSMSG_EQUAL_AS_ASSIGN, 0, JSEXN_SYNTAXERR, "test for equality (=
|
|||
MSG_DEF(JSMSG_EXPORT_DECL_AT_TOP_LEVEL,0, JSEXN_SYNTAXERR, "export declarations may only appear at top level of a module")
|
||||
MSG_DEF(JSMSG_FINALLY_WITHOUT_TRY, 0, JSEXN_SYNTAXERR, "finally without try")
|
||||
MSG_DEF(JSMSG_FORBIDDEN_AS_STATEMENT, 1, JSEXN_SYNTAXERR, "{0} can't appear in single-statement context")
|
||||
MSG_DEF(JSMSG_FOR_AWAIT_OUTSIDE_ASYNC, 0, JSEXN_SYNTAXERR, "for await (... of ...) is only valid in async functions and async generators")
|
||||
MSG_DEF(JSMSG_FROM_AFTER_IMPORT_CLAUSE, 0, JSEXN_SYNTAXERR, "missing keyword 'from' after import clause")
|
||||
MSG_DEF(JSMSG_FROM_AFTER_EXPORT_STAR, 0, JSEXN_SYNTAXERR, "missing keyword 'from' after export *")
|
||||
MSG_DEF(JSMSG_GARBAGE_AFTER_INPUT, 2, JSEXN_SYNTAXERR, "unexpected garbage after {0}, starting with {1}")
|
||||
|
|
|
@ -7,7 +7,7 @@ let caught = false;
|
|||
try {
|
||||
eval("await 10");
|
||||
} catch(e) {
|
||||
assertEq(e.message, "await is only valid in async functions");
|
||||
assertEq(e.message.includes("await is only valid in"), true);
|
||||
caught = true;
|
||||
}
|
||||
assertEq(caught, true);
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
var BUGNUMBER = 1391519;
|
||||
var summary = "for-await-of outside of async function should provide better error";
|
||||
|
||||
print(BUGNUMBER + ": " + summary);
|
||||
|
||||
let caught = false;
|
||||
try {
|
||||
eval("for await (let x of []) {}");
|
||||
} catch(e) {
|
||||
assertEq(e.message.includes("for await (... of ...) is only valid in"), true);
|
||||
caught = true;
|
||||
}
|
||||
assertEq(caught, true);
|
||||
|
||||
// Extra `await` shouldn't throw that error.
|
||||
caught = false;
|
||||
try {
|
||||
eval("async function f() { for await await (let x of []) {} }");
|
||||
} catch(e) {
|
||||
assertEq(e.message, "missing ( after for");
|
||||
caught = true;
|
||||
}
|
||||
assertEq(caught, true);
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
|
@ -481,8 +481,8 @@ def print_automation_format(ok, res):
|
|||
result = "TEST-PASS" if ok else "TEST-UNEXPECTED-FAIL"
|
||||
message = "Success" if ok else res.describe_failure()
|
||||
jitflags = " ".join(res.test.jitflags)
|
||||
print("{} | {} | {} (code {}, args \"{}\")".format(
|
||||
result, res.test.relpath_top, message, res.rc, jitflags))
|
||||
print("{} | {} | {} (code {}, args \"{}\") [{:.1f} s]".format(
|
||||
result, res.test.relpath_top, message, res.rc, jitflags, res.dt))
|
||||
|
||||
# For failed tests, print as much information as we have, to aid debugging.
|
||||
if ok:
|
||||
|
|
|
@ -300,4 +300,5 @@ class ResultsSink:
|
|||
result += ' | (SKIP)'
|
||||
if time > self.options.timeout:
|
||||
result += ' | (TIMEOUT)'
|
||||
result += ' [{:.1f} s]'.format(time)
|
||||
print(result)
|
||||
|
|
|
@ -961,6 +961,12 @@ IsHeapAccessAddress(const Instance &instance, uint8_t* faultingAddress)
|
|||
faultingAddress < instance.memoryBase() + accessLimit;
|
||||
}
|
||||
|
||||
MOZ_COLD static bool
|
||||
IsActiveContext(JSContext* cx)
|
||||
{
|
||||
return cx == cx->runtime()->activeContext();
|
||||
}
|
||||
|
||||
#if defined(XP_WIN)
|
||||
|
||||
static bool
|
||||
|
@ -980,7 +986,7 @@ HandleFault(PEXCEPTION_POINTERS exception)
|
|||
|
||||
// Don't allow recursive handling of signals, see AutoSetHandlingSegFault.
|
||||
JSContext* cx = TlsContext.get();
|
||||
if (!cx || cx->handlingSegFault)
|
||||
if (!cx || cx->handlingSegFault || !IsActiveContext(cx))
|
||||
return false;
|
||||
AutoSetHandlingSegFault handling(cx);
|
||||
|
||||
|
@ -1083,7 +1089,7 @@ static bool
|
|||
HandleMachException(JSContext* cx, const ExceptionRequest& request)
|
||||
{
|
||||
// Don't allow recursive handling of signals, see AutoSetHandlingSegFault.
|
||||
if (cx->handlingSegFault)
|
||||
if (cx->handlingSegFault || !IsActiveContext(cx))
|
||||
return false;
|
||||
AutoSetHandlingSegFault handling(cx);
|
||||
|
||||
|
@ -1337,7 +1343,7 @@ HandleFault(int signum, siginfo_t* info, void* ctx)
|
|||
|
||||
// Don't allow recursive handling of signals, see AutoSetHandlingSegFault.
|
||||
JSContext* cx = TlsContext.get();
|
||||
if (!cx || cx->handlingSegFault)
|
||||
if (!cx || cx->handlingSegFault || !IsActiveContext(cx))
|
||||
return false;
|
||||
AutoSetHandlingSegFault handling(cx);
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[transform3d-sorting-001.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -316,6 +316,13 @@ bool TestCreateFileA(void* aFunc)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TestQueryDosDeviceW(void* aFunc)
|
||||
{
|
||||
auto patchedQueryDosDeviceW =
|
||||
reinterpret_cast<decltype(&QueryDosDeviceW)>(aFunc);
|
||||
return patchedQueryDosDeviceW(nullptr, nullptr, 0) == 0;
|
||||
}
|
||||
|
||||
bool TestInSendMessageEx(void* aFunc)
|
||||
{
|
||||
auto patchedInSendMessageEx =
|
||||
|
@ -509,6 +516,7 @@ int main()
|
|||
TestHook(TestCreateFileW, "kernel32.dll", "CreateFileW") && // see Bug 1316415
|
||||
#endif
|
||||
TestHook(TestCreateFileA, "kernel32.dll", "CreateFileA") &&
|
||||
TestHook(TestQueryDosDeviceW, "kernelbase.dll", "QueryDosDeviceW") &&
|
||||
TestDetour("user32.dll", "CreateWindowExW") &&
|
||||
TestHook(TestInSendMessageEx, "user32.dll", "InSendMessageEx") &&
|
||||
TestHook(TestImmGetContext, "imm32.dll", "ImmGetContext") &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче