Class: Watir::HTML::Visitor
- Inherits:
-
WebIDL::RubySexpVisitor
- Object
- WebIDL::RubySexpVisitor
- Watir::HTML::Visitor
- Defined in:
- lib/watir-webdriver/html/visitor.rb
Instance Method Summary (collapse)
-
- (Visitor) initialize
constructor
A new instance of Visitor.
- - (Object) visit_implements_statement(stmt)
-
- (Object) visit_interface(interface)
WebIDL visitor interface.
- - (Object) visit_module(mod)
Constructor Details
- (Visitor) initialize
A new instance of Visitor
7 8 9 10 11 12 13 14 15 |
# File 'lib/watir-webdriver/html/visitor.rb', line 7 def initialize super # When an interface has multiple IDL definitions in the spec, the inheritance is sometimes # not repeated. So we'll keep track ourselves. @inheritance_map = {} @already_defined = [] end |
Instance Method Details
- (Object) visit_implements_statement(stmt)
49 50 51 |
# File 'lib/watir-webdriver/html/visitor.rb', line 49 def visit_implements_statement(stmt) # ignored end |
- (Object) visit_interface(interface)
WebIDL visitor interface
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/watir-webdriver/html/visitor.rb', line 21 def visit_interface(interface) name = interface.name parent = interface.inherits.first $stderr.puts name return unless name =~ /^HTML/ && name !~ /(Collection|Document)$/ if name == "HTMLElement" parent = 'Element' elsif parent @inheritance_map[name] ||= parent.name parent = parent.name else parent = @inheritance_map[name] || return end [ :scope, [:block, element_class(interface.name, interface.members.select { |e| e.kind_of?(WebIDL::Ast::Attribute) }, parent), collection_class(interface.name) ] ] end |
- (Object) visit_module(mod)
45 46 47 |
# File 'lib/watir-webdriver/html/visitor.rb', line 45 def visit_module(mod) # ignored end |