mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement the box-sizing
property
This commit is contained in:
parent
0e35d70ca8
commit
c377d9c48e
7 changed files with 168 additions and 94 deletions
|
@ -8,7 +8,7 @@ use crate::fragments::{DebugId, Fragment, ImageFragment};
|
|||
use crate::geom::flow_relative::{Rect, Vec2};
|
||||
use crate::geom::PhysicalSize;
|
||||
use crate::sizing::ContentSizes;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::style_ext::{ComputedValuesExt, PaddingBorderMargin};
|
||||
use crate::ContainingBlock;
|
||||
use canvas_traits::canvas::{CanvasId, CanvasMsg, FromLayoutMsg};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
|
@ -240,19 +240,17 @@ impl ReplacedContent {
|
|||
&self,
|
||||
containing_block: &ContainingBlock,
|
||||
style: &ComputedValues,
|
||||
pbm: &PaddingBorderMargin,
|
||||
) -> Vec2<Length> {
|
||||
let mode = style.writing_mode;
|
||||
let intrinsic_size = self.flow_relative_intrinsic_size(style);
|
||||
let intrinsic_ratio = self.inline_size_over_block_size_intrinsic_ratio(style);
|
||||
|
||||
let box_size = style.box_size().percentages_relative_to(containing_block);
|
||||
let box_size = style.content_box_size(containing_block, &pbm);
|
||||
let max_box_size = style.content_max_box_size(containing_block, &pbm);
|
||||
let min_box_size = style
|
||||
.min_box_size()
|
||||
.percentages_relative_to(containing_block)
|
||||
.content_min_box_size(containing_block, &pbm)
|
||||
.auto_is(Length::zero);
|
||||
let max_box_size = style
|
||||
.max_box_size()
|
||||
.percentages_relative_to(containing_block);
|
||||
|
||||
let default_object_size = || {
|
||||
// FIXME:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue