Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / text / whitespace / 024.html
blobb83378bd8117fe733df43f6ed1c7d3bcf08fb606
1 <HTML>
2 <HEAD>
3 <TITLE>Safari 1.0 PRE width bug</TITLE>
4 <STYLE TYPE="text/css">
5 <!--
6 .box { background: #cc9; border: black solid 1px ; padding:0.5em; }
7 .dow { border-top: solid black 1px; border-bottom: solid black 2px; }
8 -->
9 </STYLE>
10 </HEAD>
11 <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
13 <H1>Safari 1.0 PRE width bug</H1>
15 As noted in my <A HREF="/1/blog/permalink/2003.0920">blog</A>,
16 in certain cases Safari will miscalculate the width of a PRE element.
17 I think I've found the trigger. If a nested container element is preceded by
18 uncontained text and a blank line, and there are "too many" characters
19 contained in the nested element, the PRE width will be too wide.
20 In the examples below, the nested element is a SPAN whose content
21 is the days-of-week line, as follows:
22 <PRE>
23 &lt;SPAN CLASS=dow&gt; D M T W J F S&lt;/SPAN&gt;
24 </PRE>
26 <H2>Example 1</H2>
28 <table valign=top width="100%"><tr><td width="1%">
29 <PRE CLASS=box> 2003
31 <SPAN CLASS=dow> D M T W J F S</SPAN>
33 September
34 1 2 3 4 5 6
35 7 8 9 10 11 12 13
36 14 15 16 17 18 19 20
37 21 22 23 24 25 26 27
38 28 29 30</PRE>
39 </td>
40 <td valign=top width="99%">The blank line between '2003' and the nested element
41 triggers the width bug.
42 </td>
43 </tr></table><BR CLEAR=all>
45 <H2>Example 2</H2>
47 <table valign=top width="100%"><tr><td width="1%">
48 <PRE CLASS=box> 2003
50 <SPAN CLASS=dow> D M TWJFS</SPAN>
52 September
53 1 2 3 4 5 6
54 7 8 9 10 11 12 13
55 14 15 16 17 18 19 20
56 21 22 23 24 25 26 27
57 28 29 30</PRE>
58 </td>
59 <td valign=top width="99%">The blank line between '2003' and the nested element
60 triggers the width bug.
61 <P>Here, the excess whitespace is reduced by reducing the
62 number of characters contained by the nested element.</P>
63 </td>
64 </tr></table><BR CLEAR=all>
66 <H2>Example 3</H2>
68 <table valign=top width="100%"><tr><td width="1%">
69 <PRE CLASS=box> 2003
70 <SPAN CLASS=dow> D M T W J F S</SPAN>
72 September
73 1 2 3 4 5 6
74 7 8 9 10 11 12 13
75 14 15 16 17 18 19 20
76 21 22 23 24 25 26 27
77 28 29 30</PRE>
78 </td>
79 <td valign=top width="99%">The blank line between '2003' and the nested element
80 has been removed, so the bug is not triggered.
81 </td>
82 </tr></table><BR CLEAR=all>
84 <H2>Example 4</H2>
86 <table valign=top width="100%"><tr><td width="1%">
87 <PRE CLASS=box><SPAN> 2003</SPAN>
89 <SPAN CLASS=dow> D M T W J F S</SPAN>
91 September
92 1 2 3 4 5 6
93 7 8 9 10 11 12 13
94 14 15 16 17 18 19 20
95 21 22 23 24 25 26 27
96 28 29 30</PRE>
97 </td>
98 <td valign=top width="99%">The blank line between '2003' and the nested element
99 no longer triggers the width bug, because now the '2003' is itself contained by
100 a nested element (in this case, another SPAN).
101 </td>
102 </tr></table><BR CLEAR=all>
105 </BODY>
106 </HTML>