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: | Hannes Magnusson | Date: | Wed, 08 Feb 2012 14:48:49 +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 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-9565@lists.php.net to get a copy of this message | ||
On Wed, Feb 8, 2012 at 15:19, Alexey Borzov <borz_off@cs.msu.su> wrote:
> 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].
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
> 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.
I know we didn't support pt or inches properly :)
> 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
Makes sense. Your current solution is probably better then what we had
before, unsure what the idea was in the beginning there... been awhile
:)
> that it is possible to express "3*+1pc" in CSS.
I think thats an edgecase scenario that is unlikely to be used.
-Hannes