ASSERTION FAILED: !rect.isEmpty() : void WebCore::GraphicsContext::drawRect(const...
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jul 2012 17:24:14 +0000 (17:24 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jul 2012 17:24:14 +0000 (17:24 +0000)
commita55ad278d441b3d9ca4ef4fe78b1de6db9195881
tree141023abfc01ec64d89fcd8dcc3111c00fdb59a6
parent88af8f37d75a72d8d6132ea761cf468cc0a3aba1
ASSERTION FAILED: !rect.isEmpty()  : void WebCore::GraphicsContext::drawRect(const WebCore::IntRect &)
https://bugs.webkit.org/show_bug.cgi?id=92187

Reviewed by Simon Fraser.

Source/WebCore:

The border painting logic (RenderBoxModelObject::paintOneBorderSide) would pass a rect with a 0px length
to RenderObject::drawLineForBoxSide. We do check the width (thickness) but not the length so we would pass
the rect to GraphicsContext and hit the ASSERT. This change adds a check for the length too as it is the safest
way, it means that we may still do unneeded operations before bailing out but that's an existing problem in the code.

Tests: fast/borders/0px-borders-no-line-height.html
       fast/borders/double-1px-border-assert.html

* rendering/RenderObject.cpp:
(WebCore::RenderObject::drawLineForBoxSide):
Added a 0px length check. While renaming confusing variables and re-using others,
I also found a potential empty border that I fixed (tested by the 2nd case above).

LayoutTests:

* fast/borders/0px-borders-no-line-height-expected.html: Added.
* fast/borders/0px-borders-no-line-height.html: Added.
* fast/borders/double-1px-border-assert-expected.html: Added.
* fast/borders/double-1px-border-assert.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/borders/0px-borders-no-line-height-expected.html [new file with mode: 0755]
LayoutTests/fast/borders/0px-borders-no-line-height.html [new file with mode: 0755]
LayoutTests/fast/borders/double-1px-border-assert-expected.html [new file with mode: 0644]
LayoutTests/fast/borders/double-1px-border-assert.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.cpp