<?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>244844</bug_id>
          
          <creation_ts>2022-09-06 07:57:16 -0700</creation_ts>
          <short_desc>Incorrect width for elements with position:absolute, padding-left:50px, width:fit-content, and box-sizing:border-box</short_desc>
          <delta_ts>2022-09-06 08:39:06 -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>Safari 14</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>232816</dup_id>
          
          <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="Terluin Webdesign">wordpress</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1896497</commentid>
    <comment_count>0</comment_count>
    <who name="Terluin Webdesign">wordpress</who>
    <bug_when>2022-09-06 07:57:16 -0700</bug_when>
    <thetext>The width of an element is incorrect (too narrow) if the following conditions are met:
1. Property &apos;position&apos; is set to &apos;absolute&apos; or &apos;fixed&apos;.
2. Property &apos;padding-left&apos;, &apos;padding-right&apos;, &apos;border-left-width&apos;, or &apos;border-right-width&apos; are set to anything but &apos;0px&apos;, for instance: &apos;50px&apos;.
3. Property &apos;width&apos; is set to &apos;fit-content&apos;, &apos;min-content&apos;, or &apos;max-content&apos;.
4. Property &apos;box-sizing&apos; is set to &apos;border-box&apos;.

An example to be able to recreate:
&lt;div style=&quot;padding-left:50px;width:fit-content;position:absolute;top:0px;left:0px;&quot;&gt;
  &lt;div style=&quot;padding:50px;background:#000;color:#fff;font-size:25px;&quot;&gt;Text&lt;/div&gt;
&lt;/div&gt;

If you add up the left and right padding and the left and right border width, then that is the amount of width that the element is missing.
So, if I apply &apos;padding-left: 50px&apos;, then the element becomes &apos;50px&apos; too narrow.


The height of an element is incorrect (too tall) if the following conditions are met:
1. Property &apos;position&apos; is set to &apos;absolute&apos; or &apos;fixed&apos;.
2. Property &apos;padding-top&apos;, &apos;padding-bottom&apos;, &apos;border-top-width&apos;, or &apos;border-bottom-width&apos; are set to anything but &apos;0px&apos;, for instance: &apos;10px&apos;.
3. Property &apos;height&apos; is set to &apos;fit-content&apos;, &apos;min-content&apos;, or &apos;max-content&apos;.
4. Property &apos;box-sizing&apos; is set to &apos;border-box&apos;.

If you apply &apos;padding-top: 10px&apos; to such an element, then its height would go from &apos;30px&apos; to &apos;50px&apos; (double the amount of top padding).

An example to be able to recreate:
&lt;div style=&quot;padding-top:10px;height:fit-content;position:absolute;top:0px;left:0px;width:100px;&quot;&gt;
  &lt;div style=&quot;background:#000;width:100%;height:30px;&quot;&gt;&lt;/div&gt;
&lt;/div&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896504</commentid>
    <comment_count>1</comment_count>
    <who name="Terluin Webdesign">wordpress</who>
    <bug_when>2022-09-06 08:39:06 -0700</bug_when>
    <thetext>

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

    </bug>

</bugzilla>