mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
servo: Merge #4525 - layout: Implement outline-offset
per CSS-UI-3 § 5.5 (from pcwalton:outline-offset); r=mbrubeck
r? @mbrubeck Source-Repo: https://github.com/servo/servo Source-Revision: 112ab49706a525ab0b93ca37bd41e9d929218736
This commit is contained in:
parent
349c217b6b
commit
45ee1c1641
@ -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();
|
||||
|
@ -933,6 +933,14 @@ pub mod computed {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[inline]
|
||||
pub fn compute_Length(value: specified::Length, context: &Context) -> Au {
|
||||
compute_Au(value, context)
|
||||
}
|
||||
|
||||
pub type Length = Au;
|
||||
}
|
||||
|
||||
pub fn parse_url(input: &str, base_url: &Url) -> Url {
|
||||
|
@ -381,6 +381,8 @@ pub mod longhands {
|
||||
}
|
||||
</%self:longhand>
|
||||
|
||||
${predefined_type("outline-offset", "Length", "Au(0)")}
|
||||
|
||||
${new_style_struct("PositionOffsets", is_inherited=False)}
|
||||
|
||||
% for side in ["top", "right", "bottom", "left"]:
|
||||
|
Loading…
Reference in New Issue
Block a user