<?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>74131</bug_id>
          
          <creation_ts>2011-12-08 14:44:39 -0800</creation_ts>
          <short_desc>[CSS Regions] Incorrect margin-top result in regions with mixed widths</short_desc>
          <delta_ts>2022-07-13 09:29:04 -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>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>AdobeTracked</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>119393</dependson>
          <blocked>57312</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Alan Stearns">stearns</reporter>
          <assigned_to name="Mihnea Ovidenie">mihnea</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>donggwan.kim</cc>
    
    <cc>mihnea</cc>
    
    <cc>spena</cc>
    
    <cc>WebkitBugTracker</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>517814</commentid>
    <comment_count>0</comment_count>
      <attachid>118475</attachid>
    <who name="Alan Stearns">stearns</who>
    <bug_when>2011-12-08 14:44:39 -0800</bug_when>
    <thetext>Created attachment 118475
reftest

If you have an element in a region with a percentage margin, and the region is followed by another region with a larger width, this affects the top margin display. If the element is displayed entirely within a single region its margins should only be affected by that single region. If an element spans regions the margins should be calculated for each segment using the local region dimensions.

In the test file it appears as if the size and margin calculations are using the widest region in the flow, then moving and clipping for display in the first region. The computed dimensions are reported as 240px by 50px with a 30px margin, but the displayed dimensions are 160px by 50px with left and right margins of 20px and a top margin of 30px. For this testfile I&apos;d expect the displayed dimensions but with an overall margin of 20px.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>900391</commentid>
    <comment_count>1</comment_count>
    <who name="Michelangelo De Simone">michelangelo</who>
    <bug_when>2013-06-13 20:57:08 -0700</bug_when>
    <thetext>Still repros on today&apos;s nightly (r151543)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>908398</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pena">spena</who>
    <bug_when>2013-07-15 08:00:11 -0700</bug_when>
    <thetext>Taking a look at this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>912723</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pena">spena</who>
    <bug_when>2013-07-30 02:31:14 -0700</bug_when>
    <thetext>I have been debugging this, and found that during the layout stage, the computed values of the margins end up being 30px (left, right and top). If you use the web inspector, those are the reported values. However, as Alan says in comment 0, the displayed margins are 20px.

It is in the paint stage where the left and right margins get the 20px values they display, in the WebCore::RenderBox::borderBoxRectInRegion method. However, in that place the top margin is not updated.

I talked to Mihnea and he warned me that since at this point margins are/can be collapsed (http://www.w3.org/TR/CSS2/box.html#collapsing-margins), it can be complicated / impossible to simply update the top-margin there.

I am still trying to see if there&apos;s something we can do about the top margin (which doesn&apos;t break existing behaviour), but feel free to comment if you have some ideas or suggestions.

My feeling is that trying to fix this behaviour so that we actually compute the correct margins in the layout stage would be quite complicated and would require many changes, but I might be missing something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883088</commentid>
    <comment_count>4</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-13 09:29:04 -0700</bug_when>
    <thetext>CSS Regions were removed in Bug 174978.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>118475</attachid>
            <date>2011-12-08 14:44:39 -0800</date>
            <delta_ts>2011-12-08 14:44:39 -0800</delta_ts>
            <desc>reftest</desc>
            <filename>top-margin.zip</filename>
            <type>application/zip</type>
            <size>1032</size>
            <attacher name="Alan Stearns">stearns</attacher>
            
              <data encoding="base64">UEsDBAoAAAAAAIhyiD8AAAAAAAAAAAAAAAALABAAdG9wLW1hcmdpbi9VWAwAGTjhTiA44U71ARQA
UEsDBBQACAAIAG9yiD8AAAAAAAAAAAAAAAAuABAAdG9wLW1hcmdpbi90b3AtbWFyZ2luLWluLXJl
Z2lvbnMtZXhwZWN0ZWQuaHRtbFVYDAAmOOFO8jfhTvUBFABlUUFuwyAQPDevWEXqsbXTKheX+BX9
ADYbg0q8CHCTqsrfuzar2lW5AMPszM6iUv7y2O6A13PEwdEI38ttXh1Fg7GBQ7hBIu8MdF73H2+/
hKsz2TbwUtfhtqIW3WAzlx038L14XHQc3Jg2JgVpDvXjP4XjH9mOrYdI02ieevIUm85PWJ5FPF9J
hB9KZ69rY/edqiSsCu27RcgUxBzoDJmRWZBDc1hLk+e0uMBJXxB0Ws4ezxn0aCDOHUp9UlVgWeM+
ofc6pVOZZBnrBhZ2qyrGuEC2lbCXL+Age2H9AFBLBwjRcBGF3QAAAKIBAABQSwMEFAAIAAgAU3KI
PwAAAAAAAAAAAAAAACUAEAB0b3AtbWFyZ2luL3RvcC1tYXJnaW4taW4tcmVnaW9ucy5odG1sVVgM
ACE44U69N+FO9QEUAHVRQW7DIBA8N69YRerRtdMqF5f62BfkA9hgGwWzCHCcqsrfu9hUdlplL8Aw
s8wszIcvLasdUL20Gif4nvexsknWZxWyCGfKBCwNH6T4pOP7TLotMic7heaRsHU4/BXGqtEJ6Uo4
2Ct41EpArXlzXgmTEqEv4bUo7HVFe6m6PpDsuIGTkYG7Thm/cbIg5aF4/tfheNe2pqc7h6MRWYMa
XVnrUd6lDBOmxk+Ls7fV2G3H8jRIZqtTLyGgTY8DthAIiQ0pNIXtcdSUV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