diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-23 23:05:34 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-23 23:05:34 +0000 |
commit | ddeadd1c02880367ad786b113d352a519f45ec73 (patch) | |
tree | 00b8b46ee1a3fc84e5492c2183dfaa8192d261f9 /amiga | |
parent | b20949a35025b23da1bf0ac6003f4575eb94281d (diff) | |
download | netsurf-ddeadd1c02880367ad786b113d352a519f45ec73.tar.gz netsurf-ddeadd1c02880367ad786b113d352a519f45ec73.tar.bz2 |
Merge LibCSS port to trunk.
svn path=/trunk/netsurf/; revision=8752
Diffstat (limited to 'amiga')
-rwxr-xr-x | amiga/context_menu.c | 2 | ||||
-rw-r--r-- | amiga/font.c | 10 | ||||
-rwxr-xr-x | amiga/gui.c | 7 | ||||
l--------- | amiga/resources/quirks.css | 1 | ||||
-rwxr-xr-x | amiga/save_complete.c | 11 |
5 files changed, 18 insertions, 13 deletions
diff --git a/amiga/context_menu.c b/amiga/context_menu.c index 7f60d4963..24dd90f2b 100755 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -92,7 +92,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) while(curbox = box_at_point(curbox,x,y,&box_x,&box_y,&cc)) { - if (curbox->style && curbox->style->visibility == CSS_VISIBILITY_HIDDEN) continue; + if (curbox->style && css_computed_visibility(curbox->style) == CSS_VISIBILITY_HIDDEN) continue; if(curbox->href) { diff --git a/amiga/font.c b/amiga/font.c index cd7d834e2..5c694c199 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -237,7 +237,7 @@ struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle) { struct OutlineFont *ofont; char *fontname; - WORD ysize; + ULONG ysize; int tstyle = 0; if ((fstyle->flags & FONTF_ITALIC) || (fstyle->flags & FONTF_OBLIQUE)) @@ -268,14 +268,12 @@ struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle) break; } - ysize = fstyle->size; - - if(ysize < (option_font_min_size / 10) * FONT_SIZE_SCALE) - ysize = (option_font_min_size / 10) * FONT_SIZE_SCALE; + /* Scale to 16.16 fixed point */ + ysize = fstyle->size * ((1 << 16) / FONT_SIZE_SCALE); if(ESetInfo(&ofont->olf_EEngine, OT_DeviceDPI,(72<<16) | 72, - OT_PointHeight,(ysize<<16)/FONT_SIZE_SCALE, + OT_PointHeight,ysize, TAG_END) == OTERR_Success) { return ofont; diff --git a/amiga/gui.c b/amiga/gui.c index f36f4a5df..62e98afdf 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -27,6 +27,7 @@ #include "amiga/schedule.h" #include <proto/timer.h> #include "content/urldb.h" +#include "css/utils.h" #include <libraries/keymap.h> #include "desktop/history_core.h" #include <proto/locale.h> @@ -105,6 +106,7 @@ #include <reaction/reaction_macros.h> char *default_stylesheet_url; +char *quirks_stylesheet_url; char *adblock_stylesheet_url; struct MsgPort *appport; @@ -324,6 +326,7 @@ void gui_init(int argc, char** argv) messages_load(lang); default_stylesheet_url = "file:///PROGDIR:Resources/amiga.css"; + quirks_stylesheet_url = "file:///PROGDIR:Resources/quirks.css"; adblock_stylesheet_url = "file:///PROGDIR:Resources/adblock.css"; if(hubbub_initialise("PROGDIR:Resources/Aliases",myrealloc,NULL) != HUBBUB_OK) @@ -331,7 +334,7 @@ void gui_init(int argc, char** argv) die(messages_get("NoMemory")); } - css_screen_dpi = 72; + nscss_screen_dpi = INTTOFIX(72); css_scrollbar_fg_colour = 0x00aaaaaa; css_scrollbar_bg_colour = 0x00833c3c; css_scrollbar_arrow_colour = 0x00d6d6d6; @@ -1303,7 +1306,7 @@ void ami_handle_appmsg(void) box = content->data.html.layout; while ((box = box_at_point(box, x, y, &box_x, &box_y, &content))) { - if (box->style && box->style->visibility == CSS_VISIBILITY_HIDDEN) continue; + if (box->style && css_computed_visibility(box->style) == CSS_VISIBILITY_HIDDEN) continue; if (box->gadget) { diff --git a/amiga/resources/quirks.css b/amiga/resources/quirks.css new file mode 120000 index 000000000..d9fb80334 --- /dev/null +++ b/amiga/resources/quirks.css @@ -0,0 +1 @@ +../../!NetSurf/Resources/Quirks,f79
\ No newline at end of file diff --git a/amiga/save_complete.c b/amiga/save_complete.c index 26b55adf5..2f5ebd584 100755 --- a/amiga/save_complete.c +++ b/amiga/save_complete.c @@ -120,17 +120,20 @@ bool save_complete_html(struct content *c, const char *path, bool index) return true; /* save stylesheets, ignoring the base and adblocking sheets */ - for (i = STYLESHEET_STYLE; i != c->data.html.stylesheet_count; i++) { + for (i = STYLESHEET_START; i != c->data.html.stylesheet_count; i++) { struct content *css = c->data.html.stylesheet_content[i]; char *source; int source_len; + bool is_style; if (!css) continue; if (save_complete_list_check(css)) continue; - if (i != STYLESHEET_STYLE) { + is_style = (strcmp(css->url, c->data.html.base_url) == 0); + + if (is_style == false) { if (!save_complete_list_add(css)) { warn_user("NoMemory", 0); return false; @@ -140,7 +143,7 @@ bool save_complete_html(struct content *c, const char *path, bool index) if (!save_imported_sheets(css, path)) return false; - if (i == STYLESHEET_STYLE) + if (is_style) continue; /* don't save <style> elements */ snprintf(spath, sizeof spath, "%s/%x", path, @@ -317,7 +320,7 @@ bool save_imported_sheets(struct content *c, const char *path) BPTR fh = 0; for (j = 0; j != c->data.css.import_count; j++) { - struct content *css = c->data.css.import_content[j]; + struct content *css = c->data.css.imports[j]; if (!css) continue; |