mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Layout 2020: Rename flow_relative
types to Logical...
(#30324)
This makes the names of flow relative geometry consistent with what is used in the style crate and removes them from a module. With this change it's more obvious what makes these types different from the ones in `euclid`.
This commit is contained in:
parent
90ad5920e2
commit
8299868bd5
15 changed files with 314 additions and 317 deletions
|
@ -7,7 +7,7 @@ use style::values::computed::{Length, LengthPercentage};
|
|||
|
||||
use super::Fragment;
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::geom::flow_relative::Vec2;
|
||||
use crate::geom::LogicalVec2;
|
||||
|
||||
/// A reference to a Fragment which is shared between `HoistedAbsolutelyPositionedBox`
|
||||
/// and its placeholder `AbsoluteOrFixedPositionedFragment` in the original tree position.
|
||||
|
@ -15,11 +15,11 @@ use crate::geom::flow_relative::Vec2;
|
|||
#[derive(Serialize)]
|
||||
pub(crate) struct HoistedSharedFragment {
|
||||
pub fragment: Option<ArcRefCell<Fragment>>,
|
||||
pub box_offsets: Vec2<AbsoluteBoxOffsets>,
|
||||
pub box_offsets: LogicalVec2<AbsoluteBoxOffsets>,
|
||||
}
|
||||
|
||||
impl HoistedSharedFragment {
|
||||
pub(crate) fn new(box_offsets: Vec2<AbsoluteBoxOffsets>) -> Self {
|
||||
pub(crate) fn new(box_offsets: LogicalVec2<AbsoluteBoxOffsets>) -> Self {
|
||||
HoistedSharedFragment {
|
||||
fragment: None,
|
||||
box_offsets,
|
||||
|
@ -31,7 +31,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: Vec2<Length>) {
|
||||
pub(crate) fn adjust_offsets(&mut self, offsets: LogicalVec2<Length>) {
|
||||
self.box_offsets.inline.adjust_offset(offsets.inline);
|
||||
self.box_offsets.block.adjust_offset(offsets.block);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue