Subpixel rendering: Border thickness and length flooring can result empty borders
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Aug 2014 03:51:44 +0000 (03:51 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Aug 2014 03:51:44 +0000 (03:51 +0000)
commit7856469c0c4d05e394966669cbaa0563f29cd13e
tree93adb4b21826dc0cb34796fe98fc732029bd4f9d
parentc969e0f939bc7fbfc0d963ca0220e04c506e0b86
Subpixel rendering: Border thickness and length flooring can result empty borders
due to losing precision during multiple float <-> LayoutUnit conversions.
https://bugs.webkit.org/show_bug.cgi?id=135686

Reviewed by Simon Fraser.

The combination of losing precision and flooring the border thickness/length to avoid
empty border rect drawing can lead to false positives of missing borders.
This patch moves empty border checking right before painting where we can safely use round
instead of floor.

Source/WebCore:

Tests: fast/borders/hidpi-border-width-flooring.html

* rendering/RenderObject.cpp:
(WebCore::drawBorderLineRect):
(WebCore::drawBorderLine):
(WebCore::RenderObject::drawLineForBoxSide):

LayoutTests:

* fast/borders/hidpi-border-width-flooring-expected.html: Added.
* fast/borders/hidpi-border-width-flooring.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/borders/hidpi-border-width-flooring-expected.html [new file with mode: 0644]
LayoutTests/fast/borders/hidpi-border-width-flooring.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.cpp