Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit af897e2

Browse files
committed
Merge inbound to mozilla-central. a=merge
2 parents 6ef01a0 + df82180 commit af897e2

77 files changed

Lines changed: 581 additions & 198 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

accessible/generic/Accessible.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,8 +2452,7 @@ Accessible* Accessible::CurrentItem() const {
24522452
dom::Document* DOMDoc = mContent->OwnerDoc();
24532453
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
24542454
if (activeDescendantElm) {
2455-
if (nsContentUtils::ContentIsDescendantOf(mContent,
2456-
activeDescendantElm)) {
2455+
if (mContent->IsInclusiveDescendantOf(activeDescendantElm)) {
24572456
// Don't want a cyclical descendant relationship. That would be bad.
24582457
return nullptr;
24592458
}

accessible/generic/DocAccessible.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,7 @@ void DocAccessible::DoARIAOwnsRelocation(Accessible* aOwner) {
19381938
// Make an attempt to create an accessible if it wasn't created yet.
19391939
if (!child) {
19401940
// An owned child cannot be an ancestor of the owner.
1941-
if (nsContentUtils::ContentIsDescendantOf(aOwner->Elm(), childEl)) {
1941+
if (aOwner->Elm()->IsInclusiveDescendantOf(childEl)) {
19421942
continue;
19431943
}
19441944

accessible/generic/HyperTextAccessible.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,12 +1530,12 @@ bool HyperTextAccessible::SelectionBoundsAt(int32_t aSelectionNum,
15301530
endOffset = tempOffset;
15311531
}
15321532

1533-
if (!nsContentUtils::ContentIsDescendantOf(startNode, mContent))
1533+
if (!startNode->IsInclusiveDescendantOf(mContent))
15341534
*aStartOffset = 0;
15351535
else
15361536
*aStartOffset = DOMPointToOffset(startNode, startOffset);
15371537

1538-
if (!nsContentUtils::ContentIsDescendantOf(endNode, mContent))
1538+
if (!endNode->IsInclusiveDescendantOf(mContent))
15391539
*aEndOffset = CharacterCount();
15401540
else
15411541
*aEndOffset = DOMPointToOffset(endNode, endOffset, true);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This is the PDF.js project output, https://github.com/mozilla/pdf.js
22

3-
Current extension version is: 2.3.13
3+
Current extension version is: 2.3.27
44

5-
Taken from upstream commit: 28326165
5+
Taken from upstream commit: 13ebfec9

browser/extensions/pdfjs/content/build/pdf.js

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap
123123
"use strict";
124124

125125

126-
var pdfjsVersion = '2.3.13';
127-
var pdfjsBuild = '28326165';
126+
var pdfjsVersion = '2.3.27';
127+
var pdfjsBuild = '13ebfec9';
128128

129129
var pdfjsSharedUtil = __w_pdfjs_require__(1);
130130

@@ -1304,7 +1304,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
13041304

13051305
return worker.messageHandler.sendWithPromise('GetDocRequest', {
13061306
docId,
1307-
apiVersion: '2.3.13',
1307+
apiVersion: '2.3.27',
13081308
source: {
13091309
data: source.data,
13101310
url: source.url,
@@ -2620,6 +2620,8 @@ class WorkerTransport {
26202620

26212621
if (intentState.displayReadyCapability) {
26222622
intentState.displayReadyCapability.reject(new Error(data.error));
2623+
} else if (intentState.opListReadCapability) {
2624+
intentState.opListReadCapability.reject(new Error(data.error));
26232625
} else {
26242626
throw new Error(data.error);
26252627
}
@@ -3098,9 +3100,9 @@ const InternalRenderTask = function InternalRenderTaskClosure() {
30983100
return InternalRenderTask;
30993101
}();
31003102

3101-
const version = '2.3.13';
3103+
const version = '2.3.27';
31023104
exports.version = version;
3103-
const build = '28326165';
3105+
const build = '13ebfec9';
31043106
exports.build = build;
31053107

31063108
/***/ }),
@@ -4903,15 +4905,20 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
49034905
consumePath = typeof consumePath !== 'undefined' ? consumePath : true;
49044906
var ctx = this.ctx;
49054907
var strokeColor = this.current.strokeColor;
4906-
ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth);
49074908
ctx.globalAlpha = this.current.strokeAlpha;
49084909

49094910
if (strokeColor && strokeColor.hasOwnProperty('type') && strokeColor.type === 'Pattern') {
49104911
ctx.save();
4912+
let transform = ctx.mozCurrentTransform;
4913+
4914+
const scale = _util.Util.singularValueDecompose2dScale(transform)[0];
4915+
49114916
ctx.strokeStyle = strokeColor.getPattern(ctx, this);
4917+
ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth * scale);
49124918
ctx.stroke();
49134919
ctx.restore();
49144920
} else {
4921+
ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth);
49154922
ctx.stroke();
49164923
}
49174924

@@ -5908,17 +5915,32 @@ exports.TilingPattern = void 0;
59085915
var _util = __w_pdfjs_require__(1);
59095916

59105917
var ShadingIRs = {};
5918+
5919+
function applyBoundingBox(ctx, bbox) {
5920+
if (!bbox || typeof Path2D === 'undefined') {
5921+
return;
5922+
}
5923+
5924+
const width = bbox[2] - bbox[0];
5925+
const height = bbox[3] - bbox[1];
5926+
const region = new Path2D();
5927+
region.rect(bbox[0], bbox[1], width, height);
5928+
ctx.clip(region);
5929+
}
5930+
59115931
ShadingIRs.RadialAxial = {
59125932
fromIR: function RadialAxial_fromIR(raw) {
59135933
var type = raw[1];
5914-
var colorStops = raw[2];
5915-
var p0 = raw[3];
5916-
var p1 = raw[4];
5917-
var r0 = raw[5];
5918-
var r1 = raw[6];
5934+
var bbox = raw[2];
5935+
var colorStops = raw[3];
5936+
var p0 = raw[4];
5937+
var p1 = raw[5];
5938+
var r0 = raw[6];
5939+
var r1 = raw[7];
59195940
return {
59205941
type: 'Pattern',
59215942
getPattern: function RadialAxial_getPattern(ctx) {
5943+
applyBoundingBox(ctx, bbox);
59225944
var grad;
59235945

59245946
if (type === 'axial') {
@@ -6146,10 +6168,12 @@ ShadingIRs.Mesh = {
61466168
var figures = raw[4];
61476169
var bounds = raw[5];
61486170
var matrix = raw[6];
6171+
var bbox = raw[7];
61496172
var background = raw[8];
61506173
return {
61516174
type: 'Pattern',
61526175
getPattern: function Mesh_getPattern(ctx, owner, shadingFill) {
6176+
applyBoundingBox(ctx, bbox);
61536177
var scale;
61546178

61556179
if (shadingFill) {
@@ -6390,18 +6414,14 @@ function makeReasonSerializable(reason) {
63906414
return new _util.UnknownErrorException(reason.message, reason.toString());
63916415
}
63926416

6393-
function resolveOrReject(capability, success, reason) {
6394-
if (success) {
6417+
function resolveOrReject(capability, data) {
6418+
if (data.success) {
63956419
capability.resolve();
63966420
} else {
6397-
capability.reject(reason);
6421+
capability.reject(wrapReason(data.reason));
63986422
}
63996423
}
64006424

6401-
function finalize(promise) {
6402-
return Promise.resolve(promise).catch(() => {});
6403-
}
6404-
64056425
function MessageHandler(sourceName, targetName, comObj) {
64066426
this.sourceName = sourceName;
64076427
this.targetName = targetName;
@@ -6686,19 +6706,19 @@ MessageHandler.prototype = {
66866706

66876707
let deleteStreamController = () => {
66886708
Promise.all([this.streamControllers[data.streamId].startCall, this.streamControllers[data.streamId].pullCall, this.streamControllers[data.streamId].cancelCall].map(function (capability) {
6689-
return capability && finalize(capability.promise);
6709+
return capability && capability.promise.catch(function () {});
66906710
})).then(() => {
66916711
delete this.streamControllers[data.streamId];
66926712
});
66936713
};
66946714

66956715
switch (data.stream) {
66966716
case 'start_complete':
6697-
resolveOrReject(this.streamControllers[data.streamId].startCall, data.success, wrapReason(data.reason));
6717+
resolveOrReject(this.streamControllers[data.streamId].startCall, data);
66986718
break;
66996719

67006720
case 'pull_complete':
6701-
resolveOrReject(this.streamControllers[data.streamId].pullCall, data.success, wrapReason(data.reason));
6721+
resolveOrReject(this.streamControllers[data.streamId].pullCall, data);
67026722
break;
67036723

67046724
case 'pull':
@@ -6757,7 +6777,7 @@ MessageHandler.prototype = {
67576777
break;
67586778

67596779
case 'cancel_complete':
6760-
resolveOrReject(this.streamControllers[data.streamId].cancelCall, data.success, wrapReason(data.reason));
6780+
resolveOrReject(this.streamControllers[data.streamId].cancelCall, data);
67616781
deleteStreamController();
67626782
break;
67636783

browser/extensions/pdfjs/content/build/pdf.worker.js

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap
123123
"use strict";
124124

125125

126-
const pdfjsVersion = '2.3.13';
127-
const pdfjsBuild = '28326165';
126+
const pdfjsVersion = '2.3.27';
127+
const pdfjsBuild = '13ebfec9';
128128

129129
const pdfjsCoreWorker = __w_pdfjs_require__(1);
130130

@@ -240,7 +240,7 @@ var WorkerMessageHandler = {
240240
var WorkerTasks = [];
241241
const verbosity = (0, _util.getVerbosityLevel)();
242242
let apiVersion = docParams.apiVersion;
243-
let workerVersion = '2.3.13';
243+
let workerVersion = '2.3.27';
244244

245245
if (apiVersion !== workerVersion) {
246246
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
@@ -37943,6 +37943,14 @@ Shadings.RadialAxial = function RadialAxialClosure() {
3794337943
var cs = dict.get('ColorSpace', 'CS');
3794437944
cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory);
3794537945
this.cs = cs;
37946+
const bbox = dict.getArray('BBox');
37947+
37948+
if (Array.isArray(bbox) && bbox.length === 4) {
37949+
this.bbox = _util.Util.normalizeRect(bbox);
37950+
} else {
37951+
this.bbox = null;
37952+
}
37953+
3794637954
var t0 = 0.0,
3794737955
t1 = 1.0;
3794837956

@@ -38058,7 +38066,7 @@ Shadings.RadialAxial = function RadialAxialClosure() {
3805838066
}
3805938067
}
3806038068

38061-
return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1];
38069+
return ['RadialAxial', type, this.bbox, this.colorStops, p0, p1, r0, r1];
3806238070
}
3806338071
};
3806438072
return RadialAxial;
@@ -38675,7 +38683,14 @@ Shadings.Mesh = function MeshClosure() {
3867538683
this.matrix = matrix;
3867638684
this.shadingType = dict.get('ShadingType');
3867738685
this.type = 'Pattern';
38678-
this.bbox = dict.getArray('BBox');
38686+
const bbox = dict.getArray('BBox');
38687+
38688+
if (Array.isArray(bbox) && bbox.length === 4) {
38689+
this.bbox = _util.Util.normalizeRect(bbox);
38690+
} else {
38691+
this.bbox = null;
38692+
}
38693+
3867938694
var cs = dict.get('ColorSpace', 'CS');
3868038695
cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory);
3868138696
this.cs = cs;
@@ -44571,18 +44586,14 @@ function makeReasonSerializable(reason) {
4457144586
return new _util.UnknownErrorException(reason.message, reason.toString());
4457244587
}
4457344588

44574-
function resolveOrReject(capability, success, reason) {
44575-
if (success) {
44589+
function resolveOrReject(capability, data) {
44590+
if (data.success) {
4457644591
capability.resolve();
4457744592
} else {
44578-
capability.reject(reason);
44593+
capability.reject(wrapReason(data.reason));
4457944594
}
4458044595
}
4458144596

44582-
function finalize(promise) {
44583-
return Promise.resolve(promise).catch(() => {});
44584-
}
44585-
4458644597
function MessageHandler(sourceName, targetName, comObj) {
4458744598
this.sourceName = sourceName;
4458844599
this.targetName = targetName;
@@ -44867,19 +44878,19 @@ MessageHandler.prototype = {
4486744878

4486844879
let deleteStreamController = () => {
4486944880
Promise.all([this.streamControllers[data.streamId].startCall, this.streamControllers[data.streamId].pullCall, this.streamControllers[data.streamId].cancelCall].map(function (capability) {
44870-
return capability && finalize(capability.promise);
44881+
return capability && capability.promise.catch(function () {});
4487144882
})).then(() => {
4487244883
delete this.streamControllers[data.streamId];
4487344884
});
4487444885
};
4487544886

4487644887
switch (data.stream) {
4487744888
case 'start_complete':
44878-
resolveOrReject(this.streamControllers[data.streamId].startCall, data.success, wrapReason(data.reason));
44889+
resolveOrReject(this.streamControllers[data.streamId].startCall, data);
4487944890
break;
4488044891

4488144892
case 'pull_complete':
44882-
resolveOrReject(this.streamControllers[data.streamId].pullCall, data.success, wrapReason(data.reason));
44893+
resolveOrReject(this.streamControllers[data.streamId].pullCall, data);
4488344894
break;
4488444895

4488544896
case 'pull':
@@ -44938,7 +44949,7 @@ MessageHandler.prototype = {
4493844949
break;
4493944950

4494044951
case 'cancel_complete':
44941-
resolveOrReject(this.streamControllers[data.streamId].cancelCall, data.success, wrapReason(data.reason));
44952+
resolveOrReject(this.streamControllers[data.streamId].cancelCall, data);
4494244953
deleteStreamController();
4494344954
break;
4494444955

browser/extensions/pdfjs/content/web/viewer.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9634,7 +9634,8 @@ class PDFPageView {
96349634
this.eventBus.dispatch('pagerendered', {
96359635
source: this,
96369636
pageNumber: this.id,
9637-
cssTransform: true
9637+
cssTransform: true,
9638+
timestamp: performance.now()
96389639
});
96399640
return;
96409641
}
@@ -9655,7 +9656,8 @@ class PDFPageView {
96559656
this.eventBus.dispatch('pagerendered', {
96569657
source: this,
96579658
pageNumber: this.id,
9658-
cssTransform: true
9659+
cssTransform: true,
9660+
timestamp: performance.now()
96599661
});
96609662
return;
96619663
}
@@ -9861,7 +9863,8 @@ class PDFPageView {
98619863
this.eventBus.dispatch('pagerendered', {
98629864
source: this,
98639865
pageNumber: this.id,
9864-
cssTransform: false
9866+
cssTransform: false,
9867+
timestamp: performance.now()
98659868
});
98669869

98679870
if (error) {

browser/extensions/pdfjs/moz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ origin:
2020

2121
# Human-readable identifier for this version/release
2222
# Generally "version NNN", "tag SSS", "bookmark SSS"
23-
release: version 2.3.13
23+
release: version 2.3.27
2424

2525
# The package's license, where possible using the mnemonic from
2626
# https://spdx.org/licenses/

devtools/shared/defer.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44

55
"use strict";
66

7-
// We have to keep using Promise.jsm here, because DOM Promises
8-
// start freezing during panel iframes destruction.
9-
// More info in bug 1454373 comment 15.
10-
const Promise = require("promise");
11-
127
/**
138
* Returns a deferred object, with a resolve and reject property.
149
* https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred

dom/base/Document.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9328,8 +9328,7 @@ nsINode* Document::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) {
93289328
do {
93299329
if (nsPIDOMWindowOuter* win = doc->GetWindow()) {
93309330
nsCOMPtr<nsINode> node = win->GetFrameElementInternal();
9331-
if (node &&
9332-
nsContentUtils::ContentIsDescendantOf(node, adoptedNode)) {
9331+
if (node && node->IsInclusiveDescendantOf(adoptedNode)) {
93339332
rv.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
93349333
return nullptr;
93359334
}

0 commit comments

Comments
 (0)