float:left is not placed correctly when inside an empty position:relative

RESOLVED FIXED

Status

()

Core
Layout: Block and Inline
--
minor
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: mats, Assigned: roc)

Tracking

({regression, testcase})

Trunk
regression, testcase
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.8a6 -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments)

(Reporter)

Description

13 years ago
float:left is not placed correctly when inside an empty position:relative.

This is a regression from bug 209694.

STEPS TO REPRODUCE:
1. Load testcase

ACTUAL RESULTS:
blue box is placed at the left edge of the viewport.

EXPECTED RESULTS:
blue box indented 1.5em from the left edge of the viewport.
(Reporter)

Comment 1

13 years ago
Created attachment 167884 [details]
Testcase
(Reporter)

Comment 2

13 years ago
Created attachment 167886 [details]
Testcase #2

Adding a border, padding or an explicit height to the rel.pos. fixes it...
Blocks: 209694
No longer depends on: 209694

Updated

13 years ago
Flags: blocking1.8a6?

Comment 3

13 years ago
Roc's out and so he probably won't be getting to this in time for the alpha.
Setting a nomination now for beta.
Flags: blocking1.8b?
Flags: blocking1.8a6?
Flags: blocking1.8a6-
(Reporter)

Updated

13 years ago
Blocks: 278861
This was introduced by the change to nsBlockReflowContext::PlaceBlock in bug
209694.  The empty block now goes through a codepath that doesn't do relative
positioning and doesn't do correct horizontal alignment.  That seems pretty
wrong to me....

Robert, if you don't have time to look into this, please let me know and I will.
The only reason this worked before was because the non-empty overflow area
stopped us from treating the block as empty --- which is definitely wrong. We
have to fix up this code so that empty blocks are correctly aligned and
relatively positioned.
Created attachment 172315 [details] [diff] [review]
fix

This patch merges all the code that should be in common for both empty and
non-empty blocks.
Attachment #172315 - Flags: superreview?(bzbarsky)
Attachment #172315 - Flags: review?(bzbarsky)
Comment on attachment 172315 [details] [diff] [review]
fix

r+sr=bzbarsky
Attachment #172315 - Flags: superreview?(bzbarsky)
Attachment #172315 - Flags: superreview+
Attachment #172315 - Flags: review?(bzbarsky)
Attachment #172315 - Flags: review+
checked in
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Updated

13 years ago
Flags: blocking1.8b?
You need to log in before you can comment on or make changes to this bug.