<?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>288283</bug_id>
          
          <creation_ts>2025-02-21 22:31:31 -0800</creation_ts>
          <short_desc>Encapsulate containing block calculations for positioned layout</short_desc>
          <delta_ts>2025-02-25 20:34: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>Layout and Rendering</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>288398</dependson>
          <blocked>275447</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="fantasai">fantasai.bugs</reporter>
          <assigned_to name="fantasai">fantasai.bugs</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>kiet.ho</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2097037</commentid>
    <comment_count>0</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-02-21 22:31:31 -0800</bug_when>
    <thetext>Positioned layout in RenderBox is tangled up in ways that make it hard to build on:
* Setting and calculating values from containing block geometry is scattered throughout the code.
* Offset calculations for converting to/from container coordinates are unnecessarily confusing and not well separated from layout rule implementations.
* We repeat some calculations for no other reason that someone happened to put them in a function that&apos;s called multiple times.
* We pass around long lists of parameters in order to pass cached information from one function to another, which makes it hard to notice the parameters that actually changed between function calls.

To have a better foundation for adding position-area and alignment code, we should:
* Encapsulate containing block geometry logic and data.
* Package up cached values into a single struct so they can be passed as a single parameter.
* Better organize calculations into phases so that position-area adjustments to the containing block and alignment logic can be more easily and correctly integrated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2097038</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-02-21 22:31:39 -0800</bug_when>
    <thetext>&lt;rdar://problem/145348582&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2097287</commentid>
    <comment_count>2</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-02-23 19:40:07 -0800</bug_when>
    <thetext>https://github.com/WebKit/WebKit/pull/41180</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2098120</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-02-25 20:34:31 -0800</bug_when>
    <thetext>Committed 291088@main (6512cb0009b0): &lt;https://commits.webkit.org/291088@main&gt;

Reviewed commits have been landed. Closing PR #41180 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>