<?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>103246</bug_id>
          
          <creation_ts>2012-11-26 05:32:02 -0800</creation_ts>
          <short_desc>Vertical margin percentage values are resolved against logical height, not logical width</short_desc>
          <delta_ts>2012-12-14 10:41:33 -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>CSS</component>
          <version>525.x (Safari 3.2)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://jsfiddle.net/4HvZN/1/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>103576</dependson>
    
    <dependson>103579</dependson>
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Rovanion Luckey">rovanion.luckey</reporter>
          <assigned_to name="Bear Travis">betravis</assigned_to>
          <cc>betravis</cc>
    
    <cc>phiw2</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>775373</commentid>
    <comment_count>0</comment_count>
    <who name="Rovanion Luckey">rovanion.luckey</who>
    <bug_when>2012-11-26 05:32:02 -0800</bug_when>
    <thetext>Looking at the fallowing example: http://jsfiddle.net/4HvZN/1/

If opened in any other browser but a webkit-based one the .upArrow appears in the middle of the page. As seen in this image with Chrome on the right and Firefox on the left: http://i.imgur.com/26vN6.png

This seems to be because webkit-based browsers interpret the percentage as a percentage of the outer elements height. Meanwhile all other browsers interpret the percentage as a percentage of the page width.

This behaviour is seen in many implementations of WebKit such as Safari 5.1.7 for Windows, Chrome 23, the Android 2.3 browser, the Safari on the iPhone 4S and so on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775833</commentid>
    <comment_count>1</comment_count>
    <who name="Bear Travis">betravis</who>
    <bug_when>2012-11-26 13:37:00 -0800</bug_when>
    <thetext>I have created a simpler test case here:
http://jsfiddle.net/nE6NJ/ 

The problem appears to be that height is used instead of width when resolving a percentage-based margin-top on an absolutely positioned element. This conflicts with the specification:
http://www.w3.org/TR/CSS2/box.html#margin-properties</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>777420</commentid>
    <comment_count>2</comment_count>
    <who name="Bear Travis">betravis</who>
    <bug_when>2012-11-27 17:45:22 -0800</bug_when>
    <thetext>As an addendum, writing-modes specifies this should be calculated based on logical, rather than physical width.
http://dev.w3.org/csswg/css3-writing-modes/#dimension-mapping.

Going to try to patch this, so renaming bug. Will need to confirm original test case is fixed with patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>778513</commentid>
    <comment_count>3</comment_count>
    <who name="Philippe Wittenbergh">phiw2</who>
    <bug_when>2012-11-28 17:12:25 -0800</bug_when>
    <thetext>Fwiw, I had filed bug 54613 for this some (long) time ago.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>791701</commentid>
    <comment_count>4</comment_count>
    <who name="Bear Travis">betravis</who>
    <bug_when>2012-12-14 10:41:33 -0800</bug_when>
    <thetext>Closing, as bug 103576 and bug 103579 have been fixed. Both should be present as of
http://trac.webkit.org/changeset/137695</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>