]> granicus.if.org Git - docbook-dsssl/commitdiff
Bug #516859: added default.image.width
authorNorman Walsh <ndw@nwalsh.com>
Fri, 27 Sep 2002 12:27:22 +0000 (12:27 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 27 Sep 2002 12:27:22 +0000 (12:27 +0000)
xsl/html/graphics.xsl
xsl/params/default.image.width.xml [new file with mode: 0644]

index d2154ec384dc34efcb15c49d19dd78647f129d42..921b00079dede5bad87ee3dd852a7c25d36ca07d 100644 (file)
        alignment.
   -->
 
+  <xsl:variable name="width-units">
+    <xsl:choose>
+      <xsl:when test="@width">
+        <xsl:call-template name="length-units">
+          <xsl:with-param name="length" select="@width"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="not(@depth) and $default.image.width != ''">
+        <xsl:call-template name="length-units">
+          <xsl:with-param name="length" select="$default.image.width"/>
+        </xsl:call-template>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="width">
+    <xsl:choose>
+      <xsl:when test="@width">
+        <xsl:choose>
+          <xsl:when test="$width-units = '%'">
+            <xsl:value-of select="@width"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="length-spec">
+              <xsl:with-param name="length" select="@width"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:when test="not(@depth) and $default.image.width != ''">
+        <xsl:value-of select="$default.image.width"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
   <xsl:variable name="scalefit">
     <xsl:choose>
       <xsl:when test="@contentwidth or @contentdepth">0</xsl:when>
       <xsl:when test="@scale">0</xsl:when>
       <xsl:when test="@scalefit"><xsl:value-of select="@scalefit"/></xsl:when>
-      <xsl:when test="@width or @depth">1</xsl:when>
+      <xsl:when test="$width != '' or @depth">1</xsl:when>
       <xsl:otherwise>0</xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
     </xsl:if>
   </xsl:variable>
 
-  <xsl:variable name="width-units">
-    <xsl:if test="@width">
-      <xsl:call-template name="length-units">
-        <xsl:with-param name="length" select="@width"/>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:variable>
-
-  <xsl:variable name="width">
-    <xsl:if test="@width">
-      <xsl:choose>
-        <xsl:when test="$width-units = '%'">
-          <xsl:value-of select="@width"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="length-spec">
-            <xsl:with-param name="length" select="@width"/>
-          </xsl:call-template>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:if>
-  </xsl:variable>
-
   <xsl:variable name="html.width">
     <xsl:choose>
       <xsl:when test="$width-units = '%'">
         <xsl:value-of select="$width"/>
       </xsl:when>
-      <xsl:when test="@width and @width != ''">
+      <xsl:when test="$width != ''">
         <xsl:variable name="width.in.points">
           <xsl:call-template name="length-in-points">
             <xsl:with-param name="length" select="$width"/>
diff --git a/xsl/params/default.image.width.xml b/xsl/params/default.image.width.xml
new file mode 100644 (file)
index 0000000..edda404
--- /dev/null
@@ -0,0 +1,26 @@
+<refentry id="default.image.width">
+<refmeta>
+<refentrytitle>default.image.width</refentrytitle>
+<refmiscinfo role="type">length</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>default.image.width</refname>
+<refpurpose>The default width of images</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='default.image.width.frag'>
+<xsl:param name="default.image.width" select="''"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If specified, this value will be used for the
+<sgmltag class="attribute">width</sgmltag> attribute on
+images that do not specify any
+<ulink url="http://docbook.org/tdg/en/html/imagedata.html#viewport.area">viewport
+dimensions</ulink>.</para>
+
+</refsect1>
+</refentry>