<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>139742</bug_id>
          
          <creation_ts>2014-12-17 12:43:08 -0800</creation_ts>
          <short_desc>display: table-cell with position: relative and top: Xpx DIFFERENT from Firefox</short_desc>
          <delta_ts>2014-12-17 17:14:47 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jon Dufresne">jon.dufresne</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1056505</commentid>
    <comment_count>0</comment_count>
    <who name="Jon Dufresne">jon.dufresne</who>
    <bug_when>2014-12-17 12:43:08 -0800</bug_when>
    <thetext>I&apos;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&apos;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&apos;d expect the element to be rendered more like a table cell.


Test document:


&lt;!doctype HTML&gt;

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

&lt;/body&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1056506</commentid>
    <comment_count>1</comment_count>
      <attachid>243453</attachid>
    <who name="Jon Dufresne">jon.dufresne</who>
    <bug_when>2014-12-17 12:43:38 -0800</bug_when>
    <thetext>Created attachment 243453
Screenshot in WebKit</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1056507</commentid>
    <comment_count>2</comment_count>
      <attachid>243454</attachid>
    <who name="Jon Dufresne">jon.dufresne</who>
    <bug_when>2014-12-17 12:43:54 -0800</bug_when>
    <thetext>Created attachment 243454
Screenshot in Firefox</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1056639</commentid>
    <comment_count>3</comment_count>
    <who name="Jon Dufresne">jon.dufresne</who>
    <bug_when>2014-12-17 17:14:47 -0800</bug_when>
    <thetext>According to the Firefox guys, WebKit is correct, Firefox is incorrect.

&lt;https://bugzilla.mozilla.org/show_bug.cgi?id=1112750&gt;
&lt;https://bugzilla.mozilla.org/show_bug.cgi?id=35168&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>243453</attachid>
            <date>2014-12-17 12:43:38 -0800</date>
            <delta_ts>2014-12-17 12:43:38 -0800</delta_ts>
            <desc>Screenshot in WebKit</desc>
            <filename>webkit.png</filename>
            <type>image/png</type>
            <size>660</size>
            <attacher name="Jon Dufresne">jon.dufresne</attacher>
            
              <data encoding="base64">iVBORw0KGgoAAAANSUhEUgAAAT0AAADaCAIAAABbzwJEAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA
B3RJTUUH3gwRFCsZwIFUAQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAACCklEQVR42u3awQmAMBBEUVfSuIVpR6lhLEAE0YAE3rvmNvBZD1bvfQGmspoAptP2/bACzKWS
WAF8JwO6BXQLugV0C+gWdAv8r5lggCobPOV/AfcWdAvoFtAtoFvQLaBbQLegW0C3gG5Bt4BuAd2C
bgHdAroF3QK6BXQL6BZ0C+gW0C3oFtAtoFvQLaBbQLegW0C3gG4B3YJuAd0CugXdAroFdAu6BXQL
6BZ0C+gW0C2gW9AtoFvgqt091FbWeSgmwL0FdAu6BXQL6BZ0C+gW0C3oFtAtoFtAt6BbQLeAbkG3
gG4B3YJuAd0CugXdAroFdAu6BXQL6BbQLegW0C2gW9AtoFtAt6BbQLeAbkG3gG4B3QK6Bd0CugV0
C7oFdAvoFnQL6Bb4oplggMQGuLeAbkG3gG4B3YJuAd0CugXdAroFdAvoFnQL6BbQLegW0C2gW9At
oFtAt6BbQLeAbkG3gG4B3QK6Bd0CugV0C7oFdAvoFnQL6BbQLegW0C2gW0C3oFtAt4BuQbeAbgHd
gm4B3QLvVRIrgHsL6BbQLegW0C2gW9AtoFtAt6BbQLeAbkG3gG4B3QK6Bd0CugV0C7oFdAvoFnQL
6BbQLegW0C2gW9AtoFtAt4BuQbeAbgHdgm4B3QK6Bd0CugV0C7oFdAvoFtAt6BbQLaBb0C2gW0C3
oFtAt4BuQbeAboHRTjedEjOT9QbqAAAAAElFTkSuQmCC
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>243454</attachid>
            <date>2014-12-17 12:43:54 -0800</date>
            <delta_ts>2014-12-17 12:43:54 -0800</delta_ts>
            <desc>Screenshot in Firefox</desc>
            <filename>firefox.png</filename>
            <type>image/png</type>
            <size>535</size>
            <attacher name="Jon Dufresne">jon.dufresne</attacher>
            
              <data encoding="base64">iVBORw0KGgoAAAANSUhEUgAAARYAAACrCAIAAAAsDCQHAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA
B3RJTUUH3gwRFCszGzqd1wAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAABjUlEQVR42u3WsQ2AMAxFwRgxgSeGgT1DUoXadEjcdZFSfekpiaoaW2YO4I3DBCAhkBBICH7o
7FyKOyzVNC8b9MeaXiHwkQMkBBICCYGEAAmBhEBCICFAQiAhkBBICJAQSAgkBBICJAQSAgmBhEBC
gIRAQiAhkBAgIZAQSAgkBEgIJAQSAgkBEgIJgYRAQiAhQEIgIZAQSAiQEEgIJAQSAiQEEgIJgYQA
CYGEQEIgIZCQCUBCICGQEEgIkBBICCQEEgIkBBICCYGEAAmBhEBCICFAQiAhkBBICCQESAgkBBIC
CQESAgmBhEBCgIRAQiAhkBAgIZAQSAgkBBICJAQSAgmBhIC+qKrnkJkWAa8QSAgkBBICJAQSAgmB
hAAJgYRAQiAhQEIgIZAQSAgkBEgIJAQSAgkBEgIJgYRAQoCEQEIgIZAQICGQEEgIJAQSAiQEEgIJ
gYQACYGEQEIgIUBCICGQEEgIkBBICCQEEgIJmQAkBBICCYGEAAmBhEBCICFAQiAhkBBICJAQSAi+
ZAH2DgtRw99vUgAAAABJRU5ErkJggg==
</data>

          </attachment>
      

    </bug>

</bugzilla>