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 15:05:14 +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 2 3  Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-9566@lists.php.net to get a copy of this message
Hi Hannes, On 08.02.2012 18:48, 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].
Right, but leaving the * out would mean that the value is relative, and it was up to the browser to decide the actual rendered width. chromium and firefox do seem to deal with that differently though
No, <col width="1" /> means that the column should be 1 pixel wide (and it works in browsers). <col width="1*" /> means that it should have relative width (and it mostly works as <col width="1" />) Try this: <table>
    <col width="1" />
    <col />
    <col width="2" />
    <tr>
        <td style="background-color: #f00;"></td>
        <td>Middle column</td>
        <td style="background-color: #f00;"></td>
    </tr>
</table> <table>
    <col width="1*" />
    <col />
    <col width="2*" />
    <tr>
        <td style="background-color: #f00;"></td>
        <td>Middle column</td>
        <td style="background-color: #f00;"></td>
    </tr>
</table>

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