Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Cameron Cawley
Browse
Commits
cf64f0f4
Commit
cf64f0f4
authored
27 years ago
by
Kevin Bracey
Browse files
Options
Download
Email Patches
Plain Diff
Updated code to extract attributes from BODY tag, including event info.
parent
2073753b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
16 deletions
+26
-16
c/Fetch
c/Fetch
+19
-14
c/Images
c/Images
+1
-1
h/Global
h/Global
+5
-0
h/Images
h/Images
+1
-1
No files found.
c/Fetch
View file @
cf64f0f4
...
...
@@ -616,24 +616,23 @@ void fetch_preprocess_token(browser_data * b, HStream * tptr)
}
}
if
(
tptr
->
style
&
IMG
)
if
(
tptr
->
tag
==
BODY
)
{
/*
A background image
. */
/*
The BODY tag. All sorts of exciting stuff in here..
. */
if
(
tptr
->
src
)
if
(
HtmlBODYbackground
(
tptr
)
)
{
/* If there's a URL for the image, ask the image library for it */
/* and remember the image number in the browser_data structure */
image_new_image
(
b
,
tptr
->
src
,
tptr
,
2
);
image_new_image
(
b
,
HtmlBODYbackground
(
tptr
)
,
tptr
,
2
);
}
/* In the case of a background, the maxlen field in the HStream structure */
/* is used to hold a 24-bit background colour, or '-1' for 'default'. */
/* Get the 24-bit background colour, if any. */
if
(
tptr
->
maxlen
!=
(
unsigned
int
)
-
1
)
if
(
HtmlBODYbgcolour
(
tptr
)
!=
NULL_COLOUR
)
{
b
->
backgroundcol
=
tptr
->
maxlen
;
b
->
backgroundcol
=
HtmlBODYbgcolour
(
tptr
)
;
#ifdef TRACE
if
(
tl
&
(
1u
<<
6
))
Printf
(
"fetch_preprocess_token: Background colour set to %d
\n
"
,
b
->
backgroundcol
);
...
...
@@ -648,13 +647,16 @@ void fetch_preprocess_token(browser_data * b, HStream * tptr)
browser_update_bottom
(
b
,
0
);
}
/* In a manner similar to the background colour handling above, */
/* the 'size', 'rows' and 'cols' fields of the HStream struct */
/* are used to hold colour information. */
/* Get the rest of the colour info out. */
if
((
tptr
->
size
)
!=
(
unsigned
int
)
-
1
)
b
->
textcol
=
tptr
->
size
;
if
((
tptr
->
rows
)
!=
(
unsigned
int
)
-
1
)
b
->
linkcol
=
tptr
->
rows
;
if
((
tptr
->
cols
)
!=
(
unsigned
int
)
-
1
)
b
->
usedcol
=
tptr
->
cols
;
if
(
HtmlBODYtext
(
tptr
)
!=
NULL_COLOUR
)
b
->
textcol
=
HtmlBODYtext
(
tptr
);
if
(
HtmlBODYlink
(
tptr
)
!=
NULL_COLOUR
)
b
->
linkcol
=
HtmlBODYlink
(
tptr
);
if
(
HtmlBODYvlink
(
tptr
)
!=
NULL_COLOUR
)
b
->
usedcol
=
HtmlBODYvlink
(
tptr
);
if
(
HtmlBODYalink
(
tptr
)
!=
NULL_COLOUR
)
b
->
follcol
=
HtmlBODYalink
(
tptr
);
/* Also pull out the onload and onunload scripts. */
if
(
HtmlBODYonload
(
tptr
))
b
->
onload
=
HtmlBODYonload
(
tptr
);
if
(
HtmlBODYonunload
(
tptr
))
b
->
onunload
=
HtmlBODYonunload
(
tptr
);
}
/* Closure of long else to see if the HStream structure represented */
...
...
@@ -1022,6 +1024,9 @@ void fetch_fetcher(browser_data * b)
b
->
follcol
=
choices
.
col_foll
;
/* Following link default colour */
b
->
selecol
=
choices
.
col_sele
;
/* Selected (highlighted) link colour */
b
->
onload
=
NULL
;
/* <BODY onload> attribute */
b
->
onunload
=
NULL
;
/* <BODY onunload> attribute */
/* Ensure the nesting level and filling frame counters are reset */
b
->
nesting_level
=
0
;
...
...
This diff is collapsed.
Click to expand it.
c/Images
View file @
cf64f0f4
...
...
@@ -730,7 +730,7 @@ void image_abort_fetches(browser_data * b)
/* sprite for fast plotting. */
/*************************************************/
_kernel_oserror
*
image_new_image
(
browser_data
*
b
,
char
*
url
,
HStream
*
token
,
int
background
)
_kernel_oserror
*
image_new_image
(
browser_data
*
b
,
const
char
*
url
,
HStream
*
token
,
int
background
)
{
int
size
,
ok
,
ulen
,
xref
;
HStream
*
tp
;
...
...
This diff is collapsed.
Click to expand it.
h/Global
View file @
cf64f0f4
...
...
@@ -262,6 +262,11 @@ typedef struct browser_data
bistate_type
bistate
;
/* Type of a bistate button, if one is present. */
int
bistate_state
;
/* Current state of the bistate button. */
/* JavaScript support */
const
char
*
onload
;
/* The onLoad attribute specified in the BODY start tag. */
const
char
*
onunload
;
/* The onUnload attribute specified in the BODY start tag. */
/* General page display information */
int
backgroundcol
;
/* Background colour. */
...
...
This diff is collapsed.
Click to expand it.
h/Images
View file @
cf64f0f4
...
...
@@ -75,7 +75,7 @@ typedef struct image_info
/* Function prototypes */
_kernel_oserror
*
image_new_image
(
browser_data
*
b
,
char
*
url
,
HStream
*
token
,
int
background
);
_kernel_oserror
*
image_new_image
(
browser_data
*
b
,
const
char
*
url
,
HStream
*
token
,
int
background
);
void
image_abort_fetches
(
browser_data
*
b
);
_kernel_oserror
*
image_process_null
(
browser_data
*
b
);
_kernel_oserror
*
image_discard
(
browser_data
*
b
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment