<?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>18542</bug_id>
          
          <creation_ts>2008-04-16 15:25:46 -0700</creation_ts>
          <short_desc>Quirks: position: relative; top: 50%; should work</short_desc>
          <delta_ts>2022-07-23 04:32:38 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>apapirovski</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>browserbugs2</cc>
    
    <cc>hyatt</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>77868</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-04-16 15:25:46 -0700</bug_when>
    <thetext>Quirks: position: relative; top: 50%; should work

Hyatt says that 50% would be 0 in standards mode (since the root element has height: auto in standards.  However in quirks mode, the root should be as tall as the viewport.  So this should work in quirks.

http://www.toyota.com.tw/event/200707_service/
depends on this behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77869</commentid>
    <comment_count>1</comment_count>
      <attachid>20605</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-04-16 15:27:15 -0700</bug_when>
    <thetext>Created attachment 20605
Test case (blue block should be pushed down from top)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77875</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-04-16 17:09:18 -0700</bug_when>
    <thetext>Hyatt mentioned over IRC that he&apos;d found the bug, but that it might not even be worth fixing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77881</commentid>
    <comment_count>3</comment_count>
    <who name="Anatoli Papirovski">apapirovski</who>
    <bug_when>2008-04-16 19:00:22 -0700</bug_when>
    <thetext>As far as I&apos;m concerned the spec says something different. In CSS 2.1 (http://www.w3.org/TR/CSS21/visuren.html#position-props) this section was removed:

&quot;For &apos;top&apos; and &apos;bottom&apos;, if the height of the containing block is not specified explicitly (i.e., it depends on content height), the percentage value is interpreted like &apos;auto&apos;.&quot;

and there is no loger any mention of special case for height auto resulting in top: 0; which leads me to believe that we should be calculating the content height for the container and then using that as base value. (So not 100% in the case of body, but whatever the content height is.)

Have I missed something in the spec? (I&apos;ve got a patch ready for syncing-up our behavior to Firefox 3, which is only applying percentage top and bottom values if the parent height is either fixed or percentage, not auto.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>144978</commentid>
    <comment_count>4</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2009-09-04 19:20:35 -0700</bug_when>
    <thetext>&gt; Have I missed something in the spec?

Yes, I believe so.

Bug 14749 comment #14

Bug 26396 has more details.

References
----------

 * &quot;Percentages: refer to height of containing block&quot; 
coming from CSS 2.1, Section 9.3.2 Box offsets: &apos;top&apos;, &apos;right&apos;, &apos;bottom&apos;,
&apos;left&apos;
http://www.w3.org/TR/CSS21/visuren.html#position-props

  * Percentage values for the &apos;top&apos; property are relative to the containing
block.
  &quot;if the element&apos;s position is &apos;relative&apos; or &apos;static&apos;, the containing block is formed by the content edge of the nearest block-level, table cell or
inline-block ancestor box.&quot; 
coming from CSS 2.1, Section 10.1 Definition of &quot;containing block&quot;
http://www.w3.org/TR/CSS21/visudet.html#containing-block-details

    * &quot;If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, [then] the [height] value computes to &apos;auto&apos;.&quot; 
coming from CSS 2.1, Section 10.5 Content height: the &apos;height&apos; property
http://www.w3.org/TR/CSS21/visudet.html#the-height-property


The decisive factor to consider is 

a) when the containing block has a specified height

or (versus) 

b) when the containing block does not have a specified height: its height depends on its content (intrinsic height).

bugzilla.mozilla.org, bugs.kde.org all have bug reports on this issue.

regards, Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886189</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-23 04:32:27 -0700</bug_when>
    <thetext>I am not sure on what is expected behavior and which browser to align but Safari 15.6 on macOS 12.5 aligns with Chrome Canary 106 and shows the blue box down while Firefox Nightly 104 show the blue box just below the text based on attached test case. Just wanted to share latest testing results. Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>20605</attachid>
            <date>2008-04-16 15:27:15 -0700</date>
            <delta_ts>2008-04-16 15:27:15 -0700</delta_ts>
            <desc>Test case (blue block should be pushed down from top)</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>171</size>
            <attacher name="Eric Seidel (no email)">eric</attacher>
            
              <data encoding="base64">PHN0eWxlPgpkaXYgewogIHBvc2l0aW9uOiByZWxhdGl2ZTsKICB0b3A6IDUwJTsKICB3aWR0aDog
MTAwcHg7CiAgaGVpZ2h0OiAxMDBweDsKICBiYWNrZ3JvdW5kOiBibHVlOwp9Cjwvc3R5bGU+CkJs
dWUgYmxvY2sgc2hvdWxkIGJlIHB1c2hlZCBkb3duIGZyb20gdGhlIHRvcC4KPGRpdj4KPC9kaXY+
</data>

          </attachment>
      

    </bug>

</bugzilla>