hatemile 2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/CODE_OF_CONDUCT.md +46 -0
  3. data/Gemfile +9 -0
  4. data/LICENSE +202 -0
  5. data/Rakefile +64 -0
  6. data/hatemile.gemspec +37 -0
  7. data/lib/hatemile/accessible_association.rb +62 -0
  8. data/lib/hatemile/accessible_css.rb +43 -0
  9. data/lib/hatemile/accessible_display.rb +178 -0
  10. data/lib/hatemile/accessible_event.rb +95 -0
  11. data/lib/hatemile/accessible_form.rb +101 -0
  12. data/lib/hatemile/accessible_navigation.rb +82 -0
  13. data/lib/hatemile/helper.rb +58 -0
  14. data/lib/hatemile/implementation/accessible_association_implementation.rb +346 -0
  15. data/lib/hatemile/implementation/accessible_css_implementation.rb +772 -0
  16. data/lib/hatemile/implementation/accessible_display_implementation.rb +1362 -0
  17. data/lib/hatemile/implementation/accessible_event_implementation.rb +278 -0
  18. data/lib/hatemile/implementation/accessible_form_implementation.rb +386 -0
  19. data/lib/hatemile/implementation/accessible_navigation_implementation.rb +561 -0
  20. data/lib/hatemile/util/common_functions.rb +106 -0
  21. data/lib/hatemile/util/configure.rb +92 -0
  22. data/lib/hatemile/util/css/rcp/rcp_declaration.rb +77 -0
  23. data/lib/hatemile/util/css/rcp/rcp_parser.rb +115 -0
  24. data/lib/hatemile/util/css/rcp/rcp_rule.rb +86 -0
  25. data/lib/hatemile/util/css/style_sheet_declaration.rb +59 -0
  26. data/lib/hatemile/util/css/style_sheet_parser.rb +43 -0
  27. data/lib/hatemile/util/css/style_sheet_rule.rb +73 -0
  28. data/lib/hatemile/util/html/html_dom_element.rb +234 -0
  29. data/lib/hatemile/util/html/html_dom_node.rb +131 -0
  30. data/lib/hatemile/util/html/html_dom_parser.rb +150 -0
  31. data/lib/hatemile/util/html/html_dom_text_node.rb +43 -0
  32. data/lib/hatemile/util/html/nokogiri/nokogiri_html_dom_element.rb +302 -0
  33. data/lib/hatemile/util/html/nokogiri/nokogiri_html_dom_node.rb +112 -0
  34. data/lib/hatemile/util/html/nokogiri/nokogiri_html_dom_parser.rb +208 -0
  35. data/lib/hatemile/util/html/nokogiri/nokogiri_html_dom_text_node.rb +83 -0
  36. data/lib/hatemile/util/id_generator.rb +53 -0
  37. data/lib/js/common.js +98 -0
  38. data/lib/js/eventlistener.js +36 -0
  39. data/lib/js/include.js +292 -0
  40. data/lib/js/scriptlist_validation_fields.js +13 -0
  41. data/lib/js/validation.js +205 -0
  42. data/lib/locale/en-US.yml +388 -0
  43. data/lib/locale/pt-BR.yml +389 -0
  44. data/lib/skippers.xml +6 -0
  45. data/lib/symbols.xml +40 -0
  46. data/test/locale/en-US.yml +5 -0
  47. data/test/locale/pt-BR.yml +4 -0
  48. data/test/test_accessible_association_implementation.rb +258 -0
  49. data/test/test_accessible_css_implementation.rb +518 -0
  50. data/test/test_accessible_display_implementation.rb +873 -0
  51. data/test/test_accessible_form_implementation.rb +283 -0
  52. data/test/test_accessible_navigation_implementation.rb +228 -0
  53. data/test/test_common_functions.rb +128 -0
  54. data/test/test_configure.rb +73 -0
  55. data/test/test_nokogiri_html_dom_element.rb +586 -0
  56. data/test/test_nokogiri_html_dom_parser.rb +363 -0
  57. data/test/test_nokogiri_html_dom_text_node.rb +225 -0
  58. data/test/test_rcp_declaration.rb +103 -0
  59. data/test/test_rcp_parser.rb +86 -0
  60. data/test/test_rcp_rule.rb +89 -0
  61. metadata +199 -0
@@ -0,0 +1,178 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ ##
14
+ # The Hatemile module contains the interfaces with the acessibility solutions.
15
+ module Hatemile
16
+ ##
17
+ # The AccessibleDisplay interface improve accessibility, showing informations.
18
+ #
19
+ # @abstract
20
+ class AccessibleDisplay
21
+ private_class_method :new
22
+
23
+ ##
24
+ # Display the shortcuts of element.
25
+ #
26
+ # @abstract
27
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element with
28
+ # shortcuts.
29
+ # @return [void]
30
+ def display_shortcut(element)
31
+ # Interface method
32
+ end
33
+
34
+ ##
35
+ # Display all shortcuts of page.
36
+ #
37
+ # @abstract
38
+ # @return [void]
39
+ def display_all_shortcuts
40
+ # Interface method
41
+ end
42
+
43
+ ##
44
+ # Display the WAI-ARIA role of element.
45
+ #
46
+ # @abstract
47
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element.
48
+ # @return [void]
49
+ def display_role(element)
50
+ # Interface method
51
+ end
52
+
53
+ ##
54
+ # Display the WAI-ARIA roles of all elements of page.
55
+ #
56
+ # @abstract
57
+ # @return [void]
58
+ def display_all_roles
59
+ # Interface method
60
+ end
61
+
62
+ ##
63
+ # Display the headers of each data cell of table.
64
+ #
65
+ # @abstract
66
+ # @param table_cell [Hatemile::Util::Html::HTMLDOMElement] The table cell.
67
+ # @return [void]
68
+ def display_cell_header(table_cell)
69
+ # Interface method
70
+ end
71
+
72
+ ##
73
+ # Display the headers of each data cell of all tables of page.
74
+ #
75
+ # @abstract
76
+ # @return [void]
77
+ def display_all_cell_headers
78
+ # Interface method
79
+ end
80
+
81
+ ##
82
+ # Display the WAI-ARIA attributes of element.
83
+ #
84
+ # @abstract
85
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element with
86
+ # WAI-ARIA attributes.
87
+ # @return [void]
88
+ def display_waiaria_states(element)
89
+ # Interface method
90
+ end
91
+
92
+ ##
93
+ # Display the WAI-ARIA attributes of all elements of page.
94
+ #
95
+ # @abstract
96
+ # @return [void]
97
+ def display_all_waiaria_states
98
+ # Interface method
99
+ end
100
+
101
+ ##
102
+ # Display the attributes of link.
103
+ #
104
+ # @abstract
105
+ # @param link [Hatemile::Util::Html::HTMLDOMElement] The link element.
106
+ # @return [void]
107
+ def display_link_attributes(link)
108
+ # Interface method
109
+ end
110
+
111
+ ##
112
+ # Display the attributes of all links of page.
113
+ #
114
+ # @abstract
115
+ # @return [void]
116
+ def display_all_links_attributes
117
+ # Interface method
118
+ end
119
+
120
+ ##
121
+ # Display the title of element.
122
+ #
123
+ # @abstract
124
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element with
125
+ # title.
126
+ # @return [void]
127
+ def display_title(element)
128
+ # Interface method
129
+ end
130
+
131
+ ##
132
+ # Display the titles of all elements of page.
133
+ #
134
+ # @abstract
135
+ # @return [void]
136
+ def display_all_titles
137
+ # Interface method
138
+ end
139
+
140
+ ##
141
+ # Display the language of element.
142
+ #
143
+ # @abstract
144
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element.
145
+ # @return [void]
146
+ def display_language(element)
147
+ # Interface method
148
+ end
149
+
150
+ ##
151
+ # Display the language of all elements of page.
152
+ #
153
+ # @abstract
154
+ # @return [void]
155
+ def display_all_languages
156
+ # Interface method
157
+ end
158
+
159
+ ##
160
+ # Display the alternative text of image.
161
+ #
162
+ # @abstract
163
+ # @param image The image.
164
+ # @return [void]
165
+ def display_alternative_text_image(image)
166
+ # Interface method
167
+ end
168
+
169
+ ##
170
+ # Display the alternative text of all images of page.
171
+ #
172
+ # @abstract
173
+ # @return [void]
174
+ def display_all_alternative_text_images
175
+ # Interface method
176
+ end
177
+ end
178
+ end
@@ -0,0 +1,95 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ ##
14
+ # The Hatemile module contains the interfaces with the acessibility solutions.
15
+ module Hatemile
16
+ ##
17
+ # The AccessibleEvent interface improve the accessibility, making elements
18
+ # events available from a keyboard.
19
+ #
20
+ # @abstract
21
+ class AccessibleEvent
22
+ private_class_method :new
23
+
24
+ ##
25
+ # Make the drop events of element available from a keyboard.
26
+ #
27
+ # @abstract
28
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element with
29
+ # drop event.
30
+ # @return [void]
31
+ def make_accessible_drop_events(element)
32
+ # Interface method
33
+ end
34
+
35
+ ##
36
+ # Make the drag events of element available from a keyboard.
37
+ #
38
+ # @abstract
39
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element with
40
+ # drag event.
41
+ # @return [void]
42
+ def make_accessible_drag_events(element)
43
+ # Interface method
44
+ end
45
+
46
+ ##
47
+ # Make all Drag-and-Drop events of page available from a keyboard.
48
+ #
49
+ # @abstract
50
+ # @return [void]
51
+ def make_accessible_all_drag_and_drop_events
52
+ # Interface method
53
+ end
54
+
55
+ ##
56
+ # Make the hover events of element available from a keyboard.
57
+ #
58
+ # @abstract
59
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element with
60
+ # hover event.
61
+ # @return [void]
62
+ def make_accessible_hover_events(element)
63
+ # Interface method
64
+ end
65
+
66
+ ##
67
+ # Make all hover events of page available from a keyboard.
68
+ #
69
+ # @abstract
70
+ # @return [void]
71
+ def make_accessible_all_hover_events
72
+ # Interface method
73
+ end
74
+
75
+ ##
76
+ # Make the click events of element available from a keyboard.
77
+ #
78
+ # @abstract
79
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element with
80
+ # click events.
81
+ # @return [void]
82
+ def make_accessible_click_events(element)
83
+ # Interface method
84
+ end
85
+
86
+ ##
87
+ # Make all click events of page available from a keyboard.
88
+ #
89
+ # @abstract
90
+ # @return [void]
91
+ def make_accessible_all_click_events
92
+ # Interface method
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,101 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ ##
14
+ # The Hatemile module contains the interfaces with the acessibility solutions.
15
+ module Hatemile
16
+ ##
17
+ # The AccessibleForm interface improve the accessibility of forms.
18
+ #
19
+ # @abstract
20
+ class AccessibleForm
21
+ private_class_method :new
22
+
23
+ ##
24
+ # Mark that the field is required.
25
+ #
26
+ # @abstract
27
+ # @param required_field [Hatemile::Util::Html::HTMLDOMElement] The required
28
+ # field.
29
+ # @return [void]
30
+ def mark_required_field(required_field)
31
+ # Interface method
32
+ end
33
+
34
+ ##
35
+ # Mark that the fields is required.
36
+ #
37
+ # @abstract
38
+ # @return [void]
39
+ def mark_all_required_fields
40
+ # Interface method
41
+ end
42
+
43
+ ##
44
+ # Mark that the field have range.
45
+ #
46
+ # @abstract
47
+ # @param range_field [Hatemile::Util::Html::HTMLDOMElement] The range field.
48
+ # @return [void]
49
+ def mark_range_field(range_field)
50
+ # Interface method
51
+ end
52
+
53
+ ##
54
+ # Mark that the fields have range.
55
+ #
56
+ # @abstract
57
+ # @return [void]
58
+ def mark_all_range_fields
59
+ # Interface method
60
+ end
61
+
62
+ ##
63
+ # Mark that the field have autocomplete.
64
+ #
65
+ # @abstract
66
+ # @param autocomplete_field [Hatemile::Util::Html::HTMLDOMElement] The field
67
+ # with autocomplete.
68
+ # @return [void]
69
+ def mark_autocomplete_field(autocomplete_field)
70
+ # Interface method
71
+ end
72
+
73
+ ##
74
+ # Mark that the fields have autocomplete.
75
+ #
76
+ # @abstract
77
+ # @return [void]
78
+ def mark_all_autocomplete_fields
79
+ # Interface method
80
+ end
81
+
82
+ ##
83
+ # Mark a solution to display that this field is invalid.
84
+ #
85
+ # @abstract
86
+ # @param field [Hatemile::Util::Html::HTMLDOMElement] The field.
87
+ # @return [void]
88
+ def mark_invalid_field(field)
89
+ # Interface method
90
+ end
91
+
92
+ ##
93
+ # Mark a solution to display that a fields are invalid.
94
+ #
95
+ # @abstract
96
+ # @return [void]
97
+ def mark_all_invalid_fields
98
+ # Interface method
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,82 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ ##
14
+ # The Hatemile module contains the interfaces with the acessibility solutions.
15
+ module Hatemile
16
+ ##
17
+ # The AccessibleNavigation interface improve the accessibility of navigation.
18
+ #
19
+ # @abstract
20
+ class AccessibleNavigation
21
+ private_class_method :new
22
+
23
+ ##
24
+ # Provide a content skipper for element.
25
+ #
26
+ # @abstract
27
+ # @param element [Hatemile::Util::Html::HTMLDOMElement] The element.
28
+ # @return [void]
29
+ def provide_navigation_by_skipper(element)
30
+ # Interface method
31
+ end
32
+
33
+ ##
34
+ # Provide navigation by content skippers.
35
+ #
36
+ # @abstract
37
+ # @return [void]
38
+ def provide_navigation_by_all_skippers
39
+ # Interface method
40
+ end
41
+
42
+ ##
43
+ # Provide navigation by heading.
44
+ #
45
+ # @abstract
46
+ # @param heading [Hatemile::Util::Html::HTMLDOMElement] The heading element.
47
+ # @return [void]
48
+ def provide_navigation_by_heading(heading)
49
+ # Interface method
50
+ end
51
+
52
+ ##
53
+ # Provide navigation by headings of page.
54
+ #
55
+ # @abstract
56
+ # @return [void]
57
+ def provide_navigation_by_all_headings
58
+ # Interface method
59
+ end
60
+
61
+ ##
62
+ # Provide an alternative way to access the long description of element.
63
+ #
64
+ # @abstract
65
+ # @param image [Hatemile::Util::Html::HTMLDOMElement] The image with long
66
+ # description.
67
+ # @return [void]
68
+ def provide_navigation_to_long_description(image)
69
+ # Interface method
70
+ end
71
+
72
+ ##
73
+ # Provide an alternative way to access the longs descriptions of all
74
+ # elements of page.
75
+ #
76
+ # @abstract
77
+ # @return [void]
78
+ def provide_navigation_to_all_long_descriptions
79
+ # Interface method
80
+ end
81
+ end
82
+ end