patch: force layout (overriding FOUC protection) for
layout-required properties
Maciej Stachowiak
mjs at apple.com
Tue Nov 11 00:11:29 CET 2003
On Nov 7, 2003, at 4:00 PM, Dirk Mueller wrote:
> On Monday 03 November 2003 23:57, Maciej Stachowiak wrote:
>
>> Here's the patch:
>
> Hmm, that majorly sucks. do you have a testcase? I'm wondering if
> there isn't
> a way around this problem you tried to fix.
Here is a reduced test case. The citibank site in question breaks if
the width accessed during loading is 0 instead of the correct value.
This requires a layout since it is a percentage width.
A fancier solution would be to block execution of scripts if they will
require a layout until all stylesheets are in, but it's in general
impossible to tell this up front, and it's hard to pause script
execution in the middle.
Note that this will not affect the vast majority of sites at all (w/ my
fixes).
<html>
<head><link rel='stylesheet'
href='https://www.accountonline.com/svc/content/Style.css'
type='text/css'></head>
<body>
<table width="160">
<tr><td>
<nobr>Compare Payment Options</nobr>
</td></tr>
<tr><td>
<table width="100%">
<tr><td><img src="" name="widthtest" width="100%"></td></tr>
</table>
</td></tr>
</table>
<script>
alert('document.images["widthtest"].width = ' +
document.images["widthtest"].width + ', should be non-zero');
</script>
</body>
</html>
More information about the Khtml-devel
mailing list