/* HTML element binding using duktape and libdom
 *
 * Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
 *
 * This file is part of NetSurf, http://www.netsurf-browser.org/
 *
 * Released under the terms of the MIT License,
 *         http://www.opensource.org/licenses/mit-license
 */

prologue HTMLElement()
%{
#include <utils/corestrings.h>
#define HANDLER_MAGIC MAGIC(HANDLER_MAP)
%}

init HTMLElement(struct dom_html_element *html_element::element);

getter HTMLElement::dir();
setter HTMLElement::dir();

getter HTMLElement::lang();
setter HTMLElement::lang();

getter HTMLElement::title();
setter HTMLElement::title();

getter HTMLElement::onchange();
setter HTMLElement::onchange();

setter HTMLElement::onclick();
getter HTMLElement::onclick();

getter HTMLElement::onabort();
setter HTMLElement::onabort();
getter HTMLElement::onautocompleteerror();
setter HTMLElement::onautocompleteerror();
getter HTMLElement::onautocomplete();
setter HTMLElement::onautocomplete();
getter HTMLElement::onblur();
setter HTMLElement::onblur();
getter HTMLElement::oncancel();
setter HTMLElement::oncancel();
getter HTMLElement::oncanplaythrough();
setter HTMLElement::oncanplaythrough();
getter HTMLElement::oncanplay();
setter HTMLElement::oncanplay();
getter HTMLElement::onclose();
setter HTMLElement::onclose();
getter HTMLElement::oncontextmenu();
setter HTMLElement::oncontextmenu();
getter HTMLElement::oncuechange();
setter HTMLElement::oncuechange();
getter HTMLElement::ondblclick();
setter HTMLElement::ondblclick();
getter HTMLElement::ondragend();
setter HTMLElement::ondragend();
getter HTMLElement::ondragenter();
setter HTMLElement::ondragenter();
getter HTMLElement::ondragexit();
setter HTMLElement::ondragexit();
getter HTMLElement::ondragleave();
setter HTMLElement::ondragleave();
getter HTMLElement::ondragover();
setter HTMLElement::ondragover();
getter HTMLElement::ondragstart();
setter HTMLElement::ondragstart();
getter HTMLElement::ondrag();
setter HTMLElement::ondrag();
getter HTMLElement::ondrop();
setter HTMLElement::ondrop();
getter HTMLElement::ondurationchange();
setter HTMLElement::ondurationchange();
getter HTMLElement::onemptied();
setter HTMLElement::onemptied();
getter HTMLElement::onended();
setter HTMLElement::onended();
getter HTMLElement::onfocus();
setter HTMLElement::onfocus();
getter HTMLElement::oninput();
setter HTMLElement::oninput();
getter HTMLElement::oninvalid();
setter HTMLElement::oninvalid();
getter HTMLElement::onkeydown();
setter HTMLElement::onkeydown();
getter HTMLElement::onkeypress();
setter HTMLElement::onkeypress();
getter HTMLElement::onkeyup();
setter HTMLElement::onkeyup();
getter HTMLElement::onloadeddata();
setter HTMLElement::onloadeddata();
getter HTMLElement::onloadedmetadata();
setter HTMLElement::onloadedmetadata();
getter HTMLElement::onloadstart();
setter HTMLElement::onloadstart();
getter HTMLElement::onload();
setter HTMLElement::onload();
getter HTMLElement::onmousedown();
setter HTMLElement::onmousedown();
getter HTMLElement::onmouseenter();
setter HTMLElement::onmouseenter();
getter HTMLElement::onmouseleave();
setter HTMLElement::onmouseleave();
getter HTMLElement::onmousemove();
setter HTMLElement::onmousemove();
getter HTMLElement::onmouseout();
setter HTMLElement::onmouseout();
getter HTMLElement::onmouseover();
setter HTMLElement::onmouseover();
getter HTMLElement::onmouseup();
setter HTMLElement::onmouseup();
getter HTMLElement::onpause();
setter HTMLElement::onpause();
getter HTMLElement::onplaying();
setter HTMLElement::onplaying();
getter HTMLElement::onplay();
setter HTMLElement::onplay();
getter HTMLElement::onprogress();
setter HTMLElement::onprogress();
getter HTMLElement::onratechange();
setter HTMLElement::onratechange();
getter HTMLElement::onreset();
setter HTMLElement::onreset();
getter HTMLElement::onresize();
setter HTMLElement::onresize();
getter HTMLElement::onscroll();
setter HTMLElement::onscroll();
getter HTMLElement::onseeked();
setter HTMLElement::onseeked();
getter HTMLElement::onseeking();
setter HTMLElement::onseeking();
getter HTMLElement::onselect();
setter HTMLElement::onselect();
getter HTMLElement::onshow();
setter HTMLElement::onshow();
getter HTMLElement::onsort();
setter HTMLElement::onsort();
getter HTMLElement::onstalled();
setter HTMLElement::onstalled();
getter HTMLElement::onsubmit();
setter HTMLElement::onsubmit();
getter HTMLElement::onsuspend();
setter HTMLElement::onsuspend();
getter HTMLElement::ontimeupdate();
setter HTMLElement::ontimeupdate();
getter HTMLElement::ontoggle();
setter HTMLElement::ontoggle();
getter HTMLElement::onvolumechange();
setter HTMLElement::onvolumechange();
getter HTMLElement::onwaiting();
setter HTMLElement::onwaiting();
getter HTMLElement::onwheel();
setter HTMLElement::onwheel();

getter HTMLElement::style()
%{
	/* Minimal implementation to avoid infinite-loop in Modernizr (c.f. #2413) */
	if (dukky_create_object(ctx, PROTO_NAME(CSSSTYLEDECLARATION), 0) != DUK_EXEC_SUCCESS) {
		return 0;
	}
	return 1;
%}