| 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. 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.
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. Actual The field is a plain text input. The box is rendered with style="width:300" and keeps its default width, with no message. 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. The WYSIWYG usability audit of the macros found this on the Box and Gallery macros. The message macros, which are based on the Box macro, and the Code macro have the same width parameter. |