XSLT/XSL-FO/SVG/MathML 仕様についてXSL-FO |
|
Q. |
border で囲んだ fo:block に margin-left="0pt" を指定した場合と指定しなかった場合で結果が異なります。
[No.2005082601]
|
---|---|
A. |
W3CのXSL-FO仕様の勧告には以下のように書かれています。 ...
XSL modifications to the CSS definition: さらに、5.3.2 Margin, Space, and Indent Propertiesには以下の式があります。 5.3.2 Margin, Space, and Indent Properties ...
start-indent = margin-corresponding + padding-corresponding + border-corresponding-width ...
start-indent = inherited_value_of(start-indent) + margin-corresponding + padding-corresponding + border-corresponding-width ...
margin-corresponding = start-indent - inherited_value_of(start-indent) - padding-corresponding - border-corresponding-width 例えば、以下のような場合、 <fo:block margin-left="0" margin-right="0" border="5mm double black"> 上記の式に従って計算すると、 start-indent = inherited_value_of(start-indent) + margin-corresponding + padding-corresponding + border-corresponding-width = 0 + 0 + 0 + 5mm = 5mm end-indent = inherited_value_of(end-indent) + margin-corresponding + padding-corresponding + border-corresponding-width = 0 + 0 + 0 + 5mm = 5mm となります。 marginの指定がない以下のような場合は、 <fo:block border="5mm double black"> margin-corresponding = start-indent - inherited_value_of(start-indent) - padding-corresponding - border-corresponding-width margin-corresponding = end-indent - inherited_value_of(end-indent) - padding-corresponding - border-corresponding-width から、 margin-left = 0 - 0 - 0 - 5mm = -5mm margin-right = 0 - 0 - 0 - 5mm = -5mm となり、marginが指定された場合とは異なる結果になります。 |