[PATCH][RFC] Gopher support
by François Revol
I cleaned up the gopher support I wrote.
Still needs some more work but it's usable.
Comments ?
François.
12 years
Proof of concept gopher support
by François Revol
Hi,
I started writing some gopher support code out of boredom...
http://revolf.free.fr/beos/shots/shot_netsurf_gopher_vs_fx2_001.png
Not too bad but the current code fails to handle items that are split over several chunks of incoming data, since it hooks into the curl fetcher.
On first hand I wanted to write a content renderer but it seems quite overkill for something that can easily be converted to html.
Though after looking at the css and image handlers I'm thinking maybe I could just fake one with only a convert function that would just replace itself with html content.
I'm not sure how to handle it without screwing up the internal state though...
possibly the html data could get the gopher source as parent content ?
François.
12 years, 1 month
Layout: collapsing margins
by Michael Drake
The attached patch tries to fix collapsing margins.
Margins should collapse between the bottom of a box that causes height and
the top of the next box content that causes height. The boxes must have a
common ancestor within the current block formatting context for margins to
collapse between them.
The margin is applied as a vertical offset at the top of the first box
that has height.
The attached patch implements collapsing margins.
http://source.netsurf-browser.org/trunk/netsurftest/haveproblems/collapsi...
The patch fixes the above test case. It also makes various other changes
to margin handling and fixes some other stuff relating to vertical
positioning of boxes. E.g. the position of the search box on Wikipedia
pages, and the position of the sidebar on Ars Technica.
It makes the bottom 3 rows of the Acid2 face appear one row too high,
obscuring the bottom row of the smile. I'm not sure why, currently.
--
Michael Drake (tlsa) http://www.netsurf-browser.org/
Index: render/layout.c
===================================================================
--- render/layout.c (revision 12213)
+++ render/layout.c (working copy)
@@ -69,6 +69,8 @@
struct content *content);
static void layout_minmax_block(struct box *block,
const struct font_functions *font_func);
+static struct box* layout_next_margin_block(struct box *box, struct box *block,
+ int viewport_height, int *max_pos_margin, int *max_neg_margin);
static bool layout_block_object(struct box *block);
static void layout_get_object_dimensions(struct box *box,
int *width, int *height,
@@ -208,7 +210,8 @@
int max_neg_margin = 0;
int y = 0;
int lm, rm;
- struct box *margin_box;
+ struct box *margin_collapse = NULL;
+ bool in_margin = false;
css_fixed gadget_size;
css_unit gadget_unit; /* Checkbox / radio buttons */
@@ -281,7 +284,7 @@
gadget_unit, block->style));
}
- box = margin_box = block->children;
+ box = block->children;
/* set current coordinates to top-left of the block */
cx = 0;
y = cy = block->padding[TOP];
@@ -314,7 +317,6 @@
while (box) {
assert(box->type == BOX_BLOCK || box->type == BOX_TABLE ||
box->type == BOX_INLINE_CONTAINER);
- assert(margin_box);
/* Tables are laid out before being positioned, because the
* position depends on the width which is calculated in
@@ -336,6 +338,16 @@
goto advance_to_next_box;
}
+ /* If we don't know which box the current margin collapses
+ * through to, find out. Update the pos/neg margin values. */
+ if (margin_collapse == NULL) {
+ margin_collapse = layout_next_margin_block(box, block,
+ viewport_height,
+ &max_pos_margin, &max_neg_margin);
+ /* We have a margin that has not yet been applied. */
+ in_margin = true;
+ }
+
/* Clearance. */
y = 0;
if (box->style && css_computed_clear(box->style) !=
@@ -343,19 +355,6 @@
y = layout_clear(block->float_children,
css_computed_clear(box->style));
- /* Get top margin */
- if (box->style) {
- layout_find_dimensions(box->parent->width,
- viewport_height, box, box->style,
- NULL, NULL, NULL, NULL,
- box->margin, NULL, NULL);
- }
-
- if (max_pos_margin < box->margin[TOP])
- max_pos_margin = box->margin[TOP];
- else if (max_neg_margin < -box->margin[TOP])
- max_neg_margin = -box->margin[TOP];
-
/* Blocks establishing a block formatting context get minimum
* left and right margins to avoid any floats. */
lm = rm = 0;
@@ -405,8 +404,9 @@
* diminished due to floats. */
int x0, x1, top;
struct box *left, *right;
- top = cy > y ? cy : y;
- top += max_pos_margin - max_neg_margin;
+ top = cy + max_pos_margin -
+ max_neg_margin;
+ top = (top > y) ? top : y;
x0 = cx;
x1 = cx + box->parent->width -
box->parent->padding[LEFT] -
@@ -436,34 +436,47 @@
cx += box->x;
/* Position box: vertical. */
- if (box->type != BOX_BLOCK || y ||
- box->border[TOP].width || box->padding[TOP]) {
- margin_box->y += max_pos_margin - max_neg_margin;
- cy += max_pos_margin - max_neg_margin;
- max_pos_margin = max_neg_margin = 0;
- margin_box = 0;
+ if (box->border[TOP].width) {
box->y += box->border[TOP].width;
cy += box->border[TOP].width;
- if (cy < y) {
- box->y += y - cy;
- cy = y;
- }
}
+ /* Vertical margin */
+ if (((box->type == BOX_BLOCK &&
+ (box->flags & HAS_HEIGHT)) ||
+ box->type == BOX_TABLE ||
+ (box->type == BOX_INLINE_CONTAINER &&
+ box != box->parent->children) ||
+ margin_collapse == box) &&
+ in_margin == true) {
+ /* Margin goes above this box. */
+ cy += max_pos_margin - max_neg_margin;
+ box->y += max_pos_margin - max_neg_margin;
+
+ /* Current margin has been applied. */
+ in_margin = false;
+ max_pos_margin = max_neg_margin = 0;
+ }
+
+ /* Handle clearance */
+ if (box->type != BOX_INLINE_CONTAINER &&
+ (y > 0) && (cy < y)) {
+ /* box clears something*/
+ box->y += y - cy;
+ cy = y;
+ }
+
/* Unless the box has an overflow style of visible, the box
* establishes a new block context. */
if (box->type == BOX_BLOCK && box->style &&
css_computed_overflow(box->style) !=
CSS_OVERFLOW_VISIBLE) {
- cy += max_pos_margin - max_neg_margin;
- box->y += max_pos_margin - max_neg_margin;
layout_block_context(box, viewport_height, content);
- if (box->type == BOX_BLOCK || box->object)
- cy += box->padding[TOP];
+ cy += box->padding[TOP];
- if (box->type == BOX_BLOCK && box->height == AUTO) {
+ if (box->height == AUTO) {
box->height = 0;
layout_block_add_scrollbar(box, BOTTOM);
}
@@ -471,23 +484,13 @@
cx -= box->x;
cy += box->height + box->padding[BOTTOM] +
box->border[BOTTOM].width;
- max_pos_margin = max_neg_margin = 0;
- if (max_pos_margin < box->margin[BOTTOM])
- max_pos_margin = box->margin[BOTTOM];
- else if (max_neg_margin < -box->margin[BOTTOM])
- max_neg_margin = -box->margin[BOTTOM];
y = box->y + box->padding[TOP] + box->height +
box->padding[BOTTOM] +
box->border[BOTTOM].width;
+
/* Skip children, because they are done in the new
* block context */
goto advance_to_next_box;
- } else if (box->type == BOX_BLOCK && (box->flags & HAS_HEIGHT)) {
- /* This block doesn't establish a new block formatting
- * context */
- cy += max_pos_margin - max_neg_margin;
- box->y += max_pos_margin - max_neg_margin;
- max_pos_margin = max_neg_margin = 0;
}
#ifdef LAYOUT_DEBUG
@@ -546,14 +549,17 @@
/* Advance to next box. */
if (box->type == BOX_BLOCK && !box->object && box->children) {
/* Down into children. */
+
+ if (box == margin_collapse) {
+ /* Current margin collapsed though to this box.
+ * Unset margin_collapse. */
+ margin_collapse = NULL;
+ }
+
y = box->padding[TOP];
box = box->children;
box->y = y;
cy += y;
- if (!margin_box) {
- max_pos_margin = max_neg_margin = 0;
- margin_box = box;
- }
continue;
} else if (box->type == BOX_BLOCK || box->object)
cy += box->padding[TOP];
@@ -565,23 +571,33 @@
cy += box->height + box->padding[BOTTOM] +
box->border[BOTTOM].width;
- max_pos_margin = max_neg_margin = 0;
- if (max_pos_margin < box->margin[BOTTOM])
- max_pos_margin = box->margin[BOTTOM];
- else if (max_neg_margin < -box->margin[BOTTOM])
- max_neg_margin = -box->margin[BOTTOM];
cx -= box->x;
y = box->y + box->padding[TOP] + box->height +
box->padding[BOTTOM] +
box->border[BOTTOM].width;
+
advance_to_next_box:
if (!box->next) {
/* No more siblings:
* up to first ancestor with a sibling. */
+
+ if (box == margin_collapse) {
+ /* Current margin collapsed though to this box.
+ * Unset margin_collapse. */
+ margin_collapse = NULL;
+ }
+
+ /* Apply bottom margin */
+ if (max_pos_margin < box->margin[BOTTOM])
+ max_pos_margin = box->margin[BOTTOM];
+ else if (max_neg_margin < -box->margin[BOTTOM])
+ max_neg_margin = -box->margin[BOTTOM];
+
do {
box = box->parent;
if (box == block)
break;
+
if (box->height == AUTO) {
box->height = y - box->padding[TOP];
@@ -607,22 +623,37 @@
cy += box->padding[BOTTOM] +
box->border[BOTTOM].width;
+ cx -= box->x;
+ y = box->y + box->padding[TOP] + box->height +
+ box->padding[BOTTOM] +
+ box->border[BOTTOM].width;
+
+ /* Apply bottom margin */
if (max_pos_margin < box->margin[BOTTOM])
max_pos_margin = box->margin[BOTTOM];
else if (max_neg_margin < -box->margin[BOTTOM])
max_neg_margin = -box->margin[BOTTOM];
- cx -= box->x;
- y = box->y + box->padding[TOP] + box->height +
- box->padding[BOTTOM] +
- box->border[BOTTOM].width;
- } while (box != block && !box->next);
+
+ } while (box->next == NULL);
if (box == block)
break;
}
+
/* To next sibling. */
+
+ if (box == margin_collapse) {
+ /* Current margin collapsed though to this box.
+ * Unset margin_collapse. */
+ margin_collapse = NULL;
+
+ /* Apply bottom margin */
+ if (max_pos_margin < box->margin[BOTTOM])
+ max_pos_margin = box->margin[BOTTOM];
+ else if (max_neg_margin < -box->margin[BOTTOM])
+ max_neg_margin = -box->margin[BOTTOM];
+ }
box = box->next;
box->y = y;
- margin_box = box;
}
/* Account for bottom margin of last contained block */
@@ -737,11 +768,16 @@
case BOX_INLINE_CONTAINER:
layout_minmax_inline_container(child,
&child_has_height, font_func);
+ if (child_has_height &&
+ child ==
+ child->parent->children)
+ block->flags |= MAKE_HEIGHT;
break;
case BOX_TABLE:
layout_minmax_table(child, font_func);
/* todo: fix for zero height tables */
child_has_height = true;
+ child->flags |= MAKE_HEIGHT;
break;
default:
assert(0);
@@ -779,8 +815,10 @@
min = max = FIXTOINT(nscss_len2px(width, wunit, block->style));
}
- if (height > 0 && hunit != CSS_UNIT_PCT)
+ if (height > 0 && hunit != CSS_UNIT_PCT) {
+ block->flags |= MAKE_HEIGHT;
block->flags |= HAS_HEIGHT;
+ }
/* add margins, border, padding to min, max widths */
/* Note: we don't know available width here so percentage margin
@@ -824,6 +862,119 @@
/**
+ * Find next block that current margin collapses to.
+ *
+ * \param box box to start tree-order search from (top margin is included)
+ * \param block box responsible for current block fromatting context
+ * \param viewport_height height of viewport in px
+ * \param max_pos_margin updated to to maximum positive margin encountered
+ * \param max_neg_margin updated to to maximum negative margin encountered
+ * \return next box that current margin collapses to, or NULL if none.
+ */
+
+struct box* layout_next_margin_block(struct box *box, struct box *block,
+ int viewport_height, int *max_pos_margin, int *max_neg_margin)
+{
+ assert(block != NULL);
+
+ while (box != NULL) {
+
+ if (box->style &&
+ (css_computed_position(box->style) !=
+ CSS_POSITION_ABSOLUTE &&
+ css_computed_position(box->style) !=
+ CSS_POSITION_FIXED)) {
+ /* Not an inline_container and not positioned */
+
+ /* Get margins */
+ if (box->style) {
+ layout_find_dimensions(box->parent->width,
+ viewport_height, box,
+ box->style,
+ NULL, NULL, NULL, NULL,
+ box->margin, box->padding,
+ box->border);
+ }
+
+ /* Apply top margin */
+ if (*max_pos_margin < box->margin[TOP])
+ *max_pos_margin = box->margin[TOP];
+ else if (*max_neg_margin < -box->margin[TOP])
+ *max_neg_margin = -box->margin[TOP];
+
+ /* Check whether box is the box current margin collapses
+ * to */
+ if (box->flags & MAKE_HEIGHT ||
+ box->border[TOP].width ||
+ box->padding[TOP] ||
+ (box->style &&
+ css_computed_overflow(box->style) !=
+ CSS_OVERFLOW_VISIBLE)) {
+ /* Collapse to this box; return it */
+ return box;
+ }
+ }
+
+
+ /* Find next box */
+ if (box->type == BOX_BLOCK && !box->object && box->children &&
+ box->style &&
+ css_computed_overflow(box->style) ==
+ CSS_OVERFLOW_VISIBLE) {
+ /* Down into children. */
+ box = box->children;
+ } else {
+ if (!box->next) {
+ /* No more siblings:
+ * Go up to first ancestor with a sibling. */
+ do {
+ /* Apply bottom margin */
+ if (*max_pos_margin <
+ box->margin[BOTTOM])
+ *max_pos_margin =
+ box->margin[BOTTOM];
+ else if (*max_neg_margin <
+ -box->margin[BOTTOM])
+ *max_neg_margin =
+ -box->margin[BOTTOM];
+
+ box = box->parent;
+ } while (box != block && !box->next);
+
+ if (box == block) {
+ /* Margins don't collapse with stuff
+ * outside the block formatting context
+ */
+ return block;
+ }
+ }
+
+ /* Apply bottom margin */
+ if (*max_pos_margin < box->margin[BOTTOM])
+ *max_pos_margin = box->margin[BOTTOM];
+ else if (*max_neg_margin < -box->margin[BOTTOM])
+ *max_neg_margin = -box->margin[BOTTOM];
+
+ /* To next sibling. */
+ box = box->next;
+
+ /* Get margins */
+ if (box->style) {
+ layout_find_dimensions(box->parent->width,
+ viewport_height, box,
+ box->style,
+ NULL, NULL, NULL, NULL,
+ box->margin, box->padding,
+ box->border);
+ }
+ }
+ }
+
+ return NULL;
+}
+
+
+/**
* Layout a block which contains an object.
*
* \param block box of type BLOCK, INLINE_BLOCK, TABLE, or TABLE_CELL
Index: render/box.h
===================================================================
--- render/box.h (revision 12213)
+++ render/box.h (working copy)
@@ -124,7 +124,8 @@
PRE_STRIP = 1 << 3, /* PRE tag needing leading newline stripped */
CLONE = 1 << 4, /* continuation of previous box from wrapping */
MEASURED = 1 << 5, /* text box width has been measured */
- HAS_HEIGHT = 1 << 6 /* box has height */
+ HAS_HEIGHT = 1 << 6, /* box has height (perhaps due to children) */
+ MAKE_HEIGHT = 1 << 7 /* box causes its own height */
} box_flags;
/* Sides of a box */
12 years, 1 month
[OSX] Build issue with the bundle
by François Revol
I noticed the cocoa build attempts to cp -R some files to the NetSurf.app bundle, but fails with it already existed on some files in .svn/ folders...
I thought gcp had a --exclude option unlike the BSD cp, but it doesn't either, so someone will have to use tar I guess...
François.
12 years, 1 month
NetSurf Society AGM 2011 -- Agenda
by Daniel Silverstone
Hello,
The membership list for the society stands as per my previous email. I have
received no resignations nor applications.
I received nominations and seconds for the current committee, as such the
following is the agenda for the AGM, scheduled for 13:00 UTC (14:00 UK, 15:00
CEST) on Saturday 16th April 2011.
Agenda:
1. Welcome
2. Secretary's Report
2. Treasurer's Report
3. Chairman's Report
4. Committee Election
5. Project steering
6. A.O.B
7. Closing
The only nominations I have received for the committee is that of the
incumbents, thus the committee being voted upon is:
Chairman: Michael Drake
Secretary: Daniel Silverstone
Treasurer: John-Mark Bell
If you are unable to attend and wish to register a vote for or against those
nominations then please email me before the meeting starts.
The Project steering item is to review goals for NetSurf 3.0 and our current
situation regarding those goals.
Regards,
Daniel.
NetSurf Society Secretary
--
Daniel Silverstone http://www.netsurf-browser.org/
PGP mail accepted and encouraged. Key Id: 3CCE BABE 206C 3B69
12 years, 1 month
NetSurf Society Report 2010-2011
by Michael Drake
Thanks to the Secretary and Treasurer for their continued work in these
roles this past year.
Year in review
==============
Approximately this time last year we released NetSurf 2.5. In the last 12
months we have developed and released NetSurf 2.6 and we are on the verge
of releasing NetSurf 2.7. Both of these releases have done much to
advance the state of the project. The changes introduced in them have had
quite a wide scope, improving many aspects of the browser and our
libraries.
NetSurf core
------------
Improvements made to NetSurf's core have affected many areas including
page layout, fetching, content caching, rendering, memory usage and
performance. Perhaps the most obvious new feature has been the addition
of core-controlled windows for global history, hotlist (bookmarks), and
cookie management. These are available for use by all front ends, and
have increased the user-facing functionality on several platforms.
There has been an increasing practice of profiling the browser to direct
development attention to specific aspects of performance.
Some work has been done this year as part of an on-going effort to
simplify and improve the core/front end interface. This work has helped
remove some of the complexity that was previously required in front ends.
NetSurf front ends
------------------
The year has seen the implementation of two new front ends. The Mac OS X
front end in particular was written very swiftly, and is already
considered release-ready. The new Atari front end is also showing great
promise, extending the potential userbase for NetSurf further. These
developments further demonstrate the portability of NetSurf.
The Windows port has continued to mature over the last 12 months, however
it lacks an actual maintainer at the moment. This has reduced the
potential for its advancement. By contrast, the RISC OS front end, which
was without a maintainer last year, now has a maintainer and much work has
been done to make the RISC OS code easier to work with.
Some work has been put into creating an environment for automated
cross-compilations of NetSurf for various platforms. This work is still
in progress.
Project libraries
-----------------
Much effort has been put into our core libraries. LibCSS in particular
has been improved substantially. These advances have included the
addition of support for certain features of CSS3.
Part of the work carried out on our core libraries has focused on
rationalising their APIs. As yet, none of the core libraries' APIs are
considered fully stable. This means they have not reached "release"
versioning (i.e. 1.x) in this period.
We have seen third party projects making use of some of our core libraries.
Little work has been done on LibDOM in the last 12 months. However, some
recent decisions have established what work is required for LibDOM to
reach the state were NetSurf can start using it.
Going forward
=============
The main story of NetSurf's development plan since NetSurf 1.x has been
shared widely before. Here it is again:
| 1. New HTML parser (hubbub)
| 2. New CSS engine (libcss)
| 3. New DOM implementation (libdom) < We are here now
| 4. New layout engine
| 5. Add JavaScript support
|
| [1] was introduced with NetSurf 2.0
| [2] was introduced with NetSurf 2.5
| [3] is intended for NetSurf 3.0
| [4] is intended for NetSurf 4.0
| [5] is intended for NetSurf 5.0
The practice of profiling NetSurf has identified CSS selection as a
significant performance issue. The reason for this is understood, and
performance is expected to be vastly improved once NetSurf uses LibDOM
instead of LibXML. Since this coincides with the general plan, the
development focus after NetSurf 2.7 is expected to centre around LibDOM.
The next 12 months
------------------
It will be ideal if we are in a position to release NetSurf 3.0 with
LibDOM in the next year. We should certainly aim to make progress on this
during the period.
In addition to working toward milestone 3, as outlined above in the main
story of NetSurf's development, we can also complete some side quests this
year. Some good candidates for attention that have been mentioned before
are:
+ Moving frames handling to the core.
(Requested by several front end maintainers.)
+ Rewriting URL handling.
(Frequently comes up amongst core developers.)
+ Making the core a library.
(Routinely sought-after by front end and core developers alike.)
There are many others on the Development Plan wiki page:
http://wiki.netsurf-browser.org/Development_Plan
Continued work on automated cross-compilation and also automated testing
will be of great value to the project.
Finally we should produce a roadmap for LibSVGTiny. Currently it is not
released alongside our other libraries. Could it use LibCSS? Maybe Expat
and LibDOM instead of LibXML? Support for more SVG features? Output
shape as polygon, rather than path, when shape has only straight lines?
NetSurf project steering will be discussed at the forthcoming AGM.
Thanks to everyone involved in the project for their contributions over
the last 12 months!
--
Michael Drake (tlsa) http://www.netsurf-browser.org/
12 years, 1 month
Re: Fwd: Please Test Netsurf With valgrind
by Frank Gerlach
Indeed my goal is to help you making netsurf better. Please see the attached valgrind log. (compressed with gzip).
Also the other files which will help you identify my system configuration - a standard Ubuntu 10.04.
Frank
-------- Original-Nachricht --------
> Datum: Thu, 7 Apr 2011 09:50:32 +0100
> Von: Daniel Silverstone <dsilvers(a)netsurf-browser.org>
> An: Frank Gerlach <frankgerlach22(a)gmx.de>
> CC: NetSurf Development Discussion List <netsurf-dev(a)netsurf-browser.org>
> Betreff: Re: Fwd: Please Test Netsurf With valgrind
> On Thu, Apr 07, 2011 at 09:06:11AM +0200, Frank Gerlach wrote:
> > I grabbed your email addresses indiscriminately from netsurf source
> code. I
> > do think this does not amount to spamming, as it is security-related:
>
> Why did you not stop to think about (a) which frontends you were
> complaining
> about, and (b) whether or not the project had an appropriate mailing list
> for
> thisp?
>
>
> > The problem: Lots of illegal memory operations while executing Netsurf.
> >
> > How to reproduce:
> > A) get current Netsurf code
> > B) get all prerequesites (xml parsers and all that)
> > C) Compile A) and B) on Ubuntu 10.04
>
> Compile which frontend? Certainly the implication of Ubuntu means you
> should
> not have been sending this email to the AmigaOS frontend developers, or
> any of
> the other uniquely-frontend-only developers who aren't related to what I
> assume
> will be a GTK build of NetSurf.
>
> > E) run with
> >
> > valgrind <netsurf executable>
> >
> > F) Surf the net. (spiegel.de, bbc.co.uk, wired.com, slashdot,
> theregister)
>
> > G) Look at the valgrind output. Looks extremely bad (illegal free()s and
> lots
> > of other nasty errors).
>
> It would have been significantly more useful if you'd attached the errors
> you
> are concerned about, but never mind.
>
>
> > Valgrind is an excellent tool to "cheaply" improve source quality and I
> > suggest you use it before you check in code. All checked in code should
> not
> > report valgrind errors (with the procedure described above). Valgrind is
> > normally very accurate !
>
> If you think we do not use valgrind regularly, both in memcheck and
> callgrind
> modes, then you are sorely mistaken. Your approach to this message, and
> the
> language you used, was actually strongly offensive (and did get caught in
> several people's spam traps since it was an identical message to several
> addresses which boiled down to the same person). I will give you the
> benefit
> of the doubt and assume you were honestly trying to help rather than to
> slander
> our development practices and rant at us.
>
> You will find that NetSurf 2.7 has been branched, along with its
> prerequisite
> libraries, within our SVN repository and we are gearing up for a release.
> If
> you honestly want to help us along the way, please join us on #netsurf on
> the
> Freenode IRC network and help us to track down and correct the issues you
> seem
> able to identify for us.
>
> Regards,
>
> Daniel.
>
> --
> Daniel Silverstone http://www.simtec.co.uk/
>
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
12 years, 1 month
Re: Fwd: Please Test Netsurf With valgrind
by Daniel Silverstone
On Thu, Apr 07, 2011 at 09:06:11AM +0200, Frank Gerlach wrote:
> I grabbed your email addresses indiscriminately from netsurf source code. I
> do think this does not amount to spamming, as it is security-related:
Why did you not stop to think about (a) which frontends you were complaining
about, and (b) whether or not the project had an appropriate mailing list for
thisp?
> The problem: Lots of illegal memory operations while executing Netsurf.
>
> How to reproduce:
> A) get current Netsurf code
> B) get all prerequesites (xml parsers and all that)
> C) Compile A) and B) on Ubuntu 10.04
Compile which frontend? Certainly the implication of Ubuntu means you should
not have been sending this email to the AmigaOS frontend developers, or any of
the other uniquely-frontend-only developers who aren't related to what I assume
will be a GTK build of NetSurf.
> E) run with
>
> valgrind <netsurf executable>
>
> F) Surf the net. (spiegel.de, bbc.co.uk, wired.com, slashdot, theregister)
> G) Look at the valgrind output. Looks extremely bad (illegal free()s and lots
> of other nasty errors).
It would have been significantly more useful if you'd attached the errors you
are concerned about, but never mind.
> Valgrind is an excellent tool to "cheaply" improve source quality and I
> suggest you use it before you check in code. All checked in code should not
> report valgrind errors (with the procedure described above). Valgrind is
> normally very accurate !
If you think we do not use valgrind regularly, both in memcheck and callgrind
modes, then you are sorely mistaken. Your approach to this message, and the
language you used, was actually strongly offensive (and did get caught in
several people's spam traps since it was an identical message to several
addresses which boiled down to the same person). I will give you the benefit
of the doubt and assume you were honestly trying to help rather than to slander
our development practices and rant at us.
You will find that NetSurf 2.7 has been branched, along with its prerequisite
libraries, within our SVN repository and we are gearing up for a release. If
you honestly want to help us along the way, please join us on #netsurf on the
Freenode IRC network and help us to track down and correct the issues you seem
able to identify for us.
Regards,
Daniel.
--
Daniel Silverstone http://www.simtec.co.uk/
12 years, 1 month
(Documentation?) bug in libCSS css_computed_style_compose?
by James Montgomerie
Hello,
I'm working on libCSS just now, implementing support for some of the 'page' properties (page-break-before, page-break-after etc). I've noticed what I think is a bug in css_computed_style_compose, and I wanted to run it past the experts before trying to fix it, in case I've got the wrong end of the stick.
The symptoms are that properties that should by default /not/ inherit are inheriting.
The cause, I think, is in css_computed_style_compose. It happens when 'child' and 'result' point to the same object, and parent has 'page' group properties set (I think this will apply equally to the current 'uncommon' group), but the child does not. In the loop, when we get to the first set property in a group, it is composed (because the group in parent is not NULL), which causes the group to be allocated in the result object (the setters allocate the group if it doesn't already exist), and memset to 0. This meant that, because 'child' and 'result' are the same, all the other properties in 'child' are now set to 0 (by the memset when the group is set up). 0 is 'inherit'. Properties that /should/ have a non-inherit initial value are now set to inherit erroneously.
The solution is either to call initial_... for all the properties in the group when it's set up (in the "ENSURE_PAGE" macro, or equivalent), or maybe to change the docs to state that child and result may NOT be the same object.
Does this sound like a plausible diagnosis?
Thanks,
Jamie.
12 years, 1 month