|
| Description: |
Macro parameters that take a CSS value, like the {{width}} and {{height}} of the Box and Gallery macros, are plain text fields in the Edit Macro dialog. Nothing says what can be typed, and an invalid value is accepted silently: {{width="300"}} is output as {{style="width:300"}}, which browsers ignore since a length needs a unit, and {{width="abc"}} is output as is.
h2. Steps to reproduce # Edit a page with the WYSIWYG editor. # Insert a Box macro and open the advanced parameters. # Type {{300}} in the Width field and submit.
h2. Expected The field helps to enter a valid CSS length, for example a number with a unit picked from a list, and rejects an invalid value.
h2. Actual The field is a plain text input. The box is rendered with {{style="width:300"}} and keeps its default width, with no message.
h2. Proposal A field for CSS lengths, and possibly for other CSS values, needs a brainstorming and a design before it is implemented. The parameters using it then need a dedicated type, so that the Edit Macro dialog can pick the right displayer.
h2. Impact found by the audit on macro fluidity The [WYSIWYG usability audit of the macros|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/] found 8 parameters taking a CSS length in a plain text field: the {{width}} of [Box|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/box/], [Info Message|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/info/], [Warning Message|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/warning/], [Error Message|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/error/], [Success Message|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/success/] and [Code|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/code/], and the {{width}} and {{height}} of [Gallery|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/gallery/]. * Criterion [C4 , input-assistance|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/] was recorded OK on them, with a note pointing to this issue the [cross-macro findings|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Cross-macro%20findings/] of the WYSIWYG usability audit of the macros , only because no field for CSS values exists yet. * Invalid values are accepted silently: {{abc}}, and {{300}} without a unit, are output as is, and the box or the gallery keeps its default size with no message. This fails criterion [C13 , constraints|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/] on the Box and Gallery parameters, and criterion [E2, errors|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/] on the seven macros. * Nothing tells the user what to type: the description of the Gallery {{width}}, "The gallery width", does not say that a CSS length like {{620px}} or {{100%}} is expected, which fails criterion [C1 , clarity|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/]. |
|