[Webkit-unassigned] [Bug 139742] New: display: table-cell with position: relative and top: Xpx DIFFERENT from Firefox

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 17 12:43:08 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=139742

            Bug ID: 139742
           Summary: display: table-cell with position: relative and top:
                    Xpx DIFFERENT from Firefox
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jon.dufresne at gmail.com

I'm not sure which rendering is technically correct based on the spec. But I ran into this issue while developing and noticed a difference between Firefox and WebKit. The results from WebKit surprised me the most and is why I'm reporting this here. If this is actually a Firefox bug, please let me know and I will file the bug in the appropriate place.

When an element has the CSS:

display: table-cell;
position: relative;
top: Xpx;

Where X is some value greater than 0, the element is renderd X pixels from the top. I am surprised by this as I would expect (intuitively; not based on a spec) table-cell display to override the relative positioning. That is, I'd expect the element to be rendered more like a table cell.


Test document:


<!doctype HTML>

<head>
  <title>Test</title>
  <style>
    #row {
        display: table;
    }
    .cell {
        display: table-cell;
        position: relative;
        height: 100px;
        width: 100px;
    }
    #left {
        background-color: green;
        top: 50px;
    }
    #right {
        background-color: red;
    }
  </style>
</head>
<body>
  <div id="row">
    <div id="left" class="cell"></div>
    <div id="right" class="cell"></div>
  </div>

</body>

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141217/80f606ee/attachment-0002.html>


More information about the webkit-unassigned mailing list