Closed Bug 599882 Opened 15 years ago Closed 13 years ago

Baseline of an inline block with relatively positioned block child is affected by the relative positioning

Categories

(Core :: Layout: Block and Inline, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: asamsamsa, Assigned: bzbarsky)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b6) Gecko/20100101 Firefox/4.0b6 Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b6) <html> <head> <style type="text/css"> .positionned { display:block; position: relative; left:100px; top:150px; } .nowidth { display:inline-block; width:0; } </style> </head> <body> <span>Hello world !</span><p class="nowidth"><span class="positionned">Positionned text</span></p><span>hello world !</span> </body> </html> Reproducible: Always Steps to Reproduce: 1.Use the code provided above 2.Modify the bottom value as you like Actual Results: All the box are vertically positioned. Expected Results: Only the positioned text box should be vertically positioned.
David, it looks like the baseline calculation for the inline block is using the positioned text. It's not clear to me whether this is the right behavior per spec, but Webkit and Presto don't seem to do that.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: box block displayed and relative positioned in a inline block displayed box bug → Baseline of an inline block with relatively positioned block child is affected by the relative positioning
Even ccing David. See comment 1, please.
To fix this, nsLayoutUtils::GetFirstLinePosition and nsLayoutUtils::GetLastLineBaseline need to undo the effects of relative positioning.
OS: Windows 7 → All
Priority: -- → P3
Hardware: x86 → All
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Why did you add the boolean parameter for the list bullet stuff? Shouldn't the same change apply there as well?
Well, that question is why you're reviewing this, and not dholbert. ;) I don't know. Should it? If it should, I'll nix the boolean, obviously.
But note that every single other UA agrees with us right now, before this change, on the bullet position...
Attachment #672424 - Flags: review?(dbaron)
Attachment #671021 - Attachment is obsolete: true
Attachment #671021 - Flags: review?(dbaron)
Comment on attachment 672424 [details] [diff] [review] With the bullet position also changed. I still think it's the right thing based on the definition of relative positioning and keeping a consistent model for what relative positioning means; if it causes compat problems we can switch to the first patch.
Attachment #672424 - Flags: review?(dbaron) → review+
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla19
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Depends on: 871819
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: