Closed Bug 1737792 Opened 3 years ago Closed 2 years ago

floating elements are incorrectly layout in webkit-box display

Categories

(Core :: Layout, defect)

Firefox 93
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: kramarczyk, Unassigned)

Details

Attachments

(2 files)

Attached image bug.png

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36

Steps to reproduce:

Render following:

<html>
  <head>
    <style>
      .wrapper {
        line-height: 20px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        width: 400px;
        background-color: lightgray;
      }
      .spacer1 {
        width: 50px;
        height: 20px;
        background-color: red;
        float: right;
      }
      .spacer2 {
        width: 50px;
        height: 20px;
        background-color: green;
        float: right;
        clear: right;
      }
    </style>
  </head>
  <body>
    <div class="wrapper">
      <div class="spacer1"></div>
      <div class="spacer2"></div>
      aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
      aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
      aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
      aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
      aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
      aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
      aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
      aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa 
    </div>    
  </body>
</html>

Actual results:

floating elements are no longer floating. See attached file.

Expected results:

floating elements are floating. See attached file.

The Bugbug bot thinks this bug should belong to the 'Core::Layout' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Layout
Product: Firefox → Core
Attachment #9247796 - Attachment mime type: text/plain → text/html

WebKit renders like us, except it doesn't actually paint the floats for some reason.

However, why would Chrome's rendering be the expected rendering? float is generally ignored in flexbox contexts, so I don't see why this would be different.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

However, why would Chrome's rendering be the expected rendering? float is generally ignored in flexbox contexts, so I don't see why this would be different.
My understanding is that display: -webkit-box is not the same same display: flex and floating elements should not be ignored, but I might be mistaken since there's no official documentation for this as far as I am aware.

The severity field is not set for this bug.
:alaskanemily, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(emcdonough)

Rendering matches Chromium now.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(emcdonough)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: