mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Make LengthPercentage not copy.
This is needed to support min() / max() / clamp(), etc. Differential Revision: https://phabricator.services.mozilla.com/D57249
This commit is contained in:
parent
a541046147
commit
789ddd9dc1
5 changed files with 58 additions and 49 deletions
|
@ -468,7 +468,7 @@ impl<T: Zero> LogicalSize<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Copy> LogicalSize<T> {
|
||||
impl<T> LogicalSize<T> {
|
||||
#[inline]
|
||||
pub fn new(mode: WritingMode, inline: T, block: T) -> LogicalSize<T> {
|
||||
LogicalSize {
|
||||
|
@ -486,7 +486,9 @@ impl<T: Copy> LogicalSize<T> {
|
|||
LogicalSize::new(mode, size.width, size.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Copy> LogicalSize<T> {
|
||||
#[inline]
|
||||
pub fn width(&self, mode: WritingMode) -> T {
|
||||
self.debug_writing_mode.check(mode);
|
||||
|
@ -860,7 +862,7 @@ impl<T: Zero> LogicalMargin<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Copy> LogicalMargin<T> {
|
||||
impl<T> LogicalMargin<T> {
|
||||
#[inline]
|
||||
pub fn new(
|
||||
mode: WritingMode,
|
||||
|
@ -878,11 +880,6 @@ impl<T: Copy> LogicalMargin<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn new_all_same(mode: WritingMode, value: T) -> LogicalMargin<T> {
|
||||
LogicalMargin::new(mode, value, value, value, value)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_physical(mode: WritingMode, offsets: SideOffsets2D<T>) -> LogicalMargin<T> {
|
||||
let block_start;
|
||||
|
@ -917,6 +914,14 @@ impl<T: Copy> LogicalMargin<T> {
|
|||
}
|
||||
LogicalMargin::new(mode, block_start, inline_end, block_end, inline_start)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl<T: Copy> LogicalMargin<T> {
|
||||
#[inline]
|
||||
pub fn new_all_same(mode: WritingMode, value: T) -> LogicalMargin<T> {
|
||||
LogicalMargin::new(mode, value, value, value, value)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn top(&self, mode: WritingMode) -> T {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue