jbarnette-johnson 1.0.0.200806240111

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. data/CHANGELOG +5 -0
  2. data/MANIFEST +385 -0
  3. data/MINGW32.mk +124 -0
  4. data/README.rdoc +51 -0
  5. data/Rakefile +166 -0
  6. data/bin/johnson +107 -0
  7. data/cross-compile.txt +38 -0
  8. data/ext/spidermonkey/context.c +122 -0
  9. data/ext/spidermonkey/context.h +19 -0
  10. data/ext/spidermonkey/conversions.c +286 -0
  11. data/ext/spidermonkey/conversions.h +18 -0
  12. data/ext/spidermonkey/debugger.c +208 -0
  13. data/ext/spidermonkey/debugger.h +9 -0
  14. data/ext/spidermonkey/extconf.rb +25 -0
  15. data/ext/spidermonkey/extensions.c +37 -0
  16. data/ext/spidermonkey/extensions.h +12 -0
  17. data/ext/spidermonkey/global.c +40 -0
  18. data/ext/spidermonkey/global.h +11 -0
  19. data/ext/spidermonkey/idhash.c +16 -0
  20. data/ext/spidermonkey/idhash.h +8 -0
  21. data/ext/spidermonkey/immutable_node.c.erb +522 -0
  22. data/ext/spidermonkey/immutable_node.h +22 -0
  23. data/ext/spidermonkey/jroot.h +187 -0
  24. data/ext/spidermonkey/js_land_proxy.c +609 -0
  25. data/ext/spidermonkey/js_land_proxy.h +20 -0
  26. data/ext/spidermonkey/ruby_land_proxy.c +537 -0
  27. data/ext/spidermonkey/ruby_land_proxy.h +17 -0
  28. data/ext/spidermonkey/runtime.c +304 -0
  29. data/ext/spidermonkey/runtime.h +25 -0
  30. data/ext/spidermonkey/spidermonkey.c +20 -0
  31. data/ext/spidermonkey/spidermonkey.h +29 -0
  32. data/js/johnson/browser.js +9 -0
  33. data/js/johnson/browser/env.js +687 -0
  34. data/js/johnson/browser/jquery.js +3444 -0
  35. data/js/johnson/browser/xmlsax.js +1564 -0
  36. data/js/johnson/browser/xmlw3cdom.js +4189 -0
  37. data/js/johnson/cli.js +30 -0
  38. data/js/johnson/prelude.js +80 -0
  39. data/js/johnson/template.js +29 -0
  40. data/lib/hoe.rb +748 -0
  41. data/lib/johnson.rb +46 -0
  42. data/lib/johnson/cli.rb +7 -0
  43. data/lib/johnson/cli/options.rb +56 -0
  44. data/lib/johnson/error.rb +4 -0
  45. data/lib/johnson/nodes.rb +7 -0
  46. data/lib/johnson/nodes/binary_node.rb +64 -0
  47. data/lib/johnson/nodes/for.rb +14 -0
  48. data/lib/johnson/nodes/for_in.rb +12 -0
  49. data/lib/johnson/nodes/function.rb +13 -0
  50. data/lib/johnson/nodes/list.rb +27 -0
  51. data/lib/johnson/nodes/node.rb +68 -0
  52. data/lib/johnson/nodes/ternary_node.rb +20 -0
  53. data/lib/johnson/parser.rb +21 -0
  54. data/lib/johnson/parser/syntax_error.rb +13 -0
  55. data/lib/johnson/runtime.rb +55 -0
  56. data/lib/johnson/spidermonkey/context.rb +10 -0
  57. data/lib/johnson/spidermonkey/debugger.rb +67 -0
  58. data/lib/johnson/spidermonkey/immutable_node.rb +280 -0
  59. data/lib/johnson/spidermonkey/js_land_proxy.rb +62 -0
  60. data/lib/johnson/spidermonkey/mutable_tree_visitor.rb +233 -0
  61. data/lib/johnson/spidermonkey/ruby_land_proxy.rb +52 -0
  62. data/lib/johnson/spidermonkey/runtime.rb +94 -0
  63. data/lib/johnson/version.rb +4 -0
  64. data/lib/johnson/visitable.rb +16 -0
  65. data/lib/johnson/visitors.rb +4 -0
  66. data/lib/johnson/visitors/dot_visitor.rb +167 -0
  67. data/lib/johnson/visitors/ecma_visitor.rb +315 -0
  68. data/lib/johnson/visitors/enumerating_visitor.rb +115 -0
  69. data/lib/johnson/visitors/sexp_visitor.rb +172 -0
  70. data/lib/rails/init.rb +37 -0
  71. data/test/assets/index.html +38 -0
  72. data/test/assets/jquery_test.html +186 -0
  73. data/test/helper.rb +58 -0
  74. data/test/johnson/browser_test.rb +38 -0
  75. data/test/johnson/conversions/array_test.rb +32 -0
  76. data/test/johnson/conversions/boolean_test.rb +17 -0
  77. data/test/johnson/conversions/callable_test.rb +34 -0
  78. data/test/johnson/conversions/file_test.rb +15 -0
  79. data/test/johnson/conversions/nil_test.rb +20 -0
  80. data/test/johnson/conversions/number_test.rb +34 -0
  81. data/test/johnson/conversions/regexp_test.rb +24 -0
  82. data/test/johnson/conversions/string_test.rb +26 -0
  83. data/test/johnson/conversions/struct_test.rb +15 -0
  84. data/test/johnson/conversions/symbol_test.rb +19 -0
  85. data/test/johnson/conversions/thread_test.rb +24 -0
  86. data/test/johnson/error_test.rb +9 -0
  87. data/test/johnson/extensions_test.rb +56 -0
  88. data/test/johnson/nodes/array_literal_test.rb +57 -0
  89. data/test/johnson/nodes/array_node_test.rb +26 -0
  90. data/test/johnson/nodes/binary_node_test.rb +61 -0
  91. data/test/johnson/nodes/bracket_access_test.rb +16 -0
  92. data/test/johnson/nodes/delete_test.rb +11 -0
  93. data/test/johnson/nodes/do_while_test.rb +12 -0
  94. data/test/johnson/nodes/dot_accessor_test.rb +15 -0
  95. data/test/johnson/nodes/export_test.rb +9 -0
  96. data/test/johnson/nodes/for_test.rb +54 -0
  97. data/test/johnson/nodes/function_test.rb +71 -0
  98. data/test/johnson/nodes/if_test.rb +41 -0
  99. data/test/johnson/nodes/import_test.rb +13 -0
  100. data/test/johnson/nodes/label_test.rb +19 -0
  101. data/test/johnson/nodes/object_literal_test.rb +110 -0
  102. data/test/johnson/nodes/return_test.rb +16 -0
  103. data/test/johnson/nodes/semi_test.rb +8 -0
  104. data/test/johnson/nodes/switch_test.rb +55 -0
  105. data/test/johnson/nodes/ternary_test.rb +25 -0
  106. data/test/johnson/nodes/throw_test.rb +9 -0
  107. data/test/johnson/nodes/try_node_test.rb +59 -0
  108. data/test/johnson/nodes/typeof_test.rb +11 -0
  109. data/test/johnson/nodes/unary_node_test.rb +23 -0
  110. data/test/johnson/nodes/void_test.rb +11 -0
  111. data/test/johnson/nodes/while_test.rb +26 -0
  112. data/test/johnson/nodes/with_test.rb +10 -0
  113. data/test/johnson/prelude_test.rb +56 -0
  114. data/test/johnson/runtime_test.rb +46 -0
  115. data/test/johnson/spidermonkey/context_test.rb +21 -0
  116. data/test/johnson/spidermonkey/immutable_node_test.rb +34 -0
  117. data/test/johnson/spidermonkey/js_land_proxy_test.rb +236 -0
  118. data/test/johnson/spidermonkey/ruby_land_proxy_test.rb +225 -0
  119. data/test/johnson/spidermonkey/runtime_test.rb +17 -0
  120. data/test/johnson/version_test.rb +13 -0
  121. data/test/johnson/visitors/dot_visitor_test.rb +39 -0
  122. data/test/johnson/visitors/enumerating_visitor_test.rb +12 -0
  123. data/test/johnson_test.rb +16 -0
  124. data/test/jquery_units/test.js +27 -0
  125. data/test/jquery_units/test_helper.js +197 -0
  126. data/test/jquery_units/units/ajax.js +795 -0
  127. data/test/jquery_units/units/core.js +1563 -0
  128. data/test/jquery_units/units/event.js +299 -0
  129. data/test/jquery_units/units/fx.js +427 -0
  130. data/test/jquery_units/units/offset.js +112 -0
  131. data/test/jquery_units/units/selector.js +224 -0
  132. data/test/jspec/helper.js +7 -0
  133. data/test/jspec/jspec.js +192 -0
  134. data/test/jspec/simple_spec.js +68 -0
  135. data/test/parser_test.rb +276 -0
  136. data/todo/.keep +0 -0
  137. metadata +501 -0
@@ -0,0 +1,115 @@
1
+ module Johnson
2
+ module Visitors
3
+ class EnumeratingVisitor
4
+ attr_accessor :block
5
+ def initialize(block)
6
+ @block = block
7
+ end
8
+
9
+ def visit_SourceElements(o)
10
+ block.call(o)
11
+ o.value.each { |x| x.accept(self) }
12
+ self
13
+ end
14
+
15
+ %w{
16
+ ArrayLiteral Comma Export FunctionCall Import New ObjectLiteral
17
+ VarStatement
18
+ }.each do |type|
19
+ define_method(:"visit_#{type}") do |o|
20
+ block.call(o)
21
+ o.value.each { |x| x.accept(self) }
22
+ self
23
+ end
24
+ end
25
+
26
+ %w{ Name Number Regexp String }.each do |type|
27
+ define_method(:"visit_#{type}") do |o|
28
+ block.call(o)
29
+ self
30
+ end
31
+ end
32
+
33
+ %w{ Break Continue False Null This True }.each do |type|
34
+ define_method(:"visit_#{type}") do |o|
35
+ block.call(o)
36
+ self
37
+ end
38
+ end
39
+
40
+ def visit_For(o)
41
+ block.call(o)
42
+ o.init && o.init.accept(self)
43
+ o.cond && o.cond.accept(self)
44
+ o.update && o.update.accept(self)
45
+ o.body.accept(self)
46
+ self
47
+ end
48
+
49
+ def visit_ForIn(o)
50
+ block.call(o)
51
+ o.in_cond.accept(self)
52
+ o.body.accept(self)
53
+ self
54
+ end
55
+
56
+ def visit_Try(o)
57
+ block.call(o)
58
+ o.cond.accept(self)
59
+ o.b_then && o.b_then.map { |x| x.accept(self) }
60
+ o.b_else && o.b_else.accept(self)
61
+ self
62
+ end
63
+
64
+ %w{ Ternary If Catch }.each do |node|
65
+ define_method(:"visit_#{node}") do |o|
66
+ block.call(o)
67
+ o.cond.accept(self)
68
+ o.b_then && o.b_then.accept(self)
69
+ o.b_else && o.b_else.accept(self)
70
+ self
71
+ end
72
+ end
73
+ ### UNARY NODES ###
74
+ %w{ BitwiseNot Delete Not Parenthesis PostfixDecrement PostfixIncrement
75
+ PrefixDecrement PrefixIncrement Return Throw Typeof UnaryNegative
76
+ UnaryPositive Void
77
+ }.each do |node|
78
+ define_method(:"visit_#{node}") do |o|
79
+ block.call(o)
80
+ o.value && o.value.accept(self)
81
+ self
82
+ end
83
+ end
84
+
85
+ ### FUNCTION NODES ###
86
+ def visit_Function(o)
87
+ block.call(o)
88
+ o.body.accept(self)
89
+ self
90
+ end
91
+
92
+ ### BINARY NODES ###
93
+ %w{ And AssignExpr BracketAccess Case Default DoWhile DotAccessor Equal
94
+ GetterProperty GreaterThan GreaterThanOrEqual In InstanceOf Label
95
+ LessThan LessThanOrEqual NotEqual OpAdd OpAddEqual OpBitAnd
96
+ OpBitAndEqual OpBitOr OpBitOrEqual OpBitXor OpBitXorEqual OpDivide
97
+ OpDivideEqual OpEqual OpLShift OpLShiftEqual OpMod OpModEqual
98
+ OpMultiply OpMultiplyEqual OpRShift OpRShiftEqual OpSubtract
99
+ OpSubtractEqual OpURShift OpURShiftEqual Or Property SetterProperty
100
+ StrictEqual StrictNotEqual Switch While With
101
+ }.each do |node|
102
+ define_method(:"visit_#{node}") do |o|
103
+ block.call(o)
104
+ o.left && o.left.accept(self)
105
+ o.right && o.right.accept(self)
106
+ self
107
+ end
108
+ end
109
+
110
+ def accept(target)
111
+ target.accept(self)
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,172 @@
1
+ module Johnson
2
+ module Visitors
3
+ class SexpVisitor
4
+ def visit_SourceElements(o)
5
+ o.value.map { |x| x.accept(self) }
6
+ end
7
+
8
+ {
9
+ 'VarStatement' => :var,
10
+ 'Comma' => :comma,
11
+ 'ObjectLiteral' => :object,
12
+ 'ArrayLiteral' => :array,
13
+ 'New' => :new,
14
+ 'FunctionCall' => :function_call,
15
+ 'Import' => :import,
16
+ 'Export' => :export,
17
+ }.each do |type,sym|
18
+ define_method(:"visit_#{type}") do |o|
19
+ [sym, o.value.map { |x| x.accept(self) }]
20
+ end
21
+ end
22
+
23
+ {
24
+ 'Name' => :name,
25
+ 'Number' => :lit,
26
+ 'Regexp' => :lit,
27
+ 'String' => :str
28
+ }.each do |type,sym|
29
+ define_method(:"visit_#{type}") do |o|
30
+ [sym, o.value]
31
+ end
32
+ end
33
+
34
+ {
35
+ 'Break' => :break,
36
+ 'Continue' => :continue,
37
+ 'Null' => :nil,
38
+ 'True' => :true,
39
+ 'False' => :false,
40
+ 'This' => :this,
41
+ }.each do |type,sym|
42
+ define_method(:"visit_#{type}") do |o|
43
+ [sym]
44
+ end
45
+ end
46
+
47
+ def visit_For(o)
48
+ [ :for,
49
+ o.init && o.init.accept(self),
50
+ o.cond && o.cond.accept(self),
51
+ o.update && o.update.accept(self),
52
+ o.body.accept(self)
53
+ ]
54
+ end
55
+
56
+ def visit_ForIn(o)
57
+ [ :for_in,
58
+ o.in_cond.accept(self),
59
+ o.body.accept(self)
60
+ ]
61
+ end
62
+
63
+ def visit_Try(o)
64
+ [ :try,
65
+ o.cond.accept(self),
66
+ o.b_then ? o.b_then.map { |x| x.accept(self) } : nil,
67
+ o.b_else ? o.b_else.accept(self) : nil
68
+ ]
69
+ end
70
+
71
+ {
72
+ 'Ternary' => :ternary,
73
+ 'If' => :if,
74
+ 'Catch' => :catch,
75
+ }.each do |node,ident|
76
+ define_method(:"visit_#{node}") do |o|
77
+ [ ident,
78
+ o.cond.accept(self),
79
+ o.b_then ? o.b_then.accept(self) : nil,
80
+ o.b_else ? o.b_else.accept(self) : nil
81
+ ]
82
+ end
83
+ end
84
+ ### UNARY NODES ###
85
+ {
86
+ 'Throw' => :throw,
87
+ 'Delete' => :delete,
88
+ 'Void' => :void,
89
+ 'Typeof' => :typeof,
90
+ 'PrefixDecrement' => :prefix_dec,
91
+ 'PostfixDecrement' => :postfix_dec,
92
+ 'PrefixIncrement' => :prefix_inc,
93
+ 'PostfixIncrement' => :postfix_inc,
94
+ 'Parenthesis' => :paren,
95
+ 'Return' => :return,
96
+ 'UnaryNegative' => :u_neg,
97
+ 'UnaryPositive' => :u_pos,
98
+ 'BitwiseNot' => :bitwise_not,
99
+ 'Not' => :not,
100
+ }.each do |node,ident|
101
+ define_method(:"visit_#{node}") do |o|
102
+ [ident, o.value && o.value.accept(self)]
103
+ end
104
+ end
105
+
106
+ ### FUNCTION NODES ###
107
+ def visit_Function(o)
108
+ [:func_expr, o.name, o.arguments, o.body.accept(self)]
109
+ end
110
+
111
+ ### BINARY NODES ###
112
+ {
113
+ 'In' => :in,
114
+ 'InstanceOf' => :instanceof,
115
+ 'Switch' => :switch,
116
+ 'Case' => :case,
117
+ 'Default' => :default,
118
+ 'With' => :with,
119
+ 'DoWhile' => :do_while,
120
+ 'While' => :while,
121
+ 'Property' => :property,
122
+ 'GreaterThanOrEqual' => :gt_equal,
123
+ 'LessThanOrEqual' => :lt_equal,
124
+ 'GreaterThan' => :gt,
125
+ 'LessThan' => :lt,
126
+ 'GetterProperty' => :getter,
127
+ 'SetterProperty' => :setter,
128
+ 'OpEqual' => :op_equal,
129
+ 'OpMultiply' => :op_multiply,
130
+ 'OpMultiplyEqual' => :op_multiply_equal,
131
+ 'OpAddEqual' => :op_add_equal,
132
+ 'OpSubtractEqual' => :op_subtract_equal,
133
+ 'OpAdd' => :op_add,
134
+ 'OpSubtract' => :op_subtract,
135
+ 'OpDivideEqual' => :op_divide_equal,
136
+ 'OpDivide' => :op_divide,
137
+ 'OpLShiftEqual' => :op_lshift_equal,
138
+ 'OpRShiftEqual' => :op_rshift_equal,
139
+ 'OpURShiftEqual' => :op_urshift_equal,
140
+ 'OpLShift' => :op_lshift,
141
+ 'OpRShift' => :op_rshift,
142
+ 'OpURShift' => :op_urshift,
143
+ 'OpBitAndEqual' => :op_bitand_equal,
144
+ 'OpBitAnd' => :op_bitand,
145
+ 'OpBitXorEqual' => :op_bitxor_equal,
146
+ 'OpBitOrEqual' => :op_bitor_equal,
147
+ 'OpBitXor' => :op_bitxor,
148
+ 'OpBitOr' => :op_bitor,
149
+ 'OpModEqual' => :op_mod_equal,
150
+ 'OpMod' => :op_mod,
151
+ 'AssignExpr' => :assign,
152
+ 'BracketAccess' => :bracket_access,
153
+ 'DotAccessor' => :dot_accessor,
154
+ 'Equal' => :equal,
155
+ 'NotEqual' => :not_equal,
156
+ 'Or' => :or,
157
+ 'And' => :and,
158
+ 'StrictEqual' => :strict_equal,
159
+ 'StrictNotEqual' => :strict_not_equal,
160
+ 'Label' => :label,
161
+ }.each do |node,ident|
162
+ define_method(:"visit_#{node}") do |o|
163
+ [ident, o.left && o.left.accept(self), o.right &&o.right.accept(self)]
164
+ end
165
+ end
166
+
167
+ def accept(target)
168
+ target.accept(self)
169
+ end
170
+ end
171
+ end
172
+ end
data/lib/rails/init.rb ADDED
@@ -0,0 +1,37 @@
1
+ require 'johnson'
2
+
3
+ class EJSHandler < ActionView::TemplateHandler
4
+ class EJSProxy # :nodoc:
5
+ def initialize(controller)
6
+ @controller = controller
7
+ end
8
+
9
+ def key?(pooperty)
10
+ @controller.instance_variables.include?("@#{pooperty}")
11
+ end
12
+
13
+ def [](pooperty)
14
+ @controller.instance_variable_get("@#{pooperty}")
15
+ end
16
+
17
+ def []=(pooperty, value)
18
+ @controller.instance_variable_set("@#{pooperty}", value)
19
+ end
20
+ end
21
+
22
+ def initialize(view)
23
+ @view = view
24
+ end
25
+
26
+ def render(template)
27
+ ctx = Johnson::Runtime.new
28
+ ctx.evaluate('Johnson.require("johnson/template");')
29
+ ctx['template'] = template.source
30
+ ctx['controller'] = @view.controller
31
+ ctx['at'] = EJSProxy.new(@view.controller)
32
+
33
+ ctx.evaluate('Johnson.templatize(template).call(at)')
34
+ end
35
+ end
36
+
37
+ ActionView::Template.register_template_handler("ejs", EJSHandler)
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>Test Page for Apache Installation</title>
6
+ </head>
7
+ <!-- Background white, links blue (unvisited), navy (visited), red
8
+ (active) -->
9
+ <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
10
+ vlink="#000080" alink="#FF0000">
11
+ <p>If you can see this, it means that the installation of the <a
12
+ href="http://www.apache.org/foundation/preFAQ.html">Apache web
13
+ server</a> software on this system was successful. You may now add
14
+ content to this directory and replace this page.</p>
15
+
16
+ <hr width="50%" size="8" id='test' />
17
+ <h2 align="center">Seeing this instead of the website you
18
+ expected?</h2>
19
+
20
+ <p>This page is here because the site administrator has changed the
21
+ configuration of this web server. Please <strong>contact the person
22
+ responsible for maintaining this server with questions.</strong>
23
+ The Apache Software Foundation, which wrote the web server software
24
+ this site administrator is using, has nothing to do with
25
+ maintaining this site and cannot help resolve configuration
26
+ issues.</p>
27
+
28
+ <hr width="50%" size="8" />
29
+ <p>The Apache <a href="manual/">documentation</a> has been included
30
+ with this distribution.</p>
31
+
32
+ <p>You are free to use the image below on an Apache-powered web
33
+ server. Thanks for using Apache!</p>
34
+
35
+ <div align="center"><img src="apache_pb.gif" alt="" /></div>
36
+ </body>
37
+ </html>
38
+
@@ -0,0 +1,186 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <title>jQuery Test Suite</title>
6
+ <link rel="Stylesheet" media="screen" href="data/testsuite.css" />
7
+ <script>var jQuery = "jQuery", $ = "$"; // For testing .noConflict()</script>
8
+ <script type="text/javascript" src="../dist/jquery.js"></script>
9
+ <script type="text/javascript" src="data/testrunner.js"></script>
10
+ <script type="text/javascript" src="unit/core.js"></script>
11
+ <script type="text/javascript" src="unit/selector.js"></script>
12
+ <script type="text/javascript" src="unit/event.js"></script>
13
+ <script type="text/javascript" src="unit/ajax.js"></script>
14
+ <script type="text/javascript" src="unit/fx.js"></script>
15
+ </head>
16
+
17
+ <body id="body">
18
+ <h1 id="header">jQuery Test Suite</h1>
19
+ <h2 id="banner"/>
20
+ <h2 id="userAgent"/>
21
+
22
+ <!-- Test HTML -->
23
+ <div id="nothiddendiv" style="height:1px;background:white;">
24
+ <div id="nothiddendivchild"/>
25
+ </div>
26
+ <!-- this iframe is outside the #main so it won't reload constantly wasting time, but it means the tests must be "safe" and clean up after themselves -->
27
+ <iframe id="loadediframe" name="loadediframe" style="display:none;" src="data/iframe.html"/>
28
+ <dl id="dl" style="display:none;">
29
+ <div id="main" style="display: none;">
30
+ <p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
31
+ <p id="ap">
32
+ Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
33
+ <a id="groups" href="http://groups.google.com/">Google Groups</a>.
34
+ This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>:
35
+ <a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
36
+
37
+ </p>
38
+ <div id="foo">
39
+ <p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
40
+ <p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
41
+ <p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
42
+
43
+ </div>
44
+ <p id="first">Try them out:</p>
45
+ <ul id="firstUL"></ul>
46
+ <ol id="empty"></ol>
47
+ <form id="form" action="formaction">
48
+ <input type="text" name="action" value="Test" id="text1" maxlength="30"/>
49
+ <input type="text" name="text2" value="Test" id="text2" disabled="disabled"/>
50
+ <input type="radio" name="radio1" id="radio1" value="on"/>
51
+
52
+ <input type="radio" name="radio2" id="radio2" checked="checked"/>
53
+ <input type="checkbox" name="check" id="check1" checked="checked"/>
54
+ <input type="checkbox" id="check2" value="on"/>
55
+
56
+ <input type="hidden" name="hidden" id="hidden1"/>
57
+ <input type="text" style="display:none;" name="foo[bar]" id="hidden2"/>
58
+
59
+ <input type="text" id="name" name="name" value="name" />
60
+
61
+ <button id="button" name="button">Button</button>
62
+
63
+ <textarea id="area1" maxlength="30">foobar</textarea>
64
+
65
+ <select name="select1" id="select1">
66
+ <option id="option1a" class="emptyopt" value="">Nothing</option>
67
+ <option id="option1b" value="1">1</option>
68
+ <option id="option1c" value="2">2</option>
69
+ <option id="option1d" value="3">3</option>
70
+ </select>
71
+ <select name="select2" id="select2">
72
+ <option id="option2a" class="emptyopt" value="">Nothing</option>
73
+ <option id="option2b" value="1">1</option>
74
+ <option id="option2c" value="2">2</option>
75
+ <option id="option2d" selected="selected" value="3">3</option>
76
+ </select>
77
+ <select name="select3" id="select3" multiple="multiple">
78
+ <option id="option3a" class="emptyopt" value="">Nothing</option>
79
+ <option id="option3b" selected="selected" value="1">1</option>
80
+ <option id="option3c" selected="selected" value="2">2</option>
81
+ <option id="option3d" value="3">3</option>
82
+ </select>
83
+
84
+ <object id="object1" codebase="stupid">
85
+ <param name="p1" value="x1" />
86
+ <param name="p2" value="x2" />
87
+ </object>
88
+
89
+ <span id="台北Táiběi"/>
90
+ <span id="台北" lang="中文"/>
91
+ <span id="utf8class1" class="台北Táiběi 台北"/>
92
+ <span id="utf8class2" class="台北"/>
93
+ <span id="foo:bar" class="foo:bar"/>
94
+ <span id="test.foo[5]bar" class="test.foo[5]bar"/>
95
+
96
+ <foo_bar id="foobar">test element</foo_bar>
97
+ </form>
98
+ <b id="floatTest">Float test.</b>
99
+ <iframe id="iframe" name="iframe"></iframe>
100
+ <form id="lengthtest">
101
+ <input type="text" id="length" name="test"/>
102
+ <input type="text" id="idTest" name="id"/>
103
+ </form>
104
+ <table id="table"></table>
105
+
106
+ <div id="fx-queue">
107
+ <div id="fadein" class='chain test'>fadeIn<div>fadeIn</div></div>
108
+ <div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div>
109
+
110
+ <div id="show" class='chain test'>show<div>show</div></div>
111
+ <div id="hide" class='chain test out'>hide<div>hide</div></div>
112
+
113
+ <div id="togglein" class='chain test'>togglein<div>togglein</div></div>
114
+ <div id="toggleout" class='chain test out'>toggleout<div>toggleout</div></div>
115
+
116
+
117
+ <div id="slideup" class='chain test'>slideUp<div>slideUp</div></div>
118
+ <div id="slidedown" class='chain test out'>slideDown<div>slideDown</div></div>
119
+
120
+ <div id="slidetogglein" class='chain test'>slideToggleIn<div>slideToggleIn</div></div>
121
+ <div id="slidetoggleout" class='chain test out'>slideToggleOut<div>slideToggleOut</div></div>
122
+ </div>
123
+
124
+ <div id="fx-tests"></div>
125
+
126
+ <form id="testForm" action="#" method="get">
127
+ <textarea name="T3" rows="2" cols="15">?
128
+ Z</textarea>
129
+ <input type="hidden" name="H1" value="x" />
130
+ <input type="hidden" name="H2" />
131
+ <input name="PWD" type="password" value="" />
132
+ <input name="T1" type="text" />
133
+ <input name="T2" type="text" value="YES" readonly="readonly" />
134
+ <input type="checkbox" name="C1" value="1" />
135
+ <input type="checkbox" name="C2" />
136
+ <input type="radio" name="R1" value="1" />
137
+ <input type="radio" name="R1" value="2" />
138
+ <input type="text" name="My Name" value="me" />
139
+ <input type="reset" name="reset" value="NO" />
140
+ <select name="S1">
141
+ <option value="abc">ABC</option>
142
+ <option value="abc">ABC</option>
143
+ <option value="abc">ABC</option>
144
+ </select>
145
+ <select name="S2" multiple="multiple" size="3">
146
+ <option value="abc">ABC</option>
147
+ <option value="abc">ABC</option>
148
+ <option value="abc">ABC</option>
149
+ </select>
150
+ <select name="S3">
151
+ <option selected="selected">YES</option>
152
+ </select>
153
+ <select name="S4">
154
+ <option value="" selected="selected">NO</option>
155
+ </select>
156
+ <input type="submit" name="sub1" value="NO" />
157
+ <input type="submit" name="sub2" value="NO" />
158
+ <input type="image" name="sub3" value="NO" />
159
+ <button name="sub4" type="submit" value="NO">NO</button>
160
+ <input name="D1" type="text" value="NO" disabled="disabled" />
161
+ <input type="checkbox" checked="checked" disabled="disabled" name="D2" value="NO" />
162
+ <input type="radio" name="D3" value="NO" checked="checked" disabled="disabled" />
163
+ <select name="D4" disabled="disabled">
164
+ <option selected="selected" value="NO">NO</option>
165
+ </select>
166
+ </form>
167
+ <div id="moretests">
168
+ <form>
169
+ <div id="checkedtest" style="display:none;">
170
+ <input type="radio" name="checkedtestradios" checked="checked"/>
171
+ <input type="radio" name="checkedtestradios" value="on"/>
172
+ <input type="checkbox" name="checkedtestcheckboxes" checked="checked"/>
173
+ <input type="checkbox" name="checkedtestcheckboxes" />
174
+ </div>
175
+ </form>
176
+ <div id="nonnodes"><span>hi</span> there <!-- mon ami --></div>
177
+ <div id="t2037">
178
+ <div><div class="hidden">hidden</div></div>
179
+ </div>
180
+ </div>
181
+ </div>
182
+ </dl>
183
+
184
+ <ol id="tests"></ol>
185
+ </body>
186
+ </html>