mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #7502 - bjwbell:elliptical-borders, r=pcwalton
gfx: Add elliptical border radius support TODO: Add code for parsing shorthand border-radius e.g. "border-radius: 10px 5% / 20px". r? @pcwalton <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7502) <!-- Reviewable:end -->
This commit is contained in:
commit
5bad6b1b6e
9 changed files with 603 additions and 305 deletions
|
@ -8,12 +8,12 @@
|
|||
|
||||
use fragment::Fragment;
|
||||
|
||||
use euclid::{Matrix4, SideOffsets2D};
|
||||
use euclid::{Matrix4, SideOffsets2D, Size2D};
|
||||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
use style::computed_values::transform::ComputedMatrix;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use style::values::computed::{BorderRadiusSize, LengthOrPercentageOrAuto};
|
||||
use style::values::computed::{LengthOrPercentageOrNone, LengthOrPercentage};
|
||||
use util::geometry::Au;
|
||||
use util::logical_geometry::LogicalMargin;
|
||||
|
@ -425,6 +425,13 @@ pub fn specified(length: LengthOrPercentage, containing_length: Au) -> Au {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn specified_border_radius(radius: BorderRadiusSize, containing_length: Au) -> Size2D<Au> {
|
||||
let BorderRadiusSize(size) = radius;
|
||||
let w = specified(size.width, containing_length);
|
||||
let h = specified(size.height, containing_length);
|
||||
Size2D::new(w, h)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn padding_from_style(style: &ComputedValues, containing_block_inline_size: Au)
|
||||
-> LogicalMargin<Au> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue