File: mksupportpage.tcl

package info (click to toggle)
tk-html3 3.0~fossil20110109-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,644 kB
  • ctags: 5,882
  • sloc: ansic: 48,994; tcl: 26,030; sh: 1,190; yacc: 161; makefile: 24
file content (494 lines) | stat: -rw-r--r-- 13,475 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494

source [file join [file dirname [info script]] common.tcl]

set ::html {}
set ::html_head {}

proc P {args} {
    foreach a $args {
        append ::html "$a "
    }
    append ::html "\n"
}

proc SUPPORTTABLE {title args} {
    P <table border=1> <tr> <th colspan=2> $title
    foreach {a b} $args {
        P <tr> <td> $a <td width="100%"> $b
    }
    P </table>
}
proc CSSREF {section property {class {support}}} {
    # set cssdoc file:///home/dan/work/tkhtml/docs/css_1.0/css1_spec.html
    set cssdoc http://www.w3.org/TR/CSS21/
    set ref ${cssdoc}${section}.html#propdef-${property}
    return "<a href=\"$ref\" class=\"$class\">$property</a>"
}

set ::section_counter 1
proc SECTION {title} {
    set name "part$::section_counter"
    P <a name="$name"><h2>$title</h2></a>
    addPageSection $title $name
    incr ::section_counter
}

set ::title ""
proc START {title} {
    set ::html_head [subst {
        <html>
        <head>
          <title>$title</title>
          <link rel="stylesheet" href="tkhtml_tcl_tk.css">
        </head>
        <body>
    }]
    set ::title $title
}

proc FINISH {} {
    puts $::html_head
    puts [getTabs 1]
    puts [subst {
        <div id="body">
        <h1>$::title</h1>
        [getToc]
    }]
    puts {<div id="text">}
    puts $::html
    puts {
        </div>
        </div>
        </body>
        </html>
    }
}

###########################################################################

START "DOM, CSS and HTML Support"

P {
<p>
	Ultimately, Tkhtml3 aims to support those aspects of HTML 4.01 and CSS
	2.1 that apply to the parsing and visual rendering of documents. But,
	as you may have surmised, that is a work in progress. This document
	describes the current situation in terms of the CSS properties, CSS
	selectors, HTML attributes and HTML tags supported.
</p><p>
	This document currently tracks the CVS version against the CSS 
	2.1, HTML 4.01 (todo) and DOM (todo) specifications.
</p>
}

SECTION "CSS Property Support"

P {
<p>
	The tables in this section compare CSS property support in Tkhtml3 
	with the <a href="http://www.w3.org/TR/CSS21/">CSS level 2.1</a>
	specification. Of course, there may be bugs in the support of
	any or all of the properties listed as supported below. If you find a
        bug, <i>please report it</i>!
</p>
}

SUPPORTTABLE {Font Properties} \
	[CSSREF fonts font-family] {
		Standard families "cursive" and "fantasy" are only
		available if the underlying font system used by Tk supports
		them.  
        } \
	[CSSREF fonts font-style] {
		Values 'italic' and 'oblique' map to "-slant italic"
		and 'normal' maps to "-slant roman".
	} \
	[CSSREF fonts font-variant nosupport] {No support.} \
	[CSSREF fonts font-weight] {
		Values 'bold', 'bolder' and numbers greater than 550
		map to "-weight bold", everything else maps to 
		"-weight normal".
	} \
	[CSSREF fonts font-size] {} \
	[CSSREF fonts font] {
		Supported except for font-variant values ('small-caps').
	}

SUPPORTTABLE {Color and Background Properties} \
	[CSSREF colors color] {} \
	[CSSREF colors background-color] {} \
	[CSSREF colors background-image] {} \
	[CSSREF colors background-repeat] {} \
	[CSSREF colors background-attachment] {} \
	[CSSREF colors background-position] {} \
	[CSSREF colors background] {}

SUPPORTTABLE {Text Properties} \
	[CSSREF text word-spacing nosupport] {No support.} \
	[CSSREF text letter-spacing nosupport] {No support.} \
	[CSSREF text text-decoration] {
		Value 'blink' is not supported. Also, multiple decorations
		(e.g. an underline and an overline) are not supported.
	} \
	[CSSREF text vertical-align] {} \
	[CSSREF text text-transform nosupport] {No support.} \
	[CSSREF text text-align] {} \
	[CSSREF text text-indent] {} \
	[CSSREF text white-space] {}

SUPPORTTABLE {Box Properties} \
	[CSSREF box margin] {
		Properties 'margin-top', 'margin-right', 'margin-bottom' and 
		'margin-left' are also supported. 
	} \
	[CSSREF box padding] {
		Properties 'padding-top', 'padding-right', 'padding-bottom' and 
		'padding-left' are also supported. 
	} \
	[CSSREF box border-width] {} \
	[CSSREF box border-style] {
		All border styles apart from 'none' (i.e. 'dashed', 
		'groove' etc.) are currently rendered as solid lines. This
		is legal according to the spec, but it's sub-optimal.
        } \
	[CSSREF box border-color] {} \
	[CSSREF box border] {
		Properties 'border-top', 'border-right', 'border-bottom' and
		'border-left' are also supported. Also 'border-top-color',
		'border-left-width' and other such variants.
	} 

SUPPORTTABLE {Visual Rendering Properties} \
	[CSSREF visuren display] {
		Not all values are supported. Currently supported values are
		'inline', 'block', 'list-item', 'table', 'table-row',
		'table-cell', 'none' and 'inherit'. The following are 
		handled as 'block': 'run-in', 'inline-block', 'table-caption'.
        } \
	[CSSREF visudet width] {} \
	[CSSREF visudet height] {} \
	[CSSREF visuren float] {} \
	[CSSREF visuren clear] {} \
	[CSSREF visudet line-height] {} \
	[CSSREF visudet min-width] {Support is a bit patchy. Most cases work.} \
	[CSSREF visudet max-width] {Support is a bit patchy. Most cases work.} \
	[CSSREF visudet min-height] {Support is a bit patchy. Most cases work.}\
	[CSSREF visudet max-height] {Support is a bit patchy. Most cases work.}\
	[CSSREF visuren position] {
		Positioning modes 'static', 'relative', 'fixed' and 'absolute' 
		are all supported.
        } \
	[CSSREF visuren left] {}    \
	[CSSREF visuren right] {}   \
	[CSSREF visuren top] {}     \
	[CSSREF visuren bottom] {}  \
	[CSSREF visuren z-index] {} \
	[CSSREF visuren unicode-bidi nosupport] {
		Tkhtml3 does not yet support bi-directional text. So the
		properties "unicode-bidi" and "direction" are both ignored.
	} \
	[CSSREF visuren direction nosupport] {No support.}

SUPPORTTABLE {Visual Effects Properties} \
	[CSSREF visufx overflow] {} \
	[CSSREF visufx clip nosupport] {No support.} \
	[CSSREF visufx visibility] {}

SUPPORTTABLE {Table Properties} \
	[CSSREF tables border-collapse nosupport] {No support.} \
	[CSSREF tables border-spacing] {}  \
	[CSSREF tables caption-side nosupport] {No support.}    \
	[CSSREF tables empty-cells nosupport] {No support.}     \
	[CSSREF tables table-layout nosupport] {No support.}

SUPPORTTABLE {User Interface Properties} \
	[CSSREF ui cursor] {
          Only enumerated values are supported. Tkhtml3 doesn't actually
          do anything with this property, but it is available for the
          applications use.
        } \
	[CSSREF ui outline]        {} \
	[CSSREF ui outline-width ] {} \
	[CSSREF ui outline-color ] {} \
	[CSSREF ui outline-style ] {}

SUPPORTTABLE {Generated Content Properties}                         \
	[CSSREF generate list-style-type] {}                        \
	[CSSREF generate list-style-image] {}                       \
	[CSSREF generate list-style-position] {}                    \
	[CSSREF generate list-style] {}                             \
	[CSSREF generate content] {String, attr(), counter() and counters() 
          values work. There is no support for url(), or the keywords
          for automatic quotes generation.
        }  \
	[CSSREF generate counter-increment] {} \
	[CSSREF generate counter-reset] {}     \
	[CSSREF generate quotes nosupport] {No support.}

# List of CSS 2.1 properties considered out of scope for Tkhtml.
set outofscopes {
    azimuth cue-after cue-before cue elevation pause-after pause-before
    pause pitch-range pitch play-during richness speak-header speak-numeral
    speak-punctuation speak speech-rate stress voice-family volume

    orphans page-break-after page-break-before page-break-inside widows
}
P {
  <p>
    The following CSS 2.1 properties are currently considered to be
    outside of Tkhtml3's scope, as they only apply to aural or paged 
    document rendering:
  </p>
}
P <table style="margin:0px"><tr><td valign=top><ul>
set ii 1
foreach property $outofscopes {
    P <li>$property
    incr ii
    if {$ii % 10 == 0} {P </ul></td><td valign=top><ul>}
}
P </table>

SECTION {CSS Selector Support}

P {
<p>
	Essentially, all CSS 2.1 selectors are supported except for
	the following pseudo-elements:
</p>
<ul>
	<li> :first-letter
	<li> :first-line
	<li> :lang
</ul>
}


if 0 {

SECTION {HTML Parsing Support}

P {
  <p>This section describes the some of the special processing that
     Tkhtml does to support HTML.

  <p style="text-align:center"><b>Implicit Elements</b>

  <p>In any Html document, the &lt;html&gt;, &lt;head&gt; and
     &lt;body&gt; elements are always present, even if not explicity
     opened or closed in the html text.

  <p style="text-align:center"><b>Implicit Closing Tags</b>

  <p>This sub-section describes the cases where the Html parser infers
     the presence of implicit closing tags and inserts them before 
     generating the document tree. Tkhtml can detect implicit closing 
     tags in five cases:

  <dl>
     <dt>Empty elements:
     <dd>The &lt;br&gt;, &lt;area&gt;, &lt;link&gt;, &lt;img&gt;, 
         &lt;param&gt;, &lt;hr&gt;, &lt;base&gt;, &lt;meta&gt; and 
         &lt;input&gt; elements are always empty, they cannot contain 
         any other elements.

     <dt>Inline content only elements:
     <dd>The &lt;p&gt; and &lt;dt&gt; elements may only contain inline 
         content. They are implicitly closed by any element that does not
         generate inline content (according to html).

     <dt>Flow content only elements:
     <dd>The &lt;th&gt;, &lt;td&gt;, &lt;p&gt; and &lt;dt&gt; elements may 
         only contain flow content. They are implicitly closed by any 
         element that does not generate flow content (according to html).

     <dt>Table-cell content only elements:
     <dd>The &lt;tr&gt; element may only contain &lt;th&gt; or &lt;td&gt; 
         elements.

     <dt>Text content only elements:
     <dd>The &lt;option&gt; element may only contain text, not markup tags.
  </dl>


  <p style="text-align:center"><b>Table Support</b>

  <p>Table support is a curious mix of support for CSS and Html at the 
     moment. The CSS display types 'table', 'table-row' and 'table-cell' are 
     recognized for laying out document sub-trees as tables. The default 
     stylesheet assigns these values to the display properties of Html 
     &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; and &lt;th&gt; elements.

  <p>Tkhtml checks for and respects the "rowspan" and "cellspan" attributes 
     on any element with the display property set to 'table-cell'. There is 
     no way to asign a row or column span via CSS (at least not with Tkhtml).

  <p>There is no support for the &lt;caption&gt;, &lt;thead&gt;, 
     &lt;tfoot&gt;, &lt;tbody&gt;, &lt;colgroup&gt; and &lt;col&gt; tags,
     these are ignored by the parser.

  <p>The Tkhtml layout engine simply ignores any children of an element with 
     display property 'table' that do not have their display property set 
     to 'table-row'. Children of 'table-row' elements that are not of type
     'table-cell' are similarly ignored. This is incorrect, the CSS2 
     specification requires anonymous boxes to be inserted where such 
     elements are missing. The Tkhtml html parser compensates for this by 
     transforming each sub-tree rooted at a &lt;table&gt; element 
     according to the following rules:

  <ol>
    <li>Children of &lt;table&gt; elements other than &lt;tr&gt;,  
        &lt;td&gt; and &lt;th&gt; are moved in the tree to become left-hand 
        siblings of the &lt;table&gt; element.

    <li>Should there exist one or more &lt;td&gt; or &lt;th&gt; children of
        the &lt;table&gt; element, then one or more &lt;tr&gt; elements is
        inserted into the tree. Each new &lt;tr&gt; element is a child of
        the &lt;table&gt; element.

    <li>Children of &lt;tr&gt; elements that are themselves children 
        of &lt;table&gt; elements other than &lt;td&gt; and &lt;th&gt; are
        also moved in the tree to become left-hand siblings of the 
        &lt;table&gt; element.
  </ol>
 
  <p>Logically, steps are performed in the order above. For example, 
     parsing the following Html fragment:

  <pre class=code>
&lt;table&gt;
  &lt;div&gt;Text A&lt;/div&gt;
  &lt;tr&gt; &lt;div&gt;Text B&lt;/div&gt;
    &lt;td&gt; Text C
  &lt;/tr&gt;
  &lt;td&gt; Text D
  &lt;td&gt; Text E
&lt;/table&gt;
  </pre>
  
  <p>Produces the tree that one would expect from:

  <pre class=code>
&lt;div&gt;Text A&lt;/div&gt;
&lt;div&gt;Text B&lt;/div&gt;
&lt;table&gt;
  &lt;tr&gt; 
    &lt;td&gt; Text C
  &lt;/tr&gt;
  &lt;tr&gt; 
    &lt;td&gt; Text D
    &lt;td&gt; Text E
  &lt;/tr&gt;
&lt;/table&gt;
  </pre>

}

SECTION {HTML Element Support}


# List of HTML attributes:
abbr
accept-charset
accept
accesskey
action
align
alt
archive
axis
background
bgcolor
border
cellpadding
char
charoff
charset
checked
cite
class
classid
clear
code
codebase
codetype
color
cols
colspan
compact
content
coords
data
datetime
declare
defer
dir
disabled
enctype
face
for
frame
frameborder
headers
height
href
hreflang
hspace
http-equiv
id
ismap
label
lang
language
link
longdesc
longdesc
marginheight
marginwidth
maxlength
media
method
multiple
name
nohref
noresize
noshade
nowrap
object
profile
prompt
readonly
rel
rev
rows
rowspan
rules
scheme
scope
scrolling
selected
shape
size
span
src
standby
start
style
summary
tabindex
target
text
title
type
usemap
valign
value
valuetype
version
vlink
vspace
width
}

FINISH