Commit 9a80a12d authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Increased WimpSlot of debug !Browse by 200K.

FRAMES_SUPPORT #define removed.

Optimised fm_token_font_info().

Added support for LI tokens with text (for ordered lists).

Now outdents bullets from indent value, rather than indenting bullets by
the indent value and further indenting text. May need to look at default
Choices files because of this.

Limited the margin to always be non-negative.
parent 1f061a5c
......@@ -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
......
......@@ -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 */
......
......@@ -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);
......
......@@ -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;
}
}
/*************************************************/
......
......@@ -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;
}
/*************************************************/
......
......@@ -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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment