mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
use au in HoistedSharedFragment (#32288)
This commit is contained in:
parent
c89fb1f381
commit
903c516fb5
3 changed files with 11 additions and 11 deletions
|
@ -2,8 +2,9 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use serde::Serialize;
|
||||
use style::values::computed::{Length, LengthPercentage};
|
||||
use style::values::computed::LengthPercentage;
|
||||
|
||||
use super::Fragment;
|
||||
use crate::cell::ArcRefCell;
|
||||
|
@ -31,7 +32,7 @@ impl HoistedSharedFragment {
|
|||
/// In some cases `inset: auto`-positioned elements do not know their precise
|
||||
/// position until after they're hoisted. This lets us adjust auto values
|
||||
/// after the fact.
|
||||
pub(crate) fn adjust_offsets(&mut self, offsets: LogicalVec2<Length>) {
|
||||
pub(crate) fn adjust_offsets(&mut self, offsets: LogicalVec2<Au>) {
|
||||
self.box_offsets.inline.adjust_offset(offsets.inline);
|
||||
self.box_offsets.block.adjust_offset(offsets.block);
|
||||
}
|
||||
|
@ -40,7 +41,7 @@ impl HoistedSharedFragment {
|
|||
#[derive(Clone, Debug, Serialize)]
|
||||
pub(crate) enum AbsoluteBoxOffsets {
|
||||
StaticStart {
|
||||
start: Length,
|
||||
start: Au,
|
||||
},
|
||||
Start {
|
||||
start: LengthPercentage,
|
||||
|
@ -59,7 +60,7 @@ impl AbsoluteBoxOffsets {
|
|||
matches!(self, AbsoluteBoxOffsets::Both { .. })
|
||||
}
|
||||
|
||||
pub(crate) fn adjust_offset(&mut self, new_offset: Length) {
|
||||
pub(crate) fn adjust_offset(&mut self, new_offset: Au) {
|
||||
if let AbsoluteBoxOffsets::StaticStart { ref mut start } = *self {
|
||||
*start = new_offset
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue