<?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>133049</bug_id>
          
          <creation_ts>2014-05-18 09:18:02 -0700</creation_ts>
          <short_desc>Child padding set in %, when the parent has padding as well</short_desc>
          <delta_ts>2022-12-14 12:54:30 -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>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 7</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>221202</dup_id>
          
          <bug_file_loc>http://jsfiddle.net/Vd8YN/3/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aleksey">listtad</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>ik</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1010074</commentid>
    <comment_count>0</comment_count>
    <who name="Aleksey">listtad</who>
    <bug_when>2014-05-18 09:18:02 -0700</bug_when>
    <thetext>Steps to reproduce:

1. Create a parent div with left and right padding.
2. Place another div into the div from step 1.
3. Set the child&apos;s width and padding in percents - for example, 100%.
HTML:

&lt;div class=&quot;parent padded&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;parent&quot;&gt;&lt;/div&gt;

CSS:

.parent{
    position:relative;
    width:200px;
    height:100px;
}
.parent.padded{
    padding:20px 30px;
}
.parent:after{
    position:absolute;
    bottom:0;
    left:0;
    box-sizing:border-box;
    width:50%;
    padding-bottom:50%;

    content:&quot;&quot;;
}

Since CSS block&apos;s width and padding (all sides) depend on  the block&apos;s parent&apos;t width, both width and padding of the child div should be calculated based on a common formula: the parent width should either include padding or not. Ideally, this should depend on the box-sizing property.

So, width: 50% and padding:50% should calculate to equal values.

But the problem is: the child&apos;s padding (which is in percents) does not respect the parent&apos;s paddings, while the child&apos;s width does.

In Firefox (v12, v22), Opera (12.15), IE 9 this works as I expect.  If it&apos;s not a bug, I would love to be pointed at some explaination. Maybe the behavior described is the right one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1692172</commentid>
    <comment_count>1</comment_count>
    <who name="">ik</who>
    <bug_when>2020-09-26 02:35:10 -0700</bug_when>
    <thetext>Bump. This is still a problem in 2020.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1906238</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-10-17 13:02:09 -0700</bug_when>
    <thetext>I am not able to reproduce this bug since all browsers (Safari Technology Preview 155, Safari 16, Chrome Canary 109 and Firefox Nightly 107) render this same across all. Appreciate if someone can confirm and we can close this bug accordingly. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1919266</commentid>
    <comment_count>3</comment_count>
    <who name="">ik</who>
    <bug_when>2022-12-14 12:52:22 -0800</bug_when>
    <thetext>Sorry, didn&apos;t receive an email for the last comment. This issue has been fixed and can be closed, see:
https://bugs.webkit.org/show_bug.cgi?id=221202</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1919267</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-12-14 12:54:30 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 221202 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>