[libcss] PATCH rgba() support
by Rasmus Andersson
Hi,
I've patched libcss to support the rgba() CSS "function":
rgba(0, 0, 0, 0.2) => 0x00000033
This patch also changes the default value of the alpha component to
0xff (100% opaque). i.e:
black => 0x000000ff
#000000 => 0x000000ff
#123 => 0x112233ff
--
Rasmus Andersson
12 years, 9 months
NetSurf libs now AmigaOS .libraries
by Chris Young
Hi all
I will add this text to the wiki and upload the wrapper code. Is it
OK to put the code (structure below) in a subdir of each supported
library? Any suggestions as to name? "amiga_lib"?
I suspect the makefile/code can be cleaned up a bit, and possibly
integrated somewhat with the core library buildsystem - but I haven't
investigated as makefiles tend to break if I attempt to change them.
AmigaOS libraries have been created for the main NetSurf project
libraries:
libwapcaplet (wapcaplet.library)
libhubbub (hubbub.library)
libnsbmp (nsbmp.library)
libnsgif (nsgif.library)
libparserutils (parserutils.library)
libcss (css.library)
These comprise of the library itself and a stub C link library, which
opens the AmigaOS library and redirects function calls to the correct
place, negating the need to add additional code to applications to use
it.
Source structure
include/ Includes for building the library
interfaces/ and using without the stub link library
libname.h FUNCTION TABLE
proto/
libname.h
init.c Library init code
makefile.lib Makefile (named so as not to confuse core build system)
libname.library_rev.* Version numbering
stubs/ Stub link library
auto.c Code to open the .library
funcs.c STUB FUNCTIONS
vectors.c FUNCTION TABLE
Building the library
Build the static version of the library as usual:
gmake COMPONENT_TYPE=lib-static BUILD=release
Then cd to the directory containing the AmigaOS library code and run:
make -fmakefile.lib revision (bumps the library revision number)
make -fmakefile.lib (builds the library)
make -fmakefile.lib libname.a (builds the stub link library)
Adding new functions
If a new function is added to the original library, the AmigaOS
library wrapper needs to be updated in the three files marked in
capitals above.
New functions *must* be added to the end of the two function tables
(they must match in both tables, if one is missing from either table
the library will crash unexpectedly!), and a stub function added.
The version numbers in makefile.lib and in the OpenLibrary() call in
stubs/auto.c *must* be increased (this can wait until the next release
of the library/NetSurf - it only needs to be increased if new
functions are added between releases)
Modified API
If the API of a function is modified, it will need to be added as per
a new function in the instructions above. The previous incarnation of
the function will need to be renamed in the two function tables, and
the stub library function amended so it will still work as expected
from old code.
Major incompatible API changes may need a different approach (such as
a "v2" main interface, or a brand new .library with a different name)
Caveats
Amiga libraries have global shared data, rather than per-instance
data. This means some minor modifications have had to be made (within
the AmigaOS library interface, not the original link libraries):
_initialise and _finalise
These routines are called within the library initialisation/exit
code, rather than by the caller. This ensures the library is only
initialised once, and in a consistent state for all users of that
library.
parserutils.library
The initialisation code is hard-coded to read a central aliases file
(L:CharSets/Aliases). Any users of this library needing a custom
aliases file will fail (or the file will need to be merged with the
central one). Such usage is expected to be extremely rare.
wapcaplet.library
There is a security flaw in this library due to the implementation
and its translation to a system global context. All users of this
library get the same context and thus, the same linked-list set of
strings. This has the advantage of greater efficiency, and is
necessary so both (eg) css.library and NetSurf can share strings. Any
sensitive data stored in lwc_strings can easily be extracted by a
malicious user of the library. The nature of wapcaplet.library does
not lend itself to storage of personal information, so it is not
expected that any application will intentionally do this. As
wapcaplet.library could easily be patched to intercept strings as they
are being set, and - in a system without memory protection - any
application can read strings from memory regardless, this additional
problem is deemed insignificant. The warning "do not use
wapcaplet.library for sensitive data" should be heeded (instead link
libwapcaplet.a, or better yet use something more appropriate). This
will be revisited if it is deemed a significant risk.
Regards
Chris
12 years, 10 months
url.c patch
by Richard Kenyon
Hi, I've written the following patch for NetSurf.
This should replace 'bool url_host_is_ip_address(const char *host)'
in 'utils/url.c'
-------------------------------------------------------------------------------
/* Each digit of an octet is represented as a character
* so the maximum 'length' of an octet is 3
*/
#define MAX_OCTET_LEN 3
#define N_OCTETS 4 /* ipv4 addresses consist of 4 octets */
#define DECIMAL 10 /* octets are in base 10 */
/**
* Determine if host is a valid ipv4 address.
*
* \param host Address to validate.
*
* \return Boolean: true if host is valid, else false.
*/
bool url_host_is_ip4_address(const char *host)
{
/* We accept an ipv4 address written in dot-decimal notation
* ipv4 addresses consist of 4 octets of the address
* separately in decimal and separated by periods
* for example 123.0.42.255
*/
assert(host != NULL);
char *p;
int octet_count = 0;
int octet;
do {
octet = strtol(host, &p, DECIMAL);
host = p + 1;
if (octet >= 0 && octet <= 255)
octet_count++;
else
return false;
} while (*p != '\0');
/* If we don't have 4 octets then host is invalid */
return (octet_count == N_OCTETS);
}
-------------------------------------------------------------------------------
The new function is called 'url_host_is_ip4_address'
to reflect that we're only dealing with ipv4 addresses.
Hope this helps,
Richard
--
Richard Kenyon <http://cosmia.org.uk>
Do not settle for answers. Do not even seek them. Demand solutions.
cat , undeterred by brahma ! plenty , seat me at whole of broad day by daylight ." once the
12 years, 10 months
Re: Segfault on Twitter - ID: 3113770
by Levon Haykazyan
> ----- Original Message -----
> From: John-Mark Bell <jmb(a)netsurf-browser.org>
> To: netsurf-dev(a)netsurf-browser.org
> Subject: Re: Segfault on Twitter - ID: 3113770
> Date: Thu, 25 Nov 2010 23:14:12 +0000
>
>
> On Sun, 2010-11-21 at 20:11 +0100, Levon Haykazyan wrote:
> > Hi,
> >
> > The attached little patch should fix the above mentioned bug.
>
> It may prevent the crash, but I'm not convinced it's the correct
> solution. Returning false from that function indicates to the caller
> that memory was exhausted when fulfilling their request. That's
> certainly not what has happened when we've removed a cookie that has
> expired.
>
Agreed. But returning true while freeing the parameter c is
also not correct. Returning true from that function indicates
to the caller that c was successfully inserted into database.
That's certainly not what has happened.
> > I don't know whether this is the right place to send the patch,
> > but for some reason I couldn't post it in the bug tracker.
>
> This is the right place, yes.
>
> Thanks,
>
>
> J.
>
Thanks,
Levon
--
You Rock! Your E-Mail Should Too! Signup Now at Rock.com and get 2GB of Storage!
http://connections.rock.com/user/displayUserRegisterPage.kickAction?as=11...
12 years, 10 months
Re: Tab history issues
by Levon Haykazyan
Hi Michael,
I am using GTK front-end, but most of the code I am talking
about is in subsystem desktop. So I assume that the issue is
universal.
On File->New_tab Netsurf optionally either copies new tab
or opens a blank one. The history is copied in both cases.
I guess it can be argued that the history needs to be
preserved in the former case but not in the later.
Thanks,
Levon
> ----- Original Message -----
> From: Michael Drake <tlsa(a)netsurf-browser.org>
> To: netsurf-dev(a)netsurf-browser.org
> Subject: Re: Tab history issues
> Date: Wed, 24 Nov 2010 17:45:11 +0000 (GMT)
>
>
> In article <20101124171524.BA7106545AE(a)c-in3ws--03-02.sv2.lotuslive.com>,
> Levon Haykazyan <levon(a)rock.com> wrote:
>
> > I have noticed that upon creation of a new tab (say by
> > Right_click->Open_in_a_new_tab or File->New_tab) the history
> > of the current tab is copied.
>
> When you follow a link in a new window or new tab, preservation of the
> local history is the intended behaviour for NetSurf.
>
> The File -> New tab menu option should not preserve local history (neither
> should File -> New window), so if it does that sounds like a bug.
>
> > In addition if you search the web through the google search entry next
> > to the address bar, the search page is not added to history.
>
> That sounds like a bug too.
>
> Which front end are you using?
>
> --
>
> Michael Drake (tlsa) http://www.netsurf-browser.org/
>
--
You Rock! Your E-Mail Should Too! Signup Now at Rock.com and get 2GB of Storage!
http://connections.rock.com/user/displayUserRegisterPage.kickAction?as=11...
12 years, 10 months
Trouble compiling libnsfb: XCB dependency
by Yanik Ruiz-Ramon
Hi devels,
I'm trying to compile libnsfb on Ubuntu Lucid Lynx and I am running into
trouble with the XCB dependencies. I've install all the XCB developer
libraries I can get my hands on, but I keep getting this error message when
I try to compile. Any ideas what is wrong here? I've searched and found
other people with the same problem, but no solution.
Thanks in advance.
Best,
Yanik
COMPILE: src/libnsfb.c
COMPILE: src/cursor.c
COMPILE: src/plot/api.c
COMPILE: src/plot/util.c
COMPILE: src/plot/generic.c
COMPILE: src/plot/32bpp.c
COMPILE: src/plot/16bpp.c
COMPILE: src/plot/8bpp.c
COMPILE: src/surface/surface.c
COMPILE: src/surface/sdl.c
COMPILE: src/surface/vnc.c
COMPILE: src/surface/able.c
COMPILE: src/surface/ram.c
COMPILE: src/surface/linux.c
COMPILE: src/surface/x.c
*src/surface/x.c:21:27: error: xcb/xcb_image.h: No such file or directory*
*src/surface/x.c:22:26: error: xcb/xcb_atom.h: No such file or directory*
*src/surface/x.c:23:27: error: xcb/xcb_icccm.h: No such file or directory*
*src/surface/x.c:24:25: error: xcb/xcb_aux.h: No such file or directory*
src/surface/x.c:25:29: error: xcb/xcb_keysyms.h: No such file or directory
src/surface/x.c:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
src/surface/x.c:45: error: expected ‘)’ before ‘*’ token
src/surface/x.c:60: error: expected specifier-qualifier-list before
‘xcb_key_symbols_t’
src/surface/x.c: In function ‘update_pixmap’:
src/surface/x.c:422: error: ‘xstate_t’ has no member named ‘shminfo’
src/surface/x.c:425: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:426: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:427: error: ‘xstate_t’ has no member named ‘gc’
src/surface/x.c:428: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:433: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:434: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:435: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:435: error: ‘xstate_t’ has no member named ‘image’
cc1: warnings being treated as errors
src/surface/x.c:438: error: implicit declaration of function
‘xcb_image_shm_put’
src/surface/x.c:438: error: nested extern declaration of ‘xcb_image_shm_put’
src/surface/x.c:439: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:440: error: ‘xstate_t’ has no member named ‘gc’
src/surface/x.c:441: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:442: error: ‘xstate_t’ has no member named ‘shminfo’
src/surface/x.c: In function ‘update_and_redraw_pixmap’:
src/surface/x.c:457: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:458: error: ‘xstate_t’ has no member named ‘window’
src/surface/x.c:459: error: ‘xstate_t’ has no member named ‘gc’
src/surface/x.c: In function ‘xcopy’:
src/surface/x.c:503: error: implicit declaration of function ‘xcb_aux_sync’
src/surface/x.c:503: error: nested extern declaration of ‘xcb_aux_sync’
src/surface/x.c:509: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:510: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:511: error: ‘xstate_t’ has no member named ‘gc’
src/surface/x.c:556: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:557: error: ‘xstate_t’ has no member named ‘window’
src/surface/x.c:558: error: ‘xstate_t’ has no member named ‘gc’
src/surface/x.c: At top level:
src/surface/x.c:600: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
src/surface/x.c:687: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
src/surface/x.c: In function ‘x_initialise’:
src/surface/x.c:759: error: ‘xcb_size_hints_t’ undeclared (first use in this
function)
src/surface/x.c:759: error: (Each undeclared identifier is reported only
once
src/surface/x.c:759: error: for each function it appears in.)
src/surface/x.c:759: error: ‘hints’ undeclared (first use in this function)
src/surface/x.c:792: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:792: error: implicit declaration of function
‘create_shm_image’
src/surface/x.c:792: error: nested extern declaration of ‘create_shm_image’
src/surface/x.c:794: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:795: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:795: error: implicit declaration of function ‘create_image’
src/surface/x.c:795: error: nested extern declaration of ‘create_image’
src/surface/x.c:797: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:806: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:807: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:813: error: ‘xstate_t’ has no member named ‘keysymbols’
src/surface/x.c:813: error: implicit declaration of function
‘xcb_key_symbols_alloc’
src/surface/x.c:813: error: nested extern declaration of
‘xcb_key_symbols_alloc’
src/surface/x.c:826: error: ‘xstate_t’ has no member named ‘window’
src/surface/x.c:829: error: ‘xstate_t’ has no member named ‘window’
src/surface/x.c:831: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:831: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:836: error: implicit declaration of function
‘xcb_alloc_size_hints’
src/surface/x.c:836: error: nested extern declaration of
‘xcb_alloc_size_hints’
src/surface/x.c:837: error: implicit declaration of function
‘xcb_size_hints_set_max_size’
src/surface/x.c:837: error: nested extern declaration of
‘xcb_size_hints_set_max_size’
src/surface/x.c:837: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:837: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:838: error: implicit declaration of function
‘xcb_size_hints_set_min_size’
src/surface/x.c:838: error: nested extern declaration of
‘xcb_size_hints_set_min_size’
src/surface/x.c:838: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:838: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:839: error: implicit declaration of function
‘xcb_set_wm_size_hints’
src/surface/x.c:839: error: nested extern declaration of
‘xcb_set_wm_size_hints’
src/surface/x.c:839: error: ‘xstate_t’ has no member named ‘window’
src/surface/x.c:839: error: ‘WM_NORMAL_HINTS’ undeclared (first use in this
function)
src/surface/x.c:840: error: implicit declaration of function
‘xcb_free_size_hints’
src/surface/x.c:840: error: nested extern declaration of
‘xcb_free_size_hints’
src/surface/x.c:843: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:844: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:844: error: ‘xstate_t’ has no member named ‘window’
src/surface/x.c:844: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:844: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:851: error: ‘xstate_t’ has no member named ‘gc’
src/surface/x.c:852: error: ‘xstate_t’ has no member named ‘gc’
src/surface/x.c:852: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:859: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:859: error: ‘xstate_t’ has no member named ‘image’
src/surface/x.c:863: error: ‘xstate_t’ has no member named ‘window’
src/surface/x.c: In function ‘x_finalise’:
src/surface/x.c:875: error: implicit declaration of function
‘xcb_key_symbols_free’
src/surface/x.c:875: error: nested extern declaration of
‘xcb_key_symbols_free’
src/surface/x.c:875: error: ‘xstate_t’ has no member named ‘keysymbols’
src/surface/x.c:878: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c: In function ‘x_input’:
src/surface/x.c:944: error: ‘xstate_t’ has no member named ‘pmap’
src/surface/x.c:945: error: ‘xstate_t’ has no member named ‘window’
src/surface/x.c:946: error: ‘xstate_t’ has no member named ‘gc’
src/surface/x.c:1022: error: implicit declaration of function
‘xcb_key_symbols_get_keysym’
src/surface/x.c:1022: error: nested extern declaration of
‘xcb_key_symbols_get_keysym’
src/surface/x.c:1022: error: ‘xstate_t’ has no member named ‘keysymbols’
src/surface/x.c:1028: error: ‘xstate_t’ has no member named ‘keysymbols’
make: *** [build-Linux-Linux-release-lib-static/src_surface_x.o] Error 1
12 years, 10 months
Tab history issues
by Levon Haykazyan
Hi guys,
I have noticed that upon creation of a new tab (say by
Right_click->Open_in_a_new_tab or File->New_tab) the history
of the current tab is copied. In addition if you search the
web through the google search entry next to the address bar,
the search page is not added to history.
Is this the intended behaviour or a bug? And in the later case
should this be fixed to a "normal browser behaviour"?
Thanks,
Levon
--
You Rock! Your E-Mail Should Too! Signup Now at Rock.com and get 2GB of Storage!
http://connections.rock.com/user/displayUserRegisterPage.kickAction?as=11...
12 years, 10 months
Bitmap Potter / Clipping rectangle
by m0n0
Hello again ;)
I have a question about the clipping rectangle within
the bitmap plot function...
Should the clipping rectangle clip the original image
or should it clip the scaled image?
Framebuffer version is not an good reference for this,
because it doesn't implement scaling. GTK does it, but
the code is gdk dependent and I'm not sure how these
gdk_* functions behave.
If the clipping really should be done on the source
image, should the clipping rectangle also get scaled
like the image, and then applied to the scaled image?
Thanks for reading and your help. :)
Greets,
Ole
12 years, 10 months