NetSurf
Data Structures | Macros | Functions
html.h File Reference

Interface to text/html content handler. More...

#include <stdbool.h>
#include "netsurf/types.h"
#include "netsurf/content_type.h"
#include "netsurf/browser_window.h"
#include "netsurf/mouse.h"
#include "desktop/frame_types.h"
Include dependency graph for html.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  html_stylesheet
 Container for stylesheets used by an HTML document. More...
 
struct  html_script
 Container for scripts used by an HTML document. More...
 
struct  content_html_object
 An object (img, object, etc. More...
 
struct  content_html_frames
 Frame tree (frameset or frame tag) More...
 
struct  content_html_iframe
 Inline frame list (iframe tag) More...
 

Macros

#define STYLESHEET_BASE   0 /* base style sheet */
 
#define STYLESHEET_QUIRKS   1 /* quirks mode stylesheet */
 
#define STYLESHEET_ADBLOCK   2 /* adblocking stylesheet */
 
#define STYLESHEET_USER   3 /* user stylesheet */
 
#define STYLESHEET_START   4 /* start of document stylesheets */
 

Functions

nserror html_init (void)
 initialise content handler More...
 
void html_redraw_a_box (struct hlcache_handle *h, struct box *box)
 redraw a specific box More...
 
struct content_html_frameshtml_get_frameset (struct hlcache_handle *h)
 obtain html frame content from handle More...
 
struct content_html_iframehtml_get_iframe (struct hlcache_handle *h)
 obtain html iframe content from handle More...
 
const char * html_get_base_target (struct hlcache_handle *h)
 obtain html base target from handle More...
 
void html_set_file_gadget_filename (struct hlcache_handle *hl, struct form_control *gadget, const char *fn)
 set filename on a file gadget More...
 
struct html_stylesheethtml_get_stylesheets (struct hlcache_handle *h, unsigned int *n)
 Retrieve stylesheets used by HTML document. More...
 
struct content_html_objecthtml_get_objects (struct hlcache_handle *h, unsigned int *n)
 Retrieve objects used by HTML document. More...
 
bool html_get_id_offset (struct hlcache_handle *h, lwc_string *frag_id, int *x, int *y)
 get the offset within the docuemnt of a fragment id More...
 

Detailed Description

Interface to text/html content handler.

These functions should in general be called via the content interface.

Definition in file html.h.

Macro Definition Documentation

◆ STYLESHEET_ADBLOCK

#define STYLESHEET_ADBLOCK   2 /* adblocking stylesheet */

Definition at line 150 of file html.h.

◆ STYLESHEET_BASE

#define STYLESHEET_BASE   0 /* base style sheet */

Definition at line 148 of file html.h.

◆ STYLESHEET_QUIRKS

#define STYLESHEET_QUIRKS   1 /* quirks mode stylesheet */

Definition at line 149 of file html.h.

◆ STYLESHEET_START

#define STYLESHEET_START   4 /* start of document stylesheets */

Definition at line 152 of file html.h.

◆ STYLESHEET_USER

#define STYLESHEET_USER   3 /* user stylesheet */

Definition at line 151 of file html.h.

Function Documentation

◆ html_get_base_target()

const char * html_get_base_target ( hlcache_handle h)

obtain html base target from handle

used by core browser

obtain html base target from handle

Parameters
hContent to retrieve base target from
Returns
Pointer to target, or NULL if none

Definition at line 2054 of file html.c.

References html_content::base_target, and hlcache_handle_get_content().

Referenced by browser_window_find_target().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_get_frameset()

struct content_html_frames * html_get_frameset ( hlcache_handle h)

obtain html frame content from handle

used by core browser

obtain html frame content from handle

Parameters
hContent to inspect
Returns
Pointer to framesets, or NULL if none

Definition at line 2009 of file html.c.

References html_content::frameset, and hlcache_handle_get_content().

Referenced by browser_window_create_frameset(), and browser_window_recalculate_frameset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_get_id_offset()

bool html_get_id_offset ( hlcache_handle h,
lwc_string *  frag_id,
int *  x,
int *  y 
)

get the offset within the docuemnt of a fragment id

get the offset within the docuemnt of a fragment id

Parameters
hHTML document to search
frag_idString containing an element id
xUpdated to global x coord iff id found
yUpdated to global y coord iff id found
Returns
true iff id found

Definition at line 2073 of file html.c.

References box_coords(), box_find_by_id(), content_get_type(), CONTENT_HTML, html_get_box_tree(), box::x, and box::y.

Referenced by frag_scroll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_get_iframe()

struct content_html_iframe * html_get_iframe ( hlcache_handle h)

obtain html iframe content from handle

used by core browser

obtain html iframe content from handle

Parameters
hContent to inspect
Returns
Pointer to iframes, or NULL if none

Definition at line 2024 of file html.c.

References hlcache_handle_get_content(), and html_content::iframe.

Referenced by browser_window_create_iframes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_get_objects()

struct content_html_object * html_get_objects ( hlcache_handle h,
unsigned int *  n 
)

Retrieve objects used by HTML document.

Parameters
hContent to retrieve objects from
nPointer to location to receive number of objects
Returns
Pointer to array of objects
Parameters
hContent to retrieve objects from
nPointer to location to receive number of objects
Returns
Pointer to list of objects

Definition at line 60 of file object.c.

References hlcache_handle_get_content(), html_content::num_objects, and html_content::object_list.

Referenced by browser_window_reload(), and save_complete_save_html_objects().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_get_stylesheets()

struct html_stylesheet * html_get_stylesheets ( struct hlcache_handle h,
unsigned int *  n 
)

Retrieve stylesheets used by HTML document.

Parameters
hContent to retrieve stylesheets from
nPointer to location to receive number of sheets
Returns
Pointer to array of stylesheets

Definition at line 498 of file css.c.

References hlcache_handle_get_content(), html_content::stylesheet_count, and html_content::stylesheets.

Referenced by browser_window_reload(), and save_complete_save_html_stylesheets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_init()

nserror html_init ( void  )

initialise content handler

Returns
NSERROR_OK on success otherwise appropriate error code

Definition at line 2382 of file html.c.

References content_factory_register_handler(), html_content_handler, html_css_init(), html_fini(), html_types, NOF_ELEMENTS, and NSERROR_OK.

Referenced by netsurf_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_redraw_a_box()

void html_redraw_a_box ( hlcache_handle h,
struct box box 
)

redraw a specific box

used by core browser

redraw a specific box

Parameters
hcontent containing the box, of type CONTENT_HTML
boxbox to redraw

Definition at line 1111 of file html.c.

References BOTTOM, box_coords(), content_request_redraw(), box::height, LEFT, box::padding, RIGHT, TOP, box::width, box::x, and box::y.

Referenced by browser_window_invalidate_iframe(), and browser_window_scroll_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_set_file_gadget_filename()

void html_set_file_gadget_filename ( struct hlcache_handle hl,
struct form_control gadget,
const char *  fn 
)

set filename on a file gadget

used by core browser

Definition at line 1666 of file html.c.

References box::gadget, hl, hlcache_handle_get_content(), and html__set_file_gadget_filename().

Referenced by browser_window_set_gadget_filename().

Here is the call graph for this function:
Here is the caller graph for this function: