This relates to how XXE itself treats CSS values that it does not support, and it in particular relates to the Emulate Browser view for XHTML documents (though in principle and perhaps also in practise, it does also relate to the Semantic View, when one alter the way XXE displays elements).

Theory:

   When a CSS parser discovers a value that it does not support, it should ignore the entire style rule.

Example:

    blockquote{margin-left:1mm}
    blockquote{margin-left:1km}

In the above example, because 'km' (as much as I know) is an unsupported unit value in CSS, the second style rule should be completely ignored, and the first style rule should be used and applied.

XXE does not follow this rule, it seems. In addition, XXE has many limitations with regard to the degree to which it supports CSS.

So for instance, the Emulate Browser View supports the 'margin-left' property, as long as one uses the units that XXE supports. Thus it supports

    margin-left:200px;

But it does not support

    margin-left:55%;

(If we use the built in style editor to add margin-left:55%; for a particular element, we are told that this value unit is not supported.)

For that reason, if, inside a <style> element, one does this:

    margin-left:200px;
    margin-left:55%;

Then, for instance, Firefox would use the last style rule, since it knows about both units and thus supports both rules – but the last rule should override the first rule. Whereas the Emulate View should ignore the last rule and apply the first rule, since it does not know about the percentage unit it margin styles.

Currently, howver, this does not happen. What happens instead, is that both rules are ignored by XXE.

This has several effects. The most important thing being that i makes it difficult to work around the limitations of XXE’s Emulate Browser view.

It also makes Emulate Browser kind of useless, since one way to work around this limitation, is to make XXE spesific CSS styles that goes into
'xhtml-config:css/xhtml_user_styles.css'  (for the Emulate Browser view) or
'xhtml-config:css/xhtml5.css' (for the semantic view).

But if you add the margin-left:200px; to xhtml_user_styles.css, and you also add marign-left:55% to the <style> element of the document you are editing, then XXE will in fact ignore both stylel rules and default to margin-left:0;

So please make life simpler for us and make XXE ignore style rules entirely when it does not understand/support the unit value that is used inside the style rule!

Leif Halvard Silli


--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to