mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Implement outline-offset
per CSS-UI-3 § 5.5.
This commit is contained in:
parent
a88e668091
commit
af7cf26e76
6 changed files with 62 additions and 4 deletions
|
@ -569,10 +569,11 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
// Outlines are not accounted for in the dimensions of the border box, so adjust the
|
||||
// absolute bounds.
|
||||
let mut bounds = *bounds;
|
||||
bounds.origin.x = bounds.origin.x - width;
|
||||
bounds.origin.y = bounds.origin.y - width;
|
||||
bounds.size.width = bounds.size.width + width + width;
|
||||
bounds.size.height = bounds.size.height + width + width;
|
||||
let offset = width + style.get_outline().outline_offset;
|
||||
bounds.origin.x = bounds.origin.x - offset;
|
||||
bounds.origin.y = bounds.origin.y - offset;
|
||||
bounds.size.width = bounds.size.width + offset + offset;
|
||||
bounds.size.height = bounds.size.height + offset + offset;
|
||||
|
||||
// Append the outline to the display list.
|
||||
let color = style.resolve_color(style.get_outline().outline_color).to_gfx_color();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue