J
John Nagle
I'm writing a Greasemonkey script which, among other things, puts a
SPAN element around some A tags. Sometimes, though, the height of the
SPAN element is smaller than that of the enclosing element.
The relevant portion of the DOM looks like this:
DIV (x=71,y-441, w=780, h=8)
#text
SPAN (x=71,y=441, w=780, h=2)
A (x=72,y=442, w=91. h=52)
STRONG
#text
P
#text
SPAN
#text
The position and size given are from the Firefox 2 DOM inspector.
Note that the SPAN tag is too wide and not high enough to enclose its contents.
Why is this happening? Usually, the SPAN tag encloses its contents, but not here.
Absolute positioning and layers don't seem to be involved; none of the
items below the first SPAN have a class, and that SPAN doesn't specify
size, position, or layer.
What I'd like to do is to compute the enclosing box for everything
below the SPAN, regardless of of absolute positioning, etc. Is there
any way to do this?
(What I'm doing, of course, is adding annotation information to A tags on
other web pages, using Greasemonkey. Most of the time, putting a SPAN
around the link properly encloses the link with a box, but not always.)
John Nagle
SPAN element around some A tags. Sometimes, though, the height of the
SPAN element is smaller than that of the enclosing element.
The relevant portion of the DOM looks like this:
DIV (x=71,y-441, w=780, h=8)
#text
SPAN (x=71,y=441, w=780, h=2)
A (x=72,y=442, w=91. h=52)
STRONG
#text
P
#text
SPAN
#text
The position and size given are from the Firefox 2 DOM inspector.
Note that the SPAN tag is too wide and not high enough to enclose its contents.
Why is this happening? Usually, the SPAN tag encloses its contents, but not here.
Absolute positioning and layers don't seem to be involved; none of the
items below the first SPAN have a class, and that SPAN doesn't specify
size, position, or layer.
What I'd like to do is to compute the enclosing box for everything
below the SPAN, regardless of of absolute positioning, etc. Is there
any way to do this?
(What I'm doing, of course, is adding annotation information to A tags on
other web pages, using Greasemonkey. Most of the time, putting a SPAN
around the link properly encloses the link with a box, but not always.)
John Nagle