Rev 17 | Rev 20 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 17 | Rev 19 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | * @var Array[string=>string]
|
28 | * @var Array[string=>string]
|
29 | */
|
29 | */
|
30 | protected $urns = array(); |
30 | protected $urns = array(); |
31 | 31 | ||
32 | /**
|
32 | /**
|
- | 33 | * <code>true</code> generates form controls for submitting test case
|
|
- | 34 | * results
|
|
- | 35 | *
|
|
- | 36 | * @var bool
|
|
- | 37 | */
|
|
- | 38 | protected $testcase = false; |
|
- | 39 | ||
- | 40 | /**
|
|
33 | * The list of language features
|
41 | * The list of language features
|
34 | *
|
42 | *
|
35 | * @var array[Features]
|
43 | * @var array[Features]
|
36 | */
|
44 | */
|
37 | protected $items = array(); |
45 | protected $items = array(); |
Line 51... | Line 59... | ||
51 | */
|
59 | */
|
52 | public function __construct($a) |
60 | public function __construct($a) |
53 | {
|
61 | {
|
54 | $aVars = get_class_vars(get_class($this)); |
62 | $aVars = get_class_vars(get_class($this)); |
55 | 63 | ||
- | 64 | ||
56 | while ((list($key, $value) = each($aVars))) |
65 | foreach ($aVars as $key => $value) |
57 | {
|
66 | {
|
58 | if (isset($a[$key])) |
67 | if (isset($a[$key])) |
59 | {
|
68 | {
|
60 | $this->$key = $a[$key]; |
69 | $this->$key = $a[$key]; |
61 | }
|
70 | }
|
62 | }
|
71 | }
|
63 | 72 | ||
64 | /* Inform items of ourself so that URNs can be used for links */
|
73 | /* Inform items of ourself so that URNs can be used for links */
|
65 | if (is_array($this->items)) |
74 | if (is_array($this->items)) |
66 | {
|
75 | {
|
67 | foreach ($this->items as &$item) |
76 | foreach ($this->items as &$item) |
68 | {
|
77 | {
|
Line 81... | Line 90... | ||
81 | }
|
90 | }
|
82 | }
|
91 | }
|
83 | }
|
92 | }
|
84 | }
|
93 | }
|
85 | 94 | ||
- | 95 | /*
|
|
- | 96 | * Protected properties may be read, but not written
|
|
- | 97 | */
|
|
- | 98 | public function __get($property) |
|
- | 99 | {
|
|
- | 100 | if (property_exists(get_class($this), $property)) |
|
- | 101 | {
|
|
- | 102 | return $this->$property; |
|
- | 103 | }
|
|
- | 104 | }
|
|
- | 105 | ||
86 | public function printHeaders() |
106 | public function printHeaders() |
87 | {
|
107 | {
|
88 | foreach ($this->versions as $ver) |
108 | foreach ($this->versions as $key => $ver) |
89 | {
|
109 | {
|
- | 110 | if ($key || $this->testcase) |
|
- | 111 | {
|
|
90 | ?>
|
112 | ?>
|
91 | <th><?php echo $ver; ?></th> |
113 | <th><?php echo $ver; ?></th> |
92 | <?php
|
114 | <?php
|
- | 115 | }
|
|
93 | }
|
116 | }
|
94 | }
|
117 | }
|
95 | 118 | ||
96 | /**
|
119 | /**
|
97 | * Prints the list of features.
|
120 | * Prints the list of features.
|
Line 220... | Line 243... | ||
220 | */
|
243 | */
|
221 | public function __construct($params = array()) |
244 | public function __construct($params = array()) |
222 | {
|
245 | {
|
223 | $aVars = get_class_vars(__CLASS__); |
246 | $aVars = get_class_vars(__CLASS__); |
224 | 247 | ||
225 | while ((list($key, $value) = each($aVars))) |
248 | foreach ($aVars as $key => $value) |
226 | {
|
249 | {
|
227 | if (isset($params[$key])) |
250 | if (isset($params[$key])) |
228 | {
|
251 | {
|
229 | $this->$key = $params[$key]; |
252 | $this->$key = $params[$key]; |
230 | }
|
253 | }
|
Line 417... | Line 440... | ||
417 | array('self', 'shl'),*/
|
440 | array('self', 'shl'),*/
|
418 | preg_replace('/…/', '…', $this->content)/*)*/; |
441 | preg_replace('/…/', '…', $this->content)/*)*/; |
419 | ?></th>
|
442 | ?></th>
|
420 | <?php
|
443 | <?php
|
421 | $versions = $this->versions; |
444 | $versions = $this->versions; |
- | 445 | $testcase = false; |
|
422 | if (!is_null($this->list)) |
446 | if (!is_null($this->list)) |
423 | {
|
447 | {
|
424 | $versions =& $this->list->versions; |
448 | $versions =& $this->list->versions; |
- | 449 | $testcase = $this->list->testcase; |
|
425 | }
|
450 | }
|
426 | 451 | ||
427 | static $row = 0; |
452 | static $row = 0; |
428 | $row++; |
453 | $row++; |
429 | 454 | ||
Line 433... | Line 458... | ||
433 | foreach ($versions as $key => $value) |
458 | foreach ($versions as $key => $value) |
434 | {
|
459 | {
|
435 | $column++; |
460 | $column++; |
436 | $id = "td$row-$column"; |
461 | $id = "td$row-$column"; |
437 | $ver = isset($thisVersions[$key]) ? $thisVersions[$key] : ''; |
462 | $ver = isset($thisVersions[$key]) ? $thisVersions[$key] : ''; |
- | 463 | if ($key || $testcase) |
|
- | 464 | {
|
|
438 | ?>
|
465 | ?>
|
439 | <td<?php
|
466 | <td<?php
|
440 | if (!$key) |
467 | if (!$key) |
441 | {
|
468 | {
|
442 | echo " id='$id'"; |
469 | echo " id='$id'"; |
443 | }
|
470 | }
|
444 | 471 | ||
445 | echo $this->getAssumed($ver) . $this->getTested($ver); |
472 | echo $this->getAssumed($ver) . $this->getTested($ver); |
446 | 473 | ||
447 | if (!$key) |
474 | if (!$key) |
448 | {
|
475 | {
|
449 | if (!empty($ver)) |
476 | if (!empty($ver)) |
Line 457... | Line 484... | ||
457 | FEATURES_ENCODING |
484 | FEATURES_ENCODING |
458 | )
|
485 | )
|
459 | . '"'; |
486 | . '"'; |
460 | }
|
487 | }
|
461 | else
|
488 | else
|
462 | {
|
489 | {
|
463 | echo ' title="Not applicable: No automated test case' |
490 | echo ' title="Not applicable: No automated test case' |
464 | . ' is available for this feature. If possible, please' |
491 | . ' is available for this feature. If possible, please' |
465 | . ' click the feature code in the first column to run' |
492 | . ' click the feature code in the first column to run' |
466 | . ' a manual test."'; |
493 | . ' a manual test."'; |
467 | }
|
494 | }
|
468 | }
|
495 | }
|
- | 496 | else
|
|
- | 497 | {
|
|
- | 498 | echo ' title="' |
|
- | 499 | . htmlspecialchars( |
|
- | 500 | preg_replace('/<.*?>/', '', $value), |
|
- | 501 | ENT_COMPAT, FEATURES_ENCODING) |
|
- | 502 | . '"'; |
|
- | 503 | }
|
|
469 | ?>><?php |
504 | ?>><?php |
470 | if ($key) |
505 | if ($key) |
471 | {
|
506 | {
|
472 | echo $this->getVer($ver); |
507 | echo $this->getVer($ver); |
473 | 508 | ||
Line 476... | Line 511... | ||
476 | {
|
511 | {
|
477 | echo $ver['footnote']; |
512 | echo $ver['footnote']; |
478 | }
|
513 | }
|
479 | }
|
514 | }
|
480 | else
|
515 | else
|
481 | {
|
516 | {
|
482 | if (!empty($ver)) |
517 | if (!empty($ver) && $testcase) |
483 | {
|
518 | {
|
484 | ?><script type="text/javascript">
|
519 | ?><script type="text/javascript">
|
485 | // <![CDATA[ |
520 | // <![CDATA[ |
486 | var s = test(<?php echo $ver; ?>, '<span title="Supported">+<\/span>', |
521 | var s = test(<?php echo $ver; ?>, |
- | 522 | '<input title="Supported" name="<?php echo htmlspecialchars($this->title, ENT_COMPAT, FEATURES_ENCODING); ?>" value="+" readonly>', |
|
487 | '<span title="Not supported">−<\/span>'); |
523 | '<input title="Not supported" name="<?php echo htmlspecialchars($this->title, ENT_COMPAT, FEATURES_ENCODING); ?>" value="−" readonly>'); |
488 | tryThis("document.write(s);", |
524 | jsx.tryThis("document.write(s);", |
489 | "document.getElementById('<?php echo $id; ?>').appendChild(" |
525 | "document.getElementById('<?php echo $id; ?>').appendChild(" |
490 | + "document.createTextNode(s));"); |
526 | + "document.createTextNode(s));"); |
491 | // ]]> |
527 | // ]]> |
492 | </script><?php
|
528 | </script><?php
|
493 | }
|
529 | }
|
494 | else
|
530 | else
|
495 | {
|
531 | {
|
496 | echo '<abbr>N/A</abbr>'; |
532 | echo '<abbr>N/A</abbr>'; |
497 | }
|
533 | }
|
498 | }
|
534 | }
|
499 | ?></td>
|
535 | ?></td>
|
500 | <?php
|
536 | <?php
|
- | 537 | }
|
|
501 | }
|
538 | }
|
502 | ?>
|
539 | ?>
|
503 | </tr> |
540 | </tr> |
504 | <?php
|
541 | <?php
|
505 | }
|
542 | }
|