servo/components
bors-servo f29ddb4b5d Auto merge of #7577 - bjwbell:borders_pixel_rounding_bug, r=mbrubeck
gfx: Fix bug with 1px width borders disappearing

In to_nearest_azure_rect when rounding to pixel coordinates, maintain
the invariant of rect non-overlap (if before rounding two rects don't overlap).

The previous code rounded the rect top left corner to the nearest pixel with
the size rounded to the nearest pixel multiple which can violate the
non-overlap condition, e.g.
10px×9.60px at (0px,6.6px) & 10px×9.60px at (0px,16.2px)
would round to
10px×10.0px at (0px,7.0px) & 10px×10.0px at (0px,16.0px), which overlap.

Instead round each corner to the nearest pixel.

For rects that dont need to satify the non-overlap condition and with
width or height between 0.5px and 1px, rounding each rect corner to the
nearest pixel can yield an empty rect e.g.
10px×0.6px at 0px,28.56px -> 10px×0px at 0px,29px.

For this scenario a new function to_nearest_non_empty_azure_rect
rounds the rect top left corner to the nearest pixel and the rect size
to the nearest pixel multiple. It's possible for non-overlapping rects
after this rounding to overlap.

This should fix https://github.com/servo/servo/issues/7184 "rounding ...borders not to be visible", without breaking https://github.com/servo/servo/issues/7152 "Underlines less than 1px high sometimes invisible".

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7577)
<!-- Reviewable:end -->
2015-09-09 13:30:41 -06:00
..
canvas webgl: Add shader validation and translation 2015-08-30 14:23:14 +02:00
canvas_traits Make use of FromStr and Default traits in lib canvas 2015-09-03 14:42:53 -03:00
compositing Auto merge of #7547 - connorimes:move_script_profiling, r=jdm 2015-09-08 09:32:56 -06:00
devtools Make devtools depend on plugins. 2015-09-02 19:51:23 +02:00
devtools_traits Send the start and end half of a TimelineMarker to the devtools PullTimelineMarkers thread together. 2015-08-28 20:48:07 +02:00
gfx Auto merge of #7577 - bjwbell:borders_pixel_rounding_bug, r=mbrubeck 2015-09-09 13:30:41 -06:00
gfx_traits Layerize canvas 2015-05-20 19:10:50 +02:00
layout Auto merge of #7563 - mrobinson:layerize-stacking-contexts, r=pcwalton 2015-09-09 10:52:56 -06:00
layout_traits sort all uses 2015-08-20 20:47:12 +08:00
msg Layerize StackingContexts that are on top of layers 2015-09-09 09:13:14 -07:00
net Fix up some unnecessary uses of unsafe. 2015-09-02 15:50:17 -07:00
net_traits Only use the resource manager's HSTS list. 2015-08-30 12:14:02 +10:00
plugins Auto merge of #7499 - nerith:style, r=metajack 2015-09-02 12:05:58 -06:00
profile Add heartbeats for new script profiler categories 2015-09-08 14:05:50 -05:00
profile_traits Combine script profiling with profile crates. Fixes #7514. 2015-09-04 16:09:44 -05:00
script Auto merge of #7523 - eefriedman:unnecessary-unsafe, r=SimonSapin 2015-09-09 00:05:17 -06:00
script_traits Combine script profiling with profile crates. Fixes #7514. 2015-09-04 16:09:44 -05:00
servo Bump up skia and js packages to follow recent fixes 2015-09-09 09:35:55 +00:00
style Auto merge of #7502 - bjwbell:elliptical-borders, r=pcwalton 2015-09-04 18:46:24 -06:00
style_traits Fix some build warnings 2015-09-09 12:44:18 -06:00
util Auto merge of #7523 - eefriedman:unnecessary-unsafe, r=SimonSapin 2015-09-09 00:05:17 -06:00
webdriver_server sort all uses 2015-08-20 20:47:12 +08:00
webdriver_traits Add support for switching frames with the webdriver API. 2015-06-01 23:18:55 +01:00