From d9a776caf8c76e9e737c843ced4ee7f46712ab10 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Wed, 7 Jul 2021 18:46:43 +0200 Subject: [PATCH] XFA - Enable disabled fields (bug 1719464) - it's a workaround in waiting for JS implementation to let the use fill manually some fields. --- src/core/xfa/html_utils.js | 2 ++ src/display/xfa_layer.js | 23 +++++++++++++++++------ web/xfa_layer_builder.css | 2 ++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/core/xfa/html_utils.js b/src/core/xfa/html_utils.js index 644e0c0edc9a7..bebe96ec6f5a7 100644 --- a/src/core/xfa/html_utils.js +++ b/src/core/xfa/html_utils.js @@ -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; diff --git a/src/display/xfa_layer.js b/src/display/xfa_layer.js index 937061e8a3cca..57504beb43176 100644 --- a/src/display/xfa_layer.js +++ b/src/display/xfa_layer.js @@ -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); } diff --git a/web/xfa_layer_builder.css b/web/xfa_layer_builder.css index bc6c110487fe2..379f10ff204fb 100644 --- a/web/xfa_layer_builder.css +++ b/web/xfa_layer_builder.css @@ -254,6 +254,8 @@ flex: 1; } +.xfaNonInteractive input, +.xfaNonInteractive textarea, .xfaDisabled input, .xfaDisabled textarea, .xfaReadOnly input,