Small images in absolute positionned <div>. Am I missing something ?

VERIFIED DUPLICATE of bug 22274

Status

()

VERIFIED DUPLICATE of bug 22274
17 years ago
17 years ago

People

(Reporter: boullet.marc, Assigned: attinasi)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments)

(Reporter)

Description

17 years ago
BuildID 2001101803 NT4 but this is in for centuries.

Consider the following HTML (testcase1.htm in attached zip file) :

<html>
<body bgcolor="lightblue">
<div id="curslayer" style="position:absolute; top:10px; left:10px; z-index:5;
visibility:show;">
<img name="0" src="pot0.gif" alt="cursor" border="0">
</div>
<div id="rulerlayer" style="position:absolute; top:0px; left:10px; z-index:3;
visibility:show;">
<img name="2" src="ruler.gif" alt="ruler" border="0">
</div>
</body>
</html>

pot0.gif is a 11x7 pixels image.

1. Execute this code with moz, IE5.5, NS 4.7
2. See the results in screenshot1.
What I'm expecting with this code is to place the image at the point x=10, y=10.
Mozilla is the only browser to do it right. IE and NS shifts the image down
vertically by 8 pixels (8+ 7 (image height) = 15: remember this number)
3. Place a <!DOCTYPE..STRICT..> line in front of the code (testcase2.htm) and
reexecute.
4. Now all browsers show the same behaviour (i.e. a 8 pixels shift down).
See screenshot2
5. Change the image to be 11x15 pixels (testcase3.htm). Everything become normal
in both quirks and strict mode for all browsers. For all images whose height is
greater or equal to 15, the positionning is correct.
See screenshot3
6. Change the html to have two pot0 images in the <div> (testcase4.htm)
The two images are separated horizontally by 4 pixels (11+4=15). See screenshot4

I must admit that I'm a little bit lost here.
I can image several explanations, none of them satisfying me:
1. Images can't be smaller than 15x15. testcase1 proved the inverse in quirks mode
2.<div> can't be smaller than 15x 15. a default style parameter ?????
3. the right answer from Mozilla experts

Pragmatically, to avoid developers to special case in JS the top and left
parameters, Mozilla quirks mode should behave like other browsers (i.e the same
as its strict mode). 
For me, it would be still wrong but once you know that everybody is wrong....


zip file and screenshots coming soon
(Reporter)

Comment 1

17 years ago
Created attachment 54212 [details]
zip file with html testcases and gif images
(Reporter)

Comment 2

17 years ago
Created attachment 54213 [details]
screenshot1
(Reporter)

Comment 3

17 years ago
Created attachment 54214 [details]
screenshot2
(Reporter)

Comment 4

17 years ago
Created attachment 54215 [details]
screenshot3
(Reporter)

Comment 5

17 years ago
Created attachment 54216 [details]
screenshot4
(Reporter)

Comment 6

17 years ago
OK, I read bug 22274.
I think I understand a little bit better the issue.
I add style="display:block;" in testcase2.htm and it works like
expected.

I still see a compatibility issue with other browsers in quirks mode.
Marking this bug as a duplicate of bug 22274 and continuing the discussion
over there
(Reporter)

Comment 7

17 years ago

*** This bug has been marked as a duplicate of 22274 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE
verify dupe
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.