]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed incorrect handling of percentages in vertical-align property values and added...
authorManuel Mall <manuel@apache.org>
Sat, 6 May 2006 10:10:08 +0000 (10:10 +0000)
committerManuel Mall <manuel@apache.org>
Sat, 6 May 2006 10:10:08 +0000 (10:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@400279 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/FOPropertyMapping.java
status.xml
test/layoutengine/standard-testcases/inline_vertical-align_1.xml

index 307e1d5a339c658602ff6c4825e56d56884162d3..c69f47f2569ccc8cd888cbe4a80e8163b2393cb2 100644 (file)
@@ -2669,6 +2669,7 @@ public class FOPropertyMapping implements Constants {
         m.addEnum("bottom", getEnumProperty(EN_BOTTOM, "BOTTOM"));
         m.setDatatypeParser(new VerticalAlignShorthandParser());
         m.setDefault("baseline");
+        m.setPercentBase(LengthBase.ALIGNMENT_ADJUST);
         addPropertyMaker("vertical-align", m);
 
         // white-space
index 36fc373eda1c90a10cc6b077aaaa68b899e0a456..d355d228964eeff611a8e683bfe6c24e8b0cf749 100644 (file)
@@ -27,6 +27,9 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="MM" type="fix">
+        Bugfix: Percentages in vertical-align property values were not correctly handled.
+      </action>
       <action context="Code" dev="JM" type="fix" fixes-bug="38243" due-to="Gerhard Oettl">
         Bugfix: Gaps in table-columns cause a NullPointerException.
       </action>
index 457b4a8984d06eea2a36a248114b1d54360779a5..eed8d39f5ffdbd9abede827135693e0c608bedc1 100644 (file)
@@ -24,7 +24,7 @@
   <fo>
     <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
       <fo:layout-master-set>
-        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+        <fo:simple-page-master master-name="normal" page-width="5in" page-height="6in">
           <fo:region-body/>
         </fo:simple-page-master>
       </fo:layout-master-set>
           <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
             Before <fo:inline font-size="10pt" vertical-align="sub" background-color="yellow">vertical-align="sub"</fo:inline> After
           </fo:block>
+          <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+            Before <fo:inline font-size="10pt" vertical-align="3pt" background-color="yellow">vertical-align="3pt"</fo:inline> After
+          </fo:block>
+          <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+            Before <fo:inline font-size="10pt" vertical-align="-3pt" background-color="yellow">vertical-align="-3pt"</fo:inline> After
+          </fo:block>
+          <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+            Before <fo:inline font-size="10pt" vertical-align="50%" background-color="yellow">vertical-align="50%"</fo:inline> After
+          </fo:block>
+          <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
+            Before <fo:inline font-size="10pt" vertical-align="-50%" background-color="yellow">vertical-align="-50%"</fo:inline> After
+          </fo:block>
           <fo:block background-color="silver" margin="2pt 0pt 2pt 0pt" font-size="20pt">
             Before <fo:inline vertical-align="super" background-color="yellow">vertical-align="super"</fo:inline> After
           </fo:block>
     <eval expected="9795" xpath="//flow/block[9]/lineArea[1]/inlineparent/@offset"/>
     <eval expected="0" xpath="//flow/block[9]/lineArea[1]/text[2]/@offset"/>
 
-    <eval expected="28960" xpath="//flow/block[10]/lineArea[1]/@bpd"/>
+    <eval expected="18500" xpath="//flow/block[10]/lineArea[1]/@bpd"/>
     <eval expected="2750" xpath="//flow/block[10]/lineArea[1]/@space-before"/>
     <eval expected="2750" xpath="//flow/block[10]/lineArea[1]/@space-after"/>
-    <eval expected="10460" xpath="//flow/block[10]/lineArea[1]/text[1]/@offset"/>
-    <eval expected="0" xpath="//flow/block[10]/lineArea[1]/inlineparent/@offset"/>
-    <eval expected="10460" xpath="//flow/block[10]/lineArea[1]/text[2]/@offset"/>
+    <eval expected="0" xpath="//flow/block[10]/lineArea[1]/text[1]/@offset"/>
+    <eval expected="4180" xpath="//flow/block[10]/lineArea[1]/inlineparent/@offset"/>
+    <eval expected="0" xpath="//flow/block[10]/lineArea[1]/text[2]/@offset"/>
 
-    <eval expected="23730" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
+    <eval expected="19430" xpath="//flow/block[11]/lineArea[1]/@bpd"/>
     <eval expected="2750" xpath="//flow/block[11]/lineArea[1]/@space-before"/>
     <eval expected="2750" xpath="//flow/block[11]/lineArea[1]/@space-after"/>
     <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[1]/@offset"/>
-    <eval expected="5230" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
+    <eval expected="10180" xpath="//flow/block[11]/lineArea[1]/inlineparent/@offset"/>
     <eval expected="0" xpath="//flow/block[11]/lineArea[1]/text[2]/@offset"/>
+
+    <eval expected="18500" xpath="//flow/block[12]/lineArea[1]/@bpd"/>
+    <eval expected="2750" xpath="//flow/block[12]/lineArea[1]/@space-before"/>
+    <eval expected="2750" xpath="//flow/block[12]/lineArea[1]/@space-after"/>
+    <eval expected="0" xpath="//flow/block[12]/lineArea[1]/text[1]/@offset"/>
+    <eval expected="1180" xpath="//flow/block[12]/lineArea[1]/inlineparent/@offset"/>
+    <eval expected="0" xpath="//flow/block[12]/lineArea[1]/text[2]/@offset"/>
+
+    <eval expected="22430" xpath="//flow/block[13]/lineArea[1]/@bpd"/>
+    <eval expected="2750" xpath="//flow/block[13]/lineArea[1]/@space-before"/>
+    <eval expected="2750" xpath="//flow/block[13]/lineArea[1]/@space-after"/>
+    <eval expected="0" xpath="//flow/block[13]/lineArea[1]/text[1]/@offset"/>
+    <eval expected="13180" xpath="//flow/block[13]/lineArea[1]/inlineparent/@offset"/>
+    <eval expected="0" xpath="//flow/block[13]/lineArea[1]/text[2]/@offset"/>
+
+    <eval expected="28960" xpath="//flow/block[14]/lineArea[1]/@bpd"/>
+    <eval expected="2750" xpath="//flow/block[14]/lineArea[1]/@space-before"/>
+    <eval expected="2750" xpath="//flow/block[14]/lineArea[1]/@space-after"/>
+    <eval expected="10460" xpath="//flow/block[14]/lineArea[1]/text[1]/@offset"/>
+    <eval expected="0" xpath="//flow/block[14]/lineArea[1]/inlineparent/@offset"/>
+    <eval expected="10460" xpath="//flow/block[14]/lineArea[1]/text[2]/@offset"/>
+
+    <eval expected="23730" xpath="//flow/block[15]/lineArea[1]/@bpd"/>
+    <eval expected="2750" xpath="//flow/block[15]/lineArea[1]/@space-before"/>
+    <eval expected="2750" xpath="//flow/block[15]/lineArea[1]/@space-after"/>
+    <eval expected="0" xpath="//flow/block[15]/lineArea[1]/text[1]/@offset"/>
+    <eval expected="5230" xpath="//flow/block[15]/lineArea[1]/inlineparent/@offset"/>
+    <eval expected="0" xpath="//flow/block[15]/lineArea[1]/text[2]/@offset"/>
   </checks>
 </testcase>