mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-28 23:28:16 +02:00
XFA - Fix layout issues (again)
- some elements weren't displayed because their rotation angle was not taken into account; - fix box model (XFA concept): - remove use of outline; - position correctly border which isn't part of box dimensions; - fix margins issues (see issue #13474). - move border on button instead of having it on wrapping div;
This commit is contained in:
parent
e8fe0711ee
commit
cfa727474e
7 changed files with 415 additions and 345 deletions
|
@ -80,9 +80,9 @@ const StyleMapping = new Map([
|
|||
],
|
||||
["xfa-spacerun", ""],
|
||||
["xfa-tab-stops", ""],
|
||||
["font-size", value => measureToString(1 * getMeasurement(value))],
|
||||
["font-size", value => measureToString(getMeasurement(value))],
|
||||
["letter-spacing", value => measureToString(getMeasurement(value))],
|
||||
["line-height", value => measureToString(0.99 * getMeasurement(value))],
|
||||
["line-height", value => measureToString(getMeasurement(value))],
|
||||
["margin", value => measureToString(getMeasurement(value))],
|
||||
["margin-bottom", value => measureToString(getMeasurement(value))],
|
||||
["margin-left", value => measureToString(getMeasurement(value))],
|
||||
|
@ -216,7 +216,7 @@ class Body extends XhtmlObject {
|
|||
return HTMLResult.EMPTY;
|
||||
}
|
||||
html.name = "div";
|
||||
html.attributes.class = "xfaRich";
|
||||
html.attributes.class = ["xfaRich"];
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ class Html extends XhtmlObject {
|
|||
return HTMLResult.success({
|
||||
name: "div",
|
||||
attributes: {
|
||||
class: "xfaRich",
|
||||
class: ["xfaRich"],
|
||||
style: {},
|
||||
},
|
||||
value: this[$content] || "",
|
||||
|
@ -262,7 +262,7 @@ class Html extends XhtmlObject {
|
|||
|
||||
if (children.length === 1) {
|
||||
const child = children[0];
|
||||
if (child.attributes && child.attributes.class === "xfaRich") {
|
||||
if (child.attributes && child.attributes.class.includes("xfaRich")) {
|
||||
return HTMLResult.success(child);
|
||||
}
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ class Html extends XhtmlObject {
|
|||
return HTMLResult.success({
|
||||
name: "div",
|
||||
attributes: {
|
||||
class: "xfaRich",
|
||||
class: ["xfaRich"],
|
||||
style: {},
|
||||
},
|
||||
children,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue