Re: svn: /phd/trunk/ phpdotnet/phd/Format.php phpdotnet/phd/Package/Generic/PDF.php phpdotnet/phd/Package/Generic/XHTML.php
phpdotnet/phd/Package/PEAR/XHTML.php tests/php/TestChunkedXHTML.php tests/php/bug49101-1.phpt tests/php/bug49101-2.p

From: Date: Wed, 08 Feb 2012 14:19:18 +0000
Subject: Re: svn: /phd/trunk/ phpdotnet/phd/Format.php phpdotnet/phd/Package/Generic/PDF.php phpdotnet/phd/Package/Generic/XHTML.php
phpdotnet/phd/Package/PEAR/XHTML.php tests/php/TestChunkedXHTML.php tests/php/bug49101-1.phpt tests/php/bug49101-2.p
References: 1  Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-9564@lists.php.net to get a copy of this message
Hi Hannes, On 08.02.2012 17:46, Hannes Magnusson wrote:
avb                                      Tue, 07 Feb 2012 06:30:24 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=323107 Log: * Get rid of redundant align and valign attributes on table-related tags, make non-redundant ones output as inline styles
          if (isset($attrs["colwidth"])) {
-            $retval .= ' width="' .((int)$attrs["colwidth"]). '"';
+            if (preg_match('/^\\d+\\*$/', $attrs['colwidth'])) {
+                // relative_length measure has no analogue in CSS and is
+                // unsupported in browsers, leave as is
+                $retval .= ' width="' . $attrs['colwidth'] . '"';
+            } else {
+                // probably fixed width, use inline styles
+                $style[] = 'width: ' . $attrs['colwidth'];
+            }
          }
Hmh It used to be casted to an integer, no matter what.. now we wind up with * in the<col width=""> attributes.. is that valid in html?
Casting to integer was definitely wrong. DocBook's colwidth has the following description [1]:
    ColWidth specifies the desired width of the relevant column. It can be either a fixed measure using one of the CALS units (36pt, 10pc, etc.) or a proportional measure. Proportional measures have the form “number*”, meaning this column should be number times wider than a column with the measure “1*” (or just “*”). These two forms can be mixed, as in “3*+1pc”.
<col width="1*" /> is valid in HTML [2], just no browser supports it [3]. Measures in units like pt can be inserted as styles and will be handled properly, unlike casting them to integer (essentially, pixels). Mixed measures are also inserted as styles but will be broken. The best approach is of course to write special code that will translate "1*" to whatever browsers understand (percents, likely). I am not even sure that it is possible to express "3*+1pc" in CSS. [1] http://www.docbook.org/tdg/en/html/colspec.html [2] http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-strict.dtd_col [3] http://www.w3schools.com/tags/att_col_width.asp

« previous php.doc.cvs (#9564) next »