View Javadoc
1   /*
2    * Copyright (c) 2002-2017 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package com.gargoylesoftware.htmlunit.javascript.host.html;
16  
17  import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_COLOR_RESTRICT;
18  import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_COLOR_TO_LOWER;
19  import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ALIGN_ACCEPTS_ARBITRARY_VALUES;
20  import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_VALUE_NULL;
21  import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OFFSET_PARENT_NULL_IF_FIXED;
22  import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WIDTH_HEIGHT_ACCEPTS_ARBITRARY_VALUES;
23  import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME;
24  import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE;
25  import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF;
26  import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45;
27  import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52;
28  import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE;
29  
30  import java.io.IOException;
31  import java.lang.reflect.InvocationTargetException;
32  import java.lang.reflect.Method;
33  import java.net.MalformedURLException;
34  import java.net.URL;
35  import java.util.ArrayList;
36  import java.util.HashMap;
37  import java.util.HashSet;
38  import java.util.List;
39  import java.util.Locale;
40  import java.util.Map;
41  import java.util.Set;
42  import java.util.regex.Pattern;
43  
44  import org.apache.commons.lang3.ArrayUtils;
45  import org.apache.commons.logging.Log;
46  import org.apache.commons.logging.LogFactory;
47  import org.xml.sax.helpers.AttributesImpl;
48  
49  import com.gargoylesoftware.htmlunit.SgmlPage;
50  import com.gargoylesoftware.htmlunit.WebClient;
51  import com.gargoylesoftware.htmlunit.html.DomAttr;
52  import com.gargoylesoftware.htmlunit.html.DomElement;
53  import com.gargoylesoftware.htmlunit.html.DomNode;
54  import com.gargoylesoftware.htmlunit.html.DomText;
55  import com.gargoylesoftware.htmlunit.html.HtmlAbbreviated;
56  import com.gargoylesoftware.htmlunit.html.HtmlAcronym;
57  import com.gargoylesoftware.htmlunit.html.HtmlAddress;
58  import com.gargoylesoftware.htmlunit.html.HtmlArticle;
59  import com.gargoylesoftware.htmlunit.html.HtmlAside;
60  import com.gargoylesoftware.htmlunit.html.HtmlBaseFont;
61  import com.gargoylesoftware.htmlunit.html.HtmlBidirectionalIsolation;
62  import com.gargoylesoftware.htmlunit.html.HtmlBidirectionalOverride;
63  import com.gargoylesoftware.htmlunit.html.HtmlBig;
64  import com.gargoylesoftware.htmlunit.html.HtmlBody;
65  import com.gargoylesoftware.htmlunit.html.HtmlBold;
66  import com.gargoylesoftware.htmlunit.html.HtmlCenter;
67  import com.gargoylesoftware.htmlunit.html.HtmlCitation;
68  import com.gargoylesoftware.htmlunit.html.HtmlCode;
69  import com.gargoylesoftware.htmlunit.html.HtmlDefinition;
70  import com.gargoylesoftware.htmlunit.html.HtmlDefinitionDescription;
71  import com.gargoylesoftware.htmlunit.html.HtmlDefinitionTerm;
72  import com.gargoylesoftware.htmlunit.html.HtmlDivision;
73  import com.gargoylesoftware.htmlunit.html.HtmlElement;
74  import com.gargoylesoftware.htmlunit.html.HtmlEmphasis;
75  import com.gargoylesoftware.htmlunit.html.HtmlExample;
76  import com.gargoylesoftware.htmlunit.html.HtmlFigure;
77  import com.gargoylesoftware.htmlunit.html.HtmlFigureCaption;
78  import com.gargoylesoftware.htmlunit.html.HtmlFooter;
79  import com.gargoylesoftware.htmlunit.html.HtmlHeader;
80  import com.gargoylesoftware.htmlunit.html.HtmlItalic;
81  import com.gargoylesoftware.htmlunit.html.HtmlKeyboard;
82  import com.gargoylesoftware.htmlunit.html.HtmlLayer;
83  import com.gargoylesoftware.htmlunit.html.HtmlListing;
84  import com.gargoylesoftware.htmlunit.html.HtmlMain;
85  import com.gargoylesoftware.htmlunit.html.HtmlMark;
86  import com.gargoylesoftware.htmlunit.html.HtmlNav;
87  import com.gargoylesoftware.htmlunit.html.HtmlNoBreak;
88  import com.gargoylesoftware.htmlunit.html.HtmlNoEmbed;
89  import com.gargoylesoftware.htmlunit.html.HtmlNoFrames;
90  import com.gargoylesoftware.htmlunit.html.HtmlNoLayer;
91  import com.gargoylesoftware.htmlunit.html.HtmlNoScript;
92  import com.gargoylesoftware.htmlunit.html.HtmlPage;
93  import com.gargoylesoftware.htmlunit.html.HtmlPlainText;
94  import com.gargoylesoftware.htmlunit.html.HtmlRp;
95  import com.gargoylesoftware.htmlunit.html.HtmlRt;
96  import com.gargoylesoftware.htmlunit.html.HtmlRuby;
97  import com.gargoylesoftware.htmlunit.html.HtmlS;
98  import com.gargoylesoftware.htmlunit.html.HtmlSample;
99  import com.gargoylesoftware.htmlunit.html.HtmlSection;
100 import com.gargoylesoftware.htmlunit.html.HtmlSmall;
101 import com.gargoylesoftware.htmlunit.html.HtmlStrike;
102 import com.gargoylesoftware.htmlunit.html.HtmlStrong;
103 import com.gargoylesoftware.htmlunit.html.HtmlSubscript;
104 import com.gargoylesoftware.htmlunit.html.HtmlSummary;
105 import com.gargoylesoftware.htmlunit.html.HtmlSuperscript;
106 import com.gargoylesoftware.htmlunit.html.HtmlTable;
107 import com.gargoylesoftware.htmlunit.html.HtmlTableDataCell;
108 import com.gargoylesoftware.htmlunit.html.HtmlTeletype;
109 import com.gargoylesoftware.htmlunit.html.HtmlUnderlined;
110 import com.gargoylesoftware.htmlunit.html.HtmlVariable;
111 import com.gargoylesoftware.htmlunit.html.HtmlWordBreak;
112 import com.gargoylesoftware.htmlunit.html.SubmittableElement;
113 import com.gargoylesoftware.htmlunit.javascript.background.BackgroundJavaScriptFactory;
114 import com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJob;
115 import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass;
116 import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor;
117 import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction;
118 import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter;
119 import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter;
120 import com.gargoylesoftware.htmlunit.javascript.host.ClientRect;
121 import com.gargoylesoftware.htmlunit.javascript.host.Element;
122 import com.gargoylesoftware.htmlunit.javascript.host.Window;
123 import com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleDeclaration;
124 import com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration;
125 import com.gargoylesoftware.htmlunit.javascript.host.css.StyleAttributes;
126 import com.gargoylesoftware.htmlunit.javascript.host.dom.DOMStringMap;
127 import com.gargoylesoftware.htmlunit.javascript.host.dom.DOMTokenList;
128 import com.gargoylesoftware.htmlunit.javascript.host.dom.Node;
129 import com.gargoylesoftware.htmlunit.javascript.host.dom.NodeList;
130 import com.gargoylesoftware.htmlunit.javascript.host.event.EventHandler;
131 import com.gargoylesoftware.htmlunit.javascript.host.event.MouseEvent;
132 
133 import net.sourceforge.htmlunit.corejs.javascript.Context;
134 import net.sourceforge.htmlunit.corejs.javascript.Function;
135 import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject;
136 
137 /**
138  * The JavaScript object {@code HTMLElement} which is the base class for all HTML
139  * objects. This will typically wrap an instance of {@link HtmlElement}.
140  *
141  * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
142  * @author David K. Taylor
143  * @author Barnaby Court
144  * @author <a href="mailto:cse@dynabean.de">Christian Sell</a>
145  * @author Chris Erskine
146  * @author David D. Kilzer
147  * @author Daniel Gredler
148  * @author Marc Guillemot
149  * @author Hans Donner
150  * @author Bruce Faulkner
151  * @author Ahmed Ashour
152  * @author Sudhan Moghe
153  * @author Ronald Brill
154  * @author Frank Danek
155  */
156 @JsxClass(domClass = HtmlAbbreviated.class, value = {CHROME, FF})
157 @JsxClass(domClass = HtmlAcronym.class, value = {CHROME, FF})
158 @JsxClass(domClass = HtmlAddress.class, value = {CHROME, FF})
159 @JsxClass(domClass = HtmlArticle.class)
160 @JsxClass(domClass = HtmlAside.class)
161 @JsxClass(domClass = HtmlBaseFont.class, value = {CHROME, FF})
162 @JsxClass(domClass = HtmlBidirectionalIsolation.class, value = CHROME)
163 @JsxClass(domClass = HtmlBidirectionalOverride.class, value = {CHROME, FF})
164 @JsxClass(domClass = HtmlBig.class, value = {CHROME, FF})
165 @JsxClass(domClass = HtmlBold.class, value = {CHROME, FF})
166 @JsxClass(domClass = HtmlCenter.class, value = {CHROME, FF, EDGE})
167 @JsxClass(domClass = HtmlCitation.class, value = {CHROME, FF})
168 @JsxClass(domClass = HtmlCode.class, value = {CHROME, FF})
169 @JsxClass(domClass = HtmlDefinition.class, value = {CHROME, FF})
170 @JsxClass(domClass = HtmlDefinitionDescription.class, value = {CHROME, FF})
171 @JsxClass(domClass = HtmlDefinitionTerm.class, value = {CHROME, FF})
172 @JsxClass(domClass = HtmlElement.class, value = {FF, IE})
173 @JsxClass(domClass = HtmlEmphasis.class, value = {CHROME, FF})
174 @JsxClass(domClass = HtmlExample.class, value = FF45)
175 @JsxClass(domClass = HtmlFigure.class)
176 @JsxClass(domClass = HtmlFigureCaption.class)
177 @JsxClass(domClass = HtmlFooter.class)
178 @JsxClass(domClass = HtmlHeader.class)
179 @JsxClass(domClass = HtmlItalic.class, value = {CHROME, FF})
180 @JsxClass(domClass = HtmlKeyboard.class, value = {CHROME, FF})
181 @JsxClass(domClass = HtmlLayer.class, value = CHROME)
182 @JsxClass(domClass = HtmlListing.class, value = FF45)
183 @JsxClass(domClass = HtmlMark.class)
184 @JsxClass(domClass = HtmlNav.class)
185 @JsxClass(domClass = HtmlNoBreak.class, value = {CHROME, FF})
186 @JsxClass(domClass = HtmlNoEmbed.class)
187 @JsxClass(domClass = HtmlNoFrames.class)
188 @JsxClass(domClass = HtmlNoLayer.class, value = CHROME)
189 @JsxClass(domClass = HtmlNoScript.class)
190 @JsxClass(domClass = HtmlPlainText.class, value = {CHROME, FF})
191 @JsxClass(domClass = HtmlRuby.class, value = CHROME)
192 @JsxClass(domClass = HtmlRp.class, value = CHROME)
193 @JsxClass(domClass = HtmlRt.class, value = CHROME)
194 @JsxClass(domClass = HtmlS.class, value = {CHROME, FF})
195 @JsxClass(domClass = HtmlSample.class, value = {CHROME, FF})
196 @JsxClass(domClass = HtmlSection.class)
197 @JsxClass(domClass = HtmlSmall.class, value = {CHROME, FF})
198 @JsxClass(domClass = HtmlStrike.class, value = {CHROME, FF})
199 @JsxClass(domClass = HtmlStrong.class, value = {CHROME, FF})
200 @JsxClass(domClass = HtmlSubscript.class, value = {CHROME, FF})
201 @JsxClass(domClass = HtmlSummary.class, value = {CHROME, FF52})
202 @JsxClass(domClass = HtmlSuperscript.class, value = {CHROME, FF})
203 @JsxClass(domClass = HtmlTeletype.class, value = {CHROME, FF})
204 @JsxClass(domClass = HtmlUnderlined.class, value = {CHROME, FF})
205 @JsxClass(domClass = HtmlWordBreak.class)
206 @JsxClass(domClass = HtmlMain.class, value = {CHROME, FF})
207 @JsxClass(domClass = HtmlVariable.class, value = {CHROME, FF})
208 public class HTMLElement extends Element {
209 
210     private static final Class<?>[] METHOD_PARAMS_OBJECT = new Class[] {Object.class};
211     private static final Pattern PERCENT_VALUE = Pattern.compile("\\d+%");
212     /* http://msdn.microsoft.com/en-us/library/ie/aa358802.aspx */
213     private static final Map<String, String> COLORS_MAP_IE = new HashMap<>();
214 
215     private static final Log LOG = LogFactory.getLog(HTMLElement.class);
216 
217     private static final int BEHAVIOR_ID_UNKNOWN = -1;
218     /** BEHAVIOR_ID_CLIENT_CAPS. */
219     public static final int BEHAVIOR_ID_CLIENT_CAPS = 0;
220     /** BEHAVIOR_ID_HOMEPAGE. */
221     public static final int BEHAVIOR_ID_HOMEPAGE = 1;
222     /** BEHAVIOR_ID_DOWNLOAD. */
223     public static final int BEHAVIOR_ID_DOWNLOAD = 2;
224 
225     private static final String BEHAVIOR_CLIENT_CAPS = "#default#clientCaps";
226     private static final String BEHAVIOR_HOMEPAGE = "#default#homePage";
227     private static final String BEHAVIOR_DOWNLOAD = "#default#download";
228 
229     /**
230      * Static counter for {@link #uniqueID_}.
231      */
232     private static int UniqueID_Counter_ = 1;
233 
234     private final Set<String> behaviors_ = new HashSet<>();
235     private String uniqueID_;
236 
237     static {
238         COLORS_MAP_IE.put("AliceBlue", "#F0F8FF");
239         COLORS_MAP_IE.put("AntiqueWhite", "#FAEBD7");
240         COLORS_MAP_IE.put("Aqua", "#00FFFF");
241         COLORS_MAP_IE.put("Aquamarine", "#7FFFD4");
242         COLORS_MAP_IE.put("Azure", "#F0FFFF");
243         COLORS_MAP_IE.put("Beige", "#F5F5DC");
244         COLORS_MAP_IE.put("Bisque", "#FFE4C4");
245         COLORS_MAP_IE.put("Black", "#000000");
246         COLORS_MAP_IE.put("BlanchedAlmond", "#FFEBCD");
247         COLORS_MAP_IE.put("Blue", "#0000FF");
248         COLORS_MAP_IE.put("BlueViolet", "#8A2BE2");
249         COLORS_MAP_IE.put("Brown", "#A52A2A");
250         COLORS_MAP_IE.put("BurlyWood", "#DEB887");
251         COLORS_MAP_IE.put("CadetBlue", "#5F9EA0");
252         COLORS_MAP_IE.put("Chartreuse", "#7FFF00");
253         COLORS_MAP_IE.put("Chocolate", "#D2691E");
254         COLORS_MAP_IE.put("Coral", "#FF7F50");
255         COLORS_MAP_IE.put("CornflowerBlue", "#6495ED");
256         COLORS_MAP_IE.put("Cornsilk", "#FFF8DC");
257         COLORS_MAP_IE.put("Crimson", "#DC143C");
258         COLORS_MAP_IE.put("Cyan", "#00FFFF");
259         COLORS_MAP_IE.put("DarkBlue", "#00008B");
260         COLORS_MAP_IE.put("DarkCyan", "#008B8B");
261         COLORS_MAP_IE.put("DarkGoldenrod", "#B8860B");
262         COLORS_MAP_IE.put("DarkGray", "#A9A9A9");
263         COLORS_MAP_IE.put("DarkGrey", "#A9A9A9");
264         COLORS_MAP_IE.put("DarkGreen", "#006400");
265         COLORS_MAP_IE.put("DarkKhaki", "#BDB76B");
266         COLORS_MAP_IE.put("DarkMagenta", "#8B008B");
267         COLORS_MAP_IE.put("DarkOliveGreen", "#556B2F");
268         COLORS_MAP_IE.put("DarkOrange", "#FF8C00");
269         COLORS_MAP_IE.put("DarkOrchid", "#9932CC");
270         COLORS_MAP_IE.put("DarkRed", "#8B0000");
271         COLORS_MAP_IE.put("DarkSalmon", "#E9967A");
272         COLORS_MAP_IE.put("DarkSeaGreen", "#8FBC8F");
273         COLORS_MAP_IE.put("DarkSlateBlue", "#483D8B");
274         COLORS_MAP_IE.put("DarkSlateGray", "#2F4F4F");
275         COLORS_MAP_IE.put("DarkSlateGrey", "#2F4F4F");
276         COLORS_MAP_IE.put("DarkTurquoise", "#00CED1");
277         COLORS_MAP_IE.put("DarkViolet", "#9400D3");
278         COLORS_MAP_IE.put("DeepPink", "#FF1493");
279         COLORS_MAP_IE.put("DeepSkyBlue", "#00BFFF");
280         COLORS_MAP_IE.put("DimGray", "#696969");
281         COLORS_MAP_IE.put("DimGrey", "#696969");
282         COLORS_MAP_IE.put("DodgerBlue", "#1E90FF");
283         COLORS_MAP_IE.put("FireBrick", "#B22222");
284         COLORS_MAP_IE.put("FloralWhite", "#FFFAF0");
285         COLORS_MAP_IE.put("ForestGreen", "#228B22");
286         COLORS_MAP_IE.put("Fuchsia", "#FF00FF");
287         COLORS_MAP_IE.put("Gainsboro", "#DCDCDC");
288         COLORS_MAP_IE.put("GhostWhite", "#F8F8FF");
289         COLORS_MAP_IE.put("Gold", "#FFD700");
290         COLORS_MAP_IE.put("Goldenrod", "#DAA520");
291         COLORS_MAP_IE.put("Gray", "#808080");
292         COLORS_MAP_IE.put("Grey", "#808080");
293         COLORS_MAP_IE.put("Green", "#008000");
294         COLORS_MAP_IE.put("GreenYellow", "#ADFF2F");
295         COLORS_MAP_IE.put("Honeydew", "#F0FFF0");
296         COLORS_MAP_IE.put("HotPink", "#FF69B4");
297         COLORS_MAP_IE.put("IndianRed", "#CD5C5C");
298         COLORS_MAP_IE.put("Indigo", "#4B0082");
299         COLORS_MAP_IE.put("Ivory", "#FFFFF0");
300         COLORS_MAP_IE.put("Khaki", "#F0E68C");
301         COLORS_MAP_IE.put("Lavender", "#E6E6FA");
302         COLORS_MAP_IE.put("LavenderBlush", "#FFF0F5");
303         COLORS_MAP_IE.put("LawnGreen", "#7CFC00");
304         COLORS_MAP_IE.put("LemonChiffon", "#FFFACD");
305         COLORS_MAP_IE.put("LightBlue", "#ADD8E6");
306         COLORS_MAP_IE.put("LightCoral", "#F08080");
307         COLORS_MAP_IE.put("LightCyan", "#E0FFFF");
308         COLORS_MAP_IE.put("LightGoldenrodYellow", "#FAFAD2");
309         COLORS_MAP_IE.put("LightGreen", "#90EE90");
310         COLORS_MAP_IE.put("LightGray", "#D3D3D3");
311         COLORS_MAP_IE.put("LightGrey", "#D3D3D3");
312         COLORS_MAP_IE.put("LightPink", "#FFB6C1");
313         COLORS_MAP_IE.put("LightSalmon", "#FFA07A");
314         COLORS_MAP_IE.put("LightSeaGreen", "#20B2AA");
315         COLORS_MAP_IE.put("LightSkyBlue", "#87CEFA");
316         COLORS_MAP_IE.put("LightSlateGray", "#778899");
317         COLORS_MAP_IE.put("LightSlateGrey", "#778899");
318         COLORS_MAP_IE.put("LightSteelBlue", "#B0C4DE");
319         COLORS_MAP_IE.put("LightYellow", "#FFFFE0");
320         COLORS_MAP_IE.put("Lime", "#00FF00");
321         COLORS_MAP_IE.put("LimeGreen", "#32CD32");
322         COLORS_MAP_IE.put("Linen", "#FAF0E6");
323         COLORS_MAP_IE.put("Magenta", "#FF00FF");
324         COLORS_MAP_IE.put("Maroon", "#800000");
325         COLORS_MAP_IE.put("MediumAquamarine", "#66CDAA");
326         COLORS_MAP_IE.put("MediumBlue", "#0000CD");
327         COLORS_MAP_IE.put("MediumOrchid", "#BA55D3");
328         COLORS_MAP_IE.put("MediumPurple", "#9370DB");
329         COLORS_MAP_IE.put("MediumSeaGreen", "#3CB371");
330         COLORS_MAP_IE.put("MediumSlateBlue", "#7B68EE");
331         COLORS_MAP_IE.put("MediumSpringGreen", "#00FA9A");
332         COLORS_MAP_IE.put("MediumTurquoise", "#48D1CC");
333         COLORS_MAP_IE.put("MediumVioletRed", "#C71585");
334         COLORS_MAP_IE.put("MidnightBlue", "#191970");
335         COLORS_MAP_IE.put("MintCream", "#F5FFFA");
336         COLORS_MAP_IE.put("MistyRose", "#FFE4E1");
337         COLORS_MAP_IE.put("Moccasin", "#FFE4B5");
338         COLORS_MAP_IE.put("NavajoWhite", "#FFDEAD");
339         COLORS_MAP_IE.put("Navy", "#000080");
340         COLORS_MAP_IE.put("OldLace", "#FDF5E6");
341         COLORS_MAP_IE.put("Olive", "#808000");
342         COLORS_MAP_IE.put("OliveDrab", "#6B8E23");
343         COLORS_MAP_IE.put("Orange", "#FFA500");
344         COLORS_MAP_IE.put("OrangeRed", "#FF4500");
345         COLORS_MAP_IE.put("Orchid", "#DA70D6");
346         COLORS_MAP_IE.put("PaleGoldenrod", "#EEE8AA");
347         COLORS_MAP_IE.put("PaleGreen", "#98FB98");
348         COLORS_MAP_IE.put("PaleTurquoise", "#AFEEEE");
349         COLORS_MAP_IE.put("PaleVioletRed", "#DB7093");
350         COLORS_MAP_IE.put("PapayaWhip", "#FFEFD5");
351         COLORS_MAP_IE.put("PeachPuff", "#FFDAB9");
352         COLORS_MAP_IE.put("Peru", "#CD853F");
353         COLORS_MAP_IE.put("Pink", "#FFC0CB");
354         COLORS_MAP_IE.put("Plum", "#DDA0DD");
355         COLORS_MAP_IE.put("PowderBlue", "#B0E0E6");
356         COLORS_MAP_IE.put("Purple", "#800080");
357         COLORS_MAP_IE.put("Red", "#FF0000");
358         COLORS_MAP_IE.put("RosyBrown", "#BC8F8F");
359         COLORS_MAP_IE.put("RoyalBlue", "#4169E1");
360         COLORS_MAP_IE.put("SaddleBrown", "#8B4513");
361         COLORS_MAP_IE.put("Salmon", "#FA8072");
362         COLORS_MAP_IE.put("SandyBrown", "#F4A460");
363         COLORS_MAP_IE.put("SeaGreen", "#2E8B57");
364         COLORS_MAP_IE.put("Seashell", "#FFF5EE");
365         COLORS_MAP_IE.put("Sienna", "#A0522D");
366         COLORS_MAP_IE.put("Silver", "#C0C0C0");
367         COLORS_MAP_IE.put("SkyBlue", "#87CEEB");
368         COLORS_MAP_IE.put("SlateBlue", "#6A5ACD");
369         COLORS_MAP_IE.put("SlateGray", "#708090");
370         COLORS_MAP_IE.put("SlateGrey", "#708090");
371         COLORS_MAP_IE.put("Snow", "#FFFAFA");
372         COLORS_MAP_IE.put("SpringGreen", "#00FF7F");
373         COLORS_MAP_IE.put("SteelBlue", "#4682B4");
374         COLORS_MAP_IE.put("Tan", "#D2B48C");
375         COLORS_MAP_IE.put("Teal", "#008080");
376         COLORS_MAP_IE.put("Thistle", "#D8BFD8");
377         COLORS_MAP_IE.put("Tomato", "#FF6347");
378         COLORS_MAP_IE.put("Turquoise", "#40E0D0");
379         COLORS_MAP_IE.put("Violet", "#EE82EE");
380         COLORS_MAP_IE.put("Wheat", "#F5DEB3");
381         COLORS_MAP_IE.put("White", "#FFFFFF");
382         COLORS_MAP_IE.put("WhiteSmoke", "#F5F5F5");
383         COLORS_MAP_IE.put("Yellow", "#FFFF00");
384         COLORS_MAP_IE.put("YellowGreen", "#9ACD32");
385     }
386 
387     private boolean endTagForbidden_;
388 
389     /**
390      * Creates an instance.
391      */
392     @JsxConstructor({CHROME, FF, EDGE})
393     public HTMLElement() {
394     }
395 
396     /**
397      * Sets the DOM node that corresponds to this JavaScript object.
398      * @param domNode the DOM node
399      */
400     @Override
401     public void setDomNode(final DomNode domNode) {
402         super.setDomNode(domNode);
403 
404         final String name = domNode.getLocalName();
405         if ("wbr".equalsIgnoreCase(name)
406                 || "basefont".equalsIgnoreCase(name)
407                 || "keygen".equalsIgnoreCase(name)
408                 || "track".equalsIgnoreCase(name)) {
409             endTagForbidden_ = true;
410         }
411     }
412 
413     /**
414      * Returns the element title.
415      * @return the ID of this element
416      */
417     @JsxGetter
418     public String getTitle() {
419         return getDomNodeOrDie().getAttribute("title");
420     }
421 
422     /**
423      * Sets the title of this element.
424      * @param newTitle the new identifier of this element
425      */
426     @JsxSetter
427     public void setTitle(final String newTitle) {
428         getDomNodeOrDie().setAttribute("title", newTitle);
429     }
430 
431     /**
432      * Returns true if this element is disabled.
433      * @return true if this element is disabled
434      */
435     @JsxGetter(IE)
436     public boolean isDisabled() {
437         return getDomNodeOrDie().hasAttribute("disabled");
438     }
439 
440     /**
441      * Sets whether or not to disable this element.
442      * @param disabled True if this is to be disabled
443      */
444     @JsxSetter(IE)
445     public void setDisabled(final boolean disabled) {
446         final HtmlElement element = getDomNodeOrDie();
447         if (disabled) {
448             element.setAttribute("disabled", "disabled");
449         }
450         else {
451             element.removeAttribute("disabled");
452         }
453     }
454 
455     /**
456      * {@inheritDoc}
457      */
458     @Override
459     public String getLocalName() {
460         final DomNode domNode = getDomNodeOrDie();
461         if (domNode.getHtmlPageOrNull() != null) {
462             final String prefix = domNode.getPrefix();
463             if (prefix != null) {
464                 // create string builder only if needed (performance)
465                 final StringBuilder localName = new StringBuilder(prefix.toLowerCase(Locale.ROOT));
466                 localName.append(':');
467                 localName.append(domNode.getLocalName().toLowerCase(Locale.ROOT));
468                 return localName.toString();
469             }
470             return domNode.getLocalName().toLowerCase(Locale.ROOT);
471         }
472         return domNode.getLocalName();
473     }
474 
475     /**
476      * An IE-only method which clears all custom attributes.
477      */
478     @JsxFunction(IE)
479     public void clearAttributes() {
480         final HtmlElement node = getDomNodeOrDie();
481 
482         // Remove custom attributes defined directly in HTML.
483         final List<String> removals = new ArrayList<>();
484         for (final String attributeName : node.getAttributesMap().keySet()) {
485             // Quick hack to figure out what's a "custom" attribute, and what isn't.
486             // May not be 100% correct.
487             if (!ScriptableObject.hasProperty(getPrototype(), attributeName)) {
488                 removals.add(attributeName);
489             }
490         }
491         for (final String attributeName : removals) {
492             node.removeAttribute(attributeName);
493         }
494 
495         // Remove custom attributes defined at runtime via JavaScript.
496         for (final Object id : getAllIds()) {
497             if (id instanceof Integer) {
498                 final int i = ((Integer) id).intValue();
499                 delete(i);
500             }
501             else if (id instanceof String) {
502                 delete((String) id);
503             }
504         }
505     }
506 
507     /**
508      * An IE-only method which copies all custom attributes from the specified source element
509      * to this element.
510      * @param source the source element from which to copy the custom attributes
511      * @param preserveIdentity if {@code false}, the <tt>name</tt> and <tt>id</tt> attributes are not copied
512      */
513     @JsxFunction(IE)
514     public void mergeAttributes(final HTMLElement source, final Object preserveIdentity) {
515         final HtmlElement src = source.getDomNodeOrDie();
516         final HtmlElement target = getDomNodeOrDie();
517 
518         // Merge ID and name if we aren't preserving identity.
519         if (preserveIdentity instanceof Boolean && !((Boolean) preserveIdentity).booleanValue()) {
520             target.setId(src.getId());
521             target.setAttribute("name", src.getAttribute("name"));
522         }
523     }
524 
525     /**
526      * Sets an attribute.
527      * See also <a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-F68F082">
528      * the DOM reference</a>
529      *
530      * @param name Name of the attribute to set
531      * @param value Value to set the attribute to
532      */
533     @Override
534     public void setAttribute(String name, final String value) {
535         getDomNodeOrDie().setAttribute(name, value);
536 
537         // call corresponding event handler setOnxxx if found
538         if (!name.isEmpty()) {
539             name = name.toLowerCase(Locale.ROOT);
540             if (name.startsWith("on")) {
541                 try {
542                     name = Character.toUpperCase(name.charAt(0)) + name.substring(1);
543                     final Method method = getClass().getMethod("set" + name, METHOD_PARAMS_OBJECT);
544                     method.invoke(this, new Object[] {new EventHandler(getDomNodeOrDie(), name.substring(2), value)});
545                 }
546                 catch (final NoSuchMethodException e) {
547                     //silently ignore
548                 }
549                 catch (final IllegalAccessException e) {
550                     //silently ignore
551                 }
552                 catch (final InvocationTargetException e) {
553                     throw new RuntimeException(e.getCause());
554                 }
555             }
556         }
557     }
558 
559     /**
560      * Gets the attributes of the element in the form of a {@link org.xml.sax.Attributes}.
561      * @param element the element to read the attributes from
562      * @return the attributes
563      */
564     protected AttributesImpl readAttributes(final HtmlElement element) {
565         final AttributesImpl attributes = new AttributesImpl();
566         for (final DomAttr entry : element.getAttributesMap().values()) {
567             final String name = entry.getName();
568             final String value = entry.getValue();
569             attributes.addAttribute(null, name, name, null, value);
570         }
571 
572         return attributes;
573     }
574 
575     /**
576      * Removes this object from the document hierarchy.
577      * @param removeChildren whether to remove children or no
578      * @return a reference to the object that is removed
579      */
580     @JsxFunction(IE)
581     public HTMLElement removeNode(final boolean removeChildren) {
582         final HTMLElement parent = (HTMLElement) getParentElement();
583         if (parent != null) {
584             parent.removeChild(this);
585             if (!removeChildren) {
586                 final NodeList collection = getChildNodes();
587                 final int length = collection.getLength();
588                 for (int i = 0; i < length; i++) {
589                     final Node object = (Node) collection.item(Integer.valueOf(0));
590                     parent.appendChild(object);
591                 }
592             }
593         }
594         return this;
595     }
596 
597     /**
598      * Gets the attribute node for the specified attribute.
599      * @param attributeName the name of the attribute to retrieve
600      * @return the attribute node for the specified attribute
601      */
602     @Override
603     public Object getAttributeNode(final String attributeName) {
604         return getAttributes().getNamedItem(attributeName);
605     }
606 
607     /**
608      * {@inheritDoc}
609      */
610     @Override
611     @JsxFunction(IE)
612     public HTMLCollection getElementsByClassName(final String className) {
613         return super.getElementsByClassName(className);
614     }
615 
616     /**
617      * {@inheritDoc}
618      */
619     @Override
620     @JsxGetter(propertyName = "className", value = IE)
621     public Object getClassName_js() {
622         return super.getClassName_js();
623     }
624 
625     /**
626      * {@inheritDoc}
627      */
628     @Override
629     @JsxGetter(IE)
630     public String getOuterHTML() {
631         return super.getOuterHTML();
632     }
633 
634     /**
635      * {@inheritDoc}
636      */
637     @Override
638     @JsxSetter(IE)
639     public void setOuterHTML(final Object value) {
640         super.setOuterHTML(value);
641     }
642 
643     /**
644      * {@inheritDoc}
645      */
646     @Override
647     @JsxGetter(IE)
648     public String getInnerHTML() {
649         return super.getInnerHTML();
650     }
651 
652     /**
653      * {@inheritDoc}
654      */
655     @Override
656     @JsxSetter(IE)
657     public void setInnerHTML(final Object value) {
658         super.setInnerHTML(value);
659     }
660 
661     /**
662      * {@inheritDoc}
663      */
664     @Override
665     @JsxSetter(propertyName = "className", value = IE)
666     public void setClassName_js(final String className) {
667         super.setClassName_js(className);
668     }
669 
670     /**
671      * {@inheritDoc}
672      */
673     @Override
674     @JsxFunction(IE)
675     public void insertAdjacentHTML(final String position, final String text) {
676         super.insertAdjacentHTML(position, text);
677     }
678 
679     /**
680      * {@inheritDoc}
681      */
682     @Override
683     @JsxFunction(IE)
684     public void insertAdjacentText(final String where, final String text) {
685         super.insertAdjacentText(where, text);
686     }
687 
688     /**
689      * {@inheritDoc}
690      */
691     @Override
692     @JsxFunction(IE)
693     public Object insertAdjacentElement(final String where, final Object insertedElement) {
694         return super.insertAdjacentElement(where, insertedElement);
695     }
696 
697     /**
698      * Gets the innerText attribute.
699      * @return the contents of this node as text
700      */
701     @JsxGetter
702     public String getInnerText() {
703         final StringBuilder buf = new StringBuilder();
704         // we can't rely on DomNode.asXml because it adds indentation and new lines
705         printChildren(buf, getDomNodeOrDie(), false);
706         return buf.toString();
707     }
708 
709     /**
710      * Replaces all child elements of this element with the supplied text value.
711      * @param value the new value for the contents of this element
712      */
713     @JsxSetter
714     public void setInnerText(final Object value) {
715         final String valueString;
716         if (value == null && getBrowserVersion().hasFeature(JS_INNER_TEXT_VALUE_NULL)) {
717             valueString = null;
718         }
719         else {
720             valueString = Context.toString(value);
721         }
722         setInnerTextImpl(valueString);
723     }
724 
725     /**
726      * The worker for setInnerText.
727      * @param value the new value for the contents of this node
728      */
729     protected void setInnerTextImpl(final String value) {
730         final DomNode domNode = getDomNodeOrDie();
731 
732         domNode.removeAllChildren();
733 
734         if (value != null && !value.isEmpty()) {
735             domNode.appendChild(new DomText(domNode.getPage(), value));
736         }
737     }
738 
739     /**
740      * Replaces all child elements of this element with the supplied text value.
741      * @param value the new value for the contents of this element
742      */
743     @Override
744     public void setTextContent(final Object value) {
745         setInnerTextImpl(value == null ? null : Context.toString(value));
746     }
747 
748     /**
749      * ProxyDomNode.
750      */
751     public static class ProxyDomNode extends HtmlDivision {
752 
753         private final DomNode target_;
754         private final boolean append_;
755 
756         /**
757          * Constructor.
758          * @param page the page
759          * @param target the target
760          * @param append append or no
761          */
762         public ProxyDomNode(final SgmlPage page, final DomNode target, final boolean append) {
763             super(HtmlDivision.TAG_NAME, page, null);
764             target_ = target;
765             append_ = append;
766         }
767 
768         /**
769          * {@inheritDoc}
770          */
771         @Override
772         public DomNode appendChild(final org.w3c.dom.Node node) {
773             final DomNode domNode = (DomNode) node;
774             if (append_) {
775                 return target_.appendChild(domNode);
776             }
777             target_.insertBefore(domNode);
778             return domNode;
779         }
780 
781         /**
782          * Gets wrapped DomNode.
783          * @return the node
784          */
785         public DomNode getDomNode() {
786             return target_;
787         }
788 
789         /**
790          * Returns append or not.
791          * @return append or not
792          */
793         public boolean isAppend() {
794             return append_;
795         }
796     }
797 
798     /**
799      * Adds the specified behavior to this HTML element. Currently only supports
800      * the following default IE behaviors:
801      * <ul>
802      *   <li>#default#clientCaps</li>
803      *   <li>#default#homePage</li>
804      *   <li>#default#download</li>
805      * </ul>
806      * @param behavior the URL of the behavior to add, or a default behavior name
807      * @return an identifier that can be user later to detach the behavior from the element
808      */
809     public int addBehavior(final String behavior) {
810         // if behavior already defined, then nothing to do
811         if (behaviors_.contains(behavior)) {
812             return 0;
813         }
814 
815         final Class<? extends HTMLElement> c = getClass();
816         if (BEHAVIOR_CLIENT_CAPS.equalsIgnoreCase(behavior)) {
817             defineProperty("availHeight", c, 0);
818             defineProperty("availWidth", c, 0);
819             defineProperty("bufferDepth", c, 0);
820             defineProperty("colorDepth", c, 0);
821             defineProperty("connectionType", c, 0);
822             defineProperty("cookieEnabled", c, 0);
823             defineProperty("cpuClass", c, 0);
824             defineProperty("height", c, 0);
825             defineProperty("javaEnabled", c, 0);
826             defineProperty("platform", c, 0);
827             defineProperty("systemLanguage", c, 0);
828             defineProperty("userLanguage", c, 0);
829             defineProperty("width", c, 0);
830             defineFunctionProperties(new String[] {"addComponentRequest"}, c, 0);
831             defineFunctionProperties(new String[] {"clearComponentRequest"}, c, 0);
832             defineFunctionProperties(new String[] {"compareVersions"}, c, 0);
833             defineFunctionProperties(new String[] {"doComponentRequest"}, c, 0);
834             defineFunctionProperties(new String[] {"getComponentVersion"}, c, 0);
835             defineFunctionProperties(new String[] {"isComponentInstalled"}, c, 0);
836             behaviors_.add(BEHAVIOR_CLIENT_CAPS);
837             return BEHAVIOR_ID_CLIENT_CAPS;
838         }
839         else if (BEHAVIOR_HOMEPAGE.equalsIgnoreCase(behavior)) {
840             defineFunctionProperties(new String[] {"isHomePage"}, c, 0);
841             defineFunctionProperties(new String[] {"setHomePage"}, c, 0);
842             defineFunctionProperties(new String[] {"navigateHomePage"}, c, 0);
843             behaviors_.add(BEHAVIOR_CLIENT_CAPS);
844             return BEHAVIOR_ID_HOMEPAGE;
845         }
846         else if (BEHAVIOR_DOWNLOAD.equalsIgnoreCase(behavior)) {
847             defineFunctionProperties(new String[] {"startDownload"}, c, 0);
848             behaviors_.add(BEHAVIOR_DOWNLOAD);
849             return BEHAVIOR_ID_DOWNLOAD;
850         }
851         else {
852             LOG.warn("Unimplemented behavior: " + behavior);
853             return BEHAVIOR_ID_UNKNOWN;
854         }
855     }
856 
857     /**
858      * Removes the behavior corresponding to the specified identifier from this element.
859      * @param id the identifier for the behavior to remove
860      */
861     public void removeBehavior(final int id) {
862         switch (id) {
863             case BEHAVIOR_ID_CLIENT_CAPS:
864                 delete("availHeight");
865                 delete("availWidth");
866                 delete("bufferDepth");
867                 delete("colorDepth");
868                 delete("connectionType");
869                 delete("cookieEnabled");
870                 delete("cpuClass");
871                 delete("height");
872                 delete("javaEnabled");
873                 delete("platform");
874                 delete("systemLanguage");
875                 delete("userLanguage");
876                 delete("width");
877                 delete("addComponentRequest");
878                 delete("clearComponentRequest");
879                 delete("compareVersions");
880                 delete("doComponentRequest");
881                 delete("getComponentVersion");
882                 delete("isComponentInstalled");
883                 behaviors_.remove(BEHAVIOR_CLIENT_CAPS);
884                 break;
885             case BEHAVIOR_ID_HOMEPAGE:
886                 delete("isHomePage");
887                 delete("setHomePage");
888                 delete("navigateHomePage");
889                 behaviors_.remove(BEHAVIOR_HOMEPAGE);
890                 break;
891             case BEHAVIOR_ID_DOWNLOAD:
892                 delete("startDownload");
893                 behaviors_.remove(BEHAVIOR_DOWNLOAD);
894                 break;
895             default:
896                 LOG.warn("Unexpected behavior id: " + id + ". Ignoring.");
897         }
898     }
899 
900     //----------------------- START #default#clientCaps BEHAVIOR -----------------------
901 
902     /**
903      * Returns the screen's available height. Part of the <tt>#default#clientCaps</tt>
904      * default IE behavior implementation.
905      * @return the screen's available height
906      */
907     public int getAvailHeight() {
908         return getWindow().getScreen().getAvailHeight();
909     }
910 
911     /**
912      * Returns the screen's available width. Part of the <tt>#default#clientCaps</tt>
913      * default IE behavior implementation.
914      * @return the screen's available width
915      */
916     public int getAvailWidth() {
917         return getWindow().getScreen().getAvailWidth();
918     }
919 
920     /**
921      * Returns the screen's buffer depth. Part of the <tt>#default#clientCaps</tt>
922      * default IE behavior implementation.
923      * @return the screen's buffer depth
924      */
925     public int getBufferDepth() {
926         return getWindow().getScreen().getBufferDepth();
927     }
928 
929     /**
930      * Returns the screen's color depth. Part of the <tt>#default#clientCaps</tt>
931      * default IE behavior implementation.
932      * @return the screen's color depth
933      */
934     public int getColorDepth() {
935         return getWindow().getScreen().getColorDepth();
936     }
937 
938     /**
939      * Returns the connection type being used. Part of the <tt>#default#clientCaps</tt>
940      * default IE behavior implementation.
941      * @return the connection type being used
942      * Current implementation always return "modem"
943      */
944     public String getConnectionType() {
945         return "modem";
946     }
947 
948     /**
949      * Returns {@code true} if cookies are enabled. Part of the <tt>#default#clientCaps</tt>
950      * default IE behavior implementation.
951      * @return whether or not cookies are enabled
952      */
953     public boolean isCookieEnabled() {
954         return getWindow().getNavigator().isCookieEnabled();
955     }
956 
957     /**
958      * Returns the type of CPU used. Part of the <tt>#default#clientCaps</tt>
959      * default IE behavior implementation.
960      * @return the type of CPU used
961      */
962     public String getCpuClass() {
963         return getWindow().getNavigator().getCpuClass();
964     }
965 
966     /**
967      * Returns the screen's height. Part of the <tt>#default#clientCaps</tt>
968      * default IE behavior implementation.
969      * @return the screen's height
970      */
971     public int getHeight() {
972         return getWindow().getScreen().getHeight();
973     }
974 
975     /**
976      * Returns {@code true} if Java is enabled. Part of the <tt>#default#clientCaps</tt>
977      * default IE behavior implementation.
978      * @return whether or not Java is enabled
979      */
980     public boolean isJavaEnabled() {
981         return getWindow().getNavigator().javaEnabled();
982     }
983 
984     /**
985      * Returns the platform used. Part of the <tt>#default#clientCaps</tt>
986      * default IE behavior implementation.
987      * @return the platform used
988      */
989     public String getPlatform() {
990         return getWindow().getNavigator().getPlatform();
991     }
992 
993     /**
994      * Returns the system language. Part of the <tt>#default#clientCaps</tt>
995      * default IE behavior implementation.
996      * @return the system language
997      */
998     public String getSystemLanguage() {
999         return getWindow().getNavigator().getSystemLanguage();
1000     }
1001 
1002     /**
1003      * Returns the user language. Part of the <tt>#default#clientCaps</tt>
1004      * default IE behavior implementation.
1005      * @return the user language
1006      */
1007     public String getUserLanguage() {
1008         return getWindow().getNavigator().getUserLanguage();
1009     }
1010 
1011     /**
1012      * Returns the screen's width. Part of the <tt>#default#clientCaps</tt>
1013      * default IE behavior implementation.
1014      * @return the screen's width
1015      */
1016     public int getWidth() {
1017         return getWindow().getScreen().getWidth();
1018     }
1019 
1020     /**
1021      * Adds the specified component to the queue of components to be installed. Note
1022      * that no components ever get installed, and this call is always ignored. Part of
1023      * the <tt>#default#clientCaps</tt> default IE behavior implementation.
1024      * @param id the identifier for the component to install
1025      * @param idType the type of identifier specified
1026      * @param minVersion the minimum version of the component to install
1027      */
1028     public void addComponentRequest(final String id, final String idType, final String minVersion) {
1029         if (LOG.isDebugEnabled()) {
1030             LOG.debug("Call to addComponentRequest(" + id + ", " + idType + ", " + minVersion + ") ignored.");
1031         }
1032     }
1033 
1034     /**
1035      * Clears the component install queue of all component requests. Note that no components
1036      * ever get installed, and this call is always ignored. Part of the <tt>#default#clientCaps</tt>
1037      * default IE behavior implementation.
1038      */
1039     public void clearComponentRequest() {
1040         if (LOG.isDebugEnabled()) {
1041             LOG.debug("Call to clearComponentRequest() ignored.");
1042         }
1043     }
1044 
1045     /**
1046      * Compares the two specified version numbers. Part of the <tt>#default#clientCaps</tt>
1047      * default IE behavior implementation.
1048      * @param v1 the first of the two version numbers to compare
1049      * @param v2 the second of the two version numbers to compare
1050      * @return -1 if v1 is less than v2, 0 if v1 equals v2, and 1 if v1 is more than v2
1051      */
1052     public int compareVersions(final String v1, final String v2) {
1053         final int i = v1.compareTo(v2);
1054         if (i == 0) {
1055             return 0;
1056         }
1057         else if (i < 0) {
1058             return -1;
1059         }
1060         else {
1061             return 1;
1062         }
1063     }
1064 
1065     /**
1066      * Downloads all the components queued via {@link #addComponentRequest(String, String, String)}.
1067      * @return {@code true} if the components are downloaded successfully
1068      * Current implementation always return {@code false}
1069      */
1070     public boolean doComponentRequest() {
1071         return false;
1072     }
1073 
1074     /**
1075      * Returns the version of the specified component.
1076      * @param id the identifier for the component whose version is to be returned
1077      * @param idType the type of identifier specified
1078      * @return the version of the specified component
1079      */
1080     public String getComponentVersion(final String id, final String idType) {
1081         if ("{E5D12C4E-7B4F-11D3-B5C9-0050045C3C96}".equals(id)) {
1082             // Yahoo Messenger.
1083             return "";
1084         }
1085         // Everything else.
1086         return "1.0";
1087     }
1088 
1089     /**
1090      * Returns {@code true} if the specified component is installed.
1091      * @param id the identifier for the component to check for
1092      * @param idType the type of id specified
1093      * @param minVersion the minimum version to check for
1094      * @return {@code true} if the specified component is installed
1095      */
1096     public boolean isComponentInstalled(final String id, final String idType, final String minVersion) {
1097         return false;
1098     }
1099 
1100     //----------------------- START #default#download BEHAVIOR -----------------------
1101 
1102     /**
1103      * Implementation of the IE behavior #default#download.
1104      * @param uri the URI of the download source
1105      * @param callback the method which should be called when the download is finished
1106      * @see <a href="http://msdn.microsoft.com/en-us/library/ms531406.aspx">MSDN documentation</a>
1107      * @throws MalformedURLException if the URL cannot be created
1108      */
1109     public void startDownload(final String uri, final Function callback) throws MalformedURLException {
1110         final HtmlPage page = (HtmlPage) getWindow().getWebWindow().getEnclosedPage();
1111         final URL url = page.getFullyQualifiedUrl(uri);
1112         if (!page.getUrl().getHost().equals(url.getHost())) {
1113             throw Context.reportRuntimeError("Not authorized url: " + url);
1114         }
1115         final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory().
1116                 createDownloadBehaviorJob(url, callback, getWindow().getWebWindow().getWebClient());
1117         page.getEnclosingWindow().getJobManager().addJob(job, page);
1118     }
1119 
1120     //----------------------- END #default#download BEHAVIOR -----------------------
1121 
1122     //----------------------- START #default#homePage BEHAVIOR -----------------------
1123 
1124     /**
1125      * Returns {@code true} if the specified URL is the web client's current
1126      * homepage and the document calling the method is on the same domain as the
1127      * user's homepage. Part of the <tt>#default#homePage</tt> default IE behavior
1128      * implementation.
1129      * @param url the URL to check
1130      * @return {@code true} if the specified URL is the current homepage
1131      */
1132     public boolean isHomePage(final String url) {
1133         try {
1134             final URL newUrl = new URL(url);
1135             final URL currentUrl = getDomNodeOrDie().getPage().getUrl();
1136             final String home = getDomNodeOrDie().getPage().getEnclosingWindow()
1137                     .getWebClient().getOptions().getHomePage();
1138             final boolean sameDomains = newUrl.getHost().equalsIgnoreCase(currentUrl.getHost());
1139             final boolean isHomePage = home != null && home.equals(url);
1140             return sameDomains && isHomePage;
1141         }
1142         catch (final MalformedURLException e) {
1143             return false;
1144         }
1145     }
1146 
1147     /**
1148      * Sets the web client's current homepage. Part of the <tt>#default#homePage</tt>
1149      * default IE behavior implementation.
1150      * @param url the new homepage URL
1151      */
1152     public void setHomePage(final String url) {
1153         getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient().getOptions().setHomePage(url);
1154     }
1155 
1156     /**
1157      * Causes the web client to navigate to the current home page. Part of the
1158      * <tt>#default#homePage</tt> default IE behavior implementation.
1159      * @throws IOException if loading home page fails
1160      */
1161     public void navigateHomePage() throws IOException {
1162         final WebClient webClient = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient();
1163         webClient.getPage(webClient.getOptions().getHomePage());
1164     }
1165 
1166     //----------------------- END #default#homePage BEHAVIOR -----------------------
1167 
1168     /**
1169      * Returns this element's <tt>offsetHeight</tt>, which is the element height plus the element's padding
1170      * plus the element's border. This method returns a dummy value compatible with mouse event coordinates
1171      * during mouse events.
1172      * @return this element's <tt>offsetHeight</tt>
1173      * @see <a href="http://msdn2.microsoft.com/en-us/library/ms534199.aspx">MSDN Documentation</a>
1174      * @see <a href="http://www.quirksmode.org/js/elementdimensions.html">Element Dimensions</a>
1175      */
1176     @JsxGetter
1177     public int getOffsetHeight() {
1178         if (isDisplayNone() || !getDomNodeOrDie().isAttachedToPage()) {
1179             return 0;
1180         }
1181         final MouseEvent event = MouseEvent.getCurrentMouseEvent();
1182         if (isAncestorOfEventTarget(event)) {
1183             // compute appropriate offset height to pretend mouse event was produced within this element
1184             return event.getClientY() - getPosY() + 50;
1185         }
1186         final ComputedCSSStyleDeclaration style = getWindow().getComputedStyle(this, null);
1187         return style.getCalculatedHeight(true, true);
1188     }
1189 
1190     /**
1191      * Returns this element's <tt>offsetWidth</tt>, which is the element width plus the element's padding
1192      * plus the element's border. This method returns a dummy value compatible with mouse event coordinates
1193      * during mouse events.
1194      * @return this element's <tt>offsetWidth</tt>
1195      * @see <a href="http://msdn2.microsoft.com/en-us/library/ms534304.aspx">MSDN Documentation</a>
1196      * @see <a href="http://www.quirksmode.org/js/elementdimensions.html">Element Dimensions</a>
1197      */
1198     @JsxGetter
1199     public int getOffsetWidth() {
1200         if (isDisplayNone() || !getDomNodeOrDie().isAttachedToPage()) {
1201             return 0;
1202         }
1203 
1204         final MouseEvent event = MouseEvent.getCurrentMouseEvent();
1205         if (isAncestorOfEventTarget(event)) {
1206             // compute appropriate offset width to pretend mouse event was produced within this element
1207             return event.getClientX() - getPosX() + 50;
1208         }
1209         final ComputedCSSStyleDeclaration style = getWindow().getComputedStyle(this, null);
1210         return style.getCalculatedWidth(true, true);
1211     }
1212 
1213     /**
1214      * Returns {@code true} if this element's node is an ancestor of the specified event's target node.
1215      * @param event the event whose target node is to be checked
1216      * @return {@code true} if this element's node is an ancestor of the specified event's target node
1217      */
1218     protected boolean isAncestorOfEventTarget(final MouseEvent event) {
1219         if (event == null) {
1220             return false;
1221         }
1222         else if (!(event.getSrcElement() instanceof HTMLElement)) {
1223             return false;
1224         }
1225         final HTMLElement srcElement = (HTMLElement) event.getSrcElement();
1226         return getDomNodeOrDie().isAncestorOf(srcElement.getDomNodeOrDie());
1227     }
1228 
1229     /**
1230      * {@inheritDoc}
1231      */
1232     @Override
1233     public String toString() {
1234         return "HTMLElement for " + getDomNodeOrNull();
1235     }
1236 
1237     /**
1238      * Sets the Uniform Resource Name (URN) specified in the namespace declaration.
1239      * @param tagUrn the Uniform Resource Name (URN) specified in the namespace declaration
1240      * @see <a href="http://msdn.microsoft.com/en-us/library/ms534658.aspx">MSDN documentation</a>
1241      */
1242     @JsxSetter(IE)
1243     public void setTagUrn(final String tagUrn) {
1244         throw Context.reportRuntimeError("Error trying to set tagUrn to '" + tagUrn + "'.");
1245     }
1246 
1247     /**
1248      * Gets the first ancestor instance of {@link HTMLElement}. It is mostly identical
1249      * to {@link #getParent()} except that it skips XML nodes.
1250      * @return the parent HTML element
1251      * @see #getParent()
1252      */
1253     public HTMLElement getParentHTMLElement() {
1254         Node parent = getParent();
1255         while (parent != null && !(parent instanceof HTMLElement)) {
1256             parent = parent.getParent();
1257         }
1258         return (HTMLElement) parent;
1259     }
1260 
1261     /**
1262      * {@inheritDoc}
1263      */
1264     @Override
1265     @JsxFunction(IE)
1266     public void scrollIntoView() { /* do nothing at the moment */ }
1267 
1268     /**
1269      * Retrieves an auto-generated, unique identifier for the object.
1270      * <b>Note</b> The unique ID generated is not guaranteed to be the same every time the page is loaded.
1271      * @return an auto-generated, unique identifier for the object
1272      */
1273     @JsxGetter(IE)
1274     public String getUniqueID() {
1275         if (uniqueID_ == null) {
1276             uniqueID_ = "ms__id" + UniqueID_Counter_++;
1277         }
1278         return uniqueID_;
1279     }
1280 
1281     /**
1282      * {@inheritDoc}
1283      */
1284     @Override
1285     public HtmlElement getDomNodeOrDie() {
1286         return (HtmlElement) super.getDomNodeOrDie();
1287     }
1288 
1289     /**
1290      * {@inheritDoc}
1291      */
1292     @Override
1293     public HtmlElement getDomNodeOrNull() {
1294         return (HtmlElement) super.getDomNodeOrNull();
1295     }
1296 
1297     /**
1298      * Remove focus from this element.
1299      */
1300     @JsxFunction
1301     public void blur() {
1302         getDomNodeOrDie().blur();
1303     }
1304 
1305     /**
1306      * Sets the focus to this element.
1307      */
1308     @JsxFunction
1309     public void focus() {
1310         final HtmlElement domNode = getDomNodeOrDie();
1311         if (domNode instanceof SubmittableElement) {
1312             domNode.focus();
1313         }
1314 
1315         // no action otherwise!
1316     }
1317 
1318     /**
1319      * Sets the object as active without setting focus to the object.
1320      * @see <a href="http://msdn.microsoft.com/en-us/library/ms536738.aspx">MSDN documentation</a>
1321      */
1322     @JsxFunction(IE)
1323     public void setActive() {
1324         final Window window = getWindow();
1325         final HTMLDocument document = (HTMLDocument) window.getDocument();
1326         document.setActiveElement(this);
1327         if (window.getWebWindow() == window.getWebWindow().getWebClient().getCurrentWindow()) {
1328             final HtmlElement element = getDomNodeOrDie();
1329             ((HtmlPage) element.getPage()).setFocusedElement(element);
1330         }
1331     }
1332 
1333     /**
1334      * {@inheritDoc}
1335      */
1336     @Override
1337     public String getNodeName() {
1338         final DomNode domNode = getDomNodeOrDie();
1339         String nodeName = domNode.getNodeName();
1340         if (domNode.getHtmlPageOrNull() != null) {
1341             nodeName = nodeName.toUpperCase(Locale.ROOT);
1342         }
1343         return nodeName;
1344     }
1345 
1346     /**
1347      * {@inheritDoc}
1348      */
1349     @Override
1350     public String getPrefix() {
1351         return null;
1352     }
1353 
1354     /**
1355      * Click this element. This simulates the action of the user clicking with the mouse.
1356      * @throws IOException if this click triggers a page load that encounters problems
1357      */
1358     @JsxFunction
1359     public void click() throws IOException {
1360         getDomNodeOrDie().click();
1361     }
1362 
1363     /**
1364      * Returns the {@code spellcheck} property.
1365      * @return the {@code spellcheck} property
1366      */
1367     @JsxGetter(FF)
1368     public boolean isSpellcheck() {
1369         return Context.toBoolean(getDomNodeOrDie().getAttribute("spellcheck"));
1370     }
1371 
1372     /**
1373      * Sets the {@code spellcheck} property.
1374      * @param spellcheck the {@code spellcheck} property
1375      */
1376     @JsxSetter(FF)
1377     public void setSpellcheck(final boolean spellcheck) {
1378         getDomNodeOrDie().setAttribute("spellcheck", Boolean.toString(spellcheck));
1379     }
1380 
1381     /**
1382      * Returns the {@code lang} property.
1383      * @return the {@code lang} property
1384      */
1385     @JsxGetter
1386     public String getLang() {
1387         return getDomNodeOrDie().getAttribute("lang");
1388     }
1389 
1390     /**
1391      * Sets the {@code lang} property.
1392      * @param lang the {@code lang} property
1393      */
1394     @JsxSetter
1395     public void setLang(final String lang) {
1396         getDomNodeOrDie().setAttribute("lang", lang);
1397     }
1398 
1399     /**
1400      * Returns the {@code language} property.
1401      * @return the {@code language} property
1402      */
1403     @JsxGetter(IE)
1404     public String getLanguage() {
1405         return getDomNodeOrDie().getAttribute("language");
1406     }
1407 
1408     /**
1409      * Sets the {@code language} property.
1410      * @param language the {@code language} property
1411      */
1412     @JsxSetter(IE)
1413     public void setLanguage(final String language) {
1414         getDomNodeOrDie().setAttribute("language", language);
1415     }
1416 
1417     /**
1418      * Returns the {@code dir} property.
1419      * @return the {@code dir} property
1420      */
1421     @JsxGetter
1422     public String getDir() {
1423         return getDomNodeOrDie().getAttribute("dir");
1424     }
1425 
1426     /**
1427      * Sets the {@code dir} property.
1428      * @param dir the {@code dir} property
1429      */
1430     @JsxSetter
1431     public void setDir(final String dir) {
1432         getDomNodeOrDie().setAttribute("dir", dir);
1433     }
1434 
1435     /**
1436      * Returns the value of the tabIndex attribute.
1437      * @return the value of the tabIndex attribute
1438      */
1439     @JsxGetter
1440     public int getTabIndex() {
1441         return (int) Context.toNumber(getDomNodeOrDie().getAttribute("tabindex"));
1442     }
1443 
1444     /**
1445      * Sets the {@code tabIndex} property.
1446      * @param tabIndex the {@code tabIndex} property
1447      */
1448     @JsxSetter
1449     public void setTabIndex(final int tabIndex) {
1450         getDomNodeOrDie().setAttribute("tabindex", Integer.toString(tabIndex));
1451     }
1452 
1453     /**
1454      * Returns the {@code accessKey} property.
1455      * @return the {@code accessKey} property
1456      */
1457     @JsxGetter
1458     public String getAccessKey() {
1459         return getDomNodeOrDie().getAttribute("accesskey");
1460     }
1461 
1462     /**
1463      * Sets the {@code accessKey} property.
1464      * @param accessKey the {@code accessKey} property
1465      */
1466     @JsxSetter
1467     public void setAccessKey(final String accessKey) {
1468         getDomNodeOrDie().setAttribute("accesskey", accessKey);
1469     }
1470 
1471     /**
1472      * Returns the value of the specified attribute (width or height).
1473      * @return the value of the specified attribute (width or height)
1474      * @param attributeName the name of the attribute to return (<tt>"width"</tt> or <tt>"height"</tt>)
1475      * @param returnNegativeValues if {@code true}, negative values are returned;
1476      *        if {@code false}, this method returns an empty string in lieu of negative values;
1477      *        if {@code null}, this method returns <tt>0</tt> in lieu of negative values
1478      */
1479     protected String getWidthOrHeight(final String attributeName, final Boolean returnNegativeValues) {
1480         String value = getDomNodeOrDie().getAttribute(attributeName);
1481         if (getBrowserVersion().hasFeature(JS_WIDTH_HEIGHT_ACCEPTS_ARBITRARY_VALUES)) {
1482             return value;
1483         }
1484         if (!PERCENT_VALUE.matcher(value).matches()) {
1485             try {
1486                 final Float f = Float.valueOf(value);
1487                 final int i = f.intValue();
1488                 if (i < 0) {
1489                     if (returnNegativeValues == null) {
1490                         value = "0";
1491                     }
1492                     else if (!returnNegativeValues.booleanValue()) {
1493                         value = "";
1494                     }
1495                     else {
1496                         value = Integer.toString(i);
1497                     }
1498                 }
1499                 else {
1500                     value = Integer.toString(i);
1501                 }
1502             }
1503             catch (final NumberFormatException e) {
1504                 if (!getBrowserVersion().hasFeature(JS_WIDTH_HEIGHT_ACCEPTS_ARBITRARY_VALUES)) {
1505                     value = "";
1506                 }
1507             }
1508         }
1509         return value;
1510     }
1511 
1512     /**
1513      * Sets the value of the specified attribute (width or height).
1514      * @param attributeName the name of the attribute to set (<tt>"width"</tt> or <tt>"height"</tt>)
1515      * @param value the value of the specified attribute (width or height)
1516      * @param allowNegativeValues if {@code true}, negative values will be stored;
1517      *        if {@code false}, negative values cause an exception to be thrown;<br>
1518      *        this check/conversion is only done if the feature JS_WIDTH_HEIGHT_ACCEPTS_ARBITRARY_VALUES
1519      *        is set for the simulated browser
1520      */
1521     protected void setWidthOrHeight(final String attributeName, String value, final boolean allowNegativeValues) {
1522         if (!getBrowserVersion().hasFeature(JS_WIDTH_HEIGHT_ACCEPTS_ARBITRARY_VALUES) && !value.isEmpty()) {
1523             if (value.endsWith("px")) {
1524                 value = value.substring(0, value.length() - 2);
1525             }
1526             boolean error = false;
1527             if (!PERCENT_VALUE.matcher(value).matches()) {
1528                 try {
1529                     final Float f = Float.valueOf(value);
1530                     final int i = f.intValue();
1531                     if (i < 0) {
1532                         if (!allowNegativeValues) {
1533                             error = true;
1534                         }
1535                     }
1536                 }
1537                 catch (final NumberFormatException e) {
1538                     error = true;
1539                 }
1540             }
1541             if (error) {
1542                 final Exception e = new Exception("Cannot set the '" + attributeName
1543                         + "' property to invalid value: '" + value + "'");
1544                 Context.throwAsScriptRuntimeEx(e);
1545             }
1546         }
1547         getDomNodeOrDie().setAttribute(attributeName, value);
1548     }
1549 
1550     /**
1551      * Sets the specified color attribute to the specified value.
1552      * @param name the color attribute's name
1553      * @param value the color attribute's value
1554      */
1555     protected void setColorAttribute(final String name, final String value) {
1556         String s = value;
1557         if (!s.isEmpty()) {
1558             final boolean restrict = getBrowserVersion().hasFeature(HTML_COLOR_RESTRICT);
1559 
1560             boolean isName = false;
1561             if (restrict) {
1562                 for (final String key : COLORS_MAP_IE.keySet()) {
1563                     if (key.equalsIgnoreCase(value)) {
1564                         isName = true;
1565                         break;
1566                     }
1567                 }
1568             }
1569             if (!isName) {
1570                 if (restrict) {
1571                     if (s.charAt(0) == '#') {
1572                         s = s.substring(1);
1573                     }
1574                     final StringBuilder builder = new StringBuilder(7);
1575                     for (int x = 0; x < 6 && x < s.length(); x++) {
1576                         final char ch = s.charAt(x);
1577                         if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F')) {
1578                             builder.append(ch);
1579                         }
1580                         else {
1581                             builder.append('0');
1582                         }
1583                     }
1584                     builder.insert(0, '#');
1585                     s = builder.toString();
1586                 }
1587             }
1588             if (getBrowserVersion().hasFeature(HTML_COLOR_TO_LOWER)) {
1589                 s = s.toLowerCase(Locale.ROOT);
1590             }
1591         }
1592         getDomNodeOrDie().setAttribute(name, s);
1593     }
1594 
1595     /**
1596      * Returns the value of the {@code align} property.
1597      * @param returnInvalidValues if {@code true}, this method will return any value, including technically
1598      *        invalid values; if {@code false}, this method will return an empty string instead of invalid values
1599      * @return the value of the {@code align} property
1600      */
1601     protected String getAlign(final boolean returnInvalidValues) {
1602         final boolean acceptArbitraryValues = getBrowserVersion().hasFeature(JS_ALIGN_ACCEPTS_ARBITRARY_VALUES);
1603 
1604         final String align = getDomNodeOrDie().getAttribute("align");
1605         if (returnInvalidValues || acceptArbitraryValues
1606             || "center".equals(align)
1607             || "justify".equals(align)
1608             || "left".equals(align)
1609             || "right".equals(align)) {
1610             return align;
1611         }
1612         return "";
1613     }
1614 
1615     /**
1616      * Sets the value of the {@code align} property.
1617      * @param align the value of the {@code align} property
1618      * @param ignoreIfNoError if {@code true}, the invocation will be a no-op if it does not trigger an error
1619      *        (i.e., it will not actually set the align attribute)
1620      */
1621     protected void setAlign(final String align, final boolean ignoreIfNoError) {
1622         final String alignLC = align.toLowerCase(Locale.ROOT);
1623         final boolean acceptArbitraryValues = getBrowserVersion().hasFeature(JS_ALIGN_ACCEPTS_ARBITRARY_VALUES);
1624         if (acceptArbitraryValues
1625                 || "center".equals(alignLC)
1626                 || "justify".equals(alignLC)
1627                 || "left".equals(alignLC)
1628                 || "right".equals(alignLC)
1629                 || "bottom".equals(alignLC)
1630                 || "middle".equals(alignLC)
1631                 || "top".equals(alignLC)) {
1632             if (!ignoreIfNoError) {
1633                 final String newValue = acceptArbitraryValues ? align : alignLC;
1634                 getDomNodeOrDie().setAttribute("align", newValue);
1635             }
1636             return;
1637         }
1638 
1639         throw Context.reportRuntimeError("Cannot set the align property to invalid value: '" + align + "'");
1640     }
1641 
1642     /**
1643      * Returns the value of the {@code vAlign} property.
1644      * @param valid the valid values; if {@code null}, any value is valid
1645      * @param defaultValue the default value to use, if necessary
1646      * @return the value of the {@code vAlign} property
1647      */
1648     protected String getVAlign(final String[] valid, final String defaultValue) {
1649         final String valign = getDomNodeOrDie().getAttribute("valign");
1650         if (valid == null || ArrayUtils.contains(valid, valign)) {
1651             return valign;
1652         }
1653         return defaultValue;
1654     }
1655 
1656     /**
1657      * Sets the value of the {@code vAlign} property.
1658      * @param vAlign the value of the {@code vAlign} property
1659      * @param valid the valid values; if {@code null}, any value is valid
1660      */
1661     protected void setVAlign(final Object vAlign, final String[] valid) {
1662         final String s = Context.toString(vAlign).toLowerCase(Locale.ROOT);
1663         if (valid == null || ArrayUtils.contains(valid, s)) {
1664             getDomNodeOrDie().setAttribute("valign", s);
1665         }
1666         else {
1667             throw Context.reportRuntimeError("Cannot set the vAlign property to invalid value: " + vAlign);
1668         }
1669     }
1670 
1671     /**
1672      * Returns the value of the {@code ch} property.
1673      * @return the value of the {@code ch} property
1674      */
1675     protected String getCh() {
1676         return getDomNodeOrDie().getAttribute("char");
1677     }
1678 
1679     /**
1680      * Sets the value of the {@code ch} property.
1681      * @param ch the value of the {@code ch} property
1682      */
1683     protected void setCh(final String ch) {
1684         getDomNodeOrDie().setAttribute("char", ch);
1685     }
1686 
1687     /**
1688      * Returns the value of the {@code chOff} property.
1689      * @return the value of the {@code chOff} property
1690      */
1691     protected String getChOff() {
1692         return getDomNodeOrDie().getAttribute("charOff");
1693     }
1694 
1695     /**
1696      * Sets the value of the {@code chOff} property.
1697      * @param chOff the value of the {@code chOff} property
1698      */
1699     protected void setChOff(String chOff) {
1700         try {
1701             final float f = Float.parseFloat(chOff);
1702             final int i = (int) f;
1703             if (i == f) {
1704                 chOff = Integer.toString(i);
1705             }
1706             else {
1707                 chOff = Float.toString(f);
1708             }
1709         }
1710         catch (final NumberFormatException e) {
1711             // Ignore.
1712         }
1713         getDomNodeOrDie().setAttribute("charOff", chOff);
1714     }
1715 
1716     /**
1717      * Returns this element's <tt>offsetLeft</tt>, which is the calculated left position of this
1718      * element relative to the <tt>offsetParent</tt>.
1719      *
1720      * @return this element's <tt>offsetLeft</tt>
1721      * @see <a href="http://msdn2.microsoft.com/en-us/library/ms534200.aspx">MSDN Documentation</a>
1722      * @see <a href="http://www.quirksmode.org/js/elementdimensions.html">Element Dimensions</a>
1723      * @see <a href="http://dump.testsuite.org/2006/dom/style/offset/spec">Reverse Engineering by Anne van Kesteren</a>
1724      */
1725     @JsxGetter
1726     public int getOffsetLeft() {
1727         if (this instanceof HTMLBodyElement) {
1728             return 0;
1729         }
1730 
1731         int left = 0;
1732         final HTMLElement offsetParent = getOffsetParent();
1733 
1734         // Add the offset for this node.
1735         DomNode node = getDomNodeOrDie();
1736         HTMLElement element = (HTMLElement) node.getScriptableObject();
1737         ComputedCSSStyleDeclaration style = element.getWindow().getComputedStyle(element, null);
1738         left += style.getLeft(true, false, false);
1739 
1740         // If this node is absolutely positioned, we're done.
1741         final String position = style.getPositionWithInheritance();
1742         if ("absolute".equals(position)) {
1743             return left;
1744         }
1745 
1746         // Add the offset for the ancestor nodes.
1747         node = node.getParentNode();
1748         while (node != null && node.getScriptableObject() != offsetParent) {
1749             if (node.getScriptableObject() instanceof HTMLElement) {
1750                 element = (HTMLElement) node.getScriptableObject();
1751                 style = element.getWindow().getComputedStyle(element, null);
1752                 left += style.getLeft(true, true, true);
1753             }
1754             node = node.getParentNode();
1755         }
1756 
1757         if (offsetParent != null) {
1758             style = offsetParent.getWindow().getComputedStyle(offsetParent, null);
1759             left += style.getMarginLeftValue();
1760             left += style.getPaddingLeftValue();
1761         }
1762 
1763         return left;
1764     }
1765 
1766     /**
1767      * Returns this element's X position.
1768      * @return this element's X position
1769      */
1770     public int getPosX() {
1771         int cumulativeOffset = 0;
1772         HTMLElement element = this;
1773         while (element != null) {
1774             cumulativeOffset += element.getOffsetLeft();
1775             if (element != this) {
1776                 final ComputedCSSStyleDeclaration style = element.getWindow().getComputedStyle(element, null);
1777                 cumulativeOffset += style.getBorderLeftValue();
1778             }
1779             element = element.getOffsetParent();
1780         }
1781         return cumulativeOffset;
1782     }
1783 
1784     /**
1785      * Returns this element's Y position.
1786      * @return this element's Y position
1787      */
1788     public int getPosY() {
1789         int cumulativeOffset = 0;
1790         HTMLElement element = this;
1791         while (element != null) {
1792             cumulativeOffset += element.getOffsetTop();
1793             if (element != this) {
1794                 final ComputedCSSStyleDeclaration style = element.getWindow().getComputedStyle(element, null);
1795                 cumulativeOffset += style.getBorderTopValue();
1796             }
1797             element = element.getOffsetParent();
1798         }
1799         return cumulativeOffset;
1800     }
1801 
1802     /**
1803      * Gets the offset parent or {@code null} if this is not an {@link HTMLElement}.
1804      * @return the offset parent or {@code null}
1805      */
1806     private HTMLElement getOffsetParent() {
1807         final Object offsetParent = getOffsetParentInternal(false);
1808         if (offsetParent instanceof HTMLElement) {
1809             return (HTMLElement) offsetParent;
1810         }
1811         return null;
1812     }
1813 
1814     /**
1815      * Returns this element's {@code offsetTop}, which is the calculated top position of this
1816      * element relative to the {@code offsetParent}.
1817      *
1818      * @return this element's {@code offsetTop}
1819      * @see <a href="http://msdn2.microsoft.com/en-us/library/ms534303.aspx">MSDN Documentation</a>
1820      * @see <a href="http://www.quirksmode.org/js/elementdimensions.html">Element Dimensions</a>
1821      * @see <a href="http://dump.testsuite.org/2006/dom/style/offset/spec">Reverse Engineering by Anne van Kesteren</a>
1822      */
1823     @JsxGetter
1824     public int getOffsetTop() {
1825         if (this instanceof HTMLBodyElement) {
1826             return 0;
1827         }
1828 
1829         int top = 0;
1830         final HTMLElement offsetParent = getOffsetParent();
1831 
1832         // Add the offset for this node.
1833         DomNode node = getDomNodeOrDie();
1834         HTMLElement element = (HTMLElement) node.getScriptableObject();
1835         ComputedCSSStyleDeclaration style = element.getWindow().getComputedStyle(element, null);
1836         top += style.getTop(true, false, false);
1837 
1838         // If this node is absolutely positioned, we're done.
1839         final String position = style.getPositionWithInheritance();
1840         if ("absolute".equals(position)) {
1841             return top;
1842         }
1843 
1844         // Add the offset for the ancestor nodes.
1845         node = node.getParentNode();
1846         while (node != null && node.getScriptableObject() != offsetParent) {
1847             if (node.getScriptableObject() instanceof HTMLElement) {
1848                 element = (HTMLElement) node.getScriptableObject();
1849                 style = element.getWindow().getComputedStyle(element, null);
1850                 top += style.getTop(false, true, true);
1851             }
1852             node = node.getParentNode();
1853         }
1854 
1855         if (offsetParent != null) {
1856             final HTMLElement thiz = (HTMLElement) getDomNodeOrDie().getScriptableObject();
1857             style = thiz.getWindow().getComputedStyle(thiz, null);
1858             final boolean thisElementHasTopMargin = style.getMarginTopValue() != 0;
1859 
1860             style = offsetParent.getWindow().getComputedStyle(offsetParent, null);
1861             if (!thisElementHasTopMargin) {
1862                 top += style.getMarginTopValue();
1863             }
1864             top += style.getPaddingTopValue();
1865         }
1866 
1867         return top;
1868     }
1869 
1870     /**
1871      * Returns this element's <tt>offsetParent</tt>. The <tt>offsetLeft</tt> and
1872      * <tt>offsetTop</tt> attributes are relative to the <tt>offsetParent</tt>.
1873      *
1874      * @return this element's <tt>offsetParent</tt>. This may be <code>undefined</code> when this node is
1875      * not attached or {@code null} for <code>body</code>.
1876      * @see <a href="http://msdn2.microsoft.com/en-us/library/ms534302.aspx">MSDN Documentation</a>
1877      * @see <a href="http://www.mozilla.org/docs/dom/domref/dom_el_ref20.html">Gecko DOM Reference</a>
1878      * @see <a href="http://www.quirksmode.org/js/elementdimensions.html">Element Dimensions</a>
1879      * @see <a href="http://www.w3.org/TR/REC-CSS2/box.html">Box Model</a>
1880      * @see <a href="http://dump.testsuite.org/2006/dom/style/offset/spec">Reverse Engineering by Anne van Kesteren</a>
1881      */
1882     @JsxGetter(propertyName = "offsetParent")
1883     public Object getOffsetParent_js() {
1884         return getOffsetParentInternal(getBrowserVersion().hasFeature(JS_OFFSET_PARENT_NULL_IF_FIXED));
1885     }
1886 
1887     private Object getOffsetParentInternal(final boolean returnNullIfFixed) {
1888         DomNode currentElement = getDomNodeOrDie();
1889 
1890         if (currentElement.getParentNode() == null) {
1891             return null;
1892         }
1893 
1894         Object offsetParent = null;
1895         final HTMLElement htmlElement = (HTMLElement) currentElement.getScriptableObject();
1896         if (returnNullIfFixed && "fixed".equals(htmlElement.getStyle().getStyleAttribute(
1897                 StyleAttributes.Definition.POSITION, true))) {
1898             return null;
1899         }
1900 
1901         final ComputedCSSStyleDeclaration style = htmlElement.getWindow().getComputedStyle(htmlElement, null);
1902         final String position = style.getPositionWithInheritance();
1903         final boolean staticPos = "static".equals(position);
1904 
1905         final boolean useTables = staticPos;
1906 
1907         while (currentElement != null) {
1908 
1909             final DomNode parentNode = currentElement.getParentNode();
1910             if (parentNode instanceof HtmlBody
1911                 || (useTables && parentNode instanceof HtmlTableDataCell)
1912                 || (useTables && parentNode instanceof HtmlTable)) {
1913                 offsetParent = parentNode.getScriptableObject();
1914                 break;
1915             }
1916 
1917             if (parentNode != null && parentNode.getScriptableObject() instanceof HTMLElement) {
1918                 final HTMLElement parentElement = (HTMLElement) parentNode.getScriptableObject();
1919                 final ComputedCSSStyleDeclaration parentStyle =
1920                             parentElement.getWindow().getComputedStyle(parentElement, null);
1921                 final String parentPosition = parentStyle.getPositionWithInheritance();
1922                 final boolean parentIsStatic = "static".equals(parentPosition);
1923                 if (!parentIsStatic) {
1924                     offsetParent = parentNode.getScriptableObject();
1925                     break;
1926                 }
1927             }
1928 
1929             currentElement = currentElement.getParentNode();
1930         }
1931 
1932         return offsetParent;
1933     }
1934 
1935     /**
1936      * {@inheritDoc}
1937      */
1938     @Override
1939     public ClientRect getBoundingClientRect() {
1940         final ClientRect textRectangle = super.getBoundingClientRect();
1941 
1942         int left = getPosX();
1943         int top = getPosY();
1944 
1945         // account for any scrolled ancestors
1946         Object parentNode = getOffsetParentInternal(false);
1947         while (parentNode != null
1948                 && (parentNode instanceof HTMLElement)
1949                 && !(parentNode instanceof HTMLBodyElement)) {
1950             final HTMLElement elem = (HTMLElement) parentNode;
1951             left -= elem.getScrollLeft();
1952             top -= elem.getScrollTop();
1953 
1954             parentNode = elem.getParentNode();
1955         }
1956 
1957         textRectangle.setBottom(top + getOffsetHeight());
1958         textRectangle.setLeft(left);
1959         textRectangle.setRight(left + getOffsetWidth());
1960         textRectangle.setTop(top);
1961 
1962         return textRectangle;
1963     }
1964 
1965     /**
1966      * Gets the token list of class attribute.
1967      * @return the token list of class attribute
1968      */
1969     @Override
1970     @JsxGetter
1971     public DOMTokenList getClassList() {
1972         return new DOMTokenList(this, "class");
1973     }
1974 
1975     /**
1976      * {@inheritDoc} Overridden to modify browser configurations.
1977      */
1978     @Override
1979     @JsxFunction
1980     public boolean hasAttribute(final String name) {
1981         return super.hasAttribute(name);
1982     }
1983 
1984     /**
1985      * {@inheritDoc} Overridden to modify browser configurations.
1986      */
1987     @Override
1988     @JsxGetter(IE)
1989     public HTMLCollection getChildren() {
1990         return super.getChildren();
1991     }
1992 
1993     /**
1994      * {@inheritDoc} Overridden to modify browser configurations.
1995      */
1996     @Override
1997     @JsxGetter
1998     public Element getParentElement() {
1999         return super.getParentElement();
2000     }
2001 
2002     /**
2003      * Returns the {@code dataset} attribute.
2004      * @return the {@code dataset} attribute
2005      */
2006     @JsxGetter({CHROME, FF,
2007         IE})
2008     public DOMStringMap getDataset() {
2009         return new DOMStringMap(this);
2010     }
2011 
2012     /**
2013      * {@inheritDoc}
2014      */
2015     @Override
2016     protected boolean isEndTagForbidden() {
2017         return endTagForbidden_;
2018     }
2019 
2020     /**
2021      * Returns whether the tag is lower case in .outerHTML/.innerHTML.
2022      * It seems to be a feature for HTML5 elements for IE.
2023      * @return whether the tag is lower case in .outerHTML/.innerHTML
2024      */
2025     protected boolean isLowerCaseInOuterHtml() {
2026         return false;
2027     }
2028 
2029     /**
2030      * Sets the {@code onchange} event handler for this element.
2031      * @param onchange the {@code onchange} event handler for this element
2032      */
2033     @JsxSetter
2034     public void setOnchange(final Object onchange) {
2035         setEventHandler("change", onchange);
2036     }
2037 
2038     /**
2039      * Returns the {@code onchange} event handler for this element.
2040      * @return the {@code onchange} event handler for this element
2041      */
2042     @JsxGetter
2043     public Function getOnchange() {
2044         return getEventHandler("change");
2045     }
2046 
2047     /**
2048      * Returns the {@code onsubmit} event handler for this element.
2049      * @return the {@code onsubmit} event handler for this element
2050      */
2051     @JsxGetter
2052     public Object getOnsubmit() {
2053         return getEventHandler("submit");
2054     }
2055 
2056     /**
2057      * Sets the {@code onsubmit} event handler for this element.
2058      * @param onsubmit the {@code onsubmit} event handler for this element
2059      */
2060     @JsxSetter
2061     public void setOnsubmit(final Object onsubmit) {
2062         setEventHandler("submit", onsubmit);
2063     }
2064 
2065     /**
2066      * Mock for the moment.
2067      * @param retargetToElement if true, all events are targeted directly to this element;
2068      * if false, events can also fire at descendants of this element
2069      */
2070     @JsxFunction({FF, IE})
2071     public void setCapture(final boolean retargetToElement) {
2072         // empty
2073     }
2074 
2075     /**
2076      * Mock for the moment.
2077      * @return true for success
2078      */
2079     @JsxFunction({FF, IE})
2080     public boolean releaseCapture() {
2081         return true;
2082     }
2083 
2084     /**
2085      * Returns the {@code contentEditable} property.
2086      * @return the {@code contentEditable} property
2087      */
2088     @JsxGetter
2089     public String getContentEditable() {
2090         final String attribute = getDomNodeOrDie().getAttribute("contentEditable");
2091         if (attribute == DomElement.ATTRIBUTE_NOT_DEFINED) {
2092             return "inherit";
2093         }
2094         if (attribute == DomElement.ATTRIBUTE_VALUE_EMPTY) {
2095             return "true";
2096         }
2097         return attribute;
2098     }
2099 
2100     /**
2101      * Sets the {@code contentEditable} property.
2102      * @param contentEditable the {@code contentEditable} property to set
2103      */
2104     @JsxSetter
2105     public void setContentEditable(final String contentEditable) {
2106         getDomNodeOrDie().setAttribute("contentEditable", contentEditable);
2107     }
2108 
2109     /**
2110      * Returns the {@code isContentEditable} property.
2111      * @return the {@code isContentEditable} property
2112      */
2113     @JsxGetter
2114     public boolean isIsContentEditable() {
2115         final String attribute = getContentEditable();
2116         if ("true".equals(attribute)) {
2117             return true;
2118         }
2119         else if ("inherit".equals(attribute)) {
2120             final DomNode parent = getDomNodeOrDie().getParentNode();
2121             if (parent != null) {
2122                 final Object parentScriptable = parent.getScriptableObject();
2123                 if (parentScriptable instanceof HTMLElement) {
2124                     return ((HTMLElement) parentScriptable).isIsContentEditable();
2125                 }
2126             }
2127         }
2128         return false;
2129     }
2130 
2131     /**
2132      * {@inheritDoc}
2133      */
2134     @Override
2135     @JsxGetter
2136     public CSSStyleDeclaration getStyle() {
2137         return super.getStyle();
2138     }
2139 
2140     /**
2141      * {@inheritDoc}
2142      */
2143     @Override
2144     @JsxSetter
2145     public void setStyle(final String style) {
2146         super.setStyle(style);
2147     }
2148 
2149     /**
2150      * Returns the runtime style object for this element.
2151      * @return the runtime style object for this element
2152      */
2153     @JsxGetter(IE)
2154     public CSSStyleDeclaration getRuntimeStyle() {
2155         return super.getStyle();
2156     }
2157 
2158     /**
2159      * Returns the current (calculated) style object for this element.
2160      * @return the current (calculated) style object for this element
2161      */
2162     @JsxGetter(IE)
2163     public ComputedCSSStyleDeclaration getCurrentStyle() {
2164         if (!getDomNodeOrDie().isAttachedToPage()) {
2165             return null;
2166         }
2167         return getWindow().getComputedStyle(this, null);
2168     }
2169 
2170     /**
2171      * Sets the {@code onclick} event handler for this element.
2172      * @param handler the {@code onclick} event handler for this element
2173      */
2174     @JsxSetter
2175     public void setOnclick(final Object handler) {
2176         setEventHandler("click", handler);
2177     }
2178 
2179     /**
2180      * Returns the {@code onclick} event handler for this element.
2181      * @return the {@code onclick} event handler for this element
2182      */
2183     @JsxGetter
2184     public Object getOnclick() {
2185         return getEventHandler("click");
2186     }
2187 
2188     /**
2189      * Sets the {@code ondblclick} event handler for this element.
2190      * @param handler the {@code ondblclick} event handler for this element
2191      */
2192     @JsxSetter
2193     public void setOndblclick(final Object handler) {
2194         setEventHandler("dblclick", handler);
2195     }
2196 
2197     /**
2198      * Returns the {@code ondblclick} event handler for this element.
2199      * @return the {@code ondblclick} event handler for this element
2200      */
2201     @JsxGetter
2202     public Object getOndblclick() {
2203         return getEventHandler("dblclick");
2204     }
2205 
2206     /**
2207      * Sets the {@code onblur} event handler for this element.
2208      * @param handler the {@code onblur} event handler for this element
2209      */
2210     @JsxSetter
2211     public void setOnblur(final Object handler) {
2212         setEventHandler("blur", handler);
2213     }
2214 
2215     /**
2216      * Returns the {@code onblur} event handler for this element.
2217      * @return the {@code onblur} event handler for this element
2218      */
2219     @JsxGetter
2220     public Object getOnblur() {
2221         return getEventHandler("blur");
2222     }
2223 
2224     /**
2225      * Sets the {@code onfocus} event handler for this element.
2226      * @param handler the {@code onfocus} event handler for this element
2227      */
2228     @JsxSetter
2229     public void setOnfocus(final Object handler) {
2230         setEventHandler("focus", handler);
2231     }
2232 
2233     /**
2234      * Returns the {@code onfocus} event handler for this element.
2235      * @return the {@code onfocus} event handler for this element
2236      */
2237     @JsxGetter
2238     public Object getOnfocus() {
2239         return getEventHandler("focus");
2240     }
2241 
2242     /**
2243      * Sets the {@code onfocusin} event handler for this element.
2244      * @param handler the {@code onfocusin} event handler for this element
2245      */
2246     @JsxSetter(IE)
2247     public void setOnfocusin(final Object handler) {
2248         setEventHandler("focusin", handler);
2249     }
2250 
2251     /**
2252      * Returns the {@code onfocusin} event handler for this element.
2253      * @return the {@code onfocusin} event handler for this element
2254      */
2255     @JsxGetter(IE)
2256     public Object getOnfocusin() {
2257         return getEventHandler("focusin");
2258     }
2259 
2260     /**
2261      * Sets the {@code onfocusout} event handler for this element.
2262      * @param handler the {@code onfocusout} event handler for this element
2263      */
2264     @JsxSetter(IE)
2265     public void setOnfocusout(final Object handler) {
2266         setEventHandler("focusout", handler);
2267     }
2268 
2269     /**
2270      * Returns the {@code onfocusout} event handler for this element.
2271      * @return the {@code onfocusout} event handler for this element
2272      */
2273     @JsxGetter(IE)
2274     public Object getOnfocusout() {
2275         return getEventHandler("focusout");
2276     }
2277 
2278     /**
2279      * Sets the {@code onkeydown} event handler for this element.
2280      * @param handler the {@code onkeydown} event handler for this element
2281      */
2282     @JsxSetter
2283     public void setOnkeydown(final Object handler) {
2284         setEventHandler("keydown", handler);
2285     }
2286 
2287     /**
2288      * Returns the {@code onkeydown} event handler for this element.
2289      * @return the {@code onkeydown} event handler for this element
2290      */
2291     @JsxGetter
2292     public Object getOnkeydown() {
2293         return getEventHandler("keydown");
2294     }
2295 
2296     /**
2297      * Sets the {@code onkeypress} event handler for this element.
2298      * @param handler the {@code onkeypress} event handler for this element
2299      */
2300     @JsxSetter
2301     public void setOnkeypress(final Object handler) {
2302         setEventHandler("keypress", handler);
2303     }
2304 
2305     /**
2306      * Returns the {@code onkeypress} event handler for this element.
2307      * @return the {@code onkeypress} event handler for this element
2308      */
2309     @JsxGetter
2310     public Object getOnkeypress() {
2311         return getEventHandler("keypress");
2312     }
2313 
2314     /**
2315      * Sets the {@code onkeyup} event handler for this element.
2316      * @param handler the {@code onkeyup} event handler for this element
2317      */
2318     @JsxSetter
2319     public void setOnkeyup(final Object handler) {
2320         setEventHandler("keyup", handler);
2321     }
2322 
2323     /**
2324      * Returns the {@code onkeyup} event handler for this element.
2325      * @return the {@code onkeyup} event handler for this element
2326      */
2327     @JsxGetter
2328     public Object getOnkeyup() {
2329         return getEventHandler("keyup");
2330     }
2331 
2332     /**
2333      * Sets the {@code onmousedown} event handler for this element.
2334      * @param handler the {@code onmousedown} event handler for this element
2335      */
2336     @JsxSetter
2337     public void setOnmousedown(final Object handler) {
2338         setEventHandler("mousedown", handler);
2339     }
2340 
2341     /**
2342      * Returns the {@code onmousedown} event handler for this element.
2343      * @return the {@code onmousedown} event handler for this element
2344      */
2345     @JsxGetter
2346     public Object getOnmousedown() {
2347         return getEventHandler("mousedown");
2348     }
2349 
2350     /**
2351      * Sets the {@code onmousemove} event handler for this element.
2352      * @param handler the {@code onmousemove} event handler for this element
2353      */
2354     @JsxSetter
2355     public void setOnmousemove(final Object handler) {
2356         setEventHandler("mousemove", handler);
2357     }
2358 
2359     /**
2360      * Returns the {@code onmousemove} event handler for this element.
2361      * @return the {@code onmousemove} event handler for this element
2362      */
2363     @JsxGetter
2364     public Object getOnmousemove() {
2365         return getEventHandler("mousemove");
2366     }
2367 
2368     /**
2369      * Sets the {@code onmouseout} event handler for this element.
2370      * @param handler the {@code onmouseout} event handler for this element
2371      */
2372     @JsxSetter
2373     public void setOnmouseout(final Object handler) {
2374         setEventHandler("mouseout", handler);
2375     }
2376 
2377     /**
2378      * Returns the {@code onmouseout} event handler for this element.
2379      * @return the {@code onmouseout} event handler for this element
2380      */
2381     @JsxGetter
2382     public Object getOnmouseout() {
2383         return getEventHandler("mouseout");
2384     }
2385 
2386     /**
2387      * Sets the {@code onmouseover} event handler for this element.
2388      * @param handler the {@code onmouseover} event handler for this element
2389      */
2390     @JsxSetter
2391     public void setOnmouseover(final Object handler) {
2392         setEventHandler("mouseover", handler);
2393     }
2394 
2395     /**
2396      * Returns the {@code onmouseover} event handler for this element.
2397      * @return the {@code onmouseover} event handler for this element
2398      */
2399     @JsxGetter
2400     public Object getOnmouseover() {
2401         return getEventHandler("mouseover");
2402     }
2403 
2404     /**
2405      * Sets the {@code onmouseup} event handler for this element.
2406      * @param handler the {@code onmouseup} event handler for this element
2407      */
2408     @JsxSetter
2409     public void setOnmouseup(final Object handler) {
2410         setEventHandler("mouseup", handler);
2411     }
2412 
2413     /**
2414      * Returns the {@code onmouseup} event handler for this element.
2415      * @return the {@code onmouseup} event handler for this element
2416      */
2417     @JsxGetter
2418     public Object getOnmouseup() {
2419         return getEventHandler("mouseup");
2420     }
2421 
2422     /**
2423      * Sets the {@code oncontextmenu} event handler for this element.
2424      * @param handler the {@code oncontextmenu} event handler for this element
2425      */
2426     @JsxSetter
2427     public void setOncontextmenu(final Object handler) {
2428         setEventHandler("contextmenu", handler);
2429     }
2430 
2431     /**
2432      * Returns the {@code oncontextmenu} event handler for this element.
2433      * @return the {@code oncontextmenu} event handler for this element
2434      */
2435     @JsxGetter
2436     public Object getOncontextmenu() {
2437         return getEventHandler("contextmenu");
2438     }
2439 
2440     /**
2441      * Sets the {@code onresize} event handler for this element.
2442      * @param handler the {@code onresize} event handler for this element
2443      */
2444     @JsxSetter({CHROME, FF})
2445     public void setOnresize(final Object handler) {
2446         setEventHandler("resize", handler);
2447     }
2448 
2449     /**
2450      * Returns the {@code onresize} event handler for this element.
2451      * @return the {@code onresize} event handler for this element
2452      */
2453     @JsxGetter({CHROME, FF})
2454     public Function getOnresize() {
2455         return getEventHandler("resize");
2456     }
2457 
2458     /**
2459      * Sets the {@code onerror} event handler for this element.
2460      * @param handler the {@code onerror} event handler for this element
2461      */
2462     @JsxSetter
2463     public void setOnerror(final Object handler) {
2464         setEventHandler("error", handler);
2465     }
2466 
2467     /**
2468      * Returns the {@code onerror} event handler for this element.
2469      * @return the {@code onerror} event handler for this element
2470      */
2471     @JsxGetter
2472     public Object getOnerror() {
2473         return getEventHandler("error");
2474     }
2475 
2476     /**
2477      * Returns the {@code oninput} event handler for this element.
2478      * @return the {@code oninput} event handler for this element
2479      */
2480     @JsxGetter
2481     public Function getOninput() {
2482         return getEventHandler("input");
2483     }
2484 
2485     /**
2486      * Sets the {@code oninput} event handler for this element.
2487      * @param oninput the {@code oninput} event handler for this element
2488      */
2489     @JsxSetter
2490     public void setOninput(final Object oninput) {
2491         setEventHandler("input", oninput);
2492     }
2493 
2494     /**
2495      * {@inheritDoc}
2496      */
2497     @Override
2498     @JsxFunction(IE)
2499     public boolean contains(final Object element) {
2500         return super.contains(element);
2501     }
2502 
2503     /**
2504      * Returns the {@code hidden} property.
2505      * @return the {@code hidden} property
2506      */
2507     @JsxGetter
2508     public boolean isHidden() {
2509         return getDomNodeOrDie().hasAttribute("hidden");
2510     }
2511 
2512     /**
2513      * Sets the {@code hidden} property.
2514      * @param hidden the {@code hidden} value
2515      */
2516     @JsxSetter
2517     public void setHidden(final boolean hidden) {
2518         if (hidden) {
2519             getDomNodeOrDie().setAttribute("hidden", "hidden");
2520         }
2521         else {
2522             getDomNodeOrDie().removeAttribute("hidden");
2523         }
2524     }
2525 
2526     /**
2527      * {@inheritDoc}
2528      */
2529     @Override
2530     @JsxGetter(IE)
2531     public String getId() {
2532         return super.getId();
2533     }
2534 
2535     /**
2536      * {@inheritDoc}
2537      */
2538     @Override
2539     @JsxSetter(IE)
2540     public void setId(final String newId) {
2541         super.setId(newId);
2542     }
2543 
2544     /**
2545      * Returns the {@code onabort} event handler for this element.
2546      * @return the {@code onabort} event handler for this element
2547      */
2548     @JsxGetter
2549     public Function getOnabort() {
2550         return getEventHandler("abort");
2551     }
2552 
2553     /**
2554      * Sets the {@code onabort} event handler for this element.
2555      * @param onabort the {@code onabort} event handler for this element
2556      */
2557     @JsxSetter
2558     public void setOnabort(final Object onabort) {
2559         setEventHandler("abort", onabort);
2560     }
2561 
2562     /**
2563      * Returns the {@code onauxclick} event handler for this element.
2564      * @return the {@code onauxclick} event handler for this element
2565      */
2566     @JsxGetter(CHROME)
2567     public Function getOnauxclick() {
2568         return getEventHandler("auxclick");
2569     }
2570 
2571     /**
2572      * Sets the {@code onauxclick} event handler for this element.
2573      * @param onauxclick the {@code onauxclick} event handler for this element
2574      */
2575     @JsxSetter(CHROME)
2576     public void setOnauxclick(final Object onauxclick) {
2577         setEventHandler("auxclick", onauxclick);
2578     }
2579 
2580     /**
2581      * Returns the {@code oncancel} event handler for this element.
2582      * @return the {@code oncancel} event handler for this element
2583      */
2584     @JsxGetter(CHROME)
2585     public Function getOncancel() {
2586         return getEventHandler("cancel");
2587     }
2588 
2589     /**
2590      * Sets the {@code oncancel} event handler for this element.
2591      * @param oncancel the {@code oncancel} event handler for this element
2592      */
2593     @JsxSetter(CHROME)
2594     public void setOncancel(final Object oncancel) {
2595         setEventHandler("cancel", oncancel);
2596     }
2597 
2598     /**
2599      * Returns the {@code oncanplay} event handler for this element.
2600      * @return the {@code oncanplay} event handler for this element
2601      */
2602     @JsxGetter
2603     public Function getOncanplay() {
2604         return getEventHandler("canplay");
2605     }
2606 
2607     /**
2608      * Sets the {@code oncanplay} event handler for this element.
2609      * @param oncanplay the {@code oncanplay} event handler for this element
2610      */
2611     @JsxSetter
2612     public void setOncanplay(final Object oncanplay) {
2613         setEventHandler("canplay", oncanplay);
2614     }
2615 
2616     /**
2617      * Returns the {@code oncanplaythrough} event handler for this element.
2618      * @return the {@code oncanplaythrough} event handler for this element
2619      */
2620     @JsxGetter
2621     public Function getOncanplaythrough() {
2622         return getEventHandler("canplaythrough");
2623     }
2624 
2625     /**
2626      * Sets the {@code oncanplaythrough} event handler for this element.
2627      * @param oncanplaythrough the {@code oncanplaythrough} event handler for this element
2628      */
2629     @JsxSetter
2630     public void setOncanplaythrough(final Object oncanplaythrough) {
2631         setEventHandler("canplaythrough", oncanplaythrough);
2632     }
2633 
2634     /**
2635      * Returns the {@code onclose} event handler for this element.
2636      * @return the {@code onclose} event handler for this element
2637      */
2638     @JsxGetter(CHROME)
2639     public Function getOnclose() {
2640         return getEventHandler("close");
2641     }
2642 
2643     /**
2644      * Sets the {@code onclose} event handler for this element.
2645      * @param onclose the {@code onclose} event handler for this element
2646      */
2647     @JsxSetter(CHROME)
2648     public void setOnclose(final Object onclose) {
2649         setEventHandler("close", onclose);
2650     }
2651 
2652     /**
2653      * Returns the {@code oncuechange} event handler for this element.
2654      * @return the {@code oncuechange} event handler for this element
2655      */
2656     @JsxGetter({CHROME, IE})
2657     public Function getOncuechange() {
2658         return getEventHandler("cuechange");
2659     }
2660 
2661     /**
2662      * Sets the {@code oncuechange} event handler for this element.
2663      * @param oncuechange the {@code oncuechange} event handler for this element
2664      */
2665     @JsxSetter({CHROME, IE})
2666     public void setOncuechange(final Object oncuechange) {
2667         setEventHandler("cuechange", oncuechange);
2668     }
2669 
2670     /**
2671      * Returns the {@code ondrag} event handler for this element.
2672      * @return the {@code ondrag} event handler for this element
2673      */
2674     @JsxGetter
2675     public Function getOndrag() {
2676         return getEventHandler("drag");
2677     }
2678 
2679     /**
2680      * Sets the {@code ondrag} event handler for this element.
2681      * @param ondrag the {@code ondrag} event handler for this element
2682      */
2683     @JsxSetter
2684     public void setOndrag(final Object ondrag) {
2685         setEventHandler("drag", ondrag);
2686     }
2687 
2688     /**
2689      * Returns the {@code ondragend} event handler for this element.
2690      * @return the {@code ondragend} event handler for this element
2691      */
2692     @JsxGetter
2693     public Function getOndragend() {
2694         return getEventHandler("dragend");
2695     }
2696 
2697     /**
2698      * Sets the {@code ondragend} event handler for this element.
2699      * @param ondragend the {@code ondragend} event handler for this element
2700      */
2701     @JsxSetter
2702     public void setOndragend(final Object ondragend) {
2703         setEventHandler("dragend", ondragend);
2704     }
2705 
2706     /**
2707      * Returns the {@code ondragenter} event handler for this element.
2708      * @return the {@code ondragenter} event handler for this element
2709      */
2710     @JsxGetter
2711     public Function getOndragenter() {
2712         return getEventHandler("dragenter");
2713     }
2714 
2715     /**
2716      * Sets the {@code ondragenter} event handler for this element.
2717      * @param ondragenter the {@code ondragenter} event handler for this element
2718      */
2719     @JsxSetter
2720     public void setOndragenter(final Object ondragenter) {
2721         setEventHandler("dragenter", ondragenter);
2722     }
2723 
2724     /**
2725      * Returns the {@code ondragleave} event handler for this element.
2726      * @return the {@code ondragleave} event handler for this element
2727      */
2728     @JsxGetter
2729     public Function getOndragleave() {
2730         return getEventHandler("dragleave");
2731     }
2732 
2733     /**
2734      * Sets the {@code ondragleave} event handler for this element.
2735      * @param ondragleave the {@code ondragleave} event handler for this element
2736      */
2737     @JsxSetter
2738     public void setOndragleave(final Object ondragleave) {
2739         setEventHandler("dragleave", ondragleave);
2740     }
2741 
2742     /**
2743      * Returns the {@code ondragover} event handler for this element.
2744      * @return the {@code ondragover} event handler for this element
2745      */
2746     @JsxGetter
2747     public Function getOndragover() {
2748         return getEventHandler("dragover");
2749     }
2750 
2751     /**
2752      * Sets the {@code ondragover} event handler for this element.
2753      * @param ondragover the {@code ondragover} event handler for this element
2754      */
2755     @JsxSetter
2756     public void setOndragover(final Object ondragover) {
2757         setEventHandler("dragover", ondragover);
2758     }
2759 
2760     /**
2761      * Returns the {@code ondragstart} event handler for this element.
2762      * @return the {@code ondragstart} event handler for this element
2763      */
2764     @JsxGetter
2765     public Function getOndragstart() {
2766         return getEventHandler("dragstart");
2767     }
2768 
2769     /**
2770      * Sets the {@code ondragstart} event handler for this element.
2771      * @param ondragstart the {@code ondragstart} event handler for this element
2772      */
2773     @JsxSetter
2774     public void setOndragstart(final Object ondragstart) {
2775         setEventHandler("dragstart", ondragstart);
2776     }
2777 
2778     /**
2779      * Returns the {@code ondrop} event handler for this element.
2780      * @return the {@code ondrop} event handler for this element
2781      */
2782     @JsxGetter
2783     public Function getOndrop() {
2784         return getEventHandler("drop");
2785     }
2786 
2787     /**
2788      * Sets the {@code ondrop} event handler for this element.
2789      * @param ondrop the {@code ondrop} event handler for this element
2790      */
2791     @JsxSetter
2792     public void setOndrop(final Object ondrop) {
2793         setEventHandler("drop", ondrop);
2794     }
2795 
2796     /**
2797      * Returns the {@code ondurationchange} event handler for this element.
2798      * @return the {@code ondurationchange} event handler for this element
2799      */
2800     @JsxGetter
2801     public Function getOndurationchange() {
2802         return getEventHandler("durationchange");
2803     }
2804 
2805     /**
2806      * Sets the {@code ondurationchange} event handler for this element.
2807      * @param ondurationchange the {@code ondurationchange} event handler for this element
2808      */
2809     @JsxSetter
2810     public void setOndurationchange(final Object ondurationchange) {
2811         setEventHandler("durationchange", ondurationchange);
2812     }
2813 
2814     /**
2815      * Returns the {@code onemptied} event handler for this element.
2816      * @return the {@code onemptied} event handler for this element
2817      */
2818     @JsxGetter
2819     public Function getOnemptied() {
2820         return getEventHandler("emptied");
2821     }
2822 
2823     /**
2824      * Sets the {@code onemptied} event handler for this element.
2825      * @param onemptied the {@code onemptied} event handler for this element
2826      */
2827     @JsxSetter
2828     public void setOnemptied(final Object onemptied) {
2829         setEventHandler("emptied", onemptied);
2830     }
2831 
2832     /**
2833      * Returns the {@code onended} event handler for this element.
2834      * @return the {@code onended} event handler for this element
2835      */
2836     @JsxGetter
2837     public Function getOnended() {
2838         return getEventHandler("ended");
2839     }
2840 
2841     /**
2842      * Sets the {@code onended} event handler for this element.
2843      * @param onended the {@code onended} event handler for this element
2844      */
2845     @JsxSetter
2846     public void setOnended(final Object onended) {
2847         setEventHandler("ended", onended);
2848     }
2849 
2850     /**
2851      * Returns the {@code ongotpointercapture} event handler for this element.
2852      * @return the {@code ongotpointercapture} event handler for this element
2853      */
2854     @Override
2855     @JsxGetter(CHROME)
2856     public Function getOngotpointercapture() {
2857         return getEventHandler("gotpointercapture");
2858     }
2859 
2860     /**
2861      * Sets the {@code ongotpointercapture} event handler for this element.
2862      * @param ongotpointercapture the {@code ongotpointercapture} event handler for this element
2863      */
2864     @Override
2865     @JsxSetter(CHROME)
2866     public void setOngotpointercapture(final Object ongotpointercapture) {
2867         setEventHandler("gotpointercapture", ongotpointercapture);
2868     }
2869 
2870     /**
2871      * Returns the {@code oninvalid} event handler for this element.
2872      * @return the {@code oninvalid} event handler for this element
2873      */
2874     @JsxGetter({CHROME, FF})
2875     public Function getOninvalid() {
2876         return getEventHandler("invalid");
2877     }
2878 
2879     /**
2880      * Sets the {@code oninvalid} event handler for this element.
2881      * @param oninvalid the {@code oninvalid} event handler for this element
2882      */
2883     @JsxSetter({CHROME, FF})
2884     public void setOninvalid(final Object oninvalid) {
2885         setEventHandler("invalid", oninvalid);
2886     }
2887 
2888     /**
2889      * Returns the {@code onload} event handler for this element.
2890      * @return the {@code onload} event handler for this element
2891      */
2892     @JsxGetter
2893     public Function getOnload() {
2894         return getEventHandler("load");
2895     }
2896 
2897     /**
2898      * Sets the {@code onload} event handler for this element.
2899      * @param onload the {@code onload} event handler for this element
2900      */
2901     @JsxSetter
2902     public void setOnload(final Object onload) {
2903         setEventHandler("load", onload);
2904     }
2905 
2906     /**
2907      * Returns the {@code onloadeddata} event handler for this element.
2908      * @return the {@code onloadeddata} event handler for this element
2909      */
2910     @JsxGetter
2911     public Function getOnloadeddata() {
2912         return getEventHandler("loadeddata");
2913     }
2914 
2915     /**
2916      * Sets the {@code onloadeddata} event handler for this element.
2917      * @param onloadeddata the {@code onloadeddata} event handler for this element
2918      */
2919     @JsxSetter
2920     public void setOnloadeddata(final Object onloadeddata) {
2921         setEventHandler("loadeddata", onloadeddata);
2922     }
2923 
2924     /**
2925      * Returns the {@code onloadedmetadata} event handler for this element.
2926      * @return the {@code onloadedmetadata} event handler for this element
2927      */
2928     @JsxGetter
2929     public Function getOnloadedmetadata() {
2930         return getEventHandler("loadedmetadata");
2931     }
2932 
2933     /**
2934      * Sets the {@code onloadedmetadata} event handler for this element.
2935      * @param onloadedmetadata the {@code onloadedmetadata} event handler for this element
2936      */
2937     @JsxSetter
2938     public void setOnloadedmetadata(final Object onloadedmetadata) {
2939         setEventHandler("loadedmetadata", onloadedmetadata);
2940     }
2941 
2942     /**
2943      * Returns the {@code onloadstart} event handler for this element.
2944      * @return the {@code onloadstart} event handler for this element
2945      */
2946     @JsxGetter
2947     public Function getOnloadstart() {
2948         return getEventHandler("loadstart");
2949     }
2950 
2951     /**
2952      * Sets the {@code onloadstart} event handler for this element.
2953      * @param onloadstart the {@code onloadstart} event handler for this element
2954      */
2955     @JsxSetter
2956     public void setOnloadstart(final Object onloadstart) {
2957         setEventHandler("loadstart", onloadstart);
2958     }
2959 
2960     /**
2961      * Returns the {@code onlostpointercapture} event handler for this element.
2962      * @return the {@code onlostpointercapture} event handler for this element
2963      */
2964     @Override
2965     @JsxGetter(CHROME)
2966     public Function getOnlostpointercapture() {
2967         return getEventHandler("lostpointercapture");
2968     }
2969 
2970     /**
2971      * Sets the {@code onlostpointercapture} event handler for this element.
2972      * @param onlostpointercapture the {@code onlostpointercapture} event handler for this element
2973      */
2974     @Override
2975     @JsxSetter(CHROME)
2976     public void setOnlostpointercapture(final Object onlostpointercapture) {
2977         setEventHandler("lostpointercapture", onlostpointercapture);
2978     }
2979 
2980     /**
2981      * Returns the {@code onmouseenter} event handler for this element.
2982      * @return the {@code onmouseenter} event handler for this element
2983      */
2984     @JsxGetter
2985     public Function getOnmouseenter() {
2986         return getEventHandler("mouseenter");
2987     }
2988 
2989     /**
2990      * Sets the {@code onmouseenter} event handler for this element.
2991      * @param onmouseenter the {@code onmouseenter} event handler for this element
2992      */
2993     @JsxSetter
2994     public void setOnmouseenter(final Object onmouseenter) {
2995         setEventHandler("mouseenter", onmouseenter);
2996     }
2997 
2998     /**
2999      * Returns the {@code onmouseleave} event handler for this element.
3000      * @return the {@code onmouseleave} event handler for this element
3001      */
3002     @JsxGetter
3003     public Function getOnmouseleave() {
3004         return getEventHandler("mouseleave");
3005     }
3006 
3007     /**
3008      * Sets the {@code onmouseleave} event handler for this element.
3009      * @param onmouseleave the {@code onmouseleave} event handler for this element
3010      */
3011     @JsxSetter
3012     public void setOnmouseleave(final Object onmouseleave) {
3013         setEventHandler("mouseleave", onmouseleave);
3014     }
3015 
3016     /**
3017      * Returns the {@code onmousewheel} event handler for this element.
3018      * @return the {@code onmousewheel} event handler for this element
3019      */
3020     @JsxGetter({CHROME, IE})
3021     public Function getOnmousewheel() {
3022         return getEventHandler("mousewheel");
3023     }
3024 
3025     /**
3026      * Sets the {@code onmousewheel} event handler for this element.
3027      * @param onmousewheel the {@code onmousewheel} event handler for this element
3028      */
3029     @JsxSetter({CHROME, IE})
3030     public void setOnmousewheel(final Object onmousewheel) {
3031         setEventHandler("mousewheel", onmousewheel);
3032     }
3033 
3034     /**
3035      * Returns the {@code onpause} event handler for this element.
3036      * @return the {@code onpause} event handler for this element
3037      */
3038     @JsxGetter
3039     public Function getOnpause() {
3040         return getEventHandler("pause");
3041     }
3042 
3043     /**
3044      * Sets the {@code onpause} event handler for this element.
3045      * @param onpause the {@code onpause} event handler for this element
3046      */
3047     @JsxSetter
3048     public void setOnpause(final Object onpause) {
3049         setEventHandler("pause", onpause);
3050     }
3051 
3052     /**
3053      * Returns the {@code onplay} event handler for this element.
3054      * @return the {@code onplay} event handler for this element
3055      */
3056     @JsxGetter
3057     public Function getOnplay() {
3058         return getEventHandler("play");
3059     }
3060 
3061     /**
3062      * Sets the {@code onplay} event handler for this element.
3063      * @param onplay the {@code onplay} event handler for this element
3064      */
3065     @JsxSetter
3066     public void setOnplay(final Object onplay) {
3067         setEventHandler("play", onplay);
3068     }
3069 
3070     /**
3071      * Returns the {@code onplaying} event handler for this element.
3072      * @return the {@code onplaying} event handler for this element
3073      */
3074     @JsxGetter
3075     public Function getOnplaying() {
3076         return getEventHandler("playing");
3077     }
3078 
3079     /**
3080      * Sets the {@code onplaying} event handler for this element.
3081      * @param onplaying the {@code onplaying} event handler for this element
3082      */
3083     @JsxSetter
3084     public void setOnplaying(final Object onplaying) {
3085         setEventHandler("playing", onplaying);
3086     }
3087 
3088     /**
3089      * Returns the {@code onpointercancel} event handler for this element.
3090      * @return the {@code onpointercancel} event handler for this element
3091      */
3092     @Override
3093     @JsxGetter(CHROME)
3094     public Function getOnpointercancel() {
3095         return getEventHandler("pointercancel");
3096     }
3097 
3098     /**
3099      * Sets the {@code onpointercancel} event handler for this element.
3100      * @param onpointercancel the {@code onpointercancel} event handler for this element
3101      */
3102     @Override
3103     @JsxSetter(CHROME)
3104     public void setOnpointercancel(final Object onpointercancel) {
3105         setEventHandler("pointercancel", onpointercancel);
3106     }
3107 
3108     /**
3109      * Returns the {@code onpointerdown} event handler for this element.
3110      * @return the {@code onpointerdown} event handler for this element
3111      */
3112     @Override
3113     @JsxGetter(CHROME)
3114     public Function getOnpointerdown() {
3115         return getEventHandler("pointerdown");
3116     }
3117 
3118     /**
3119      * Sets the {@code onpointerdown} event handler for this element.
3120      * @param onpointerdown the {@code onpointerdown} event handler for this element
3121      */
3122     @Override
3123     @JsxSetter(CHROME)
3124     public void setOnpointerdown(final Object onpointerdown) {
3125         setEventHandler("pointerdown", onpointerdown);
3126     }
3127 
3128     /**
3129      * Returns the {@code onpointerenter} event handler for this element.
3130      * @return the {@code onpointerenter} event handler for this element
3131      */
3132     @Override
3133     @JsxGetter(CHROME)
3134     public Function getOnpointerenter() {
3135         return getEventHandler("pointerenter");
3136     }
3137 
3138     /**
3139      * Sets the {@code onpointerenter} event handler for this element.
3140      * @param onpointerenter the {@code onpointerenter} event handler for this element
3141      */
3142     @Override
3143     @JsxSetter(CHROME)
3144     public void setOnpointerenter(final Object onpointerenter) {
3145         setEventHandler("pointerenter", onpointerenter);
3146     }
3147 
3148     /**
3149      * Returns the {@code onpointerleave} event handler for this element.
3150      * @return the {@code onpointerleave} event handler for this element
3151      */
3152     @Override
3153     @JsxGetter(CHROME)
3154     public Function getOnpointerleave() {
3155         return getEventHandler("pointerleave");
3156     }
3157 
3158     /**
3159      * Sets the {@code onpointerleave} event handler for this element.
3160      * @param onpointerleave the {@code onpointerleave} event handler for this element
3161      */
3162     @Override
3163     @JsxSetter(CHROME)
3164     public void setOnpointerleave(final Object onpointerleave) {
3165         setEventHandler("pointerleave", onpointerleave);
3166     }
3167 
3168     /**
3169      * Returns the {@code onpointermove} event handler for this element.
3170      * @return the {@code onpointermove} event handler for this element
3171      */
3172     @Override
3173     @JsxGetter(CHROME)
3174     public Function getOnpointermove() {
3175         return getEventHandler("pointermove");
3176     }
3177 
3178     /**
3179      * Sets the {@code onpointermove} event handler for this element.
3180      * @param onpointermove the {@code onpointermove} event handler for this element
3181      */
3182     @Override
3183     @JsxSetter(CHROME)
3184     public void setOnpointermove(final Object onpointermove) {
3185         setEventHandler("pointermove", onpointermove);
3186     }
3187 
3188     /**
3189      * Returns the {@code onpointerout} event handler for this element.
3190      * @return the {@code onpointerout} event handler for this element
3191      */
3192     @Override
3193     @JsxGetter(CHROME)
3194     public Function getOnpointerout() {
3195         return getEventHandler("pointerout");
3196     }
3197 
3198     /**
3199      * Sets the {@code onpointerout} event handler for this element.
3200      * @param onpointerout the {@code onpointerout} event handler for this element
3201      */
3202     @Override
3203     @JsxSetter(CHROME)
3204     public void setOnpointerout(final Object onpointerout) {
3205         setEventHandler("pointerout", onpointerout);
3206     }
3207 
3208     /**
3209      * Returns the {@code onpointerover} event handler for this element.
3210      * @return the {@code onpointerover} event handler for this element
3211      */
3212     @Override
3213     @JsxGetter(CHROME)
3214     public Function getOnpointerover() {
3215         return getEventHandler("pointerover");
3216     }
3217 
3218     /**
3219      * Sets the {@code onpointerover} event handler for this element.
3220      * @param onpointerover the {@code onpointerover} event handler for this element
3221      */
3222     @Override
3223     @JsxSetter(CHROME)
3224     public void setOnpointerover(final Object onpointerover) {
3225         setEventHandler("pointerover", onpointerover);
3226     }
3227 
3228     /**
3229      * Returns the {@code onpointerup} event handler for this element.
3230      * @return the {@code onpointerup} event handler for this element
3231      */
3232     @Override
3233     @JsxGetter(CHROME)
3234     public Function getOnpointerup() {
3235         return getEventHandler("pointerup");
3236     }
3237 
3238     /**
3239      * Sets the {@code onpointerup} event handler for this element.
3240      * @param onpointerup the {@code onpointerup} event handler for this element
3241      */
3242     @Override
3243     @JsxSetter(CHROME)
3244     public void setOnpointerup(final Object onpointerup) {
3245         setEventHandler("pointerup", onpointerup);
3246     }
3247 
3248     /**
3249      * Returns the {@code onprogress} event handler for this element.
3250      * @return the {@code onprogress} event handler for this element
3251      */
3252     @JsxGetter
3253     public Function getOnprogress() {
3254         return getEventHandler("progress");
3255     }
3256 
3257     /**
3258      * Sets the {@code onprogress} event handler for this element.
3259      * @param onprogress the {@code onprogress} event handler for this element
3260      */
3261     @JsxSetter
3262     public void setOnprogress(final Object onprogress) {
3263         setEventHandler("progress", onprogress);
3264     }
3265 
3266     /**
3267      * Returns the {@code onratechange} event handler for this element.
3268      * @return the {@code onratechange} event handler for this element
3269      */
3270     @JsxGetter
3271     public Function getOnratechange() {
3272         return getEventHandler("ratechange");
3273     }
3274 
3275     /**
3276      * Sets the {@code onratechange} event handler for this element.
3277      * @param onratechange the {@code onratechange} event handler for this element
3278      */
3279     @JsxSetter
3280     public void setOnratechange(final Object onratechange) {
3281         setEventHandler("ratechange", onratechange);
3282     }
3283 
3284     /**
3285      * Returns the {@code onreset} event handler for this element.
3286      * @return the {@code onreset} event handler for this element
3287      */
3288     @JsxGetter
3289     public Function getOnreset() {
3290         return getEventHandler("reset");
3291     }
3292 
3293     /**
3294      * Sets the {@code onreset} event handler for this element.
3295      * @param onreset the {@code onreset} event handler for this element
3296      */
3297     @JsxSetter
3298     public void setOnreset(final Object onreset) {
3299         setEventHandler("reset", onreset);
3300     }
3301 
3302     /**
3303      * Returns the {@code onscroll} event handler for this element.
3304      * @return the {@code onscroll} event handler for this element
3305      */
3306     @JsxGetter
3307     public Function getOnscroll() {
3308         return getEventHandler("scroll");
3309     }
3310 
3311     /**
3312      * Sets the {@code onscroll} event handler for this element.
3313      * @param onscroll the {@code onscroll} event handler for this element
3314      */
3315     @JsxSetter
3316     public void setOnscroll(final Object onscroll) {
3317         setEventHandler("scroll", onscroll);
3318     }
3319 
3320     /**
3321      * Returns the {@code onseeked} event handler for this element.
3322      * @return the {@code onseeked} event handler for this element
3323      */
3324     @JsxGetter
3325     public Function getOnseeked() {
3326         return getEventHandler("seeked");
3327     }
3328 
3329     /**
3330      * Sets the {@code onseeked} event handler for this element.
3331      * @param onseeked the {@code onseeked} event handler for this element
3332      */
3333     @JsxSetter
3334     public void setOnseeked(final Object onseeked) {
3335         setEventHandler("seeked", onseeked);
3336     }
3337 
3338     /**
3339      * Returns the {@code onseeking} event handler for this element.
3340      * @return the {@code onseeking} event handler for this element
3341      */
3342     @JsxGetter
3343     public Function getOnseeking() {
3344         return getEventHandler("seeking");
3345     }
3346 
3347     /**
3348      * Sets the {@code onseeking} event handler for this element.
3349      * @param onseeking the {@code onseeking} event handler for this element
3350      */
3351     @JsxSetter
3352     public void setOnseeking(final Object onseeking) {
3353         setEventHandler("seeking", onseeking);
3354     }
3355 
3356     /**
3357      * Returns the {@code onselect} event handler for this element.
3358      * @return the {@code onselect} event handler for this element
3359      */
3360     @JsxGetter
3361     public Function getOnselect() {
3362         return getEventHandler("select");
3363     }
3364 
3365     /**
3366      * Sets the {@code onselect} event handler for this element.
3367      * @param onselect the {@code onselect} event handler for this element
3368      */
3369     @JsxSetter
3370     public void setOnselect(final Object onselect) {
3371         setEventHandler("select", onselect);
3372     }
3373 
3374     /**
3375      * Returns the {@code onshow} event handler for this element.
3376      * @return the {@code onshow} event handler for this element
3377      */
3378     @JsxGetter({CHROME, FF})
3379     public Function getOnshow() {
3380         return getEventHandler("show");
3381     }
3382 
3383     /**
3384      * Sets the {@code onshow} event handler for this element.
3385      * @param onshow the {@code onshow} event handler for this element
3386      */
3387     @JsxSetter({CHROME, FF})
3388     public void setOnshow(final Object onshow) {
3389         setEventHandler("show", onshow);
3390     }
3391 
3392     /**
3393      * Returns the {@code onstalled} event handler for this element.
3394      * @return the {@code onstalled} event handler for this element
3395      */
3396     @JsxGetter
3397     public Function getOnstalled() {
3398         return getEventHandler("stalled");
3399     }
3400 
3401     /**
3402      * Sets the {@code onstalled} event handler for this element.
3403      * @param onstalled the {@code onstalled} event handler for this element
3404      */
3405     @JsxSetter
3406     public void setOnstalled(final Object onstalled) {
3407         setEventHandler("stalled", onstalled);
3408     }
3409 
3410     /**
3411      * Returns the {@code onsuspend} event handler for this element.
3412      * @return the {@code onsuspend} event handler for this element
3413      */
3414     @JsxGetter
3415     public Function getOnsuspend() {
3416         return getEventHandler("suspend");
3417     }
3418 
3419     /**
3420      * Sets the {@code onsuspend} event handler for this element.
3421      * @param onsuspend the {@code onsuspend} event handler for this element
3422      */
3423     @JsxSetter
3424     public void setOnsuspend(final Object onsuspend) {
3425         setEventHandler("suspend", onsuspend);
3426     }
3427 
3428     /**
3429      * Returns the {@code ontimeupdate} event handler for this element.
3430      * @return the {@code ontimeupdate} event handler for this element
3431      */
3432     @JsxGetter
3433     public Function getOntimeupdate() {
3434         return getEventHandler("timeupdate");
3435     }
3436 
3437     /**
3438      * Sets the {@code ontimeupdate} event handler for this element.
3439      * @param ontimeupdate the {@code ontimeupdate} event handler for this element
3440      */
3441     @JsxSetter
3442     public void setOntimeupdate(final Object ontimeupdate) {
3443         setEventHandler("timeupdate", ontimeupdate);
3444     }
3445 
3446     /**
3447      * Returns the {@code ontoggle} event handler for this element.
3448      * @return the {@code ontoggle} event handler for this element
3449      */
3450     @JsxGetter({CHROME, FF52})
3451     public Function getOntoggle() {
3452         return getEventHandler("toggle");
3453     }
3454 
3455     /**
3456      * Sets the {@code ontoggle} event handler for this element.
3457      * @param ontoggle the {@code ontoggle} event handler for this element
3458      */
3459     @JsxSetter({CHROME, FF52})
3460     public void setOntoggle(final Object ontoggle) {
3461         setEventHandler("toggle", ontoggle);
3462     }
3463 
3464     /**
3465      * Returns the {@code onvolumechange} event handler for this element.
3466      * @return the {@code onvolumechange} event handler for this element
3467      */
3468     @JsxGetter
3469     public Function getOnvolumechange() {
3470         return getEventHandler("volumechange");
3471     }
3472 
3473     /**
3474      * Sets the {@code onvolumechange} event handler for this element.
3475      * @param onvolumechange the {@code onvolumechange} event handler for this element
3476      */
3477     @JsxSetter
3478     public void setOnvolumechange(final Object onvolumechange) {
3479         setEventHandler("volumechange", onvolumechange);
3480     }
3481 
3482     /**
3483      * Returns the {@code onwaiting} event handler for this element.
3484      * @return the {@code onwaiting} event handler for this element
3485      */
3486     @JsxGetter
3487     public Function getOnwaiting() {
3488         return getEventHandler("waiting");
3489     }
3490 
3491     /**
3492      * Sets the {@code onwaiting} event handler for this element.
3493      * @param onwaiting the {@code onwaiting} event handler for this element
3494      */
3495     @JsxSetter
3496     public void setOnwaiting(final Object onwaiting) {
3497         setEventHandler("waiting", onwaiting);
3498     }
3499 
3500     /**
3501      * Returns the {@code oncopy} event handler for this element.
3502      * @return the {@code oncopy} event handler for this element
3503      */
3504     @Override
3505     @JsxGetter({FF, IE})
3506     public Function getOncopy() {
3507         return getEventHandler("copy");
3508     }
3509 
3510     /**
3511      * Sets the {@code oncopy} event handler for this element.
3512      * @param oncopy the {@code oncopy} event handler for this element
3513      */
3514     @Override
3515     @JsxSetter({FF, IE})
3516     public void setOncopy(final Object oncopy) {
3517         setEventHandler("copy", oncopy);
3518     }
3519 
3520     /**
3521      * Returns the {@code oncut} event handler for this element.
3522      * @return the {@code oncut} event handler for this element
3523      */
3524     @Override
3525     @JsxGetter({FF, IE})
3526     public Function getOncut() {
3527         return getEventHandler("cut");
3528     }
3529 
3530     /**
3531      * Sets the {@code oncut} event handler for this element.
3532      * @param oncut the {@code oncut} event handler for this element
3533      */
3534     @Override
3535     @JsxSetter({FF, IE})
3536     public void setOncut(final Object oncut) {
3537         setEventHandler("cut", oncut);
3538     }
3539 
3540     /**
3541      * Returns the {@code onpaste} event handler for this element.
3542      * @return the {@code onpaste} event handler for this element
3543      */
3544     @Override
3545     @JsxGetter({FF, IE})
3546     public Function getOnpaste() {
3547         return getEventHandler("paste");
3548     }
3549 
3550     /**
3551      * Sets the {@code onpaste} event handler for this element.
3552      * @param onpaste the {@code onpaste} event handler for this element
3553      */
3554     @Override
3555     @JsxSetter({FF, IE})
3556     public void setOnpaste(final Object onpaste) {
3557         setEventHandler("paste", onpaste);
3558     }
3559 
3560     /**
3561      * Returns the {@code onmozfullscreenchange} event handler for this element.
3562      * @return the {@code onmozfullscreenchange} event handler for this element
3563      */
3564     @JsxGetter(FF)
3565     public Function getOnmozfullscreenchange() {
3566         return getEventHandler("mozfullscreenchange");
3567     }
3568 
3569     /**
3570      * Sets the {@code onmozfullscreenchange} event handler for this element.
3571      * @param onmozfullscreenchange the {@code onmozfullscreenchange} event handler for this element
3572      */
3573     @JsxSetter(FF)
3574     public void setOnmozfullscreenchange(final Object onmozfullscreenchange) {
3575         setEventHandler("mozfullscreenchange", onmozfullscreenchange);
3576     }
3577 
3578     /**
3579      * Returns the {@code onmozfullscreenerror} event handler for this element.
3580      * @return the {@code onmozfullscreenerror} event handler for this element
3581      */
3582     @JsxGetter(FF)
3583     public Function getOnmozfullscreenerror() {
3584         return getEventHandler("mozfullscreenerror");
3585     }
3586 
3587     /**
3588      * Sets the {@code onmozfullscreenerror} event handler for this element.
3589      * @param onmozfullscreenerror the {@code onmozfullscreenerror} event handler for this element
3590      */
3591     @JsxSetter(FF)
3592     public void setOnmozfullscreenerror(final Object onmozfullscreenerror) {
3593         setEventHandler("mozfullscreenerror", onmozfullscreenerror);
3594     }
3595 
3596     /**
3597      * Returns the {@code onmozpointerlockchange} event handler for this element.
3598      * @return the {@code onmozpointerlockchange} event handler for this element
3599      */
3600     @JsxGetter(FF45)
3601     public Function getOnmozpointerlockchange() {
3602         return getEventHandler("mozpointerlockchange");
3603     }
3604 
3605     /**
3606      * Sets the {@code onmozpointerlockchange} event handler for this element.
3607      * @param onmozpointerlockchange the {@code onmozpointerlockchange} event handler for this element
3608      */
3609     @JsxSetter(FF45)
3610     public void setOnmozpointerlockchange(final Object onmozpointerlockchange) {
3611         setEventHandler("mozpointerlockchange", onmozpointerlockchange);
3612     }
3613 
3614     /**
3615      * Returns the {@code onmozpointerlockerror} event handler for this element.
3616      * @return the {@code onmozpointerlockerror} event handler for this element
3617      */
3618     @JsxGetter(FF45)
3619     public Function getOnmozpointerlockerror() {
3620         return getEventHandler("mozpointerlockerror");
3621     }
3622 
3623     /**
3624      * Sets the {@code onmozpointerlockerror} event handler for this element.
3625      * @param onmozpointerlockerror the {@code onmozpointerlockerror} event handler for this element
3626      */
3627     @JsxSetter(FF45)
3628     public void setOnmozpointerlockerror(final Object onmozpointerlockerror) {
3629         setEventHandler("mozpointerlockerror", onmozpointerlockerror);
3630     }
3631 
3632     /**
3633      * Returns the {@code onactivate} event handler for this element.
3634      * @return the {@code onactivate} event handler for this element
3635      */
3636     @JsxGetter(IE)
3637     public Function getOnactivate() {
3638         return getEventHandler("activate");
3639     }
3640 
3641     /**
3642      * Sets the {@code onactivate} event handler for this element.
3643      * @param onactivate the {@code onactivate} event handler for this element
3644      */
3645     @JsxSetter(IE)
3646     public void setOnactivate(final Object onactivate) {
3647         setEventHandler("activate", onactivate);
3648     }
3649 
3650     /**
3651      * Returns the {@code onbeforeactivate} event handler for this element.
3652      * @return the {@code onbeforeactivate} event handler for this element
3653      */
3654     @JsxGetter(IE)
3655     public Function getOnbeforeactivate() {
3656         return getEventHandler("beforeactivate");
3657     }
3658 
3659     /**
3660      * Sets the {@code onbeforeactivate} event handler for this element.
3661      * @param onbeforeactivate the {@code onbeforeactivate} event handler for this element
3662      */
3663     @JsxSetter(IE)
3664     public void setOnbeforeactivate(final Object onbeforeactivate) {
3665         setEventHandler("beforeactivate", onbeforeactivate);
3666     }
3667 
3668     /**
3669      * Returns the {@code onbeforecopy} event handler for this element.
3670      * @return the {@code onbeforecopy} event handler for this element
3671      */
3672     @Override
3673     @JsxGetter(IE)
3674     public Function getOnbeforecopy() {
3675         return getEventHandler("beforecopy");
3676     }
3677 
3678     /**
3679      * Sets the {@code onbeforecopy} event handler for this element.
3680      * @param onbeforecopy the {@code onbeforecopy} event handler for this element
3681      */
3682     @Override
3683     @JsxSetter(IE)
3684     public void setOnbeforecopy(final Object onbeforecopy) {
3685         setEventHandler("beforecopy", onbeforecopy);
3686     }
3687 
3688     /**
3689      * Returns the {@code onbeforecut} event handler for this element.
3690      * @return the {@code onbeforecut} event handler for this element
3691      */
3692     @Override
3693     @JsxGetter(IE)
3694     public Function getOnbeforecut() {
3695         return getEventHandler("beforecut");
3696     }
3697 
3698     /**
3699      * Sets the {@code onbeforecut} event handler for this element.
3700      * @param onbeforecut the {@code onbeforecut} event handler for this element
3701      */
3702     @Override
3703     @JsxSetter(IE)
3704     public void setOnbeforecut(final Object onbeforecut) {
3705         setEventHandler("beforecut", onbeforecut);
3706     }
3707 
3708     /**
3709      * Returns the {@code onbeforedeactivate} event handler for this element.
3710      * @return the {@code onbeforedeactivate} event handler for this element
3711      */
3712     @JsxGetter(IE)
3713     public Function getOnbeforedeactivate() {
3714         return getEventHandler("beforedeactivate");
3715     }
3716 
3717     /**
3718      * Sets the {@code onbeforedeactivate} event handler for this element.
3719      * @param onbeforedeactivate the {@code onbeforedeactivate} event handler for this element
3720      */
3721     @JsxSetter(IE)
3722     public void setOnbeforedeactivate(final Object onbeforedeactivate) {
3723         setEventHandler("beforedeactivate", onbeforedeactivate);
3724     }
3725 
3726     /**
3727      * Returns the {@code onbeforepaste} event handler for this element.
3728      * @return the {@code onbeforepaste} event handler for this element
3729      */
3730     @Override
3731     @JsxGetter(IE)
3732     public Function getOnbeforepaste() {
3733         return getEventHandler("beforepaste");
3734     }
3735 
3736     /**
3737      * Sets the {@code onbeforepaste} event handler for this element.
3738      * @param onbeforepaste the {@code onbeforepaste} event handler for this element
3739      */
3740     @Override
3741     @JsxSetter(IE)
3742     public void setOnbeforepaste(final Object onbeforepaste) {
3743         setEventHandler("beforepaste", onbeforepaste);
3744     }
3745 
3746     /**
3747      * Returns the {@code ondeactivate} event handler for this element.
3748      * @return the {@code ondeactivate} event handler for this element
3749      */
3750     @JsxGetter(IE)
3751     public Function getOndeactivate() {
3752         return getEventHandler("deactivate");
3753     }
3754 
3755     /**
3756      * Sets the {@code ondeactivate} event handler for this element.
3757      * @param ondeactivate the {@code ondeactivate} event handler for this element
3758      */
3759     @JsxSetter(IE)
3760     public void setOndeactivate(final Object ondeactivate) {
3761         setEventHandler("deactivate", ondeactivate);
3762     }
3763 
3764     /**
3765      * Returns the {@code onhelp} event handler for this element.
3766      * @return the {@code onhelp} event handler for this element
3767      */
3768     @JsxGetter(IE)
3769     public Function getOnhelp() {
3770         return getEventHandler("help");
3771     }
3772 
3773     /**
3774      * Sets the {@code onhelp} event handler for this element.
3775      * @param onhelp the {@code onhelp} event handler for this element
3776      */
3777     @JsxSetter(IE)
3778     public void setOnhelp(final Object onhelp) {
3779         setEventHandler("help", onhelp);
3780     }
3781 
3782     /**
3783      * Returns the {@code onmscontentzoom} event handler for this element.
3784      * @return the {@code onmscontentzoom} event handler for this element
3785      */
3786     @JsxGetter(IE)
3787     public Function getOnmscontentzoom() {
3788         return getEventHandler("mscontentzoom");
3789     }
3790 
3791     /**
3792      * Sets the {@code onmscontentzoom} event handler for this element.
3793      * @param onmscontentzoom the {@code onmscontentzoom} event handler for this element
3794      */
3795     @JsxSetter(IE)
3796     public void setOnmscontentzoom(final Object onmscontentzoom) {
3797         setEventHandler("mscontentzoom", onmscontentzoom);
3798     }
3799 
3800     /**
3801      * Returns the {@code onmsmanipulationstatechanged} event handler for this element.
3802      * @return the {@code onmsmanipulationstatechanged} event handler for this element
3803      */
3804     @JsxGetter(IE)
3805     public Function getOnmsmanipulationstatechanged() {
3806         return getEventHandler("msmanipulationstatechanged");
3807     }
3808 
3809     /**
3810      * Sets the {@code onmsmanipulationstatechanged} event handler for this element.
3811      * @param onmsmanipulationstatechanged the {@code onmsmanipulationstatechanged} event handler for this element
3812      */
3813     @JsxSetter(IE)
3814     public void setOnmsmanipulationstatechanged(final Object onmsmanipulationstatechanged) {
3815         setEventHandler("msmanipulationstatechanged", onmsmanipulationstatechanged);
3816     }
3817 
3818     /**
3819      * Returns the {@code onselectstart} event handler for this element.
3820      * @return the {@code onselectstart} event handler for this element
3821      */
3822     @Override
3823     @JsxGetter({IE, FF52})
3824     public Function getOnselectstart() {
3825         return getEventHandler("selectstart");
3826     }
3827 
3828     /**
3829      * Sets the {@code onselectstart} event handler for this element.
3830      * @param onselectstart the {@code onselectstart} event handler for this element
3831      */
3832     @Override
3833     @JsxSetter({IE, FF52})
3834     public void setOnselectstart(final Object onselectstart) {
3835         setEventHandler("selectstart", onselectstart);
3836     }
3837 
3838     /**
3839      * Returns the {@code onanimationend} event handler.
3840      * @return the {@code onanimationend} event handler
3841      */
3842     @JsxGetter(FF52)
3843     public Function getOnanimationend() {
3844         return getEventHandler("animationend");
3845     }
3846 
3847     /**
3848      * Sets the {@code onanimationend} event handler.
3849      * @param animationend the {@code onanimationend} event handler
3850      */
3851     @JsxSetter(FF52)
3852     public void setOnanimationend(final Object animationend) {
3853         setEventHandler("animationend", animationend);
3854     }
3855 
3856     /**
3857      * Returns the {@code onanimationiteration} event handler.
3858      * @return the {@code onanimationiteration} event handler
3859      */
3860     @JsxGetter(FF52)
3861     public Function getOnanimationiteration() {
3862         return getEventHandler("animationiteration");
3863     }
3864 
3865     /**
3866      * Sets the {@code onanimationiteration} event handler.
3867      * @param animationiteration the {@code onanimationiteration} event handler
3868      */
3869     @JsxSetter(FF52)
3870     public void setOnanimationiteration(final Object animationiteration) {
3871         setEventHandler("animationiteration", animationiteration);
3872     }
3873 
3874     /**
3875      * Returns the {@code onanimationstart} event handler.
3876      * @return the {@code onanimationstart} event handler
3877      */
3878     @JsxGetter(FF52)
3879     public Function getOnanimationstart() {
3880         return getEventHandler("animationstart");
3881     }
3882 
3883     /**
3884      * Sets the {@code onanimationstart} event handler.
3885      * @param animationstart the {@code onanimationstart} event handler
3886      */
3887     @JsxSetter(FF52)
3888     public void setOnanimationstart(final Object animationstart) {
3889         setEventHandler("animationstart", animationstart);
3890     }
3891 
3892     /**
3893      * Returns the {@code ondragexit} event handler.
3894      * @return the {@code ondragexit} event handler
3895      */
3896     @JsxGetter(FF52)
3897     public Function getOndragexit() {
3898         return getEventHandler("dragexit");
3899     }
3900 
3901     /**
3902      * Sets the {@code ondragexit} event handler.
3903      * @param dragexit the {@code ondragexit} event handler
3904      */
3905     @JsxSetter(FF52)
3906     public void setOndragexit(final Object dragexit) {
3907         setEventHandler("dragexit", dragexit);
3908     }
3909 
3910     /**
3911      * Returns the {@code onloadend} event handler.
3912      * @return the {@code onloadend} event handler
3913      */
3914     @JsxGetter(FF52)
3915     public Function getOnloadend() {
3916         return getEventHandler("loadend");
3917     }
3918 
3919     /**
3920      * Sets the {@code onloadend} event handler.
3921      * @param loadend the {@code onloadend} event handler
3922      */
3923     @JsxSetter(FF52)
3924     public void setOnloadend(final Object loadend) {
3925         setEventHandler("loadend", loadend);
3926     }
3927 
3928     /**
3929      * Returns the {@code ontransitionend} event handler.
3930      * @return the {@code ontransitionend} event handler
3931      */
3932     @JsxGetter(FF52)
3933     public Function getOntransitionend() {
3934         return getEventHandler("transitionend");
3935     }
3936 
3937     /**
3938      * Sets the {@code ontransitionend} event handler.
3939      * @param transitionend the {@code ontransitionend} event handler
3940      */
3941     @JsxSetter(FF52)
3942     public void setOntransitionend(final Object transitionend) {
3943         setEventHandler("transitionend", transitionend);
3944     }
3945 
3946     /**
3947      * Returns the {@code onwebkitanimationend} event handler.
3948      * @return the {@code onwebkitanimationend} event handler
3949      */
3950     @JsxGetter(FF52)
3951     public Function getOnwebkitanimationend() {
3952         return getEventHandler("webkitanimationend");
3953     }
3954 
3955     /**
3956      * Sets the {@code onwebkitanimationend} event handler.
3957      * @param webkitanimationend the {@code onwebkitanimationend} event handler
3958      */
3959     @JsxSetter(FF52)
3960     public void setOnwebkitanimationend(final Object webkitanimationend) {
3961         setEventHandler("webkitanimationend", webkitanimationend);
3962     }
3963 
3964     /**
3965      * Returns the {@code onwebkitanimationiteration} event handler.
3966      * @return the {@code onwebkitanimationiteration} event handler
3967      */
3968     @JsxGetter(FF52)
3969     public Function getOnwebkitanimationiteration() {
3970         return getEventHandler("webkitanimationiteration");
3971     }
3972 
3973     /**
3974      * Sets the {@code onwebkitanimationiteration} event handler.
3975      * @param webkitanimationiteration the {@code onwebkitanimationiteration} event handler
3976      */
3977     @JsxSetter(FF52)
3978     public void setOnwebkitanimationiteration(final Object webkitanimationiteration) {
3979         setEventHandler("webkitanimationiteration", webkitanimationiteration);
3980     }
3981 
3982     /**
3983      * Returns the {@code onwebkitanimationstart} event handler.
3984      * @return the {@code onwebkitanimationstart} event handler
3985      */
3986     @JsxGetter(FF52)
3987     public Function getOnwebkitanimationstart() {
3988         return getEventHandler("webkitanimationstart");
3989     }
3990 
3991     /**
3992      * Sets the {@code onwebkitanimationstart} event handler.
3993      * @param webkitanimationstart the {@code onwebkitanimationstart} event handler
3994      */
3995     @JsxSetter(FF52)
3996     public void setOnwebkitanimationstart(final Object webkitanimationstart) {
3997         setEventHandler("webkitanimationstart", webkitanimationstart);
3998     }
3999 
4000     /**
4001      * Returns the {@code onwebkittransitionend} event handler.
4002      * @return the {@code onwebkittransitionend} event handler
4003      */
4004     @JsxGetter(FF52)
4005     public Function getOnwebkittransitionend() {
4006         return getEventHandler("webkittransitionend");
4007     }
4008 
4009     /**
4010      * Sets the {@code onwebkittransitionend} event handler.
4011      * @param webkittransitionend the {@code onwebkittransitionend} event handler
4012      */
4013     @JsxSetter(FF52)
4014     public void setOnwebkittransitionend(final Object webkittransitionend) {
4015         setEventHandler("webkittransitionend", webkittransitionend);
4016     }
4017 
4018 }