diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2012-03-24 19:55:01 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2012-03-24 19:55:01 +0000 |
commit | e8949416b4a1f7102cd4d8bf3e6003e946b97c43 (patch) | |
tree | 21619653850f62878ed944930c4f6679fc0ff466 /src | |
parent | 7e5fc5d1da1e38fb7bc47781b76ca10b84ab110c (diff) | |
download | libdom-e8949416b4a1f7102cd4d8bf3e6003e946b97c43.tar.gz libdom-e8949416b4a1f7102cd4d8bf3e6003e946b97c43.tar.bz2 |
Rudimentary API for dom_html_document_{get,set}_quirks_mode -- Replete with exception API for orthogonality if not happiness
svn path=/trunk/libdom/; revision=13614
Diffstat (limited to 'src')
-rw-r--r-- | src/html/html_document.c | 17 | ||||
-rw-r--r-- | src/html/html_document.h | 10 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/html/html_document.c b/src/html/html_document.c index 52e0b9c..8909743 100644 --- a/src/html/html_document.c +++ b/src/html/html_document.c @@ -73,6 +73,7 @@ dom_exception _dom_html_document_initialise(dom_html_document *doc, doc->domain = NULL; doc->url = NULL; doc->cookie = NULL; + doc->quirks = false; return DOM_NO_ERR; } @@ -347,3 +348,19 @@ dom_exception _dom_html_document_get_elements_by_name(dom_html_document *doc, return DOM_NOT_SUPPORTED_ERR; } +/*-----------------------------------------------------------------------*/ +/* Semi-internal API extensions for NetSurf */ + +dom_exception _dom_html_document_get_quirks_mode(dom_html_document *doc, + bool *result) +{ + *result = doc->quirks; + return DOM_NO_ERR; +} + +dom_exception _dom_html_document_set_quirks_mode(dom_html_document *doc, + bool quirks) +{ + doc->quirks = quirks; + return DOM_NO_ERR; +} diff --git a/src/html/html_document.h b/src/html/html_document.h index f27de20..289f7a2 100644 --- a/src/html/html_document.h +++ b/src/html/html_document.h @@ -23,6 +23,7 @@ struct dom_html_document { dom_string *domain; /**< HTML document domain */ dom_string *url; /**< HTML document URL */ dom_string *cookie; /**< HTML document cookie */ + bool quirks; /**< HTML document is in quirks mode */ }; /* Create a HTMLDocument */ @@ -80,6 +81,11 @@ dom_exception _dom_html_document_writeln(dom_html_document *doc, dom_string *text); dom_exception _dom_html_document_get_elements_by_name(dom_html_document *doc, dom_string *name, struct dom_nodelist **list); +dom_exception _dom_html_document_get_quirks_mode(dom_html_document *doc, + bool *result); +dom_exception _dom_html_document_set_quirks_mode(dom_html_document *doc, + bool result); + #define DOM_HTML_DOCUMENT_VTABLE \ _dom_html_document_get_title, \ @@ -100,7 +106,9 @@ dom_exception _dom_html_document_get_elements_by_name(dom_html_document *doc, _dom_html_document_close, \ _dom_html_document_write, \ _dom_html_document_writeln, \ - _dom_html_document_get_elements_by_name + _dom_html_document_get_elements_by_name, \ + _dom_html_document_get_quirks_mode, \ + _dom_html_document_set_quirks_mode dom_exception _dom_html_document_create_element(dom_document *doc, dom_string *tag_name, dom_element **result); |