Bug 135686 - Subpixel rendering: Border thickness and length flooring can result empty borders due to losing precision during multiple float <-> LayoutUnit conversions.
Summary: Subpixel rendering: Border thickness and length flooring can result empty bor...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks: 135898
  Show dependency treegraph
 
Reported: 2014-08-06 20:18 PDT by zalan
Modified: 2015-01-05 20:41 PST (History)
6 users (show)

See Also:


Attachments
Patch (10.07 KB, patch)
2014-08-06 20:33 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (10.06 KB, patch)
2014-08-07 20:13 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2014-08-06 20:18:48 PDT
in RenderObject::drawLineForBoxSide() we check whether the border thickness and length are > 0. Flooring is used to avoid painting empty lines.
In certain cases, when we lose precession while converting float <-> LayoutUnit back and forth, flooring a border width value of 0.5px (before conversions and 0.49999 after conversions) becomes 0 and we early return from painting.
Comment 1 zalan 2014-08-06 20:33:47 PDT
Created attachment 236169 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-08-07 13:52:12 PDT
Comment on attachment 236169 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=236169&action=review

> Source/WebCore/ChangeLog:10
> +        empty border rect drawing can lead to false positives.

false positives of what?
Comment 3 zalan 2014-08-07 20:13:01 PDT
Created attachment 236256 [details]
Patch
Comment 4 WebKit Commit Bot 2014-08-07 20:52:00 PDT
Comment on attachment 236256 [details]
Patch

Clearing flags on attachment: 236256

Committed r172326: <http://trac.webkit.org/changeset/172326>
Comment 5 WebKit Commit Bot 2014-08-07 20:52:03 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 David Kilzer (:ddkilzer) 2015-01-05 20:41:57 PST
(In reply to comment #4)
> Comment on attachment 236256 [details]
> Patch
> 
> Clearing flags on attachment: 236256
> 
> Committed r172326: <http://trac.webkit.org/changeset/172326>

Note that this change caused:

Bug 135898: Dashed/dotted borders do not paint.
<https://bugs.webkit.org/show_bug.cgi?id=135898>