Skip to content

Commit

Permalink
XFA - Enable disabled fields (bug 1719464)
Browse files Browse the repository at this point in the history
  - it's a workaround in waiting for JS implementation to let the use fill manually some fields.
  • Loading branch information
calixteman committed Jul 7, 2021
1 parent b2b7806 commit d9a776c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/core/xfa/html_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,8 @@ function fixTextIndent(styles) {
function setAccess(node, classNames) {
switch (node.access) {
case "nonInteractive":
classNames.push("xfaNonInteractive");
break;
case "readOnly":
classNames.push("xfaReadOnly");
break;
Expand Down
23 changes: 17 additions & 6 deletions src/display/xfa_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,24 @@ class XfaLayer {
}
}

/**
* TODO: re-enable that stuff once we've JS implementation.
* See https://bugzilla.mozilla.org/show_bug.cgi?id=1719465.
*
* for (const el of rootDiv.querySelectorAll(
* ".xfaDisabled input, .xfaDisabled textarea"
* )) {
* el.setAttribute("disabled", true);
* }
* for (const el of rootDiv.querySelectorAll(
* ".xfaReadOnly input, .xfaReadOnly textarea"
* )) {
* el.setAttribute("readOnly", true);
* }
*/

for (const el of rootDiv.querySelectorAll(
".xfaDisabled input, .xfaDisabled textarea"
)) {
el.setAttribute("disabled", true);
}
for (const el of rootDiv.querySelectorAll(
".xfaReadOnly input, .xfaReadOnly textarea"
".xfaNonInteractive input, .xfaNonInteractive textarea"
)) {
el.setAttribute("readOnly", true);
}
Expand Down
2 changes: 2 additions & 0 deletions web/xfa_layer_builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@
flex: 1;
}

.xfaNonInteractive input,
.xfaNonInteractive textarea,
.xfaDisabled input,
.xfaDisabled textarea,
.xfaReadOnly input,
Expand Down

0 comments on commit d9a776c

Please sign in to comment.