зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 6f1dd8377713 (bug 1326340) for browser_parsable_css.js failure
MozReview-Commit-ID: KVUOe1Pkiyq
This commit is contained in:
Родитель
7e29e33ae3
Коммит
4b4ad87d9a
|
@ -1,3 +1,3 @@
|
|||
This is the pdf.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 1.6.418
|
||||
Current extension version is: 1.6.401
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* jshint esnext:true */
|
||||
/* globals Components, Services, XPCOMUtils, PdfjsChromeUtils,
|
||||
PdfjsContentUtils, PdfStreamConverter */
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* eslint max-len: ["error", 100] */
|
||||
/* jshint esnext:true, maxlen: 100 */
|
||||
/* globals Components, Services */
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* jshint esnext:true */
|
||||
/* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils,
|
||||
dump, NetworkManager, PdfJsTelemetry, PdfjsContentUtils */
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* jshint esnext:true */
|
||||
/* globals Components, Services, XPCOMUtils */
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* jshint esnext:true */
|
||||
/* globals Components, Services, XPCOMUtils */
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
}
|
||||
}(this, function (exports) {
|
||||
'use strict';
|
||||
var pdfjsVersion = '1.6.418';
|
||||
var pdfjsBuild = '59afb4b9';
|
||||
var pdfjsVersion = '1.6.401';
|
||||
var pdfjsBuild = 'b629be05';
|
||||
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
|
||||
var pdfjsLibs = {};
|
||||
(function pdfjsWrapper() {
|
||||
|
@ -1808,15 +1808,6 @@
|
|||
switch (fieldType) {
|
||||
case 'Tx':
|
||||
return new TextWidgetAnnotationElement(parameters);
|
||||
case 'Btn':
|
||||
if (parameters.data.radioButton) {
|
||||
return new RadioButtonWidgetAnnotationElement(parameters);
|
||||
} else if (parameters.data.checkBox) {
|
||||
return new CheckboxWidgetAnnotationElement(parameters);
|
||||
} else {
|
||||
warn('Unimplemented button widget annotation: pushbutton');
|
||||
}
|
||||
break;
|
||||
case 'Ch':
|
||||
return new ChoiceWidgetAnnotationElement(parameters);
|
||||
}
|
||||
|
@ -2084,45 +2075,6 @@
|
|||
});
|
||||
return TextWidgetAnnotationElement;
|
||||
}();
|
||||
var CheckboxWidgetAnnotationElement = function CheckboxWidgetAnnotationElementClosure() {
|
||||
function CheckboxWidgetAnnotationElement(parameters) {
|
||||
WidgetAnnotationElement.call(this, parameters, parameters.renderInteractiveForms);
|
||||
}
|
||||
Util.inherit(CheckboxWidgetAnnotationElement, WidgetAnnotationElement, {
|
||||
render: function CheckboxWidgetAnnotationElement_render() {
|
||||
this.container.className = 'buttonWidgetAnnotation checkBox';
|
||||
var element = document.createElement('input');
|
||||
element.disabled = this.data.readOnly;
|
||||
element.type = 'checkbox';
|
||||
if (this.data.fieldValue && this.data.fieldValue !== 'Off') {
|
||||
element.setAttribute('checked', true);
|
||||
}
|
||||
this.container.appendChild(element);
|
||||
return this.container;
|
||||
}
|
||||
});
|
||||
return CheckboxWidgetAnnotationElement;
|
||||
}();
|
||||
var RadioButtonWidgetAnnotationElement = function RadioButtonWidgetAnnotationElementClosure() {
|
||||
function RadioButtonWidgetAnnotationElement(parameters) {
|
||||
WidgetAnnotationElement.call(this, parameters, parameters.renderInteractiveForms);
|
||||
}
|
||||
Util.inherit(RadioButtonWidgetAnnotationElement, WidgetAnnotationElement, {
|
||||
render: function RadioButtonWidgetAnnotationElement_render() {
|
||||
this.container.className = 'buttonWidgetAnnotation radioButton';
|
||||
var element = document.createElement('input');
|
||||
element.disabled = this.data.readOnly;
|
||||
element.type = 'radio';
|
||||
element.name = this.data.fieldName;
|
||||
if (this.data.fieldValue === this.data.buttonValue) {
|
||||
element.setAttribute('checked', true);
|
||||
}
|
||||
this.container.appendChild(element);
|
||||
return this.container;
|
||||
}
|
||||
});
|
||||
return RadioButtonWidgetAnnotationElement;
|
||||
}();
|
||||
var ChoiceWidgetAnnotationElement = function ChoiceWidgetAnnotationElementClosure() {
|
||||
function ChoiceWidgetAnnotationElement(parameters) {
|
||||
WidgetAnnotationElement.call(this, parameters, parameters.renderInteractiveForms);
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
}
|
||||
}(this, function (exports) {
|
||||
'use strict';
|
||||
var pdfjsVersion = '1.6.418';
|
||||
var pdfjsBuild = '59afb4b9';
|
||||
var pdfjsVersion = '1.6.401';
|
||||
var pdfjsBuild = 'b629be05';
|
||||
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
|
||||
var pdfjsLibs = {};
|
||||
(function pdfjsWrapper() {
|
||||
|
@ -45245,10 +45245,10 @@
|
|||
}
|
||||
if (!font.vertical) {
|
||||
textChunk.lastAdvanceWidth = width;
|
||||
textChunk.width += width;
|
||||
textChunk.width += width * textChunk.textAdvanceScale;
|
||||
} else {
|
||||
textChunk.lastAdvanceHeight = height;
|
||||
textChunk.height += Math.abs(height);
|
||||
textChunk.height += Math.abs(height * textChunk.textAdvanceScale);
|
||||
}
|
||||
return textChunk;
|
||||
}
|
||||
|
@ -45269,8 +45269,6 @@
|
|||
if (!textContentItem.initialized) {
|
||||
return;
|
||||
}
|
||||
textContentItem.width *= textContentItem.textAdvanceScale;
|
||||
textContentItem.height *= textContentItem.textAdvanceScale;
|
||||
textContent.items.push(runBidiTransform(textContentItem));
|
||||
textContentItem.initialized = false;
|
||||
textContentItem.str.length = 0;
|
||||
|
@ -45383,16 +45381,16 @@
|
|||
advance = items[j] * textState.fontSize / 1000;
|
||||
var breakTextRun = false;
|
||||
if (textState.font.vertical) {
|
||||
offset = advance;
|
||||
textState.translateTextMatrix(0, offset);
|
||||
offset = advance * (textState.textHScale * textState.textMatrix[2] + textState.textMatrix[3]);
|
||||
textState.translateTextMatrix(0, advance);
|
||||
breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax;
|
||||
if (!breakTextRun) {
|
||||
textContentItem.height += offset;
|
||||
}
|
||||
} else {
|
||||
advance = -advance;
|
||||
offset = advance * textState.textHScale;
|
||||
textState.translateTextMatrix(offset, 0);
|
||||
offset = advance * (textState.textHScale * textState.textMatrix[0] + textState.textMatrix[1]);
|
||||
textState.translateTextMatrix(advance, 0);
|
||||
breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax;
|
||||
if (!breakTextRun) {
|
||||
textContentItem.width += offset;
|
||||
|
@ -45886,16 +45884,7 @@
|
|||
} else if (isRef(entry)) {
|
||||
hash.update(entry.toString());
|
||||
} else if (isArray(entry)) {
|
||||
var diffLength = entry.length, diffBuf = new Array(diffLength);
|
||||
for (var j = 0; j < diffLength; j++) {
|
||||
var diffEntry = entry[j];
|
||||
if (isName(diffEntry)) {
|
||||
diffBuf[j] = diffEntry.name;
|
||||
} else if (isNum(diffEntry) || isRef(diffEntry)) {
|
||||
diffBuf[j] = diffEntry.toString();
|
||||
}
|
||||
}
|
||||
hash.update(diffBuf.join());
|
||||
hash.update(entry.length.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47171,8 +47160,6 @@
|
|||
switch (fieldType) {
|
||||
case 'Tx':
|
||||
return new TextWidgetAnnotation(parameters);
|
||||
case 'Btn':
|
||||
return new ButtonWidgetAnnotation(parameters);
|
||||
case 'Ch':
|
||||
return new ChoiceWidgetAnnotation(parameters);
|
||||
}
|
||||
|
@ -47600,72 +47587,17 @@
|
|||
});
|
||||
return TextWidgetAnnotation;
|
||||
}();
|
||||
var ButtonWidgetAnnotation = function ButtonWidgetAnnotationClosure() {
|
||||
function ButtonWidgetAnnotation(params) {
|
||||
WidgetAnnotation.call(this, params);
|
||||
this.data.checkBox = !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
|
||||
if (this.data.checkBox) {
|
||||
if (!isName(this.data.fieldValue)) {
|
||||
return;
|
||||
}
|
||||
this.data.fieldValue = this.data.fieldValue.name;
|
||||
}
|
||||
this.data.radioButton = this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
|
||||
if (this.data.radioButton) {
|
||||
this.data.fieldValue = this.data.buttonValue = null;
|
||||
var fieldParent = params.dict.get('Parent');
|
||||
if (!isDict(fieldParent) || !fieldParent.has('V')) {
|
||||
return;
|
||||
}
|
||||
var fieldParentValue = fieldParent.get('V');
|
||||
if (!isName(fieldParentValue)) {
|
||||
return;
|
||||
}
|
||||
this.data.fieldValue = fieldParentValue.name;
|
||||
var appearanceStates = params.dict.get('AP');
|
||||
if (!isDict(appearanceStates)) {
|
||||
return;
|
||||
}
|
||||
var normalAppearanceState = appearanceStates.get('N');
|
||||
if (!isDict(normalAppearanceState)) {
|
||||
return;
|
||||
}
|
||||
var keys = normalAppearanceState.getKeys();
|
||||
for (var i = 0, ii = keys.length; i < ii; i++) {
|
||||
if (keys[i] !== 'Off') {
|
||||
this.data.buttonValue = keys[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Util.inherit(ButtonWidgetAnnotation, WidgetAnnotation, {
|
||||
getOperatorList: function ButtonWidgetAnnotation_getOperatorList(evaluator, task, renderForms) {
|
||||
var operatorList = new OperatorList();
|
||||
if (renderForms) {
|
||||
return Promise.resolve(operatorList);
|
||||
}
|
||||
if (this.appearance) {
|
||||
return Annotation.prototype.getOperatorList.call(this, evaluator, task, renderForms);
|
||||
}
|
||||
return Promise.resolve(operatorList);
|
||||
}
|
||||
});
|
||||
return ButtonWidgetAnnotation;
|
||||
}();
|
||||
var ChoiceWidgetAnnotation = function ChoiceWidgetAnnotationClosure() {
|
||||
function ChoiceWidgetAnnotation(params) {
|
||||
WidgetAnnotation.call(this, params);
|
||||
this.data.options = [];
|
||||
var options = params.dict.get('Opt');
|
||||
var options = params.dict.getArray('Opt');
|
||||
if (isArray(options)) {
|
||||
var xref = params.xref;
|
||||
for (var i = 0, ii = options.length; i < ii; i++) {
|
||||
var option = xref.fetchIfRef(options[i]);
|
||||
var isOptionArray = isArray(option);
|
||||
var option = options[i];
|
||||
this.data.options[i] = {
|
||||
exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option,
|
||||
displayValue: isOptionArray ? xref.fetchIfRef(option[1]) : option
|
||||
exportValue: isArray(option) ? option[0] : option,
|
||||
displayValue: isArray(option) ? option[1] : option
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* jshint esnext:true */
|
||||
/* globals Components, PdfjsContentUtils, PdfJs, Services */
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
// Small subset of the webL10n API by Fabien Cazenave for pdf.js extension.
|
||||
|
|
|
@ -103,9 +103,7 @@
|
|||
|
||||
.annotationLayer .textWidgetAnnotation input,
|
||||
.annotationLayer .textWidgetAnnotation textarea,
|
||||
.annotationLayer .choiceWidgetAnnotation select,
|
||||
.annotationLayer .buttonWidgetAnnotation.checkBox input,
|
||||
.annotationLayer .buttonWidgetAnnotation.radioButton input {
|
||||
.annotationLayer .choiceWidgetAnnotation select {
|
||||
background-color: rgba(0, 54, 255, 0.13);
|
||||
border: 1px solid transparent;
|
||||
box-sizing: border-box;
|
||||
|
@ -124,9 +122,7 @@
|
|||
|
||||
.annotationLayer .textWidgetAnnotation input[disabled],
|
||||
.annotationLayer .textWidgetAnnotation textarea[disabled],
|
||||
.annotationLayer .choiceWidgetAnnotation select[disabled],
|
||||
.annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],
|
||||
.annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {
|
||||
.annotationLayer .choiceWidgetAnnotation select[disabled] {
|
||||
background: none;
|
||||
border: 1px solid transparent;
|
||||
cursor: not-allowed;
|
||||
|
@ -134,9 +130,7 @@
|
|||
|
||||
.annotationLayer .textWidgetAnnotation input:hover,
|
||||
.annotationLayer .textWidgetAnnotation textarea:hover,
|
||||
.annotationLayer .choiceWidgetAnnotation select:hover,
|
||||
.annotationLayer .buttonWidgetAnnotation.checkBox input:hover,
|
||||
.annotationLayer .buttonWidgetAnnotation.radioButton input:hover {
|
||||
.annotationLayer .choiceWidgetAnnotation select:hover {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
|
@ -163,12 +157,6 @@
|
|||
width: 115%;
|
||||
}
|
||||
|
||||
.annotationLayer .buttonWidgetAnnotation.checkBox input,
|
||||
.annotationLayer .buttonWidgetAnnotation.radioButton input {
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.annotationLayer .popupWrapper {
|
||||
position: absolute;
|
||||
width: 20em;
|
||||
|
|
|
@ -4119,7 +4119,7 @@ var pdfjsWebLibs;
|
|||
}
|
||||
if (error === 'cancelled') {
|
||||
self.error = null;
|
||||
return Promise.resolve(undefined);
|
||||
return;
|
||||
}
|
||||
self.renderingState = RenderingStates.FINISHED;
|
||||
if (self.loadingIconDiv) {
|
||||
|
@ -4145,25 +4145,21 @@ var pdfjsWebLibs;
|
|||
pageNumber: self.id,
|
||||
cssTransform: false
|
||||
});
|
||||
if (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
return Promise.resolve(undefined);
|
||||
};
|
||||
var paintTask = this.renderer === RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper);
|
||||
paintTask.onRenderContinue = renderContinueCallback;
|
||||
this.paintTask = paintTask;
|
||||
var resultPromise = paintTask.promise.then(function () {
|
||||
return finishPaintTask(null).then(function () {
|
||||
if (textLayer) {
|
||||
pdfPage.getTextContent({ normalizeWhitespace: true }).then(function textContentResolved(textContent) {
|
||||
textLayer.setTextContent(textContent);
|
||||
textLayer.render(TEXT_LAYER_RENDER_DELAY);
|
||||
});
|
||||
}
|
||||
});
|
||||
finishPaintTask(null);
|
||||
if (textLayer) {
|
||||
pdfPage.getTextContent({ normalizeWhitespace: true }).then(function textContentResolved(textContent) {
|
||||
textLayer.setTextContent(textContent);
|
||||
textLayer.render(TEXT_LAYER_RENDER_DELAY);
|
||||
});
|
||||
}
|
||||
}, function (reason) {
|
||||
return finishPaintTask(reason);
|
||||
finishPaintTask(reason);
|
||||
throw reason;
|
||||
});
|
||||
if (this.annotationLayerFactory) {
|
||||
if (!this.annotationLayer) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче