Open Bug 69490 Opened 24 years ago Updated 1 year ago

-moz-float-edge sucks; especially with auto margins and right floaters

Categories

(Core :: Layout: Floats, defect)

defect

Tracking

()

mozilla1.2alpha

People

(Reporter: ian, Unassigned)

References

()

Details

(Keywords: css-moz, testcase, Whiteboard: [Hixie-PF])

STEPS TO REPRODUCE
   1. float something to the right.
   2. immediately after it, create an in-flow box with 
        -moz-float-edge: margin-box;
        margin: 1em auto;
   3. lay it out.
   4. shrink the width so that there is a little room left.

EXPECTED RESULTS
   in-flow box should be centered in remaining space, and otherwise look
   normal (only high enough for its contents, etc.):

   +-----------------------------------------------------+
   |                                                     |
   |    +-------------------+    +--------------------+  |
   |    | centered text     |    |  right floater     |  |
   |    +-------------------+    +--------------------+  |
   |                                                     |
   +-----------------------------------------------------+


ACTUAL RESULTS
   quite inexplicably:

   +-----------------------------------------------------+
   |                                                     |
   |    +-------------------+    +--------------------+  |
   |    |                   |    |  right floater     |  |
   |    |                   |    +--------------------+  |
   |    | centered text     |                            |
   |    +-------------------+                            |
   |                                                     |
   +-----------------------------------------------------+

See test case.
*** Bug 69491 has been marked as a duplicate of this bug. ***
Accepting --> Moz 1.0

Is this affecting anything important for Mozilla 0.9?
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
Not particularly, in fact depending on the results of the float-display thread
on w3c-css-wg, this might end up WONTFIX. Definitely low priority, I would
target it at moz 1.1.
Severity: normal → minor
QA Contact: petersen → ian
Does this bug (and bug 69491) happen with 'padding-box' and 'border-box' as well
or just margin box.  If it's only 'margin-box' then maybe it's just
nsBlockReflowState::ComputeBlockAvailSpace that needs fixing...
Yes. It happens with all but content-box.
   http://www.hixie.ch/tests/adhoc/css/mozilla/float-edge/009.html content (ok)
   http://www.hixie.ch/tests/adhoc/css/mozilla/float-edge/010.html border
   http://www.hixie.ch/tests/adhoc/css/mozilla/float-edge/011.html padding
   http://www.hixie.ch/tests/adhoc/css/mozilla/float-edge/012.html margin

It seems the problem is that we position the box using the -moz-float-edge 
algorith (except we don't actually do it right, but whatever), but we position the
text using the CS2 algorithm.
Whiteboard: [Hixie-PF]
Target Milestone: mozilla1.0 → mozilla1.2
.
Assignee: attinasi → float
Status: ASSIGNED → NEW
Component: Layout → Layout: Floats
Blocks: 143162
Keywords: mozilla1.1
OS: Windows 2000 → All
Hardware: PC → All
Blocks: 244899
Blocks: 244932
Blocks: 138934
Blocks: 313611
Blocks: 267353
Assignee: layout.floats → nobody
QA Contact: ian → layout.floats
The test case here appears to work correctly on modern versions of Firefox, so this seems to be fixed.
We stopped using -moz-float-edge for lists in bug 413840; we now only use it for <hr>s.  Maybe we could remove it at some point.  It also supports only content-box and margin-box now.

Not sure what fixed that particular testcase, though.  We probably still want this bug open unless we have another one on getting rid of -moz-float-edge.
Severity: minor → S4

(In reply to David Baron :dbaron: from comment #8)

We stopped using -moz-float-edge for lists in bug 413840; we now only use it
for <hr>s. Maybe we could remove it at some point.

Update: our -moz-float-edge usage for <hr> was removed in bug 1781102, so -moz-float-edge is now almost unused.

At this point, we only use -moz-float-edge as part of the styles for <math>:
https://searchfox.org/mozilla-central/rev/02ff1234547a8097df4b07a0deb70dae49ac0d03/layout/mathml/mathml.css#20,33

math {
...
  -moz-float-edge: margin-box;

Maybe we could remove that as part of modernizing some of our mathml stuff, though. I know Igalia folks have done a lot of standardization work on defining how MathML behaves over the past few years, and it wouldn't surprise me if they managed to standardize it such that this is no longer necessary.

You need to log in before you can comment on or make changes to this bug.