Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

Merge PR #3580: M6: form buttons show the side panels (app.execMenuItem)

aionggf017ca3b78e9
diff --cc crates/engine/src/js.rs
index 78e026e24,c564421fe..4d502f0a9
--- a/crates/engine/src/js.rs
+++ b/crates/engine/src/js.rs
@@@ -33,16 -33,18 +37,26 @@@ impl JsOutput
fn absorb(&mut self, o: &Outcome) {
self.alerts.extend(o.alerts.iter().cloned());
self.console.extend(o.console.iter().cloned());
- self.requests.extend(o.requests.iter().cloned());
+ // A field's own scripts (keystroke, format, validate, calculate) run unasked: only a
+ // button's may show or hide a side panel, or open Save As.
+ for r in &o.requests {
+ match r {
+ Request::ShowPanel(_) => self.console.push("A field script asked to show a side panel; only a button may show a side panel".into()),
+ Request::SaveAs => {
+ self.console.push("A field script asked to save the document as a new file; only a button may open Save As".into())
+ }
+ r => self.requests.push(r.clone()),
+ }
+ }
self.errors.extend(o.error.iter().cloned());
+ // The document scripts run before every field script, so a failing one would repeat
+ // once per calculation; it is reported once.
+ for e in &o.doc_errors {
+ if !self.doc_errors.contains(e) {
+ self.doc_errors.push(e.clone());
+ self.errors.push(e.clone());
+ }
+ }
}
pub(crate) fn append(&mut self, other: JsOutput) {
diff --cc crates/engine/src/tests.rs
index e83dbe207,b43fc4cc6..bdc595b61
--- a/crates/engine/src/tests.rs
+++ b/crates/engine/src/tests.rs
@@@ -7517,46 -7298,60 +7517,100 @@@ fn exporting_office_keeps_dotted_leader
assert!(positions.windows(2).all(|pair| pair[0] < pair[1]), "reading order: {html}");
}
+/// A date typed in another of an XFA date field's edit patterns is kept in its first: yymmdd and
+/// yyyymd are rewritten as yyyymmdd, a date none of them reads is refused, and the data holds the date.
+#[test]
+fn a_date_typed_by_another_of_an_xfa_fields_edit_patterns_is_kept_in_its_first() {
+ let mut s = Session::new();
+ let id = s
+ .open("dates.pdf", None, Arc::new(pdfcraft_xfa::fixtures::shell(&pdfcraft_xfa::fixtures::date_alternatives_template())), None)
+ .expect("opens");
+ let value = |s: &Session| s.get(id).unwrap().form.iter().find(|f| f.name == "leave").unwrap().value.clone();
+ s.apply(id, Edit::SetFieldValue { name: "leave".into(), value: FieldValue::Text("261018".into()) }).expect("yymmdd is one of its patterns");
+ assert_eq!(value(&s), ["20261018"]);
+ s.apply(id, Edit::SetFieldValue { name: "leave".into(), value: FieldValue::Text("2026118".into()) }).expect("so is yyyymd");
+ assert_eq!(value(&s), ["20261108"]);
+ let refused = s.apply(id, Edit::SetFieldValue { name: "leave".into(), value: FieldValue::Text("2618".into()) });
+ assert!(refused.is_err_and(|e| e.to_string().contains("yyyymmdd")), "none of its patterns reads it");
+ assert_eq!(value(&s), ["20261108"]);
+ // The data holds the date.
+ let cos = pdfcraft_cos::Document::open(s.save_bytes(id).unwrap()).unwrap();
+ let data = pdfcraft_xfa::parse_datasets(&pdfcraft_xfa::read_packets(&cos).unwrap().unwrap().xdp).expect("a datasets packet");
+ assert_eq!(data.text_at(&pdfcraft_xfa::som_to_path("form[0].leave[0]")), Some("2026-11-08"));
+}
+
+/// A date the field's own scripts refuse is not tried again in another of an XFA date field's
+/// patterns: only a date its format refuses is, which happens before any script runs, so the
+/// scripts run once. This validate script counts its runs in `name` and accepts on its second.
+#[test]
+fn a_date_its_validate_script_refuses_is_not_tried_again() {
+ let mut s = Session::new();
+ let id = s
+ .open("dates.pdf", None, Arc::new(pdfcraft_xfa::fixtures::shell(&pdfcraft_xfa::fixtures::date_alternatives_template())), None)
+ .expect("opens");
+ let script = Some("var n = Number(getField('name').value || 0) + 1; getField('name').value = String(n); event.rc = n >= 2;".to_string());
+ s.apply(id, Edit::SetFieldScript { name: "leave".into(), event: "validate".into(), script }).unwrap();
+ let value = |s: &Session, n: &str| s.get(id).unwrap().form.iter().find(|f| f.name == n).unwrap().value.clone();
+ // Its format reads 18OCT26, and so does its DDMMMYY pattern.
+ let refused = s.apply(id, Edit::SetFieldValue { name: "leave".into(), value: FieldValue::Text("18OCT26".into()) });
+ assert!(refused.is_err(), "the validate script refused it, once");
+ assert!(value(&s, "name").is_empty(), "nothing the refused run changed is kept: {:?}", value(&s, "name"));
+}
+
+ /// An XFA button's click script may show the attachments panel; a text field's exit script
+ /// asking the same is noted on the console and ignored.
+ #[test]
+ fn an_xfa_button_may_show_a_side_panel_and_other_events_may_not() {
+ let xdp = r##"<?xml version="1.0" encoding="UTF-8"?>
+ <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
+ <template xmlns="http://www.xfa.org/schema/xfa-template/3.3/">
+ <subform name="form" layout="tb">
+ <pageSet><pageArea name="front"><contentArea x="0.5in" y="0.5in" w="7.5in" h="10in"/><medium short="8.5in" long="11in"/></pageArea></pageSet>
+ <field name="files" w="2in" h="0.3in"><ui><button/></ui><caption><value><text>Attachments</text></value></caption>
+ <event activity="click"><script contentType="application/x-javascript">app.execMenuItem("ShowHideFileAttachment");</script></event></field>
+ <field name="note" w="2in" h="0.3in"><ui><textEdit/></ui>
+ <event activity="exit"><script contentType="application/x-javascript">app.execMenuItem("ShowHideFileAttachment");</script></event></field>
+ </subform>
+ </template>
+ </xdp:xdp>
+ "##;
+ let mut s = Session::new();
+ let id = s.open("files.pdf", None, Arc::new(pdfcraft_xfa::fixtures::shell(xdp)), None).expect("opens");
+ s.take_js_output(id);
+ s.apply(id, Edit::XfaEvent { som: "form[0].files[0]".into(), activity: "click".into() }).unwrap();
+ let out = s.take_js_output(id);
+ assert_eq!(out.requests, [pdfcraft_js::Request::ShowPanel(pdfcraft_js::Panel::Attachments)], "{out:?}");
+ s.apply(id, Edit::SetFieldValue { name: "note".into(), value: FieldValue::Text("x".into()) }).unwrap();
+ let out = s.take_js_output(id);
+ assert!(out.requests.is_empty(), "only a click shows a panel: {out:?}");
+ assert!(out.console.iter().any(|c| c.contains("show a side panel")), "{:?}", out.console);
+ }
+
+ /// A validate script that asks for Save As and a side panel gets neither, with a console note
+ /// for each; a button's script may still open Save As.
+ #[test]
+ fn a_fields_own_script_may_not_save_as_or_show_a_panel() {
+ let mut s = Session::new().with_clock(|| 1_700_000_000);
+ let id = s.open("order.pdf", None, Arc::new(scripted_form()), None).unwrap();
+ s.apply(
+ id,
+ Edit::SetFieldScript {
+ name: "qty".into(),
+ event: "validate".into(),
+ script: Some("app.execMenuItem('SaveAs'); app.execMenuItem('ShowHideFileAttachment');".into()),
+ },
+ )
+ .unwrap();
+ s.take_js_output(id);
+ s.apply(id, Edit::SetFieldValue { name: "qty".into(), value: FieldValue::Text("4".into()) }).unwrap();
+ let out = s.take_js_output(id);
+ assert!(out.requests.is_empty(), "a validate script runs unasked: {out:?}");
+ assert_eq!(out.console.iter().filter(|c| c.contains("only a button may")).count(), 2, "{:?}", out.console);
+ // A button's script may.
+ let o = s.run_javascript(id, "app.execMenuItem('SaveAs');", Some("go")).unwrap();
+ assert_eq!(o.requests, [js::Request::SaveAs]);
+ }
+
/// A page whose forms go past the reading limit and whose picture goes past the image budget is
/// listed once among the truncated pages.
#[test]
diff --cc crates/js/src/lib.rs
index 777a13f31,8272918c9..7f463a48b
--- a/crates/js/src/lib.rs
+++ b/crates/js/src/lib.rs
@@@ -13,8 -13,8 +13,8 @@@
//! `required`, `display`, `hidden`, `numItems`, `getItemAt`, `currentValueIndices`,
//! `isBoxChecked`, `checkThisBox`, `exportValues`, `charLimit`, `textColor`, `fillColor`,
//! `setFocus`.
- //! - `app` (`alert`, `beep`, `response`, `launchURL`, `viewerType`, `viewerVersion`,
+ //! - `app` (`alert`, `beep`, `response`, `launchURL`, `execMenuItem`, `viewerType`, `viewerVersion`,
-//! `platform`, `setTimeOut`), `util` (`printf`, `printd`, `printx`), `console` (`println`,
+//! `platform`, `setTimeOut`), `util` (`printf`, `printd`, `printx`, `scand`), `console` (`println`,
//! `show`, `clear`), `display` and `color`.
//!
//! The engine is a sandbox: no file, network or timer access exists, and loops and recursion
diff --cc crates/js/src/tests.rs
index 358df9836,c46921c7f..06d699bcb
--- a/crates/js/src/tests.rs
+++ b/crates/js/src/tests.rs
@@@ -1520,203 -1465,52 +1530,249 @@@ fn shared_field_snapshots_isolate_write
assert!(read.changed.is_empty());
}
+mod scand {
+ use super::*;
+ use crate::xfa::{XfaDoc, XfaEvent, run_xfa};
+
+ /// Runs `util.scand(format, text)` for each case and checks the date it gives, written as
+ /// `yyyy-mm-dd HH:MM:ss`, or `null`.
+ fn assert_scand(cases: &[(&str, &str, &str)]) {
+ let list: Vec<String> = cases.iter().map(|(f, t, _)| format!("['{f}', '{t}']")).collect();
+ let script = format!(
+ "event.value = [{}].map(function (c) {{ var d = util.scand(c[0], c[1]); \
+ return d === null ? 'null' : util.printd('yyyy-mm-dd HH:MM:ss', d); }}).join('|');",
+ list.join(", ")
+ );
+ let o = go(&script, &Event::field("Calculate", "total", ""));
+ assert_eq!(o.error, None);
+ let got: Vec<&str> = o.value.split('|').collect();
+ assert_eq!(got.len(), cases.len());
+ for ((f, t, want), got) in cases.iter().zip(got) {
+ assert_eq!(got, *want, "util.scand('{f}', '{t}')");
+ }
+ }
+
+ // The cases below are another viewer's answers, observed black-box with a synthetic file.
+
+ /// Any separator may come between fields, whether the format has that one, another or none,
+ /// but a text with a space or a letter before or after the date reads nothing.
+ #[test]
+ fn scand_allows_separators_between_fields_but_nothing_before_or_after_them() {
+ assert_scand(&[
+ ("yyyymmdd", "20261018", "2026-10-18 00:00:00"),
+ ("yyyymmdd", "2026-10-18", "2026-10-18 00:00:00"),
+ ("yyyymmdd", "2026 10 18", "2026-10-18 00:00:00"),
+ ("mm/dd/yyyy", "10/18/2026", "2026-10-18 00:00:00"),
+ ("mm/dd/yyyy", "10-18-2026", "2026-10-18 00:00:00"),
+ ("yyyymmdd", " 20261018 ", "null"),
+ ("yyyymmdd", "20261018x", "null"),
+ ("yyyymmdd", "x20261018", "null"),
+ ]);
+ }
+
+ /// Digits typed together fill the joined fields with exactly as many digits as each field has
+ /// letters, so a run of any other length reads nothing.
+ #[test]
+ fn scand_splits_digits_typed_together_by_the_formats_letter_counts() {
+ assert_scand(&[
+ ("yyyymmdd", "261018", "null"),
+ ("yyyymmdd", "2026118", "null"),
+ ("yyyymmdd", "202610181", "null"),
+ ("yymmdd", "20261018", "null"),
+ ("yyyymdd", "2026118", "2026-01-18 00:00:00"),
+ ("yyyymmd", "2026118", "2026-11-08 00:00:00"),
+ ("yyyymd", "2026118", "null"),
+ ("yyyymd", "202618", "2026-01-08 00:00:00"),
+ ("yyyymd", "20261018", "null"),
+ ("yymd", "2618", "2026-01-08 00:00:00"),
+ ("yymd", "261018", "null"),
+ ]);
+ }
+
+ /// A month past 12, a day past the month's end and February 29 outside a leap year are
+ /// refused, while a month or day of 0 is read as 1.
+ #[test]
+ fn scand_refuses_impossible_dates_and_reads_a_zero_month_or_day_as_1() {
+ assert_scand(&[
+ ("yyyymmdd", "20261318", "null"),
+ ("yyyymmdd", "20260230", "null"),
+ ("yyyymmdd", "20260229", "null"),
+ ("yyyymmdd", "20240229", "2024-02-29 00:00:00"),
+ ("mm/dd/yyyy", "13/45/2026", "null"),
+ ("yyyymmdd", "20260018", "2026-01-18 00:00:00"),
+ ("yyyymmdd", "20261000", "2026-10-01 00:00:00"),
+ ]);
+ }
+
+ /// A field typed by itself may have one or two digits, but a `yyyy` year needs four; `yy` reads
+ /// as 1950–2049; month names may be full or three letters in any case; weekday names are read.
+ #[test]
+ fn scand_reads_lone_fields_two_digit_years_and_month_and_weekday_names() {
+ assert_scand(&[
+ ("mm/dd/yyyy", "1/5/2026", "2026-01-05 00:00:00"),
+ ("m/d/yyyy", "1/5/2026", "2026-01-05 00:00:00"),
+ ("m/d/yyyy", "01/05/2026", "2026-01-05 00:00:00"),
+ ("m/d/yy", "1/5/26", "2026-01-05 00:00:00"),
+ ("mm/dd/yyyy", "10/18/26", "null"),
+ ("yyyy/mm/dd", "26/10/18", "null"),
+ ("yymmdd", "261018", "2026-10-18 00:00:00"),
+ ("yymmdd", "491018", "2049-10-18 00:00:00"),
+ ("yymmdd", "501018", "1950-10-18 00:00:00"),
+ ("mmm d, yyyy", "Oct 18, 2026", "2026-10-18 00:00:00"),
+ ("mmm d, yyyy", "October 18, 2026", "2026-10-18 00:00:00"),
+ ("mmm d, yyyy", "oct 18, 2026", "2026-10-18 00:00:00"),
+ ("mmmm d, yyyy", "Oct 18, 2026", "2026-10-18 00:00:00"),
+ ("mmmm d, yyyy", "October 18, 2026", "2026-10-18 00:00:00"),
+ ("dd-mmm-yyyy", "18-Oct-2026", "2026-10-18 00:00:00"),
+ ("dddd, mmmm d, yyyy", "Sunday, October 18, 2026", "2026-10-18 00:00:00"),
+ ]);
+ }
+
+ /// A time is read along with a date, but a format with only time fields reads nothing.
+ #[test]
+ fn scand_reads_a_time_only_with_a_date() {
+ assert_scand(&[
+ ("mm/dd/yyyy HH:MM:ss", "10/18/2026 21:07:05", "2026-10-18 21:07:05"),
+ ("HH:MM", "09:07", "null"),
+ ("HH:MM", "9:07", "null"),
+ ("h:MM tt", "9:07 pm", "null"),
+ ("h:MM tt", "9:07 am", "null"),
+ ("h:MM tt", "12:07 am", "null"),
+ ("h:MM tt", "9:07pm", "null"),
+ ]);
+ }
+
+ /// An empty text reads as today at noon, and a text that is not a string (a number, or none
+ /// at all) reads nothing.
+ #[test]
+ fn scand_reads_only_text_and_an_empty_text_is_today_at_noon() {
+ let o = go(
+ "var d = util.scand('yyyymmdd', ''), n = new Date(); \
+ event.value = [d.toDateString() == n.toDateString(), d.getHours(), d.getMinutes(), d.getSeconds(), \
+ util.scand('yyyymmdd', 20261018), util.scand(), util.scand('yyyymmdd')].join('|');",
+ &Event::field("Calculate", "total", ""),
+ );
+ assert_eq!(o.error, None);
+ assert_eq!(o.value, "true|12|0|0|||");
+ }
+
+ // Not observed: the choices made where the other viewer wasn't asked.
+
+ /// A year left out is this year, `h:MM tt` reads a 12-hour time and refuses hours it cannot
+ /// have, and a letter the format writes must be typed there.
+ #[test]
+ fn scand_takes_this_year_when_none_is_given_and_reads_12_hour_times_and_written_letters() {
+ assert_scand(&[
+ ("mm/dd/yyyy h:MM tt", "10/18/2026 9:07 pm", "2026-10-18 21:07:00"),
+ ("mm/dd/yyyy h:MM tt", "10/18/2026 12:07 AM", "2026-10-18 00:07:00"),
+ ("mm/dd/yyyy h:MM tt", "10/18/2026 13:07 pm", "null"),
+ ("mm/dd/yyyy HH:MM", "10/18/2026 24:00", "null"),
+ ("yyyy-mm-ddTHH:MM", "2026-10-18T21:07", "2026-10-18 21:07:00"),
+ ("yyyy-mm-ddTHH:MM", "2026-10-18X21:07", "null"),
+ ]);
+ let o = go(
+ "var d = util.scand('mm/dd', '10/18'); event.value = [d.getFullYear() == new Date().getFullYear(), d.getMonth(), d.getDate()].join('|');",
+ &Event::field("Calculate", "total", ""),
+ );
+ assert_eq!(o.error, None);
+ assert_eq!(o.value, "true|9|18");
+ }
+
+ /// A format of 50,000 literal letters and one of 100,000 fields, with texts to match, are read
+ /// in linear time. The limit is generous so a loaded runner passes (it also covers starting
+ /// the engine and building the strings); a quadratic scan of inputs this size takes minutes.
+ #[test]
+ fn scand_reads_long_formats_and_texts_in_linear_time() {
+ // Scripts can pass anything; native code isn't bounded by the loop limit.
+ let started = std::time::Instant::now();
+ let o = go(
+ "var x = new Array(50001).join('x'), md = new Array(50001).join('md'), ones = new Array(100000).join('1 ') + '1'; \
+ event.value = [util.scand(x + 'yyyy', x + '2026') !== null, util.scand('yyyy' + md, '2026 ' + ones) !== null].join('|');",
+ &Event::field("Calculate", "total", ""),
+ );
+ assert_eq!(o.error, None);
+ assert_eq!(o.value, "true|true");
+ assert!(started.elapsed() < std::time::Duration::from_secs(10), "{:?}", started.elapsed());
+ }
+
+ /// The check an XFA form runs on leaving a date field tries six formats with `util.scand` and
+ /// writes the first that reads the text back as `yyyymmdd`, or reports an invalid date.
+ #[test]
+ fn xfa_scripts_check_typed_dates_with_util_scand() {
+ // The check a form runs when a date field is left: the first of six formats that reads
+ // the typed text, written back as yyyymmdd; or an invalid date. Results as another viewer gives them.
+ let check = |typed: &str| {
+ let script = format!(
+ "var six = ['yyyymmdd', 'yymmdd', 'yyyymdd', 'yyyymmd', 'yyyymd', 'yymd'], out = 'invalid'; \
+ for (var i = 0; i < six.length; i++) {{ var d = util.scand(six[i], '{typed}'); \
+ if (d !== null) {{ out = util.printd('yyyymmdd', d); break; }} }} out"
+ );
+ let event = XfaEvent { activity: "exit".into(), target: "form1[0].page1[0].total[0]".into(), ..Default::default() };
+ run_xfa(&script, &event, &XfaDoc::default(), &super::xfa_model::form(), Limits::default())
+ };
+ for (typed, want) in [
+ ("20261018", "20261018"),
+ ("261018", "20261018"),
+ ("2026118", "20260118"),
+ ("202618", "20260108"),
+ ("2618", "20260108"),
+ ("2026-10-18", "20261018"),
+ ("20261318", "invalid"),
+ ("20260230", "invalid"),
+ ] {
+ let o = check(typed);
+ assert_eq!(o.error, None, "{typed}: {o:?}");
+ assert_eq!(o.result.as_deref(), Some(want), "{typed}");
+ }
+ }
+}
+
+ mod menu_items {
+ use super::*;
+ use crate::xfa::{XfaDoc, XfaEffect, XfaEvent, run_xfa};
+
+ /// Every side panel has a fixed id in automation output.
+ #[test]
+ fn each_panel_has_a_fixed_id_for_automation() {
+ let ids = [Panel::Bookmarks, Panel::Pages, Panel::Attachments, Panel::Signatures, Panel::Layers].map(Panel::id);
+ assert_eq!(ids, ["bookmarks", "pages", "attachments", "signatures", "layers"]);
+ }
+
+ /// Each side panel item, Print and SaveAs make their request, in order; an unknown item
+ /// makes none and is not an error.
+ #[test]
+ fn exec_menu_item_shows_side_panels_prints_and_saves() {
+ let o = go(
+ "app.execMenuItem('ShowHideFileAttachment'); app.execMenuItem('ShowHideBookmarks'); app.execMenuItem('ShowHideThumbnails'); \
+ app.execMenuItem('ShowHideSignatures'); app.execMenuItem('ShowHideOptCont'); app.execMenuItem('Print'); \
+ app.execMenuItem('SaveAs'); app.execMenuItem('NoSuchItem');",
+ &Event::field("Mouse Up", "total", ""),
+ );
+ assert_eq!(o.error, None);
+ assert_eq!(
+ o.requests,
+ [
+ Request::ShowPanel(Panel::Attachments),
+ Request::ShowPanel(Panel::Bookmarks),
+ Request::ShowPanel(Panel::Pages),
+ Request::ShowPanel(Panel::Signatures),
+ Request::ShowPanel(Panel::Layers),
+ Request::Print,
+ Request::SaveAs,
+ ]
+ );
+ }
+
+ /// `app.execMenuItem` works in XFA scripts too: a click shows the attachments panel.
+ #[test]
+ fn xfa_scripts_show_the_attachments_panel() {
+ let event = XfaEvent { activity: "click".into(), target: "form1[0].page1[0].go[0]".into(), ..Default::default() };
+ let o = run_xfa("app.execMenuItem('ShowHideFileAttachment')", &event, &XfaDoc::default(), &super::xfa_model::form(), Limits::default());
+ assert_eq!(o.error, None, "{o:?}");
+ assert!(o.effects.contains(&XfaEffect::ShowPanel(Panel::Attachments)), "{:?}", o.effects);
+ }
+ }
+
/// The check XFA forms run on opening: without both globals, or with a version below 2.8, it
/// alerts that the viewer can't show the form.
const XFA_CHECK: &str = "if (typeof(xfa_installed) == 'undefined' || typeof(xfa_version) == 'undefined' || xfa_version < 2.8) app.alert('old viewer'); \
diff --cc parity/acrobat-features.toml
index 7d9b9ed4c,553388c5b..4d396ba3e
--- a/parity/acrobat-features.toml
+++ b/parity/acrobat-features.toml
@@@ -5165,8 -5165,8 +5165,8 @@@ milestone = "M6
status = "partial"
commands = ["tools.js_console"]
tools = ["js_run"]
-evidence = ["crates/js/src/tests.rs::calculate_scripts_read_fields_and_set_the_value", "crates/engine/src/tests.rs::form_javascript_validates_calculates_and_formats", "crates/automation/tests/it/automation.rs::javascript_through_tools", "crates/js/src/tests.rs::an_xfa_form_sees_the_xfa_plugin_installed", "crates/js/src/tests.rs::a_plain_form_sees_the_xfa_version_but_not_installed", "crates/engine/src/tests.rs::scripts_in_an_xfa_form_see_the_xfa_plugin_installed"]
-notes = "boa (pure Rust) with the forms object model: event, getField/Field (value, readonly, display, colours, items, check boxes), app (with execMenuItem for the side panels and Save As, from a button only, and Print where this.print() works), util.printf/printd/printx, console, display, color; xfa_version (3.5) in every document and xfa_installed in XFA forms, so their version check passes; no annotations, layers or dialogs (app.response returns null) yet, and no app.findComponent."
+evidence = ["crates/js/src/tests.rs::calculate_scripts_read_fields_and_set_the_value", "crates/engine/src/tests.rs::form_javascript_validates_calculates_and_formats", "crates/automation/tests/it/automation.rs::javascript_through_tools", "crates/js/src/tests.rs::an_xfa_form_sees_the_xfa_plugin_installed", "crates/js/src/tests.rs::a_plain_form_sees_the_xfa_version_but_not_installed", "crates/engine/src/tests.rs::scripts_in_an_xfa_form_see_the_xfa_plugin_installed", "crates/js/src/tests.rs::scand_allows_separators_between_fields_but_nothing_before_or_after_them"]
- notes = "boa (pure Rust) with the forms object model: event, getField/Field (value, readonly, display, colours, items, check boxes), app, util.printf/printd/printx/scand (scand reads dates as another viewer was observed to, in AcroForm and XFA scripts), console, display, color; xfa_version (3.5) in every document and xfa_installed in XFA forms, so their version check passes; no annotations, layers or dialogs (app.response returns null) yet, and no app.findComponent."
++notes = "boa (pure Rust) with the forms object model: event, getField/Field (value, readonly, display, colours, items, check boxes), app (with execMenuItem for the side panels and Save As, from a button only, and Print where this.print() works), util.printf/printd/printx/scand (scand reads dates as another viewer was observed to, in AcroForm and XFA scripts), console, display, color; xfa_version (3.5) in every document and xfa_installed in XFA forms, so their version check passes; no annotations, layers or dialogs (app.response returns null) yet, and no app.findComponent."
[[feature]]
id = "form.js-console"