(Sorry for the delay in getting this sent.)
Since the last progress report (two and a half weeks ago), I have:
- implemented (albeit somewhat buggily) the remainder of the tree
- written a basic test harness that reads in data in the html5lib test
format, runs it through hubbub, and prints the output alongside what the
output should be.
I am a bit behind where I expected to be at this point, since I was
wanted to get the test harness a little more advanced than it is; at the
moment it only checks for segfaults.
Given the current state of things, I expect to spend another couple of
weeks on improving the harness and fixing bugs in the treebuilder so
that it produces the right trees for the right input.
Hi everyone :)
The goals I had for this week were:
> - adding a separate box structure for printed content - I left it so long
> for debugging purposes(to immediately see some results) and its time to
> change it :)
It has been done - the duplicated tree is quite strongly "grown" into the
original box tree, to save memory and not duplicate unnecessary data. Works
fine now, and there is no more any flickering, when we print a page.
> - adding font measuring function support - now, we are measuring one font,
> while using another
Done, too. I think there might be a better solution for passing the font
measuring functions than the one that I use right now (saving a link to the
struct in content.data.html) , but the general mechanism is completed and
works. Also, it needs a little "calibration", as still edges of text lines
can be seen cropped.
> - taking into consideration some more text style passed to pdf plotting -
> now its just scaled and plotted with the default font
It works for the most important: generic font families and italic/bold style.
We are using the default pdf fonts now.
> - adding clipping and/or resizing images or any other objects influencing
> the width of pages
It was a minor change, but its done, and works ok - for example:
http://krym.ovh.org/krym_zdjecia/photos/photo13.php - You can see the big
picture being resized properly.
Also, one of my patches for Haru has been added to its trunk - I hope that one
more will be added this week( I have sent it already), what would allow my
branch of netsurf to run with the latest official haru development version,
and not only the one from my branch.
I also experimented a little with the gtk printing dialog, and hope to be able
to add it soon. I consulted rjek and it seems to be a question of handling
the dialog and creating one more plotter for gtk printing - similar to the
already used gtk_plotters.
During the following week I would like to add some basic support for the gtk
printing dialog, calibrate and clean up the code from this week and start
working again with haru - it is crashing to often (for example when handling
some png images ) and no one finished the unicode support that was once
started as a discussion on their mailing list.
Let me know if you have any comments, requests, etc :)
I am sorry that I am (once again) the late in posting my report, but I
wanted to birth this massive commit first :D
These past (very long) two weeks I have been working almost exclusively on a
patch of epic proportions. What started out as a simple fix to get cut
working properly quickly blossomed into a significant reworking of
textinput.c. After analyzing what would need to be done to implement cut, I
realized that in order for it to work, there needed to be a more solid way
of deleting a selection. After working for a few days in the wrong direction
(I moved all caret related data to its own structure but it was too hard to
implement), I finally settled on a better approach. One of the biggest
hurdles was that inputs have two texts to work with, one for the visible
box, and one for the gadget itself and these strings both have different
encoding, so the offsets are not always the same. Previously seperate
methods were used to edit both strings, and each offset was updated
individually. I united these methods, and simplified it so that instead of
updating both offsets, the gadget offset is calculated from the box offset
whenever it is needed. I also added calls to delete_selection inside both
textbox_delete and textbox_insert so that replacement is handled
All in all, this patch provides:
- Selected text replacement
- Correct input box behavior when a selection is defined (right arrow
moves caret to end of selection)
- Correct cut functionaliy in both versions
- Fixed bug where a selections end box could not be found
- Fixed descrepancy between where the caret was placed and where the
selection began when starting a drag-select
Now, on to Downloads...
I'm getting ready to begin work on the html/layout rendering code, so
I've been sifting through the fetching and rendering files in NetSurf.
There are a few areas I'd like to discuss before I begin moving
things about. I'm sure you all have ideas or concerns as well since
this is a pretty big section of code to move out as a stand-alone
library. Here are a few of my personal concerns that deserve input
> Currently the rendering code is designed as a box tree, which I think would be an effective design if it's moved to a library. Does everyone agree on this aspect or are there other approaches that we should consider?
> Last week we also discussed whether the library should provide GUI functionality or if the caller should be left to provide his own functions to display the resulting structure (box-tree).
> Do we provide the fetch functions to obtain the html to process or should we have the lib caller obtain the data himself and pass a reference to it?
> Even if the lib caller obtains the html data himself, how do we handle <img> tags? Does our lib fetch those?
> On the subject of images, the caller would have to provide support for that. I was thinking the box would be flagged as containing an image, which the caller could then fetch and process, but I'm not even certain how the current implementation handles this.
I'm sure I'll run across dozens of other issues once I get going on
this, but these are a few things we talked about in #netsurf. If I
could just get some feedback on what the library should and should not
do, that would really help me get started. Please respond to these
concerns and submit your own so we can all get an idea as to where
this project should be going.
I have played with my idea of making the loose layout and implemented changing
the box structure of tables to make them fit into available width.
How it works can be seen now on the testres/text2.html file. Changing the
layout was also necessary and worked for most netsurf-browser.org subpages,
but afterwards I added scaling the page, what allowed to fit it normally (
similarly - google, google groups). Also, the wiki main page is a good
example as being broken resultful (http://en.wikipedia.org/wiki/Main_Page).
For this week I plan to make all this code cleaner and more useful by:
- adding a separate box structure for printed content - I left it so long for
debugging purposes(to immediately see some results) and its time to change
- adding font measuring function support - now, we are measuring one font,
while using another
- taking into consideration some more text style passed to pdf plotting - now
its just scaled and plotted with the default font
- adding clipping and/or resizing images or any other objects influencing the
width of pages
Also, if it is no problem for you, I would like to use this weekend, to work
in advance for my following Friday(11th) and Monday(14th) and have them
free - I would like to have a short vacation, since the weather has become so
nice lately here.
Since my last report there's been a lot of work put into the
GIF and BMP libraries. Both are working far better than before in
terms of completeness and API.
Here's a list of what I've accomplished, with help from James and a
suggestions from other devs:
> Simplified test-case for decoding and displaying a GIF image
> Improved data verification regarding frame initialisation
> Proper handling of comment extensions
> Frames without image data are now flagged to be skipped rather than causing errors
> Added new functions to parse extensions and initialise the gif structure in a more friendly way--gif_create() as opposed to gif->buffer_size, etc.
> Organized the structures for separation of "public" and "private" members
> Caller is now only required to provide "critical" bitmap callbacks; non-critical callbacks are simply not called if they don't exist
> Better documentation
> Moved all necessary code from NetSurf's "bmpread" files to an external location in my branch
> Callback functions were implemented to allow operation of libnsbmp to go smoothly regardless of the bitmap functions the caller chooses to use
> Corrected coloring problems under linux
> Initialise the bmp structure in a more friendly way--bmp_create() as opposed to bmp->buffer_size, etc.
> Duplicated the GIF test-case for use as a BMP test-case
> Organized the structures for separation of "public" and "private" members
> Added Jason Summers' BMP Suite for testing
> Duplicated the BMP test-case for use as an ICO test-case
> Corrected decoding issues related to RGB16 bitmaps and 32-bit and 16-bit bitfield bitmaps
> Corrected ICO support
> Corrected several bugs that were illustrated by testing with the BMP Suite
> Integrated both libraries into my personal branch of NetSurf with the new library API's
At this point, these libraries are nearly complete. There are
still a few tweaks to be done here and there, but most if not all of
them could be deemed non-critical. The most important thing at this
point is to test the code under RISC OS.
Things I need help with:
> Testing of both libraries under RISC OS to ensure proper functionality
> General review of the code for any optimisation or suggestions--especially you, rjw, if you get around to reading this :)
> Comments, ideas, and criticisms as far as API, naming conventions, etc.
> Documentation for GIF library probably needs updating
> BMP library could use a few of the tweaks that were done to the GIF library; i.e. "Caller is now only required to provide 'critical' bitmap callbacks"
> Begin to grasp the code behind NetSurf's layout/HTML rendering to start the Layout library
Comments and concerns:
I really appreciate the feedback from several of you on IRC.
The API for these libraries has really been shaping up and I'm fairly
comfortable with their current operation. Unless there is any
interest in continued improvement of these two libraries, I'd like to
move on to the layout rendering code, which I think could take a
significant amount of time to complete. As always, feel free to
comment on anything and everything.