Merge branch 'master' of git://git.netsurf-browser.org/netsurf

This commit is contained in:
Rob Kendrick (fatigue) 2012-11-04 11:20:31 +00:00
commit ba2a0fd723
8 changed files with 46 additions and 20 deletions

View File

@ -194,8 +194,11 @@ void fetch_curl_register(void)
SETOPT(CURLOPT_VERBOSE, 0);
}
SETOPT(CURLOPT_ERRORBUFFER, fetch_error_buffer);
if (nsoption_bool(suppress_curl_debug))
if (nsoption_bool(suppress_curl_debug)) {
SETOPT(CURLOPT_DEBUGFUNCTION, fetch_curl_ignore_debug);
} else {
SETOPT(CURLOPT_VERBOSE, 1);
}
SETOPT(CURLOPT_WRITEFUNCTION, fetch_curl_data);
SETOPT(CURLOPT_HEADERFUNCTION, fetch_curl_header);
SETOPT(CURLOPT_PROGRESSFUNCTION, fetch_curl_progress);

View File

@ -213,6 +213,12 @@ GtkAdjustment *nsgtk_layout_get_hadjustment(GtkLayout *layout)
#endif
}
static void nsgtk_layout_set_adjustment_step_increment(GtkAdjustment *adj,
int value)
{
gtk_adjustment_set_step_increment(adj, value);
}
void nsgtk_layout_set_hadjustment(GtkLayout *layout, GtkAdjustment *adj)
{
#if GTK_CHECK_VERSION(3,0,0)
@ -220,6 +226,7 @@ void nsgtk_layout_set_hadjustment(GtkLayout *layout, GtkAdjustment *adj)
#else
gtk_layout_set_hadjustment(layout, adj);
#endif
nsgtk_layout_set_adjustment_step_increment(adj, 8);
}
void nsgtk_layout_set_vadjustment(GtkLayout *layout, GtkAdjustment *adj)
@ -229,6 +236,7 @@ void nsgtk_layout_set_vadjustment(GtkLayout *layout, GtkAdjustment *adj)
#else
gtk_layout_set_vadjustment(layout, adj);
#endif
nsgtk_layout_set_adjustment_step_increment(adj, 8);
}
GtkWidget *nsgtk_hbox_new(gboolean homogeneous, gint spacing)

View File

@ -13,6 +13,7 @@ operation getElementById %{
}
exc = dom_document_get_element_by_id(private->node, elementId_dom, &element);
dom_string_unref(elementId_dom);
if (exc != DOM_NO_ERR) {
return JS_FALSE;
}
@ -37,16 +38,14 @@ operation getElementsByTagName %{
return JS_FALSE;
}
LOG(("here"));
exc = dom_document_get_elements_by_tag_name(private->node, localName_dom, /*&collection*/&nodelist);
dom_string_unref(localName_dom);
if (exc != DOM_NO_ERR) {
return JS_FALSE;
}
LOG(("nodelist %p", nodelist));
if (/*collection*/nodelist != NULL) {
/* jsret = jsapi_new_HTMLCollection(cx,
/*jsret = jsapi_new_HTMLCollection(cx,
NULL,
NULL,
collection,
@ -65,8 +64,14 @@ getter textContent %{
dom_string *content;
exc = dom_node_get_text_content(private->node, &content);
if ((exc == DOM_NO_ERR) && (content != NULL)) {
if (exc != DOM_NO_ERR) {
return JS_FALSE;
}
if (content != NULL) {
jsret = JS_NewStringCopyN(cx, dom_string_data(content), dom_string_length(content));
dom_string_unref(content);
}
%}

View File

@ -82,4 +82,10 @@ operation namedItem %{
jsret = jsapi_new_HTMLElement(cx, NULL, NULL, (dom_element *)domnode, private->htmlc);
}
%}
%}
api finalise %{
if (private != NULL) {
dom_html_collection_unref(private->collection);
}
%}

View File

@ -38,3 +38,9 @@ binding document {
interface Document; /* Web IDL interface to generate */
}
api finalise %{
if (private != NULL) {
dom_node_unref(private->node);
}
%}

View File

@ -34,18 +34,12 @@ binding htmlelement {
interface HTMLElement; /* Web IDL interface to generate */
/* private members:
* - stored in private context structure.
* - passed as parameters to constructor and stored automatically.
* - are *not* considered for property getters/setters.
*
* internal members:
* - value stored in private context structure
* - not passed to constructor
* - must be instantiated by constructor
* - are considered for property getters/setters.
*/
private "dom_element *" node;
private "struct html_content *" htmlc;
}
api finalise %{
if (private != NULL) {
dom_node_unref(private->node);
}
%}

View File

@ -63,5 +63,9 @@ operation item %{
}
%}
api finalise %{
if (private != NULL) {
dom_nodelist_unref(private->nodelist);
}
%}

View File

@ -126,7 +126,7 @@ api new %{
private->document = jsapi_new_Document(cx,
NULL,
newobject,
htmlc->document,
(dom_document *)dom_node_ref(htmlc->document),
htmlc);
if (private->document == NULL) {
free(private);