J
John Nagle
Here's another one of those obscure Greasemonkey/Adwords related questions.
Google Adwords sometimes generates blocks of ads like this
DIV ad block
A ad link
DIV div surrounding text
#text ad text
A
DIV
#text
A
DIV
#text
This renders as if A were a "block" tag.
This isn't expressed as HTML source; it's created dynamically by Javascript.
If it were expressed as HTML, it would be wrong, because there's an A
tag (normally an inline element) enclosing a DIV (a block element).
Expressed as Javascript, one can argue about it. Large numbers of
Google generated ads do this.
Anyway, my problem is this. I'm attaching "rating icons" to each Google ad.
(See "http://www.sitetruth.com", if you're interested in the rating process.)
To do this, I wrap each A tag in the structure above with a DIV. So I get
DIV
DIV new DIV
DIV new DIV with Z value for new layer
A link to rating information
IMG rating icon in new layer
A original ad link
DIV original ad div
#text original ad text
DIV new DIV
DIV new DIV with Z value for new layer
A link to rating information
IMG rating icon in new layer
A
DIV
#text
DIV new DIV
DIV new DIV with Z value for new layer
A link to rating information
IMG rating icon in new layer
A
DIV
#text
This works fine, and doesn't change the appearance of the Google ads. The
rating icon is in a new, translucent layer, so that it doesn't mess up the
existing page layout. The problem is that, for some layouts, the new DIV
doesn't get the correct height or position. Instead of surrounding the ad's
A tag, it has zero height and is at the left margin for all the ads. That's
a violation of the box model. It's as if somehow its position wasn't
recomputed. This is in Firefox 2.
It's probably a Firefox bug. But I need a workaround. Do I need to
do something to force a recalc, or make modifications to the DOM in
a specific order, or something like that?
John Nagle
SiteTruth
Google Adwords sometimes generates blocks of ads like this
DIV ad block
A ad link
DIV div surrounding text
#text ad text
A
DIV
#text
A
DIV
#text
This renders as if A were a "block" tag.
This isn't expressed as HTML source; it's created dynamically by Javascript.
If it were expressed as HTML, it would be wrong, because there's an A
tag (normally an inline element) enclosing a DIV (a block element).
Expressed as Javascript, one can argue about it. Large numbers of
Google generated ads do this.
Anyway, my problem is this. I'm attaching "rating icons" to each Google ad.
(See "http://www.sitetruth.com", if you're interested in the rating process.)
To do this, I wrap each A tag in the structure above with a DIV. So I get
DIV
DIV new DIV
DIV new DIV with Z value for new layer
A link to rating information
IMG rating icon in new layer
A original ad link
DIV original ad div
#text original ad text
DIV new DIV
DIV new DIV with Z value for new layer
A link to rating information
IMG rating icon in new layer
A
DIV
#text
DIV new DIV
DIV new DIV with Z value for new layer
A link to rating information
IMG rating icon in new layer
A
DIV
#text
This works fine, and doesn't change the appearance of the Google ads. The
rating icon is in a new, translucent layer, so that it doesn't mess up the
existing page layout. The problem is that, for some layouts, the new DIV
doesn't get the correct height or position. Instead of surrounding the ad's
A tag, it has zero height and is at the left margin for all the ads. That's
a violation of the box model. It's as if somehow its position wasn't
recomputed. This is in Firefox 2.
It's probably a Firefox bug. But I need a workaround. Do I need to
do something to force a recalc, or make modifications to the DOM in
a specific order, or something like that?
John Nagle
SiteTruth