Author: vhennebert
Date: Thu Mar 24 18:14:23 2011
New Revision: 1085058

URL: http://svn.apache.org/viewvc?rev=1085058&view=rev
Log:
Bugzilla #50763: Implemented non-standard behavior for basic-link areas, such 
that they take into account the heights of their descendants areas

Added:
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java   
(with props)
    
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height.xml
   (with props)
    
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_baseline-shift.xml
   (with props)
    
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_inline-child.xml
   (with props)
    
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-child.xml
   (with props)
    
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-line.xml
   (with props)
Modified:
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/AbstractTextArea.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
    xmlgraphics/fop/trunk/status.xml
    xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml
    
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_external-destination_2.xml

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/AbstractTextArea.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/AbstractTextArea.java?rev=1085058&r1=1085057&r2=1085058&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/AbstractTextArea.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/AbstractTextArea.java 
Thu Mar 24 18:14:23 2011
@@ -185,4 +185,15 @@ public abstract class AbstractTextArea e
     public void setBaselineOffset(int baselineOffset) {
         this.baselineOffset = baselineOffset;
     }
+
+    @Override
+    int getVirtualOffset() {
+        return getOffset();
+    }
+
+    @Override
+    int getVirtualBPD() {
+        /* Word and space areas don't have a properly set bpd; return this 
area's bpd instead. */
+        return getBPD();
+    }
 }

Added: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java?rev=1085058&view=auto
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java 
(added)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java 
Thu Mar 24 18:14:23 2011
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.area.inline;
+
+import org.apache.fop.area.Area;
+
+/**
+ * An inline area produced by an fo:basic-link element. This class implements 
a different
+ * behavior to what is prescribed by the XSL-FO 1.1 Recommendation. With the 
standard
+ * behavior, there is no easy way to make a link cover e.g. a whole image.
+ *
+ * <p>See following bug report at W3C's:
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=11672</p>
+ */
+public class BasicLinkArea extends InlineParent {
+
+    private static final long serialVersionUID = 5183753430412208151L;
+
+    @Override
+    public void setParentArea(Area parentArea) {
+        super.setParentArea(parentArea);
+        /*
+         * Perform necessary modifications to make this area encompass all of 
its children
+         * elements, so as to have a useful active area. We assume that this 
method is
+         * called after all of the children areas have been added to this area.
+         */
+        /* Make this area start at its beforest child. */
+        setOffset(getOffset() + minChildOffset);
+        /* Update children offsets accordingly. */
+        for (InlineArea inline : inlines) {
+            inline.setOffset(inline.getOffset() - minChildOffset);
+        }
+        setBPD(getVirtualBPD());
+    }
+
+}

Propchange: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/BasicLinkArea.java
------------------------------------------------------------------------------
    svn:keywords = Revision Id

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java?rev=1085058&r1=1085057&r2=1085058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineArea.java 
Thu Mar 24 18:14:23 2011
@@ -251,5 +251,32 @@ public class InlineArea extends Area {
             storedIPDVariation += ipdVariation;
         }
     }
+
+    /**
+     * Returns the offset that this area would have if its offset and size 
were taking
+     * children areas into account. The bpd of an inline area is taken from 
its nominal
+     * font and doesn't depend on the bpds of its children elements. However, 
in the case
+     * of a basic-link element we want the active area to cover all of the 
children
+     * elements.
+     *
+     * @return the offset that this area would have if the before-edge of its
+     * content-rectangle were coinciding with the <q>beforest</q> before-edge 
of its
+     * children allocation-rectangles.
+     * @see #getVirtualBPD()
+     * @see BasicLinkArea
+     */
+    int getVirtualOffset() {
+        return getOffset();
+    }
+
+    /**
+     * Returns the block-progression-dimension that this area would have if it 
were taking
+     * its children elements into account. See {@linkplain 
#getVirtualOffset()}.
+     *
+     * @return the bpd
+     */
+    int getVirtualBPD() {
+        return getBPD();
+    }
 }
 

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java?rev=1085058&r1=1085057&r2=1085058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/InlineParent.java 
Thu Mar 24 18:14:23 2011
@@ -39,31 +39,42 @@ public class InlineParent extends Inline
     /** Controls whether the IPD is automatically adjusted based on the area's 
children. */
     protected transient boolean autoSize;
 
-    /**
-     * Create a new inline parent to add areas to.
-     */
-    public InlineParent() {
-    }
+    /** The offset of the <q>beforest</q> child area of this area. */
+    protected int minChildOffset;
 
     /**
-     * Override generic Area method.
-     *
-     * @param childArea the child area to add
+     * The offset of the <q>afterest</q> child area of this area. Offset from 
the
+     * before-edge of this area's content-rectangle and the after-edge of the 
child area's
+     * allocation-rectangle.
      */
+    private int maxAfterEdge;
+
     @Override
-    public void addChildArea(Area childArea) {
+    public void addChildArea(Area c) {
+        assert c instanceof InlineArea;
         if (inlines.size() == 0) {
             autoSize = (getIPD() == 0);
         }
-        if (childArea instanceof InlineArea) {
-            InlineArea inlineChildArea = (InlineArea) childArea;
-            inlines.add(inlineChildArea);
-            // set the parent area for the child area
-            inlineChildArea.setParentArea(this);
-            if (autoSize) {
-                increaseIPD(inlineChildArea.getAllocIPD());
-            }
+        InlineArea childArea = (InlineArea) c;
+        inlines.add(childArea);
+        // set the parent area for the child area
+        childArea.setParentArea(this);
+        if (autoSize) {
+            increaseIPD(childArea.getAllocIPD());
         }
+        int childOffset = childArea.getVirtualOffset();
+        minChildOffset = Math.min(minChildOffset, childOffset);
+        maxAfterEdge = Math.max(maxAfterEdge, childOffset + 
childArea.getVirtualBPD());
+    }
+
+    @Override
+    int getVirtualOffset() {
+        return getOffset() + minChildOffset;
+    }
+
+    @Override
+    int getVirtualBPD() {
+        return maxAfterEdge - minChildOffset;
     }
 
     /**
@@ -98,5 +109,6 @@ public class InlineParent extends Inline
 
         return hasUnresolvedAreas;
     }
+
 }
 

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java?rev=1085058&r1=1085057&r2=1085058&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java
 Thu Mar 24 18:14:23 2011
@@ -21,7 +21,9 @@ package org.apache.fop.layoutmgr.inline;
 
 import org.apache.fop.area.LinkResolver;
 import org.apache.fop.area.Trait;
+import org.apache.fop.area.inline.BasicLinkArea;
 import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.area.inline.InlineParent;
 import org.apache.fop.datatypes.URISpecification;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.flow.BasicLink;
@@ -77,4 +79,10 @@ public class BasicLinkLayoutManager exte
             }
         }
     }
+
+    @Override
+    protected InlineParent createInlineParent() {
+        return new BasicLinkArea();
+    }
+
 }

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java?rev=1085058&r1=1085057&r2=1085058&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
 Thu Mar 24 18:14:23 2011
@@ -198,13 +198,13 @@ public class InlineLayoutManager extends
     /**
      * Create and initialize an <code>InlineArea</code>
      *
-     * @param hasInlineParent   true if the parent is an inline
+     * @param isInline   true if the parent is an inline
      * @return the area
      */
-    protected InlineArea createArea(boolean hasInlineParent) {
+    protected InlineArea createArea(boolean isInline) {
         InlineArea area;
-        if (hasInlineParent) {
-            area = new InlineParent();
+        if (isInline) {
+            area = createInlineParent();
             area.setOffset(0);
         } else {
             area = new InlineBlockParent();
@@ -215,6 +215,10 @@ public class InlineLayoutManager extends
         return area;
     }
 
+    protected InlineParent createInlineParent() {
+        return new InlineParent();
+    }
+
     /** {@inheritDoc} */
     @Override
     protected void setTraits(boolean isNotFirst, boolean isNotLast) {

Modified: xmlgraphics/fop/trunk/status.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1085058&r1=1085057&r2=1085058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Thu Mar 24 18:14:23 2011
@@ -59,6 +59,10 @@
       documents. Example: the fix of marks layering will be such a case when 
it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Layout" dev="VH" type="fix" fixex-bug="50763">
+        Implemented non-standard behavior for basic-link areas, such that they 
take into account the 
+        heights of their descendants areas.
+      </action>
       <action context="Layout" dev="VH" type="fix">
         Bugfix: keep-together does not apply to fo:table-cell.
       </action>

Modified: xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml?rev=1085058&r1=1085057&r2=1085058&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml Thu Mar 24 
18:14:23 2011
@@ -20,13 +20,6 @@
 <!--DOCTYPE disabled-testcases SYSTEM "disabled-testcases.dtd"-->
 <disabled-testcases>
   <testcase>
-    <name>External link around an SVG not properly sized</name>
-    <file>basic-link_external-destination_2.xml</file>
-    <description>The bpd trait of the inlineparent area for the basic-link
-    is not sized correctly if it wraps an image that is higher than the 
-    nominal line.</description>
-  </testcase>
-  <testcase>
     <name>Auto-height block-containers produce fences</name>
     <file>block-container_space-before_space-after_3.xml</file>
     <description>Block-containers with no height currently don't

Modified: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_external-destination_2.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_external-destination_2.xml?rev=1085058&r1=1085057&r2=1085058&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_external-destination_2.xml
 (original)
+++ 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_external-destination_2.xml
 Thu Mar 24 18:14:23 2011
@@ -47,10 +47,12 @@
     </fo:root>
   </fo>
   <checks>
-    <eval expected="192000" 
xpath="//inlineparent[@prod-id='link']/viewport/@ipd"/>
-    <eval expected="192000" 
xpath="//inlineparent[@prod-id='link']/viewport/@bpd"/>
-    
-    <eval expected="192000" xpath="//inlineparent[@prod-id='link']/@ipd"/>
-    <eval expected="192000" xpath="//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="144000" xpath="//inlineparent[@prod-id='link']/@ipd"/>
+    <eval expected="144000" xpath="//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="0"      xpath="//inlineparent[@prod-id='link']/@offset"/>
+
+    <eval expected="144000" 
xpath="//inlineparent[@prod-id='link']/viewport/@ipd"/>
+    <eval expected="144000" 
xpath="//inlineparent[@prod-id='link']/viewport/@bpd"/>
+    <eval expected="0"      
xpath="//inlineparent[@prod-id='link']/viewport/@offset"/>
   </checks>
 </testcase>

Added: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height.xml?rev=1085058&view=auto
==============================================================================
--- 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height.xml
 (added)
+++ 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height.xml
 Thu Mar 24 18:14:23 2011
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks the height of an fo:basic-link wrapping a bigger 
element.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="page"
+          page-height="420pt" page-width="320pt" margin="10pt">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="page">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
In in <fo:basic-link 
+              id="link" color="blue" 
+              
external-destination="url(http://xmlgraphics.apache.org/fop/)"><fo:inline 
id="inline"
+                font-size="24pt" 
baseline-shift="12pt">egestas</fo:inline></fo:basic-link> nisi. 
+            Etiam at ante eget velit placerat ullamcorper.</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="84048" xpath="//inlineparent[@prod-id='link']/@ipd"/>
+    <eval expected="22200" xpath="//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="0"     xpath="//inlineparent[@prod-id='link']/@offset"/>
+
+    <eval expected="84048" 
xpath="//inlineparent[@prod-id='link']/inlineparent/@ipd"/>
+    <eval expected="22200" 
xpath="//inlineparent[@prod-id='link']/inlineparent/@bpd"/>
+    <eval expected="0"     
xpath="//inlineparent[@prod-id='link']/inlineparent/@offset"/>
+  </checks>
+</testcase>

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id

Added: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_baseline-shift.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_baseline-shift.xml?rev=1085058&view=auto
==============================================================================
--- 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_baseline-shift.xml
 (added)
+++ 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_baseline-shift.xml
 Thu Mar 24 18:14:23 2011
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks the height of an fo:basic-link with baseline-shift.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="page"
+          page-height="420pt" page-width="320pt" margin="10pt">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="page">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block font-size="40pt">Lorem ipsum dolor <fo:basic-link 
id="link" color="blue" 
+              font-size="12pt" 
external-destination="url(http://xmlgraphics.apache.org/fop/)" 
+              baseline-shift="-5pt">sit <fo:inline 
baseline-shift="5pt">amet,</fo:inline> <fo:inline 
+                font-size="24pt" 
baseline-shift="-10pt">consectetur</fo:inline> 
+              adipiscing</fo:basic-link>elit.</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- First line -->
+    <eval expected="28584" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="20104" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/@offset"/>
+
+    <eval expected="11100" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/text[1]/@bpd"/>
+    <eval expected="5000"  
xpath="//lineArea[2]//inlineparent[@prod-id='link']/text[1]/@offset"/>
+
+    <eval expected="11100" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/inlineparent[1]/@bpd"/>
+    <eval expected="0"     
xpath="//lineArea[2]//inlineparent[@prod-id='link']/inlineparent[1]/@offset"/>
+
+    <eval expected="22200" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/inlineparent[2]/@bpd"/>
+    <eval expected="6384"  
xpath="//lineArea[2]//inlineparent[@prod-id='link']/inlineparent[2]/@offset"/>
+
+    <!-- Second line -->
+    <eval expected="11100" 
xpath="//lineArea[3]//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="25104" 
xpath="//lineArea[3]//inlineparent[@prod-id='link']/@offset"/>
+  </checks>
+</testcase>

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_baseline-shift.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_baseline-shift.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id

Added: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_inline-child.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_inline-child.xml?rev=1085058&view=auto
==============================================================================
--- 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_inline-child.xml
 (added)
+++ 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_inline-child.xml
 Thu Mar 24 18:14:23 2011
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks the height of an fo:basic-link having several child 
elements wrapped into a 
+      single fo:inline element.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="page"
+          page-height="420pt" page-width="320pt" margin="10pt">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="page">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
<fo:basic-link 
+              id="link" color="blue" 
+              
external-destination="url(http://xmlgraphics.apache.org/fop/)"><fo:inline>In 
+                <fo:inline baseline-shift="12pt">in</fo:inline> <fo:inline 
font-size="24pt"
+                baseline-shift="-20pt">egestas</fo:inline> 
nisi</fo:inline></fo:basic-link>. Etiam 
+          at ante eget velit placerat ullamcorper.</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="45584"  xpath="//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="0"      xpath="//inlineparent[@prod-id='link']/@offset"/>
+
+    <eval expected="11100"  
xpath="//inlineparent[@prod-id='link']/inlineparent/@bpd"/>
+    <eval expected="12000"  
xpath="//inlineparent[@prod-id='link']/inlineparent/@offset"/>
+
+    <eval expected="11100"  
xpath="//inlineparent[@prod-id='link']/inlineparent/text[1]/@bpd"/>
+    <eval expected="0"      
xpath="//inlineparent[@prod-id='link']/inlineparent/text[1]/@offset"/>
+
+    <eval expected="11100"  
xpath="//inlineparent[@prod-id='link']/inlineparent/inlineparent[1]/@bpd"/>
+    <eval expected="-12000" 
xpath="//inlineparent[@prod-id='link']/inlineparent/inlineparent[1]/@offset"/>
+
+    <eval expected="22200"  
xpath="//inlineparent[@prod-id='link']/inlineparent/inlineparent[2]/@bpd"/>
+    <eval expected="11384"  
xpath="//inlineparent[@prod-id='link']/inlineparent/inlineparent[2]/@offset"/>
+  </checks>
+</testcase>

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_inline-child.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_inline-child.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id

Added: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-child.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-child.xml?rev=1085058&view=auto
==============================================================================
--- 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-child.xml
 (added)
+++ 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-child.xml
 Thu Mar 24 18:14:23 2011
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks the height of an fo:basic-link having several child 
elements.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="page"
+          page-height="420pt" page-width="320pt" margin="10pt">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="page">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
<fo:basic-link 
+              id="link" color="blue" 
+              
external-destination="url(http://xmlgraphics.apache.org/fop/)">In <fo:inline 
+                baseline-shift="12pt">in</fo:inline> <fo:inline 
font-size="24pt"
+                baseline-shift="-20pt">egestas</fo:inline> 
nisi</fo:basic-link>. Etiam at ante eget 
+            velit placerat ullamcorper.</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="45584" xpath="//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="0"     xpath="//inlineparent[@prod-id='link']/@offset"/>
+
+    <eval expected="11100" 
xpath="//inlineparent[@prod-id='link']/text[1]/@bpd"/>
+    <eval expected="12000" 
xpath="//inlineparent[@prod-id='link']/text[1]/@offset"/>
+
+    <eval expected="11100" 
xpath="//inlineparent[@prod-id='link']/inlineparent[1]/@bpd"/>
+    <eval expected="0"     
xpath="//inlineparent[@prod-id='link']/inlineparent[1]/@offset"/>
+
+    <eval expected="22200" 
xpath="//inlineparent[@prod-id='link']/inlineparent[2]/@bpd"/>
+    <eval expected="23384" 
xpath="//inlineparent[@prod-id='link']/inlineparent[2]/@offset"/>
+  </checks>
+</testcase>

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-child.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-child.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id

Added: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-line.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-line.xml?rev=1085058&view=auto
==============================================================================
--- 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-line.xml
 (added)
+++ 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-line.xml
 Thu Mar 24 18:14:23 2011
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks the height of an fo:basic-link spanning over several 
lines.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="page"
+          page-height="420pt" page-width="320pt" margin="10pt">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="page">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Integer quis neque 
+            vitae lectus condimentum. <fo:basic-link id="link" color="blue" 
+              
external-destination="url(http://xmlgraphics.apache.org/fop/)">In <fo:inline 
+                baseline-shift="12pt">in</fo:inline> <fo:inline 
font-size="24pt"
+                baseline-shift="-20pt">egestas</fo:inline> 
nisi</fo:basic-link>. Etiam at ante eget 
+            velit placerat ullamcorper.</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- First line -->
+    <eval expected="23100" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="0"     
xpath="//lineArea[2]//inlineparent[@prod-id='link']/@offset"/>
+                                               
+    <eval expected="11100" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/text[1]/@bpd"/>
+    <eval expected="12000" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/text[1]/@offset"/>
+                                               
+    <eval expected="11100" 
xpath="//lineArea[2]//inlineparent[@prod-id='link']/inlineparent/@bpd"/>
+    <eval expected="0"     
xpath="//lineArea[2]//inlineparent[@prod-id='link']/inlineparent/@offset"/>
+
+    <!-- Second line -->
+    <eval expected="33584" 
xpath="//lineArea[3]//inlineparent[@prod-id='link']/@bpd"/>
+    <eval expected="0"     
xpath="//lineArea[3]//inlineparent[@prod-id='link']/@offset"/>
+
+    <eval expected="22200" 
xpath="//lineArea[3]//inlineparent[@prod-id='link']/inlineparent/@bpd"/>
+    <eval expected="11384" 
xpath="//lineArea[3]//inlineparent[@prod-id='link']/inlineparent/@offset"/>
+
+    <eval expected="11100" 
xpath="//lineArea[3]//inlineparent[@prod-id='link']/text[1]/@bpd"/>
+    <eval expected="0"     
xpath="//lineArea[3]//inlineparent[@prod-id='link']/text[1]/@offset"/>
+
+  </checks>
+</testcase>

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-line.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/basic-link_height_multi-line.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to