diff --git a/Resources/UK/Browse/!RunD,feb b/Resources/UK/Browse/!RunD,feb index 558d4eb14be0dc204dbb53ab328a6754bedb0bc0..1fd0b11f166309ab37cbcdf68d51d878ccf027c5 100644 --- a/Resources/UK/Browse/!RunD,feb +++ b/Resources/UK/Browse/!RunD,feb @@ -92,7 +92,7 @@ Set Alias$@RunType_F91 /<Browse$Dir>.!Run -uri %%*0 | And finally, run the application. -WimpSlot -Min 2560K -Max 2560K +WimpSlot -Min 2760K -Max 2760K %UnSet ChangeFSI$Dir |Run <Browse$Dir>.!RunImage -debug CMal,CFle %*0 2> Pipe:$.StdErr diff --git a/c/Fetch b/c/Fetch index 38b673556a2ed6a419bd56b4906e25acb5396640..3bb0d037174210098bce60829d57010797e2453a 100644 --- a/c/Fetch +++ b/c/Fetch @@ -74,10 +74,6 @@ #define AuthorisationStr "Authorization: Basic " -/* Local compilation options */ - -#define FRAMES_SUPPORT - /* Static function prototypes */ static HStream * fetch_find_anchor_token_r (browser_data * b, HStream * streambase, char * anchor); @@ -542,115 +538,109 @@ void fetch_preprocess_token(browser_data * b, HStream * tptr) /* a body tag or header information - the code is run if it's a */ /* body tag. */ } + else if ISFRAMESET(tptr) + { + browser_data * parent; + browser_data * child = b; - #ifdef FRAMES_SUPPORT + parent = b->parent; + if (!parent) parent = b; - else if ISFRAMESET(tptr) + if (tptr->size) { - browser_data * parent; - browser_data * child = b; + int level = tptr->size; - parent = b->parent; - if (!parent) parent = b; + /* If filling_frame is equal to the number of children, then */ + /* they've all been filled - the frameset must be broken. */ - if (tptr->size) + if ( + !child->nchildren || + ( + child->nchildren && + child->filling_frame < child->nchildren + ) + ) { - int level = tptr->size; + while (level > 1) + { + /* If in a nested frameset, find out what browser_data struct */ + /* to put the frames in. This should go in the next frame that */ + /* is to be filled in according to the parent. */ - /* If filling_frame is equal to the number of children, then */ - /* they've all been filled - the frameset must be broken. */ + child = (browser_data *) child->children[child->filling_frame]; + level--; + } - if ( - !child->nchildren || - ( - child->nchildren && - child->filling_frame < child->nchildren - ) - ) + /* If stepping down a level, i.e. after a /frameset tag, */ + /* will want to increment the filling_frame field for */ + /* this browser to say that the child we just stepped */ + /* down for has been filled with a frameset. There's the */ + /* complication of a /frameset being followed by another */ + /* frameset and the level therefore staying the same; */ + /* this is dealt with in the frameset section below. */ + + if (tptr->size < parent->nesting_level) { - while (level > 1) - { - /* If in a nested frameset, find out what browser_data struct */ - /* to put the frames in. This should go in the next frame that */ - /* is to be filled in according to the parent. */ + child->filling_frame++; + } - child = (browser_data *) child->children[child->filling_frame]; - level--; - } + /* The aforementioned frameset section... */ - /* If stepping down a level, i.e. after a /frameset tag, */ - /* will want to increment the filling_frame field for */ - /* this browser to say that the child we just stepped */ - /* down for has been filled with a frameset. There's the */ - /* complication of a /frameset being followed by another */ - /* frameset and the level therefore staying the same; */ - /* this is dealt with in the frameset section below. */ + if (!(tptr->style & FRAME)) + { + /* Define a new frameset. */ - if (tptr->size < parent->nesting_level) + if (tptr->size == parent->nesting_level && child->parent) { - child->filling_frame++; + /* If at the same level as before on receiving a frameset */ + /* tag, must be doing nested frames and just had a */ + /* /frameset before this tag came along. So need to */ + /* increment the filling_frame counter of the *parent* */ + /* (remember, we're at the level of the frame to fill in, */ + /* not in the level below as with the code above that */ + /* checked the level had stepped down). Therefore, need */ + /* to find out again what browser_data struct is to be */ + /* given the frameset based on the new filled_frame value. */ + + child->parent->filling_frame++; + child = (browser_data *) child->parent->children[child->parent->filling_frame]; } - /* The aforementioned frameset section... */ - - if (!(tptr->style & FRAME)) - { - /* Define a new frameset. */ - - if (tptr->size == parent->nesting_level && child->parent) - { - /* If at the same level as before on receiving a frameset */ - /* tag, must be doing nested frames and just had a */ - /* /frameset before this tag came along. So need to */ - /* increment the filling_frame counter of the *parent* */ - /* (remember, we're at the level of the frame to fill in, */ - /* not in the level below as with the code above that */ - /* checked the level had stepped down). Therefore, need */ - /* to find out again what browser_data struct is to be */ - /* given the frameset based on the new filled_frame value. */ - - child->parent->filling_frame++; - child = (browser_data *) child->parent->children[child->parent->filling_frame]; - } - - /* Must force scrollbars off in this current view, */ - /* as a frameset is about to appear over it. */ - - windows_check_tools(child, NULL); + /* Must force scrollbars off in this current view, */ + /* as a frameset is about to appear over it. */ - /* Finally, define the frameset at the required depth. */ + windows_check_tools(child, NULL); - frames_define_frameset(child, tptr); - } - else - { - /* Fill in details of a frame. */ + /* Finally, define the frameset at the required depth. */ - frames_define_frame(child, tptr); - } + frames_define_frameset(child, tptr); + } + else + { + /* Fill in details of a frame. */ - parent->nesting_level = tptr->size; + frames_define_frame(child, tptr); } - #ifdef STRICT_PARSER + parent->nesting_level = tptr->size; + } - else - { - erb.errnum = Utils_Error_Custom_Message; + #ifdef STRICT_PARSER - StrNCpy0(erb.errmess, - lookup_token("FramNest:Frames definition is badly nested; could not complete the frames layout.", - 0,0)); + else + { + erb.errnum = Utils_Error_Custom_Message; - show_error_ret(&erb); - } + StrNCpy0(erb.errmess, + lookup_token("FramNest:Frames definition is badly nested; could not complete the frames layout.", + 0,0)); - #endif - } - } - - #endif + show_error_ret(&erb); + } + #endif + } + } else if ISHEAD(tptr) { /* Deal with header (HEAD) tags */ diff --git a/c/FetchHTML b/c/FetchHTML index 2fadf97e1591e129af1bbf49f0ffd3bf06bd3317..4cf13fea0a49d1686eb0383513fb17a8fd72cca3 100644 --- a/c/FetchHTML +++ b/c/FetchHTML @@ -1053,13 +1053,7 @@ _kernel_oserror * html_get_next_token(browser_data * b, unsigned int handle, int up->context = HtmlParse(ref_url, /* Full page URL, so parser can handle relative links */ 0, /* Length of document - zero at present (not known) */ up->type, /* Return type from the HtmlIdentify call */ - - #ifdef FRAMES_SUPPORT - 1, - #else - 0, - #endif - + 1, /* We want frames */ b->encoding, b->encoding_priority); diff --git a/c/FontManage b/c/FontManage index 85c6cd5ae2c3a198e229d99cd13c01c587508614..b1968c1de79da1b4695c4ff7feb635b612b3fd92 100644 --- a/c/FontManage +++ b/c/FontManage @@ -1684,13 +1684,15 @@ void fm_token_font_info(HStream * t, int * facenum, int * size, int * italic, in /* Set bold, italic and size details according */ /* to the header level (if the token represents */ /* header information, that is). */ - - if (redraw_header(flags) == 1) *bold = 1, *size *= 2; - if (redraw_header(flags) == 2) *bold = 1, *size = (*size * 3) / 2; - if (redraw_header(flags) == 3) *italic = 1, *size = (*size * 4) / 3; - if (redraw_header(flags) == 4) *bold = 1, *size = (*size * 4) / 3; - if (redraw_header(flags) == 5) *bold = 1; - if (redraw_header(flags) == 6) *italic = 1; + switch (redraw_header(flags)) + { + case 1: *bold = 1, *size *= 2; break; + case 2: *bold = 1, *size = (*size * 3) / 2; break; + case 3: *italic = 1, *size = (*size * 4) / 3; break; + case 4: *bold = 1, *size = (*size * 4) / 3; break; + case 5: *bold = 1; break; + case 6: *italic = 1; break; + } } /*************************************************/ diff --git a/c/Redraw b/c/Redraw index 204ac660682a63491d60a689f4c35109ec8342e5..a125f98304e03e6f3b47de071636d673028142b6 100644 --- a/c/Redraw +++ b/c/Redraw @@ -373,27 +373,50 @@ int redraw_margin(browser_data * b, reformat_cell * d, HStream * t) // if (redraw_header(s) == 3) return (i + 16 + 4); // if (redraw_header(s) == 4 || redraw_header(s) == 5) return (i + 32 + 4); - /* Add an appropriate amount for a bullet point; the */ - /* ISBULLET macro is defined in Fetch.h */ - - if (t->indent && !ISBULLET(t)) + /* Play about outdenting bullets and numbered list items. */ + if (t->tagno == TAG_LI) { - int width; + if (t->text) + { + _kernel_oserror *e; + int h, width, bytes; + + /* We need to right-align the text. Find out its width... */ + + h = fm_find_token_font(b, t); + e = fm_get_string_width(h, + t->text, + 0x40000000, + 0x40000000, + -1, + &bytes, + &width); + + if (!e) + i -= width; + } + else + { + int bullet_width; - convert_to_points(reformat_bullet_width(t->indent), &width); + /* Outdent the bullet */ + convert_to_points(reformat_bullet_width(t->indent), &bullet_width); - i += width; + i -= bullet_width; + } } /* Add an amount for block quote or address text; the */ /* constants are defined in HTMLLib:tags.h */ - if (s & (BLOCKQUOTE | ADDRESS)) return i + redraw_left_margin(b, d) + b->quote_margin; + if (s & (BLOCKQUOTE | ADDRESS)) i += b->quote_margin; /* Return a general indent based on the total summed so */ /* far plus an extra amount for lists etc. */ - return i + redraw_left_margin(b, d); + i += redraw_left_margin(b, d); + + return i > 0 ? i : 0; } /*************************************************/ diff --git a/h/Fetch b/h/Fetch index 46d348c6ba093c8429379b824f093d820dd9a34e..32f7b84ad6df4cccba43eb3e15800fd003753568 100644 --- a/h/Fetch +++ b/h/Fetch @@ -34,7 +34,7 @@ /* General definitions */ #define DISPLAY_NAMED ((HStream *) 0x40000000) /* Large enough not to be a token address */ -#define ISBULLET(p) (((p)->style) & LI) +#define ISBULLET(p) ((((p)->style) & LI) && !((p)->text)) #define ISLINK(p) ((((p)->style) & A) && ((p)->anchor)) #define Internal_URL "!INTRNL!" /* Special string (i.e. hack...) to mark a URL as internal only. */