Skip to content

Commit db0b3cd

Browse files
author
Catherine
committed
XFA - Fix xfaLink class to make links work (bug 1735738)
There were some links not working in some XFA files,I realized that the anchor tag that contains the link has an inline display and couldn't receive any height, solved this by adding a "position: absolute". Tested with two different files in Firefox Nightly and Chrome and now all links are working perfectly fine. Added reftest to avoid future regressions
1 parent 52fce0d commit db0b3cd

5 files changed

+38
-2
lines changed

test/driver.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ var rasterizeXfaLayer = (function rasterizeXfaLayerClosure() {
291291
file: "../web/xfa_layer_builder.css",
292292
promise: null,
293293
},
294+
overrides: {
295+
file: "./xfa_layer_builder_overrides.css",
296+
promise: null,
297+
},
294298
};
295299

296300
function getXfaLayerStyle() {
@@ -326,8 +330,8 @@ var rasterizeXfaLayer = (function rasterizeXfaLayerClosure() {
326330
foreignObject.appendChild(div);
327331

328332
stylePromise
329-
.then(async ([cssRules]) => {
330-
style.textContent = fontRules + "\n" + cssRules;
333+
.then(async ([common, overrides]) => {
334+
style.textContent = fontRules + "\n" + common + "\n" + overrides;
331335

332336
XfaLayer.render({
333337
xfa,

test/pdfs/xfa_bug1735738.pdf.link

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://bugzilla.mozilla.org/attachment.cgi?id=9227382

test/test_manifest.json

+8
Original file line numberDiff line numberDiff line change
@@ -6011,5 +6011,13 @@
60116011
"enableXfa": true,
60126012
"type": "eq",
60136013
"lastPage": 1
6014+
},
6015+
{ "id": "xfa_bug1735738",
6016+
"file": "pdfs/xfa_bug1735738.pdf",
6017+
"md5": "7aa91f6681798c48e0c9d9836ed30742",
6018+
"enableXfa": true,
6019+
"link": true,
6020+
"rounds": 1,
6021+
"type": "eq"
60146022
}
60156023
]

test/xfa_layer_builder_overrides.css

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* Copyright 2021 Mozilla Foundation
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
.xfaLink {
17+
opacity: 0.2;
18+
background: rgba(255, 255, 0, 1);
19+
box-shadow: 0 2px 10px rgba(255, 255, 0, 1);
20+
}

web/xfa_layer_builder.css

+3
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@
223223
.xfaLink {
224224
width: 100%;
225225
height: 100%;
226+
position: absolute;
227+
top: 0;
228+
left: 0;
226229
}
227230

228231
.xfaCheckbox,

0 commit comments

Comments
 (0)