Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/a706c69bf416beedc71e386fe344761d5d417cd1
...commit
http://git.netsurf-browser.org/netsurf.git/commit/a706c69bf416beedc71e386fe344761d5d417cd1
...tree
http://git.netsurf-browser.org/netsurf.git/tree/a706c69bf416beedc71e386fe344761d5d417cd1
The branch, master has been updated
via a706c69bf416beedc71e386fe344761d5d417cd1 (commit)
from 19cd5cb3b3771592110b7400558727b71a005f63 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=a706c69bf416beedc71e386fe344761d5d417cd1
commit a706c69bf416beedc71e386fe344761d5d417cd1
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
improve html content handler private headers
diff --git a/content/handlers/html/box_construct.c
b/content/handlers/html/box_construct.c
index f1ea71d..3d10017 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -37,7 +37,7 @@
#include "css/select.h"
#include "desktop/gui_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/object.h"
#include "html/box.h"
#include "html/box_manipulate.h"
diff --git a/content/handlers/html/box_inspect.c
b/content/handlers/html/box_inspect.c
index 268ed3d..df9a1b4 100644
--- a/content/handlers/html/box_inspect.c
+++ b/content/handlers/html/box_inspect.c
@@ -34,9 +34,9 @@
#include "css/dump.h"
#include "desktop/scrollbar.h"
+#include "html/private.h"
#include "html/box.h"
#include "html/box_inspect.h"
-#include "html/html_internal.h"
/**
* Direction to move in a box-tree walk
diff --git a/content/handlers/html/box_manipulate.c
b/content/handlers/html/box_manipulate.c
index 0bc1c9f..d88e360 100644
--- a/content/handlers/html/box_manipulate.c
+++ b/content/handlers/html/box_manipulate.c
@@ -32,11 +32,11 @@
#include "netsurf/mouse.h"
#include "desktop/scrollbar.h"
-#include "html/box.h"
-#include "html/box_manipulate.h"
+#include "html/private.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
#include "html/interaction.h"
+#include "html/box.h"
+#include "html/box_manipulate.h"
/**
diff --git a/content/handlers/html/box_normalise.c
b/content/handlers/html/box_normalise.c
index fbdb6cd..b7032da 100644
--- a/content/handlers/html/box_normalise.c
+++ b/content/handlers/html/box_normalise.c
@@ -32,11 +32,11 @@
#include "utils/errors.h"
#include "css/select.h"
+#include "html/private.h"
+#include "html/table.h"
#include "html/box.h"
#include "html/box_manipulate.h"
#include "html/box_normalise.h"
-#include "html/html_internal.h"
-#include "html/table.h"
/* Define to enable box normalise debug */
#undef BOX_NORMALISE_DEBUG
diff --git a/content/handlers/html/box_special.c
b/content/handlers/html/box_special.c
index 2d3bd05..06f2f91 100644
--- a/content/handlers/html/box_special.c
+++ b/content/handlers/html/box_special.c
@@ -41,7 +41,7 @@
#include "desktop/frame_types.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/object.h"
#include "html/box.h"
#include "html/box_manipulate.h"
diff --git a/content/handlers/html/box_textarea.c
b/content/handlers/html/box_textarea.c
index 476773f..1038be3 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -31,7 +31,8 @@
#include "desktop/textarea.h"
#include "desktop/gui_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
+#include "html/interaction.h"
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/box_textarea.h"
diff --git a/content/handlers/html/css.c b/content/handlers/html/css.c
index 23d51f1..5758981 100644
--- a/content/handlers/html/css.c
+++ b/content/handlers/html/css.c
@@ -42,13 +42,17 @@
#include "desktop/gui_internal.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
+#include "html/css.h"
static nsurl *html_default_stylesheet_url;
static nsurl *html_adblock_stylesheet_url;
static nsurl *html_quirks_stylesheet_url;
static nsurl *html_user_stylesheet_url;
+/**
+ * Convert css error to netsurf error.
+ */
static nserror css_error_to_nserror(css_error error)
{
switch (error) {
@@ -82,10 +86,10 @@ static nserror css_error_to_nserror(css_error error)
return NSERROR_CSS;
}
+
/**
* Callback for fetchcache() for stylesheets.
*/
-
static nserror
html_convert_css_callback(hlcache_handle *css,
const hlcache_event *event,
@@ -141,6 +145,7 @@ html_convert_css_callback(hlcache_handle *css,
return NSERROR_OK;
}
+
static nserror
html_stylesheet_from_domnode(html_content *c,
dom_node *node,
@@ -195,6 +200,7 @@ html_stylesheet_from_domnode(html_content *c,
return NSERROR_OK;
}
+
/**
* Process an inline stylesheet in the document.
*
@@ -202,7 +208,6 @@ html_stylesheet_from_domnode(html_content *c,
* \param style xml node of style element
* \return true on success, false if an error occurred
*/
-
static struct html_stylesheet *
html_create_style_element(html_content *c, dom_node *style)
{
@@ -254,8 +259,9 @@ html_create_style_element(html_content *c, dom_node *style)
return c->stylesheets + (c->stylesheet_count - 1);
}
-static bool html_css_process_modified_style(html_content *c,
- struct html_stylesheet *s)
+
+static bool
+html_css_process_modified_style(html_content *c, struct html_stylesheet *s)
{
hlcache_handle *sheet = NULL;
nserror error;
@@ -291,6 +297,10 @@ static bool html_css_process_modified_style(html_content
*c,
return true;
}
+
+/**
+ * process a stylesheet that has been modified.
+ */
static void html_css_process_modified_styles(void *pw)
{
html_content *c = pw;
@@ -310,6 +320,8 @@ static void html_css_process_modified_styles(void *pw)
}
}
+
+/* exported function documented in html/css.h */
bool html_css_update_style(html_content *c, dom_node *style)
{
unsigned int i;
@@ -337,6 +349,8 @@ bool html_css_update_style(html_content *c, dom_node *style)
return true;
}
+
+/* exported function documented in html/css.h */
bool html_css_process_style(html_content *c, dom_node *node)
{
unsigned int i;
@@ -368,6 +382,8 @@ bool html_css_process_style(html_content *c, dom_node *node)
return true;
}
+
+/* exported function documented in html/css.h */
bool html_css_process_link(html_content *htmlc, dom_node *node)
{
dom_string *rel, *type_attr, *media, *href;
@@ -475,6 +491,7 @@ no_memory:
return false;
}
+
/* exported interface documented in html/html.h */
struct html_stylesheet *html_get_stylesheets(hlcache_handle *h, unsigned int
*n)
{
@@ -488,8 +505,9 @@ struct html_stylesheet *html_get_stylesheets(hlcache_handle
*h, unsigned int *n)
return c->stylesheets;
}
-/* exported interface documented in html/html_internal.h */
-bool html_saw_insecure_stylesheets(html_content *html)
+
+/* exported function documented in html/css.h */
+bool html_css_saw_insecure_stylesheets(html_content *html)
{
struct html_stylesheet *s;
unsigned int i;
@@ -506,7 +524,8 @@ bool html_saw_insecure_stylesheets(html_content *html)
return false;
}
-/* exported interface documented in html/html_internal.h */
+
+/* exported function documented in html/css.h */
nserror html_css_free_stylesheets(html_content *html)
{
unsigned int i;
@@ -526,7 +545,8 @@ nserror html_css_free_stylesheets(html_content *html)
return NSERROR_OK;
}
-/* exported interface documented in html/html_internal.h */
+
+/* exported function documented in html/css.h */
nserror html_css_quirks_stylesheets(html_content *c)
{
nserror ns_error = NSERROR_OK;
@@ -554,7 +574,8 @@ nserror html_css_quirks_stylesheets(html_content *c)
return ns_error;
}
-/* exported interface documented in html/html_internal.h */
+
+/* exported function documented in html/css.h */
nserror html_css_new_stylesheets(html_content *c)
{
nserror ns_error;
@@ -624,6 +645,8 @@ nserror html_css_new_stylesheets(html_content *c)
return ns_error;
}
+
+/* exported function documented in html/css.h */
nserror
html_css_new_selection_context(html_content *c, css_select_ctx
**ret_select_ctx)
{
@@ -686,6 +709,8 @@ html_css_new_selection_context(html_content *c,
css_select_ctx **ret_select_ctx)
return NSERROR_OK;
}
+
+/* exported function documented in html/css.h */
nserror html_css_init(void)
{
nserror error;
@@ -715,6 +740,8 @@ nserror html_css_init(void)
return error;
}
+
+/* exported function documented in html/css.h */
void html_css_fini(void)
{
if (html_user_stylesheet_url != NULL) {
diff --git a/content/handlers/html/css.h b/content/handlers/html/css.h
new file mode 100644
index 0000000..35f6a61
--- /dev/null
+++ b/content/handlers/html/css.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2020 Vincent Sanders <[email protected]>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ * HTML content handler CSS interface.
+ */
+
+#ifndef NETSURF_HTML_CSS_H
+#define NETSURF_HTML_CSS_H
+
+/**
+ * Initialise html content css handling.
+ *
+ * \return NSERROR_OK on success else error code
+ */
+nserror html_css_init(void);
+
+/**
+ * Finalise html content css handling.
+ */
+void html_css_fini(void);
+
+/**
+ * create a new css selection context for an html content.
+ *
+ * \param c The html content to create css selction on.
+ * \param select_ctx A pointer to receive the new context.
+ * \return NSERROR_OK on success and \a select_ctx updated else error code
+ */
+nserror html_css_new_selection_context(struct html_content *c, css_select_ctx
**select_ctx);
+
+/**
+ * Initialise core stylesheets for a content
+ *
+ * \param c content structure to update
+ * \return NSERROR_OK on success or error code
+ */
+nserror html_css_new_stylesheets(struct html_content *c);
+
+/**
+ * Initialise quirk stylesheets for a content
+ *
+ * \param c content structure to update
+ * \return NSERROR_OK on success or error code
+ */
+nserror html_css_quirks_stylesheets(struct html_content *c);
+
+/**
+ * Free all css stylesheets associated with an HTML content.
+ *
+ * \param html The HTML content to free stylesheets from.
+ * \return NSERROR_OK on success or error code.
+ */
+nserror html_css_free_stylesheets(struct html_content *html);
+
+/**
+ * determine if any of the stylesheets were loaded insecurely
+ *
+ * \param htmlc The HTML content to check.
+ * \return true if there were insecurely loadd stylesheets else false.
+ */
+bool html_css_saw_insecure_stylesheets(struct html_content *htmlc);
+
+/**
+ * process a css stylesheet dom LINK node
+ *
+ * \param htmlc The HTML content.
+ * \param node the DOM link node to process.
+ * \return true on success else false.
+ */
+bool html_css_process_link(struct html_content *htmlc, dom_node *node);
+
+/**
+ * process a css style dom node
+ *
+ * \param htmlc The HTML content.
+ * \param node the DOM node to process.
+ * \return true on success else false.
+ */
+bool html_css_process_style(struct html_content *htmlc, dom_node *node);
+
+/**
+ * process a css style dom node update
+ *
+ * \param htmlc The HTML content.
+ * \param node the DOM node to process.
+ * \return true on success else false.
+ */
+bool html_css_update_style(struct html_content *htmlc, dom_node *node);
+
+
+
+#endif
diff --git a/content/handlers/html/css_fetcher.c
b/content/handlers/html/css_fetcher.c
index ae20879..4e0f672 100644
--- a/content/handlers/html/css_fetcher.c
+++ b/content/handlers/html/css_fetcher.c
@@ -39,7 +39,7 @@
#include "content/fetch.h"
#include "content/fetchers.h"
-#include "html/html_internal.h"
+#include "html/private.h"
typedef struct html_css_fetcher_item {
uint32_t key;
diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c
index 86c4196..93297e8 100644
--- a/content/handlers/html/form.c
+++ b/content/handlers/html/form.c
@@ -52,13 +52,13 @@
#include "desktop/textarea.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
+#include "html/private.h"
+#include "html/layout.h"
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/font.h"
#include "html/form_internal.h"
-#include "html/html.h"
-#include "html/html_internal.h"
-#include "html/layout.h"
#define MAX_SELECT_HEIGHT 210
#define SELECT_LINE_SPACING 0.2
diff --git a/content/handlers/html/forms.c b/content/handlers/html/forms.c
index 896263d..b8b9cb5 100644
--- a/content/handlers/html/forms.c
+++ b/content/handlers/html/forms.c
@@ -26,7 +26,7 @@
#include "utils/log.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
/**
* process form element from dom
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 2f6377f..b4cda4a 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -56,7 +56,8 @@
#include "desktop/gui_internal.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
+#include "html/css.h"
#include "html/object.h"
#include "html/html_save.h"
#include "html/interaction.h"
@@ -2816,7 +2817,7 @@ html_saw_insecure_objects(struct content *c)
}
/* Now check stylesheets */
- if (html_saw_insecure_stylesheets(htmlc)) {
+ if (html_css_saw_insecure_stylesheets(htmlc)) {
return true;
}
@@ -2894,12 +2895,8 @@ error:
return error;
}
-/**
- * Get the browser window containing an HTML content
- *
- * \param c HTML content
- * \return the browser window
- */
+
+/* exported function documented in html/private.h */
struct browser_window *html_get_browser_window(struct content *c)
{
html_content *html = (html_content *) c;
diff --git a/content/handlers/html/html_internal.h
b/content/handlers/html/html_internal.h
deleted file mode 100644
index ae3182a..0000000
--- a/content/handlers/html/html_internal.h
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright 2004 James Bursa <[email protected]>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * \file
- * Private data for text/html content.
- */
-
-#ifndef NETSURF_HTML_HTML_INTERNAL_H
-#define NETSURF_HTML_HTML_INTERNAL_H
-
-#include <libcss/libcss.h>
-#include <dom/bindings/hubbub/parser.h>
-
-#include "netsurf/types.h"
-#include "content/content_protected.h"
-#include "desktop/selection.h"
-
-
-struct gui_layout_table;
-struct scrollbar_msg_data;
-struct content_redraw_data;
-
-typedef enum {
- HTML_DRAG_NONE, /** No drag */
- HTML_DRAG_SELECTION, /** Own; Text selection */
- HTML_DRAG_SCROLLBAR, /** Not own; drag in scrollbar widget */
- HTML_DRAG_TEXTAREA_SELECTION, /** Not own; drag in textarea widget */
- HTML_DRAG_TEXTAREA_SCROLLBAR, /** Not own; drag in textarea widget */
- HTML_DRAG_CONTENT_SELECTION, /** Not own; drag in child content */
- HTML_DRAG_CONTENT_SCROLL /** Not own; drag in child content */
-} html_drag_type;
-
-/**
- * For drags we don't own
- */
-union html_drag_owner {
- bool no_owner;
- struct box *content;
- struct scrollbar *scrollbar;
- struct box *textarea;
-};
-
-typedef enum {
- HTML_SELECTION_NONE, /** No selection */
- HTML_SELECTION_TEXTAREA, /** Selection in one of our textareas */
- HTML_SELECTION_SELF, /** Selection in this html content */
- HTML_SELECTION_CONTENT /** Selection in child content */
-} html_selection_type;
-
-/**
- * For getting at selections in this content or things in this content
- */
-union html_selection_owner {
- bool none;
- struct box *textarea;
- struct box *content;
-};
-
-typedef enum {
- HTML_FOCUS_SELF, /**< Focus is our own */
- HTML_FOCUS_CONTENT, /**< Focus belongs to child content */
- HTML_FOCUS_TEXTAREA /**< Focus belongs to textarea */
-} html_focus_type;
-
-/**
- * For directing input
- */
-union html_focus_owner {
- bool self;
- struct box *textarea;
- struct box *content;
-};
-
-/**
- * Data specific to CONTENT_HTML.
- */
-typedef struct html_content {
- struct content base;
-
- dom_hubbub_parser *parser; /**< Parser object handle */
- bool parse_completed; /**< Whether the parse has been completed */
- bool conversion_begun; /**< Whether or not the conversion has begun */
-
- /** Document tree */
- dom_document *document;
- /** Quirkyness of document */
- dom_document_quirks_mode quirks;
-
- /** Encoding of source, NULL if unknown. */
- char *encoding;
- /** Source of encoding information. */
- dom_hubbub_encoding_source encoding_source;
-
- /** Base URL (may be a copy of content->url). */
- nsurl *base_url;
- /** Base target */
- char *base_target;
-
- /** CSS length conversion context for document. */
- nscss_len_ctx len_ctx;
-
- /** Content has been aborted in the LOADING state */
- bool aborted;
-
- /** Whether a meta refresh has been handled */
- bool refresh;
-
- /** Whether a layout (reflow) is in progress */
- bool reflowing;
-
- /** Whether an initial layout has been done */
- bool had_initial_layout;
-
- /** Whether scripts are enabled for this content */
- bool enable_scripting;
-
- /* Title element node */
- dom_node *title;
-
- /** A talloc context purely for the render box tree */
- int *bctx;
- /** A context pointer for the box conversion, NULL if no conversion
- * is in progress.
- */
- void *box_conversion_context;
- /** Box tree, or NULL. */
- struct box *layout;
- /** Document background colour. */
- colour background_colour;
-
- /** Font callback table */
- const struct gui_layout_table *font_func;
-
- /** Number of entries in scripts */
- unsigned int scripts_count;
- /** Scripts */
- struct html_script *scripts;
- /** javascript thread in use */
- struct jsthread *jsthread;
-
- /** Number of entries in stylesheet_content. */
- unsigned int stylesheet_count;
- /** Stylesheets. Each may be NULL. */
- struct html_stylesheet *stylesheets;
- /**< Style selection context */
- css_select_ctx *select_ctx;
- /**< Style selection media specification */
- css_media media;
- /**< Universal selector */
- lwc_string *universal;
-
- /** Number of entries in object_list. */
- unsigned int num_objects;
- /** List of objects. */
- struct content_html_object *object_list;
- /** Forms, in reverse order to document. */
- struct form *forms;
- /** Hash table of imagemaps. */
- struct imagemap **imagemaps;
-
- /** Browser window containing this document, or NULL if not open. */
- struct browser_window *bw;
-
- /** Frameset information */
- struct content_html_frames *frameset;
-
- /** Inline frame information */
- struct content_html_iframe *iframe;
-
- /** Content of type CONTENT_HTML containing this, or NULL if not an
- * object within a page. */
- struct html_content *page;
-
- /** Current drag type */
- html_drag_type drag_type;
- /** Widget capturing all mouse events */
- union html_drag_owner drag_owner;
-
- /** Current selection state */
- html_selection_type selection_type;
- /** Current selection owner */
- union html_selection_owner selection_owner;
-
- /** Current input focus target type */
- html_focus_type focus_type;
- /** Current input focus target */
- union html_focus_owner focus_owner;
-
- /** HTML content's own text selection object */
- struct selection sel;
-
- /** Open core-handled form SELECT menu,
- * or NULL if none currently open. */
- struct form_control *visible_select_menu;
-
- /** Context for free text search, or NULL if none */
- struct search_context *search;
- /** Search string or NULL */
- char *search_string;
-
-} html_content;
-
-/** Render padding and margin box outlines in html_redraw(). */
-extern bool html_redraw_debug;
-
-void html__redraw_a_box(html_content *html, struct box *box);
-
-/**
- * Set our drag status, and inform whatever owns the content
- *
- * \param html HTML content
- * \param drag_type Type of drag
- * \param drag_owner What owns the drag
- * \param rect Pointer movement bounds
- */
-void html_set_drag_type(html_content *html, html_drag_type drag_type,
- union html_drag_owner drag_owner, const struct rect *rect);
-
-/**
- * Set our selection status, and inform whatever owns the content
- *
- * \param html HTML content
- * \param selection_type Type of selection
- * \param selection_owner What owns the selection
- * \param read_only True iff selection is read only
- */
-void html_set_selection(html_content *html, html_selection_type selection_type,
- union html_selection_owner selection_owner, bool read_only);
-
-/**
- * Set our input focus, and inform whatever owns the content
- *
- * \param html HTML content
- * \param focus_type Type of input focus
- * \param focus_owner What owns the focus
- * \param hide_caret True iff caret to be hidden
- * \param x Carret x-coord rel to owner
- * \param y Carret y-coord rel to owner
- * \param height Carret height
- * \param clip Carret clip rect
- */
-void html_set_focus(html_content *html, html_focus_type focus_type,
- union html_focus_owner focus_owner, bool hide_caret,
- int x, int y, int height, const struct rect *clip);
-
-
-struct browser_window *html_get_browser_window(struct content *c);
-
-/**
- * Complete conversion of an HTML document
- *
- * \param htmlc Content to convert
- */
-void html_finish_conversion(html_content *htmlc);
-
-/**
- * Test if an HTML content conversion can begin
- *
- * \param htmlc html content to test
- * \return true iff the html content conversion can begin
- */
-bool html_can_begin_conversion(html_content *htmlc);
-
-/**
- * Begin conversion of an HTML document
- *
- * \param htmlc Content to convert
- */
-bool html_begin_conversion(html_content *htmlc);
-
-/* in html/html_redraw.c */
-bool html_redraw(struct content *c, struct content_redraw_data *data,
- const struct rect *clip, const struct redraw_context *ctx);
-
-/* in html/html_redraw_border.c */
-bool html_redraw_borders(struct box *box, int x_parent, int y_parent,
- int p_width, int p_height, const struct rect *clip, float scale,
- const struct redraw_context *ctx);
-
-bool html_redraw_inline_borders(struct box *box, struct rect b,
- const struct rect *clip, float scale, bool first, bool last,
- const struct redraw_context *ctx);
-
-/* in html/html_script.c */
-dom_hubbub_error html_process_script(void *ctx, dom_node *node);
-
-/* in html/html.c */
-bool html_exec(struct content *c, const char *src, size_t srclen);
-
-/**
- * Attempt script execution for defer and async scripts
- *
- * execute scripts using algorithm found in:
- *
http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#the-script-element
- *
- * \param htmlc html content.
- * \param allow_defer allow deferred execution, if not, only async scripts.
- * \return NSERROR_OK error code.
- */
-nserror html_script_exec(html_content *htmlc, bool allow_defer);
-
-/**
- * Free all script resources and references for a html content.
- *
- * \param htmlc html content.
- * \return NSERROR_OK or error code.
- */
-nserror html_script_free(html_content *htmlc);
-
-/**
- * Check if any of the scripts loaded were insecure
- */
-bool html_saw_insecure_scripts(html_content *htmlc);
-
-/* in html/html_forms.c */
-struct form *html_forms_get_forms(const char *docenc, dom_html_document *doc);
-struct form_control *html_forms_get_control_for_node(struct form *forms,
- dom_node *node);
-
-/* in html/html_css.c */
-nserror html_css_init(void);
-void html_css_fini(void);
-
-/**
- * Initialise core stylesheets for a content
- *
- * \param c content structure to update
- * \return nserror
- */
-nserror html_css_new_stylesheets(html_content *c);
-nserror html_css_quirks_stylesheets(html_content *c);
-nserror html_css_free_stylesheets(html_content *html);
-
-/** Return if any of the stylesheets were loaded insecurely */
-bool html_saw_insecure_stylesheets(html_content *html);
-
-bool html_css_process_link(html_content *htmlc, dom_node *node);
-bool html_css_process_style(html_content *htmlc, dom_node *node);
-bool html_css_update_style(html_content *c, dom_node *style);
-
-nserror html_css_new_selection_context(html_content *c,
- css_select_ctx **ret_select_ctx);
-
-/* in html/html_css_fetcher.c */
-/**
- * Register the fetcher for the pseudo x-ns-css scheme.
- *
- * \return NSERROR_OK on successful registration or error code on failure.
- */
-nserror html_css_fetcher_register(void);
-nserror html_css_fetcher_add_item(dom_string *data, nsurl *base_url,
- uint32_t *key);
-
-/**
- * Complete the HTML content state machine *iff* all scripts are finished
- */
-nserror html_proceed_to_done(html_content *html);
-
-
-/* Events */
-/**
- * Construct an event and fire it at the DOM
- *
- */
-bool fire_generic_dom_event(dom_string *type, dom_node *target,
- bool bubbles, bool cancelable);
-
-/**
- * Construct a keyboard event and fire it at the DOM
- */
-bool fire_dom_keyboard_event(dom_string *type, dom_node *target,
- bool bubbles, bool cancelable, uint32_t key);
-
-/* Useful dom_string pointers */
-struct dom_string;
-
-extern struct dom_string *html_dom_string_map;
-extern struct dom_string *html_dom_string_id;
-extern struct dom_string *html_dom_string_name;
-extern struct dom_string *html_dom_string_area;
-extern struct dom_string *html_dom_string_a;
-extern struct dom_string *html_dom_string_nohref;
-extern struct dom_string *html_dom_string_href;
-extern struct dom_string *html_dom_string_target;
-extern struct dom_string *html_dom_string_shape;
-extern struct dom_string *html_dom_string_default;
-extern struct dom_string *html_dom_string_rect;
-extern struct dom_string *html_dom_string_rectangle;
-extern struct dom_string *html_dom_string_coords;
-extern struct dom_string *html_dom_string_circle;
-extern struct dom_string *html_dom_string_poly;
-extern struct dom_string *html_dom_string_polygon;
-extern struct dom_string *html_dom_string_text_javascript;
-extern struct dom_string *html_dom_string_type;
-extern struct dom_string *html_dom_string_src;
-
-#endif
diff --git a/content/handlers/html/imagemap.c b/content/handlers/html/imagemap.c
index 37095e2..f23be23 100644
--- a/content/handlers/html/imagemap.c
+++ b/content/handlers/html/imagemap.c
@@ -37,7 +37,7 @@
#include "html/box.h"
#include "html/box_construct.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/imagemap.h"
#define HASH_SIZE 31 /* fixed size hash table */
diff --git a/content/handlers/html/interaction.c
b/content/handlers/html/interaction.c
index e4ef2f1..3f401bd 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -53,7 +53,7 @@
#include "html/box_inspect.h"
#include "html/font.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/imagemap.h"
#include "html/search.h"
#include "html/interaction.h"
diff --git a/content/handlers/html/interaction.h
b/content/handlers/html/interaction.h
index c1339c0..fe8bead 100644
--- a/content/handlers/html/interaction.h
+++ b/content/handlers/html/interaction.h
@@ -64,14 +64,60 @@ nserror html_mouse_track(struct content *c, struct
browser_window *bw,
nserror html_mouse_action(struct content *c, struct browser_window *bw,
browser_mouse_state mouse, int x, int y);
+
bool html_keypress(struct content *c, uint32_t key);
+
void html_overflow_scroll_callback(void *client_data,
struct scrollbar_msg_data *scrollbar_data);
+
void html_search(struct content *c, void *context,
search_flags_t flags, const char *string);
+
void html_search_clear(struct content *c);
+
+/**
+ * Set our drag status, and inform whatever owns the content
+ *
+ * \param html HTML content
+ * \param drag_type Type of drag
+ * \param drag_owner What owns the drag
+ * \param rect Pointer movement bounds
+ */
+void html_set_drag_type(html_content *html, html_drag_type drag_type,
+ union html_drag_owner drag_owner, const struct rect *rect);
+
+
+/**
+ * Set our selection status, and inform whatever owns the content
+ *
+ * \param html HTML content
+ * \param selection_type Type of selection
+ * \param selection_owner What owns the selection
+ * \param read_only True iff selection is read only
+ */
+void html_set_selection(html_content *html, html_selection_type selection_type,
+ union html_selection_owner selection_owner, bool read_only);
+
+
+/**
+ * Set our input focus, and inform whatever owns the content
+ *
+ * \param html HTML content
+ * \param focus_type Type of input focus
+ * \param focus_owner What owns the focus
+ * \param hide_caret True iff caret to be hidden
+ * \param x Carret x-coord rel to owner
+ * \param y Carret y-coord rel to owner
+ * \param height Carret height
+ * \param clip Carret clip rect
+ */
+void html_set_focus(html_content *html, html_focus_type focus_type,
+ union html_focus_owner focus_owner, bool hide_caret,
+ int x, int y, int height, const struct rect *clip);
+
+
#endif
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 128b12c..3d022ab 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -58,7 +58,7 @@
#include "html/html.h"
#include "html/html_save.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/font.h"
diff --git a/content/handlers/html/object.c b/content/handlers/html/object.c
index e8cdc7d..ba1470b 100644
--- a/content/handlers/html/object.c
+++ b/content/handlers/html/object.c
@@ -41,9 +41,10 @@
#include "desktop/gui_internal.h"
#include "html/html.h"
+#include "html/private.h"
+#include "html/interaction.h"
#include "html/box.h"
#include "html/box_inspect.h"
-#include "html/html_internal.h"
#include "html/object.h"
/* break reference loop */
diff --git a/content/handlers/html/private.h b/content/handlers/html/private.h
new file mode 100644
index 0000000..134acff
--- /dev/null
+++ b/content/handlers/html/private.h
@@ -0,0 +1,386 @@
+/*
+ * Copyright 2004 James Bursa <[email protected]>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ * Private data for text/html content.
+ */
+
+#ifndef NETSURF_HTML_PRIVATE_H
+#define NETSURF_HTML_PRIVATE_H
+
+#include <libcss/libcss.h>
+#include <dom/bindings/hubbub/parser.h>
+
+#include "netsurf/types.h"
+#include "content/content_protected.h"
+#include "desktop/selection.h"
+
+
+struct gui_layout_table;
+struct scrollbar_msg_data;
+struct content_redraw_data;
+
+typedef enum {
+ HTML_DRAG_NONE, /** No drag */
+ HTML_DRAG_SELECTION, /** Own; Text selection */
+ HTML_DRAG_SCROLLBAR, /** Not own; drag in scrollbar widget */
+ HTML_DRAG_TEXTAREA_SELECTION, /** Not own; drag in textarea widget */
+ HTML_DRAG_TEXTAREA_SCROLLBAR, /** Not own; drag in textarea widget */
+ HTML_DRAG_CONTENT_SELECTION, /** Not own; drag in child content */
+ HTML_DRAG_CONTENT_SCROLL /** Not own; drag in child content */
+} html_drag_type;
+
+/**
+ * For drags we don't own
+ */
+union html_drag_owner {
+ bool no_owner;
+ struct box *content;
+ struct scrollbar *scrollbar;
+ struct box *textarea;
+};
+
+typedef enum {
+ HTML_SELECTION_NONE, /** No selection */
+ HTML_SELECTION_TEXTAREA, /** Selection in one of our textareas */
+ HTML_SELECTION_SELF, /** Selection in this html content */
+ HTML_SELECTION_CONTENT /** Selection in child content */
+} html_selection_type;
+
+/**
+ * For getting at selections in this content or things in this content
+ */
+union html_selection_owner {
+ bool none;
+ struct box *textarea;
+ struct box *content;
+};
+
+typedef enum {
+ HTML_FOCUS_SELF, /**< Focus is our own */
+ HTML_FOCUS_CONTENT, /**< Focus belongs to child content */
+ HTML_FOCUS_TEXTAREA /**< Focus belongs to textarea */
+} html_focus_type;
+
+/**
+ * For directing input
+ */
+union html_focus_owner {
+ bool self;
+ struct box *textarea;
+ struct box *content;
+};
+
+/**
+ * Data specific to CONTENT_HTML.
+ */
+typedef struct html_content {
+ struct content base;
+
+ dom_hubbub_parser *parser; /**< Parser object handle */
+ bool parse_completed; /**< Whether the parse has been completed */
+ bool conversion_begun; /**< Whether or not the conversion has begun */
+
+ /** Document tree */
+ dom_document *document;
+ /** Quirkyness of document */
+ dom_document_quirks_mode quirks;
+
+ /** Encoding of source, NULL if unknown. */
+ char *encoding;
+ /** Source of encoding information. */
+ dom_hubbub_encoding_source encoding_source;
+
+ /** Base URL (may be a copy of content->url). */
+ nsurl *base_url;
+ /** Base target */
+ char *base_target;
+
+ /** CSS length conversion context for document. */
+ nscss_len_ctx len_ctx;
+
+ /** Content has been aborted in the LOADING state */
+ bool aborted;
+
+ /** Whether a meta refresh has been handled */
+ bool refresh;
+
+ /** Whether a layout (reflow) is in progress */
+ bool reflowing;
+
+ /** Whether an initial layout has been done */
+ bool had_initial_layout;
+
+ /** Whether scripts are enabled for this content */
+ bool enable_scripting;
+
+ /* Title element node */
+ dom_node *title;
+
+ /** A talloc context purely for the render box tree */
+ int *bctx;
+ /** A context pointer for the box conversion, NULL if no conversion
+ * is in progress.
+ */
+ void *box_conversion_context;
+ /** Box tree, or NULL. */
+ struct box *layout;
+ /** Document background colour. */
+ colour background_colour;
+
+ /** Font callback table */
+ const struct gui_layout_table *font_func;
+
+ /** Number of entries in scripts */
+ unsigned int scripts_count;
+ /** Scripts */
+ struct html_script *scripts;
+ /** javascript thread in use */
+ struct jsthread *jsthread;
+
+ /** Number of entries in stylesheet_content. */
+ unsigned int stylesheet_count;
+ /** Stylesheets. Each may be NULL. */
+ struct html_stylesheet *stylesheets;
+ /**< Style selection context */
+ css_select_ctx *select_ctx;
+ /**< Style selection media specification */
+ css_media media;
+ /**< Universal selector */
+ lwc_string *universal;
+
+ /** Number of entries in object_list. */
+ unsigned int num_objects;
+ /** List of objects. */
+ struct content_html_object *object_list;
+ /** Forms, in reverse order to document. */
+ struct form *forms;
+ /** Hash table of imagemaps. */
+ struct imagemap **imagemaps;
+
+ /** Browser window containing this document, or NULL if not open. */
+ struct browser_window *bw;
+
+ /** Frameset information */
+ struct content_html_frames *frameset;
+
+ /** Inline frame information */
+ struct content_html_iframe *iframe;
+
+ /** Content of type CONTENT_HTML containing this, or NULL if not an
+ * object within a page. */
+ struct html_content *page;
+
+ /** Current drag type */
+ html_drag_type drag_type;
+ /** Widget capturing all mouse events */
+ union html_drag_owner drag_owner;
+
+ /** Current selection state */
+ html_selection_type selection_type;
+ /** Current selection owner */
+ union html_selection_owner selection_owner;
+
+ /** Current input focus target type */
+ html_focus_type focus_type;
+ /** Current input focus target */
+ union html_focus_owner focus_owner;
+
+ /** HTML content's own text selection object */
+ struct selection sel;
+
+ /**
+ * Open core-handled form SELECT menu, or NULL if none
+ * currently open.
+ */
+ struct form_control *visible_select_menu;
+
+ /** Context for free text search, or NULL if none */
+ struct search_context *search;
+ /** Search string or NULL */
+ char *search_string;
+
+} html_content;
+
+/**
+ * Render padding and margin box outlines in html_redraw().
+ */
+extern bool html_redraw_debug;
+
+
+/* in html/html.c */
+
+/**
+ * redraw a box
+ *
+ * \param htmlc HTML content
+ * \param box The box to redraw.
+ */
+void html__redraw_a_box(html_content *htmlc, struct box *box);
+
+
+/**
+ * Get the browser window containing an HTML content
+ *
+ * \param c HTML content
+ * \return the browser window
+ */
+struct browser_window *html_get_browser_window(struct content *c);
+
+
+/**
+ * Complete conversion of an HTML document
+ *
+ * \param htmlc Content to convert
+ */
+void html_finish_conversion(html_content *htmlc);
+
+
+/**
+ * Test if an HTML content conversion can begin
+ *
+ * \param htmlc html content to test
+ * \return true iff the html content conversion can begin
+ */
+bool html_can_begin_conversion(html_content *htmlc);
+
+
+/**
+ * Begin conversion of an HTML document
+ *
+ * \param htmlc Content to convert
+ */
+bool html_begin_conversion(html_content *htmlc);
+
+
+/**
+ * execute some text as a script element
+ */
+bool html_exec(struct content *c, const char *src, size_t srclen);
+
+
+/**
+ * Attempt script execution for defer and async scripts
+ *
+ * execute scripts using algorithm found in:
+ *
http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#the-script-element
+ *
+ * \param htmlc html content.
+ * \param allow_defer allow deferred execution, if not, only async scripts.
+ * \return NSERROR_OK error code.
+ */
+nserror html_script_exec(html_content *htmlc, bool allow_defer);
+
+
+/**
+ * Free all script resources and references for a html content.
+ *
+ * \param htmlc html content.
+ * \return NSERROR_OK or error code.
+ */
+nserror html_script_free(html_content *htmlc);
+
+
+/**
+ * Check if any of the scripts loaded were insecure
+ */
+bool html_saw_insecure_scripts(html_content *htmlc);
+
+
+/**
+ * Complete the HTML content state machine *iff* all scripts are finished
+ */
+nserror html_proceed_to_done(html_content *html);
+
+
+/* in html/redraw.c */
+bool html_redraw(struct content *c, struct content_redraw_data *data,
+ const struct rect *clip, const struct redraw_context *ctx);
+
+
+/* in html/redraw_border.c */
+bool html_redraw_borders(struct box *box, int x_parent, int y_parent,
+ int p_width, int p_height, const struct rect *clip, float scale,
+ const struct redraw_context *ctx);
+
+
+bool html_redraw_inline_borders(struct box *box, struct rect b,
+ const struct rect *clip, float scale, bool first, bool last,
+ const struct redraw_context *ctx);
+
+
+/* in html/script.c */
+dom_hubbub_error html_process_script(void *ctx, dom_node *node);
+
+
+/* in html/forms.c */
+struct form *html_forms_get_forms(const char *docenc, dom_html_document *doc);
+struct form_control *html_forms_get_control_for_node(struct form *forms,
+ dom_node *node);
+
+
+/* in html/css_fetcher.c */
+/**
+ * Register the fetcher for the pseudo x-ns-css scheme.
+ *
+ * \return NSERROR_OK on successful registration or error code on failure.
+ */
+nserror html_css_fetcher_register(void);
+nserror html_css_fetcher_add_item(dom_string *data, nsurl *base_url,
+ uint32_t *key);
+
+
+/* Events */
+/**
+ * Construct an event and fire it at the DOM
+ *
+ */
+bool fire_generic_dom_event(dom_string *type, dom_node *target,
+ bool bubbles, bool cancelable);
+
+/**
+ * Construct a keyboard event and fire it at the DOM
+ */
+bool fire_dom_keyboard_event(dom_string *type, dom_node *target,
+ bool bubbles, bool cancelable, uint32_t key);
+
+/* Useful dom_string pointers */
+struct dom_string;
+
+extern struct dom_string *html_dom_string_map;
+extern struct dom_string *html_dom_string_id;
+extern struct dom_string *html_dom_string_name;
+extern struct dom_string *html_dom_string_area;
+extern struct dom_string *html_dom_string_a;
+extern struct dom_string *html_dom_string_nohref;
+extern struct dom_string *html_dom_string_href;
+extern struct dom_string *html_dom_string_target;
+extern struct dom_string *html_dom_string_shape;
+extern struct dom_string *html_dom_string_default;
+extern struct dom_string *html_dom_string_rect;
+extern struct dom_string *html_dom_string_rectangle;
+extern struct dom_string *html_dom_string_coords;
+extern struct dom_string *html_dom_string_circle;
+extern struct dom_string *html_dom_string_poly;
+extern struct dom_string *html_dom_string_polygon;
+extern struct dom_string *html_dom_string_text_javascript;
+extern struct dom_string *html_dom_string_type;
+extern struct dom_string *html_dom_string_src;
+
+#endif
diff --git a/content/handlers/html/redraw.c b/content/handlers/html/redraw.c
index ee6fab2..fa4cd95 100644
--- a/content/handlers/html/redraw.c
+++ b/content/handlers/html/redraw.c
@@ -58,7 +58,7 @@
#include "html/box_manipulate.h"
#include "html/font.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/layout.h"
#include "html/search.h"
diff --git a/content/handlers/html/redraw_border.c
b/content/handlers/html/redraw_border.c
index 0b3d858..39ed432 100644
--- a/content/handlers/html/redraw_border.c
+++ b/content/handlers/html/redraw_border.c
@@ -30,7 +30,7 @@
#include "netsurf/css.h"
#include "html/box.h"
-#include "html/html_internal.h"
+#include "html/private.h"
static plot_style_t plot_style_bdr = {
diff --git a/content/handlers/html/script.c b/content/handlers/html/script.c
index 81bdccd..99275c0 100644
--- a/content/handlers/html/script.c
+++ b/content/handlers/html/script.c
@@ -40,7 +40,7 @@
#include "content/hlcache.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
typedef bool (script_handler_t)(struct jsthread *jsthread, const uint8_t
*data, size_t size, const char *name);
diff --git a/content/handlers/html/search.c b/content/handlers/html/search.c
index 864fac6..8ccb692 100644
--- a/content/handlers/html/search.c
+++ b/content/handlers/html/search.c
@@ -42,7 +42,7 @@
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/search.h"
#ifndef NOF_ELEMENTS
diff --git a/content/handlers/javascript/duktape/Document.bnd
b/content/handlers/javascript/duktape/Document.bnd
index de96cd8..2f9adc3 100644
--- a/content/handlers/javascript/duktape/Document.bnd
+++ b/content/handlers/javascript/duktape/Document.bnd
@@ -14,7 +14,7 @@ prologue Document()
#include "utils/libdom.h"
#include "utils/utils.h"
#include "content/hlcache.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "content/urldb.h"
#define HANDLER_MAGIC MAGIC(HANDLER_MAP)
diff --git a/content/handlers/javascript/duktape/Window.bnd
b/content/handlers/javascript/duktape/Window.bnd
index 2c26f1d..f7d143f 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -19,7 +19,7 @@ class Window {
#include "netsurf/browser_window.h"
#include "content/hlcache.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "desktop/gui_internal.h"
#include "netsurf/misc.h"
#include "utils/ring.h"
diff --git a/desktop/selection.c b/desktop/selection.c
index 6c8f5d7..17ccb45 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -34,7 +34,7 @@
#include "netsurf/form.h"
#include "html/box.h"
#include "html/box_inspect.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/font.h"
#include "text/textplain.h"
#include "netsurf/browser_window.h"
diff --git a/desktop/textinput.c b/desktop/textinput.c
index f8da3d8..e19fb61 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -39,7 +39,7 @@
#include "netsurf/browser_window.h"
#include "netsurf/keypress.h"
#include "html/box.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/layout.h"
#include "desktop/browser_private.h"
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/box_construct.c | 2 +-
content/handlers/html/box_inspect.c | 2 +-
content/handlers/html/box_manipulate.c | 6 +-
content/handlers/html/box_normalise.c | 4 +-
content/handlers/html/box_special.c | 2 +-
content/handlers/html/box_textarea.c | 3 +-
content/handlers/html/css.c | 47 +++++--
content/handlers/html/css.h | 109 ++++++++++++++++
content/handlers/html/css_fetcher.c | 2 +-
content/handlers/html/form.c | 6 +-
content/handlers/html/forms.c | 2 +-
content/handlers/html/html.c | 13 +-
content/handlers/html/imagemap.c | 2 +-
content/handlers/html/interaction.c | 2 +-
content/handlers/html/interaction.h | 46 +++++++
content/handlers/html/layout.c | 2 +-
content/handlers/html/object.c | 3 +-
.../handlers/html/{html_internal.h => private.h} | 135 ++++++++------------
content/handlers/html/redraw.c | 2 +-
content/handlers/html/redraw_border.c | 2 +-
content/handlers/html/script.c | 2 +-
content/handlers/html/search.c | 2 +-
content/handlers/javascript/duktape/Document.bnd | 2 +-
content/handlers/javascript/duktape/Window.bnd | 2 +-
desktop/selection.c | 2 +-
desktop/textinput.c | 2 +-
26 files changed, 279 insertions(+), 125 deletions(-)
create mode 100644 content/handlers/html/css.h
rename content/handlers/html/{html_internal.h => private.h} (79%)
diff --git a/content/handlers/html/box_construct.c
b/content/handlers/html/box_construct.c
index f1ea71d..3d10017 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -37,7 +37,7 @@
#include "css/select.h"
#include "desktop/gui_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/object.h"
#include "html/box.h"
#include "html/box_manipulate.h"
diff --git a/content/handlers/html/box_inspect.c
b/content/handlers/html/box_inspect.c
index 268ed3d..df9a1b4 100644
--- a/content/handlers/html/box_inspect.c
+++ b/content/handlers/html/box_inspect.c
@@ -34,9 +34,9 @@
#include "css/dump.h"
#include "desktop/scrollbar.h"
+#include "html/private.h"
#include "html/box.h"
#include "html/box_inspect.h"
-#include "html/html_internal.h"
/**
* Direction to move in a box-tree walk
diff --git a/content/handlers/html/box_manipulate.c
b/content/handlers/html/box_manipulate.c
index 0bc1c9f..d88e360 100644
--- a/content/handlers/html/box_manipulate.c
+++ b/content/handlers/html/box_manipulate.c
@@ -32,11 +32,11 @@
#include "netsurf/mouse.h"
#include "desktop/scrollbar.h"
-#include "html/box.h"
-#include "html/box_manipulate.h"
+#include "html/private.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
#include "html/interaction.h"
+#include "html/box.h"
+#include "html/box_manipulate.h"
/**
diff --git a/content/handlers/html/box_normalise.c
b/content/handlers/html/box_normalise.c
index fbdb6cd..b7032da 100644
--- a/content/handlers/html/box_normalise.c
+++ b/content/handlers/html/box_normalise.c
@@ -32,11 +32,11 @@
#include "utils/errors.h"
#include "css/select.h"
+#include "html/private.h"
+#include "html/table.h"
#include "html/box.h"
#include "html/box_manipulate.h"
#include "html/box_normalise.h"
-#include "html/html_internal.h"
-#include "html/table.h"
/* Define to enable box normalise debug */
#undef BOX_NORMALISE_DEBUG
diff --git a/content/handlers/html/box_special.c
b/content/handlers/html/box_special.c
index 2d3bd05..06f2f91 100644
--- a/content/handlers/html/box_special.c
+++ b/content/handlers/html/box_special.c
@@ -41,7 +41,7 @@
#include "desktop/frame_types.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/object.h"
#include "html/box.h"
#include "html/box_manipulate.h"
diff --git a/content/handlers/html/box_textarea.c
b/content/handlers/html/box_textarea.c
index 476773f..1038be3 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -31,7 +31,8 @@
#include "desktop/textarea.h"
#include "desktop/gui_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
+#include "html/interaction.h"
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/box_textarea.h"
diff --git a/content/handlers/html/css.c b/content/handlers/html/css.c
index 23d51f1..5758981 100644
--- a/content/handlers/html/css.c
+++ b/content/handlers/html/css.c
@@ -42,13 +42,17 @@
#include "desktop/gui_internal.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
+#include "html/css.h"
static nsurl *html_default_stylesheet_url;
static nsurl *html_adblock_stylesheet_url;
static nsurl *html_quirks_stylesheet_url;
static nsurl *html_user_stylesheet_url;
+/**
+ * Convert css error to netsurf error.
+ */
static nserror css_error_to_nserror(css_error error)
{
switch (error) {
@@ -82,10 +86,10 @@ static nserror css_error_to_nserror(css_error error)
return NSERROR_CSS;
}
+
/**
* Callback for fetchcache() for stylesheets.
*/
-
static nserror
html_convert_css_callback(hlcache_handle *css,
const hlcache_event *event,
@@ -141,6 +145,7 @@ html_convert_css_callback(hlcache_handle *css,
return NSERROR_OK;
}
+
static nserror
html_stylesheet_from_domnode(html_content *c,
dom_node *node,
@@ -195,6 +200,7 @@ html_stylesheet_from_domnode(html_content *c,
return NSERROR_OK;
}
+
/**
* Process an inline stylesheet in the document.
*
@@ -202,7 +208,6 @@ html_stylesheet_from_domnode(html_content *c,
* \param style xml node of style element
* \return true on success, false if an error occurred
*/
-
static struct html_stylesheet *
html_create_style_element(html_content *c, dom_node *style)
{
@@ -254,8 +259,9 @@ html_create_style_element(html_content *c, dom_node *style)
return c->stylesheets + (c->stylesheet_count - 1);
}
-static bool html_css_process_modified_style(html_content *c,
- struct html_stylesheet *s)
+
+static bool
+html_css_process_modified_style(html_content *c, struct html_stylesheet *s)
{
hlcache_handle *sheet = NULL;
nserror error;
@@ -291,6 +297,10 @@ static bool html_css_process_modified_style(html_content
*c,
return true;
}
+
+/**
+ * process a stylesheet that has been modified.
+ */
static void html_css_process_modified_styles(void *pw)
{
html_content *c = pw;
@@ -310,6 +320,8 @@ static void html_css_process_modified_styles(void *pw)
}
}
+
+/* exported function documented in html/css.h */
bool html_css_update_style(html_content *c, dom_node *style)
{
unsigned int i;
@@ -337,6 +349,8 @@ bool html_css_update_style(html_content *c, dom_node *style)
return true;
}
+
+/* exported function documented in html/css.h */
bool html_css_process_style(html_content *c, dom_node *node)
{
unsigned int i;
@@ -368,6 +382,8 @@ bool html_css_process_style(html_content *c, dom_node *node)
return true;
}
+
+/* exported function documented in html/css.h */
bool html_css_process_link(html_content *htmlc, dom_node *node)
{
dom_string *rel, *type_attr, *media, *href;
@@ -475,6 +491,7 @@ no_memory:
return false;
}
+
/* exported interface documented in html/html.h */
struct html_stylesheet *html_get_stylesheets(hlcache_handle *h, unsigned int
*n)
{
@@ -488,8 +505,9 @@ struct html_stylesheet *html_get_stylesheets(hlcache_handle
*h, unsigned int *n)
return c->stylesheets;
}
-/* exported interface documented in html/html_internal.h */
-bool html_saw_insecure_stylesheets(html_content *html)
+
+/* exported function documented in html/css.h */
+bool html_css_saw_insecure_stylesheets(html_content *html)
{
struct html_stylesheet *s;
unsigned int i;
@@ -506,7 +524,8 @@ bool html_saw_insecure_stylesheets(html_content *html)
return false;
}
-/* exported interface documented in html/html_internal.h */
+
+/* exported function documented in html/css.h */
nserror html_css_free_stylesheets(html_content *html)
{
unsigned int i;
@@ -526,7 +545,8 @@ nserror html_css_free_stylesheets(html_content *html)
return NSERROR_OK;
}
-/* exported interface documented in html/html_internal.h */
+
+/* exported function documented in html/css.h */
nserror html_css_quirks_stylesheets(html_content *c)
{
nserror ns_error = NSERROR_OK;
@@ -554,7 +574,8 @@ nserror html_css_quirks_stylesheets(html_content *c)
return ns_error;
}
-/* exported interface documented in html/html_internal.h */
+
+/* exported function documented in html/css.h */
nserror html_css_new_stylesheets(html_content *c)
{
nserror ns_error;
@@ -624,6 +645,8 @@ nserror html_css_new_stylesheets(html_content *c)
return ns_error;
}
+
+/* exported function documented in html/css.h */
nserror
html_css_new_selection_context(html_content *c, css_select_ctx
**ret_select_ctx)
{
@@ -686,6 +709,8 @@ html_css_new_selection_context(html_content *c,
css_select_ctx **ret_select_ctx)
return NSERROR_OK;
}
+
+/* exported function documented in html/css.h */
nserror html_css_init(void)
{
nserror error;
@@ -715,6 +740,8 @@ nserror html_css_init(void)
return error;
}
+
+/* exported function documented in html/css.h */
void html_css_fini(void)
{
if (html_user_stylesheet_url != NULL) {
diff --git a/content/handlers/html/css.h b/content/handlers/html/css.h
new file mode 100644
index 0000000..35f6a61
--- /dev/null
+++ b/content/handlers/html/css.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2020 Vincent Sanders <[email protected]>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ * HTML content handler CSS interface.
+ */
+
+#ifndef NETSURF_HTML_CSS_H
+#define NETSURF_HTML_CSS_H
+
+/**
+ * Initialise html content css handling.
+ *
+ * \return NSERROR_OK on success else error code
+ */
+nserror html_css_init(void);
+
+/**
+ * Finalise html content css handling.
+ */
+void html_css_fini(void);
+
+/**
+ * create a new css selection context for an html content.
+ *
+ * \param c The html content to create css selction on.
+ * \param select_ctx A pointer to receive the new context.
+ * \return NSERROR_OK on success and \a select_ctx updated else error code
+ */
+nserror html_css_new_selection_context(struct html_content *c, css_select_ctx
**select_ctx);
+
+/**
+ * Initialise core stylesheets for a content
+ *
+ * \param c content structure to update
+ * \return NSERROR_OK on success or error code
+ */
+nserror html_css_new_stylesheets(struct html_content *c);
+
+/**
+ * Initialise quirk stylesheets for a content
+ *
+ * \param c content structure to update
+ * \return NSERROR_OK on success or error code
+ */
+nserror html_css_quirks_stylesheets(struct html_content *c);
+
+/**
+ * Free all css stylesheets associated with an HTML content.
+ *
+ * \param html The HTML content to free stylesheets from.
+ * \return NSERROR_OK on success or error code.
+ */
+nserror html_css_free_stylesheets(struct html_content *html);
+
+/**
+ * determine if any of the stylesheets were loaded insecurely
+ *
+ * \param htmlc The HTML content to check.
+ * \return true if there were insecurely loadd stylesheets else false.
+ */
+bool html_css_saw_insecure_stylesheets(struct html_content *htmlc);
+
+/**
+ * process a css stylesheet dom LINK node
+ *
+ * \param htmlc The HTML content.
+ * \param node the DOM link node to process.
+ * \return true on success else false.
+ */
+bool html_css_process_link(struct html_content *htmlc, dom_node *node);
+
+/**
+ * process a css style dom node
+ *
+ * \param htmlc The HTML content.
+ * \param node the DOM node to process.
+ * \return true on success else false.
+ */
+bool html_css_process_style(struct html_content *htmlc, dom_node *node);
+
+/**
+ * process a css style dom node update
+ *
+ * \param htmlc The HTML content.
+ * \param node the DOM node to process.
+ * \return true on success else false.
+ */
+bool html_css_update_style(struct html_content *htmlc, dom_node *node);
+
+
+
+#endif
diff --git a/content/handlers/html/css_fetcher.c
b/content/handlers/html/css_fetcher.c
index ae20879..4e0f672 100644
--- a/content/handlers/html/css_fetcher.c
+++ b/content/handlers/html/css_fetcher.c
@@ -39,7 +39,7 @@
#include "content/fetch.h"
#include "content/fetchers.h"
-#include "html/html_internal.h"
+#include "html/private.h"
typedef struct html_css_fetcher_item {
uint32_t key;
diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c
index 86c4196..93297e8 100644
--- a/content/handlers/html/form.c
+++ b/content/handlers/html/form.c
@@ -52,13 +52,13 @@
#include "desktop/textarea.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
+#include "html/private.h"
+#include "html/layout.h"
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/font.h"
#include "html/form_internal.h"
-#include "html/html.h"
-#include "html/html_internal.h"
-#include "html/layout.h"
#define MAX_SELECT_HEIGHT 210
#define SELECT_LINE_SPACING 0.2
diff --git a/content/handlers/html/forms.c b/content/handlers/html/forms.c
index 896263d..b8b9cb5 100644
--- a/content/handlers/html/forms.c
+++ b/content/handlers/html/forms.c
@@ -26,7 +26,7 @@
#include "utils/log.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
/**
* process form element from dom
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 2f6377f..b4cda4a 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -56,7 +56,8 @@
#include "desktop/gui_internal.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
+#include "html/css.h"
#include "html/object.h"
#include "html/html_save.h"
#include "html/interaction.h"
@@ -2816,7 +2817,7 @@ html_saw_insecure_objects(struct content *c)
}
/* Now check stylesheets */
- if (html_saw_insecure_stylesheets(htmlc)) {
+ if (html_css_saw_insecure_stylesheets(htmlc)) {
return true;
}
@@ -2894,12 +2895,8 @@ error:
return error;
}
-/**
- * Get the browser window containing an HTML content
- *
- * \param c HTML content
- * \return the browser window
- */
+
+/* exported function documented in html/private.h */
struct browser_window *html_get_browser_window(struct content *c)
{
html_content *html = (html_content *) c;
diff --git a/content/handlers/html/imagemap.c b/content/handlers/html/imagemap.c
index 37095e2..f23be23 100644
--- a/content/handlers/html/imagemap.c
+++ b/content/handlers/html/imagemap.c
@@ -37,7 +37,7 @@
#include "html/box.h"
#include "html/box_construct.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/imagemap.h"
#define HASH_SIZE 31 /* fixed size hash table */
diff --git a/content/handlers/html/interaction.c
b/content/handlers/html/interaction.c
index e4ef2f1..3f401bd 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -53,7 +53,7 @@
#include "html/box_inspect.h"
#include "html/font.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/imagemap.h"
#include "html/search.h"
#include "html/interaction.h"
diff --git a/content/handlers/html/interaction.h
b/content/handlers/html/interaction.h
index c1339c0..fe8bead 100644
--- a/content/handlers/html/interaction.h
+++ b/content/handlers/html/interaction.h
@@ -64,14 +64,60 @@ nserror html_mouse_track(struct content *c, struct
browser_window *bw,
nserror html_mouse_action(struct content *c, struct browser_window *bw,
browser_mouse_state mouse, int x, int y);
+
bool html_keypress(struct content *c, uint32_t key);
+
void html_overflow_scroll_callback(void *client_data,
struct scrollbar_msg_data *scrollbar_data);
+
void html_search(struct content *c, void *context,
search_flags_t flags, const char *string);
+
void html_search_clear(struct content *c);
+
+/**
+ * Set our drag status, and inform whatever owns the content
+ *
+ * \param html HTML content
+ * \param drag_type Type of drag
+ * \param drag_owner What owns the drag
+ * \param rect Pointer movement bounds
+ */
+void html_set_drag_type(html_content *html, html_drag_type drag_type,
+ union html_drag_owner drag_owner, const struct rect *rect);
+
+
+/**
+ * Set our selection status, and inform whatever owns the content
+ *
+ * \param html HTML content
+ * \param selection_type Type of selection
+ * \param selection_owner What owns the selection
+ * \param read_only True iff selection is read only
+ */
+void html_set_selection(html_content *html, html_selection_type selection_type,
+ union html_selection_owner selection_owner, bool read_only);
+
+
+/**
+ * Set our input focus, and inform whatever owns the content
+ *
+ * \param html HTML content
+ * \param focus_type Type of input focus
+ * \param focus_owner What owns the focus
+ * \param hide_caret True iff caret to be hidden
+ * \param x Carret x-coord rel to owner
+ * \param y Carret y-coord rel to owner
+ * \param height Carret height
+ * \param clip Carret clip rect
+ */
+void html_set_focus(html_content *html, html_focus_type focus_type,
+ union html_focus_owner focus_owner, bool hide_caret,
+ int x, int y, int height, const struct rect *clip);
+
+
#endif
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 128b12c..3d022ab 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -58,7 +58,7 @@
#include "html/html.h"
#include "html/html_save.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/font.h"
diff --git a/content/handlers/html/object.c b/content/handlers/html/object.c
index e8cdc7d..ba1470b 100644
--- a/content/handlers/html/object.c
+++ b/content/handlers/html/object.c
@@ -41,9 +41,10 @@
#include "desktop/gui_internal.h"
#include "html/html.h"
+#include "html/private.h"
+#include "html/interaction.h"
#include "html/box.h"
#include "html/box_inspect.h"
-#include "html/html_internal.h"
#include "html/object.h"
/* break reference loop */
diff --git a/content/handlers/html/html_internal.h
b/content/handlers/html/private.h
similarity index 79%
rename from content/handlers/html/html_internal.h
rename to content/handlers/html/private.h
index ae3182a..134acff 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/private.h
@@ -21,8 +21,8 @@
* Private data for text/html content.
*/
-#ifndef NETSURF_HTML_HTML_INTERNAL_H
-#define NETSURF_HTML_HTML_INTERNAL_H
+#ifndef NETSURF_HTML_PRIVATE_H
+#define NETSURF_HTML_PRIVATE_H
#include <libcss/libcss.h>
#include <dom/bindings/hubbub/parser.h>
@@ -205,8 +205,10 @@ typedef struct html_content {
/** HTML content's own text selection object */
struct selection sel;
- /** Open core-handled form SELECT menu,
- * or NULL if none currently open. */
+ /**
+ * Open core-handled form SELECT menu, or NULL if none
+ * currently open.
+ */
struct form_control *visible_select_menu;
/** Context for free text search, or NULL if none */
@@ -216,52 +218,32 @@ typedef struct html_content {
} html_content;
-/** Render padding and margin box outlines in html_redraw(). */
+/**
+ * Render padding and margin box outlines in html_redraw().
+ */
extern bool html_redraw_debug;
-void html__redraw_a_box(html_content *html, struct box *box);
-/**
- * Set our drag status, and inform whatever owns the content
- *
- * \param html HTML content
- * \param drag_type Type of drag
- * \param drag_owner What owns the drag
- * \param rect Pointer movement bounds
- */
-void html_set_drag_type(html_content *html, html_drag_type drag_type,
- union html_drag_owner drag_owner, const struct rect *rect);
+/* in html/html.c */
/**
- * Set our selection status, and inform whatever owns the content
+ * redraw a box
*
- * \param html HTML content
- * \param selection_type Type of selection
- * \param selection_owner What owns the selection
- * \param read_only True iff selection is read only
+ * \param htmlc HTML content
+ * \param box The box to redraw.
*/
-void html_set_selection(html_content *html, html_selection_type selection_type,
- union html_selection_owner selection_owner, bool read_only);
+void html__redraw_a_box(html_content *htmlc, struct box *box);
+
/**
- * Set our input focus, and inform whatever owns the content
+ * Get the browser window containing an HTML content
*
- * \param html HTML content
- * \param focus_type Type of input focus
- * \param focus_owner What owns the focus
- * \param hide_caret True iff caret to be hidden
- * \param x Carret x-coord rel to owner
- * \param y Carret y-coord rel to owner
- * \param height Carret height
- * \param clip Carret clip rect
+ * \param c HTML content
+ * \return the browser window
*/
-void html_set_focus(html_content *html, html_focus_type focus_type,
- union html_focus_owner focus_owner, bool hide_caret,
- int x, int y, int height, const struct rect *clip);
-
-
struct browser_window *html_get_browser_window(struct content *c);
+
/**
* Complete conversion of an HTML document
*
@@ -269,6 +251,7 @@ struct browser_window *html_get_browser_window(struct
content *c);
*/
void html_finish_conversion(html_content *htmlc);
+
/**
* Test if an HTML content conversion can begin
*
@@ -277,6 +260,7 @@ void html_finish_conversion(html_content *htmlc);
*/
bool html_can_begin_conversion(html_content *htmlc);
+
/**
* Begin conversion of an HTML document
*
@@ -284,25 +268,13 @@ bool html_can_begin_conversion(html_content *htmlc);
*/
bool html_begin_conversion(html_content *htmlc);
-/* in html/html_redraw.c */
-bool html_redraw(struct content *c, struct content_redraw_data *data,
- const struct rect *clip, const struct redraw_context *ctx);
-
-/* in html/html_redraw_border.c */
-bool html_redraw_borders(struct box *box, int x_parent, int y_parent,
- int p_width, int p_height, const struct rect *clip, float scale,
- const struct redraw_context *ctx);
-
-bool html_redraw_inline_borders(struct box *box, struct rect b,
- const struct rect *clip, float scale, bool first, bool last,
- const struct redraw_context *ctx);
-
-/* in html/html_script.c */
-dom_hubbub_error html_process_script(void *ctx, dom_node *node);
-/* in html/html.c */
+/**
+ * execute some text as a script element
+ */
bool html_exec(struct content *c, const char *src, size_t srclen);
+
/**
* Attempt script execution for defer and async scripts
*
@@ -315,6 +287,7 @@ bool html_exec(struct content *c, const char *src, size_t
srclen);
*/
nserror html_script_exec(html_content *htmlc, bool allow_defer);
+
/**
* Free all script resources and references for a html content.
*
@@ -323,41 +296,46 @@ nserror html_script_exec(html_content *htmlc, bool
allow_defer);
*/
nserror html_script_free(html_content *htmlc);
+
/**
* Check if any of the scripts loaded were insecure
*/
bool html_saw_insecure_scripts(html_content *htmlc);
-/* in html/html_forms.c */
-struct form *html_forms_get_forms(const char *docenc, dom_html_document *doc);
-struct form_control *html_forms_get_control_for_node(struct form *forms,
- dom_node *node);
-
-/* in html/html_css.c */
-nserror html_css_init(void);
-void html_css_fini(void);
/**
- * Initialise core stylesheets for a content
- *
- * \param c content structure to update
- * \return nserror
+ * Complete the HTML content state machine *iff* all scripts are finished
*/
-nserror html_css_new_stylesheets(html_content *c);
-nserror html_css_quirks_stylesheets(html_content *c);
-nserror html_css_free_stylesheets(html_content *html);
+nserror html_proceed_to_done(html_content *html);
+
+
+/* in html/redraw.c */
+bool html_redraw(struct content *c, struct content_redraw_data *data,
+ const struct rect *clip, const struct redraw_context *ctx);
-/** Return if any of the stylesheets were loaded insecurely */
-bool html_saw_insecure_stylesheets(html_content *html);
-bool html_css_process_link(html_content *htmlc, dom_node *node);
-bool html_css_process_style(html_content *htmlc, dom_node *node);
-bool html_css_update_style(html_content *c, dom_node *style);
+/* in html/redraw_border.c */
+bool html_redraw_borders(struct box *box, int x_parent, int y_parent,
+ int p_width, int p_height, const struct rect *clip, float scale,
+ const struct redraw_context *ctx);
-nserror html_css_new_selection_context(html_content *c,
- css_select_ctx **ret_select_ctx);
-/* in html/html_css_fetcher.c */
+bool html_redraw_inline_borders(struct box *box, struct rect b,
+ const struct rect *clip, float scale, bool first, bool last,
+ const struct redraw_context *ctx);
+
+
+/* in html/script.c */
+dom_hubbub_error html_process_script(void *ctx, dom_node *node);
+
+
+/* in html/forms.c */
+struct form *html_forms_get_forms(const char *docenc, dom_html_document *doc);
+struct form_control *html_forms_get_control_for_node(struct form *forms,
+ dom_node *node);
+
+
+/* in html/css_fetcher.c */
/**
* Register the fetcher for the pseudo x-ns-css scheme.
*
@@ -367,11 +345,6 @@ nserror html_css_fetcher_register(void);
nserror html_css_fetcher_add_item(dom_string *data, nsurl *base_url,
uint32_t *key);
-/**
- * Complete the HTML content state machine *iff* all scripts are finished
- */
-nserror html_proceed_to_done(html_content *html);
-
/* Events */
/**
diff --git a/content/handlers/html/redraw.c b/content/handlers/html/redraw.c
index ee6fab2..fa4cd95 100644
--- a/content/handlers/html/redraw.c
+++ b/content/handlers/html/redraw.c
@@ -58,7 +58,7 @@
#include "html/box_manipulate.h"
#include "html/font.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/layout.h"
#include "html/search.h"
diff --git a/content/handlers/html/redraw_border.c
b/content/handlers/html/redraw_border.c
index 0b3d858..39ed432 100644
--- a/content/handlers/html/redraw_border.c
+++ b/content/handlers/html/redraw_border.c
@@ -30,7 +30,7 @@
#include "netsurf/css.h"
#include "html/box.h"
-#include "html/html_internal.h"
+#include "html/private.h"
static plot_style_t plot_style_bdr = {
diff --git a/content/handlers/html/script.c b/content/handlers/html/script.c
index 81bdccd..99275c0 100644
--- a/content/handlers/html/script.c
+++ b/content/handlers/html/script.c
@@ -40,7 +40,7 @@
#include "content/hlcache.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
typedef bool (script_handler_t)(struct jsthread *jsthread, const uint8_t
*data, size_t size, const char *name);
diff --git a/content/handlers/html/search.c b/content/handlers/html/search.c
index 864fac6..8ccb692 100644
--- a/content/handlers/html/search.c
+++ b/content/handlers/html/search.c
@@ -42,7 +42,7 @@
#include "html/box.h"
#include "html/box_inspect.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/search.h"
#ifndef NOF_ELEMENTS
diff --git a/content/handlers/javascript/duktape/Document.bnd
b/content/handlers/javascript/duktape/Document.bnd
index de96cd8..2f9adc3 100644
--- a/content/handlers/javascript/duktape/Document.bnd
+++ b/content/handlers/javascript/duktape/Document.bnd
@@ -14,7 +14,7 @@ prologue Document()
#include "utils/libdom.h"
#include "utils/utils.h"
#include "content/hlcache.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "content/urldb.h"
#define HANDLER_MAGIC MAGIC(HANDLER_MAP)
diff --git a/content/handlers/javascript/duktape/Window.bnd
b/content/handlers/javascript/duktape/Window.bnd
index 2c26f1d..f7d143f 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -19,7 +19,7 @@ class Window {
#include "netsurf/browser_window.h"
#include "content/hlcache.h"
#include "html/html.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "desktop/gui_internal.h"
#include "netsurf/misc.h"
#include "utils/ring.h"
diff --git a/desktop/selection.c b/desktop/selection.c
index 6c8f5d7..17ccb45 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -34,7 +34,7 @@
#include "netsurf/form.h"
#include "html/box.h"
#include "html/box_inspect.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/font.h"
#include "text/textplain.h"
#include "netsurf/browser_window.h"
diff --git a/desktop/textinput.c b/desktop/textinput.c
index f8da3d8..e19fb61 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -39,7 +39,7 @@
#include "netsurf/browser_window.h"
#include "netsurf/keypress.h"
#include "html/box.h"
-#include "html/html_internal.h"
+#include "html/private.h"
#include "html/layout.h"
#include "desktop/browser_private.h"
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]