<?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>143864</bug_id>
          
          <creation_ts>2015-04-16 22:18:23 -0700</creation_ts>
          <short_desc>contentWidth can become negative with nested scrollbars</short_desc>
          <delta_ts>2022-12-16 18:20:06 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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="Bem Jones-Bey">bjonesbe</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>rwlbuis</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1086251</commentid>
    <comment_count>0</comment_count>
      <attachid>251004</attachid>
    <who name="Bem Jones-Bey">bjonesbe</who>
    <bug_when>2015-04-16 22:18:23 -0700</bug_when>
    <thetext>Created attachment 251004
Test case

This was originally reported in Blink: https://code.google.com/p/chromium/issues/detail?id=450598

This shows up when a percentage shape margin is specified, since the shape margin is computed based on the width of the containing block, and there&apos;s an assert that this computation should always return a positive number,

WebKit stack:
ASSERTION FAILED: shapeMargin() &gt;= 0
/Users/bemjb/Code/WebKit/Source/WebCore/rendering/shapes/RectangleShape.cpp(45) : WebCore::FloatRect WebCore::RectangleShape::shapeMarginBounds() const
1   0x111f23d00 WTFCrash
2   0x114cba5ff WebCore::RectangleShape::shapeMarginBounds() const
3   0x114cbad81 WebCore::RectangleShape::shapeMarginLogicalBoundingBox() const
4   0x1137830dc WebCore::Shape::lineOverlapsShapeMarginBounds(WebCore::LayoutUnit, WebCore::LayoutUnit) const
5   0x1151ca0ac WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine(WebCore::RenderBlockFlow const&amp;, WebCore::FloatingObject const&amp;, WebCore::LayoutUnit, WebCore::LayoutUnit)
6   0x1149f74af WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(WebCore::FloatingObject*)
7   0x114d23b08 WebCore::RenderBlockFlow::positionNewFloatOnLine(WebCore::FloatingObject*, WebCore::FloatingObject*, WebCore::LineInfo&amp;, WebCore::LineWidth&amp;)
8   0x1149db938 WebCore::LineBreaker::skipLeadingWhitespace(WebCore::BidiResolver&lt;WebCore::InlineIterator, WebCore::BidiRun&gt;&amp;, WebCore::LineInfo&amp;, WebCore::FloatingObject*, WebCore::LineWidth&amp;)
9   0x1149dbb80 WebCore::LineBreaker::nextLineBreak(WebCore::BidiResolver&lt;WebCore::InlineIterator, WebCore::BidiRun&gt;&amp;, WebCore::LineInfo&amp;, WebCore::RenderTextInfo&amp;, WebCore::FloatingObject*, unsigned int, WTF::Vector&lt;WebCore::WordMeasurement, 64ul, WTF::CrashOnOverflow&gt;&amp;)
10  0x114d1e4af WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange(WebCore::LineLayoutState&amp;, WebCore::BidiResolver&lt;WebCore::InlineIterator, WebCore::BidiRun&gt;&amp;, WebCore::InlineIterator const&amp;, WebCore::BidiStatus const&amp;, unsigned int)
11  0x114d1d291 WebCore::RenderBlockFlow::layoutRunsAndFloats(WebCore::LineLayoutState&amp;, bool)
12  0x114d21ad0 WebCore::RenderBlockFlow::layoutLineBoxes(bool, WebCore::LayoutUnit&amp;, WebCore::LayoutUnit&amp;)
13  0x114cfa382 WebCore::RenderBlockFlow::layoutInlineChildren(bool, WebCore::LayoutUnit&amp;, WebCore::LayoutUnit&amp;)
14  0x114cf93c8 WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit)
15  0x114cc57c9 WebCore::RenderBlock::layout()
16  0x114cfcbf3 WebCore::RenderBlockFlow::layoutBlockChild(WebCore::RenderBox&amp;, WebCore::RenderBlockFlow::MarginInfo&amp;, WebCore::LayoutUnit&amp;, WebCore::LayoutUnit&amp;)
17  0x114cfa5e6 WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&amp;)
18  0x114cf93eb WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit)
19  0x114cc57c9 WebCore::RenderBlock::layout()
20  0x114cfcbf3 WebCore::RenderBlockFlow::layoutBlockChild(WebCore::RenderBox&amp;, WebCore::RenderBlockFlow::MarginInfo&amp;, WebCore::LayoutUnit&amp;, WebCore::LayoutUnit&amp;)
21  0x114cfa5e6 WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&amp;)
22  0x114cf93eb WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit)
23  0x114cc57c9 WebCore::RenderBlock::layout()
24  0x114fefddd WebCore::RenderView::layoutContent(WebCore::LayoutState const&amp;)
25  0x114ff0c3a WebCore::RenderView::layout()
26  0x113eb6bf9 WebCore::FrameView::layout(bool)
27  0x113b16990 WebCore::Document::implicitClose()
28  0x113e806ab WebCore::FrameLoader::checkCallImplicitClose()
29  0x113e8037e WebCore::FrameLoader::checkCompleted()
30  0x113e7ee82 WebCore::FrameLoader::finishedParsing()
31  0x113b23dd3 WebCore::Document::finishedParsing()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1909670</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-11-01 17:00:57 -0700</bug_when>
    <thetext>This comment seems to mention that it was Blink specific:

https://bugs.chromium.org/p/chromium/issues/detail?id=450598#c3

This commit was pushed to fix issue in Blink:

https://src.chromium.org/viewvc/blink?view=revision&amp;revision=194638

and Webkit has similar code here:

https://github.com/WebKit/WebKit/blob/0d7afc5a45c140c44497a81e92416f01306be877/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp#L172

and I am not super sure, whether we need to do anything or not but appreciate if someone else can comment, it would be great. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1920160</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-12-16 18:20:06 -0800</bug_when>
    <thetext>Or this could be fix - https://chromium.googlesource.com/chromium/blink/+/2ab65b30003b20c2ca2828a2da1fd2cad8809f0c &amp; https://github.com/WebKit/WebKit/blob/b357325af732916368c76dd65082e0e389bfb93c/Source/WebCore/rendering/style/RenderStyle.cpp#L2026</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>251004</attachid>
            <date>2015-04-16 22:18:23 -0700</date>
            <delta_ts>2015-04-16 22:18:23 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>shape-outside-negative-block-width.html</filename>
            <type>text/html</type>
            <size>458</size>
            <attacher name="Bem Jones-Bey">bjonesbe</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZT4KYm9keTo6LXdlYmtpdC1zY3JvbGxiYXIgewogICAgLyog
T3ZlcnJpZGUgdGhlIGRlZmF1bHQgaGlkZGVuIHNjcm9sbGJhcnMgb24gT1MgWC4gKi8KICAgIC13
ZWJraXQtYXBwZWFyYW5jZTogbm9uZTsKfQpodG1sLCBib2R5IHsKICAgIHdpZHRoOiAwLjglOwog
ICAgb3ZlcmZsb3cteTogc2Nyb2xsOwp9CgpkaXYgewogICAgLXdlYmtpdC1zaGFwZS1tYXJnaW46
IDUwJTsKICAgIC13ZWJraXQtc2hhcGUtb3V0c2lkZTogY2lyY2xlKCk7CiAgICBmbG9hdDogbGVm
dDsKfQo8L3N0eWxlPgo8Ym9keT4KICAgIDxkaXY+VGVzdCBwYXNzZXMgaWYgaXQgZG9lcyBub3Qg
Y3Jhc2guPC9kaXY+CiAgICA8ZGl2PjwvZGl2Pgo8L2JvZHk+CjxzY3JpcHQ+CiAgICBpZiAod2lu
ZG93LnRlc3RSdW5uZXIpCiAgICAgICAgdGVzdFJ1bm5lci5kdW1wQXNUZXh0KCk7Cjwvc2NyaXB0
Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>