Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-DIAG-124

Chart expressions are evaluated without eval under an unchanged policy

When a page holds a chart figure, the chart runtime SHALL evaluate chart expressions with the Vega interpreter so that the page content security policy keeps no unsafe-eval and no network access.

Step 2 of path 1 in StRS-MDOKFSTUDIO-DIAG-015: from “The page has a chart figure” to “The chart is drawn in the colours of the page”.

Scenarios 2

The situations the tests check; open one to read it.

nominalNo eval and no network
Givena page with a Vega-Lite chart and a Vega chart whose expressions (calculate, filter, signals, formulas) need evaluating
Whenthe page is opened under its content security policy
Thenthe policy has no unsafe-eval, no unsafe-inline and connect-src none, both charts are drawn, no policy violation and no console error is reported, and the chart code builds no function from a string (the specification is parsed with ast true and evaluated by the Vega interpreter)
refusalThe policy is unchanged
Giventhe page policy of a page with charts
Whenit is compared with a page without charts
Thenthe directives are the same

Implemented in 1

Tested by 5