]> granicus.if.org Git - docbook-dsssl/commitdiff
Use CSS to set viewport characteristics if css.decoration is non-zero, use div instea...
authorNorman Walsh <ndw@nwalsh.com>
Wed, 18 Sep 2002 13:05:52 +0000 (13:05 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 18 Sep 2002 13:05:52 +0000 (13:05 +0000)
xsl/html/graphics.xsl

index e3f88ac617a6314dedd930d6f46cb94b52cb973e..0835b3e9a1b7cd1d89af0ab002aa45246ad79334 100644 (file)
@@ -493,7 +493,16 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
           </xsl:if>
 
           <xsl:call-template name="process.image.attributes">
-            <xsl:with-param name="alt" select="$alt"/>
+            <xsl:with-param name="alt">
+              <xsl:choose>
+                <xsl:when test="$alt != ''">
+                  <xsl:copy-of select="$alt"/>
+                </xsl:when>
+                <xsl:when test="ancestor::figure">
+                  <xsl:value-of select="normalize-space(ancestor::figure/title)"/>
+                </xsl:when>
+              </xsl:choose>
+            </xsl:with-param>
             <xsl:with-param name="html.depth" select="$html.depth"/>
             <xsl:with-param name="html.width" select="$html.width"/>
             <xsl:with-param name="longdesc" select="$longdesc"/>
@@ -536,15 +545,35 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
         <tr>
           <xsl:if test="$html.depth != '' and $depth-units != '%'">
             <!-- don't do this for percentages because browsers get confused -->
-            <xsl:attribute name="height">
-              <xsl:value-of select="$html.depth"/>
-            </xsl:attribute>
+            <xsl:choose>
+              <xsl:when test="$css.decoration != 0">
+                <xsl:attribute name="style">
+                  <xsl:text>height: </xsl:text>
+                  <xsl:value-of select="$html.depth"/>
+                </xsl:attribute>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:attribute name="height">
+                  <xsl:value-of select="$html.depth"/>
+                </xsl:attribute>
+              </xsl:otherwise>
+            </xsl:choose>
           </xsl:if>
           <td>
             <xsl:if test="$bgcolor != ''">
-              <xsl:attribute name="bgcolor">
-                <xsl:value-of select="$bgcolor"/>
-              </xsl:attribute>
+              <xsl:choose>
+                <xsl:when test="$css.decoration != 0">
+                  <xsl:attribute name="style">
+                    <xsl:text>background-color: </xsl:text>
+                    <xsl:value-of select="$bgcolor"/>
+                  </xsl:attribute>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:attribute name="bgcolor">
+                    <xsl:value-of select="$bgcolor"/>
+                  </xsl:attribute>
+                </xsl:otherwise>
+              </xsl:choose>
             </xsl:if>
             <xsl:if test="@align">
               <xsl:attribute name="align">
@@ -685,10 +714,10 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
       <xsl:call-template name="process.image"/>
     </xsl:when>
     <xsl:otherwise>
-      <p>
+      <div>
         <xsl:call-template name="anchor"/>
         <xsl:call-template name="process.image"/>
-      </p>
+      </div>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>