mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Rename ReplacedContent::used_size to used_size_as_if_inline_element
This commit is contained in:
parent
e86222d6bb
commit
14ddf39215
3 changed files with 8 additions and 5 deletions
|
@ -465,7 +465,7 @@ fn layout_atomic<'box_tree>(
|
||||||
|
|
||||||
let fragment = match atomic.as_replaced() {
|
let fragment = match atomic.as_replaced() {
|
||||||
Ok(replaced) => {
|
Ok(replaced) => {
|
||||||
let size = replaced.used_size(ifc.containing_block, &atomic.style);
|
let size = replaced.used_size_as_if_inline_element(ifc.containing_block, &atomic.style);
|
||||||
let fragments = replaced.make_fragments(&atomic.style, size.clone());
|
let fragments = replaced.make_fragments(&atomic.style, size.clone());
|
||||||
let content_rect = Rect { start_corner, size };
|
let content_rect = Rect { start_corner, size };
|
||||||
BoxFragment {
|
BoxFragment {
|
||||||
|
|
|
@ -521,7 +521,7 @@ fn layout_in_flow_replaced_block_level<'a>(
|
||||||
style: &Arc<ComputedValues>,
|
style: &Arc<ComputedValues>,
|
||||||
replaced: &ReplacedContent,
|
replaced: &ReplacedContent,
|
||||||
) -> BoxFragment {
|
) -> BoxFragment {
|
||||||
let size = replaced.used_size(containing_block, style);
|
let size = replaced.used_size_as_if_inline_element(containing_block, style);
|
||||||
|
|
||||||
let cbis = containing_block.inline_size;
|
let cbis = containing_block.inline_size;
|
||||||
let padding = style.padding().percentages_relative_to(cbis);
|
let padding = style.padding().percentages_relative_to(cbis);
|
||||||
|
|
|
@ -123,9 +123,12 @@ impl ReplacedContent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://drafts.csswg.org/css2/visudet.html#inline-replaced-width
|
/// https://drafts.csswg.org/css2/visudet.html#inline-replaced-width
|
||||||
// https://drafts.csswg.org/css2/visudet.html#inline-replaced-height
|
/// https://drafts.csswg.org/css2/visudet.html#inline-replaced-height
|
||||||
pub fn used_size(
|
///
|
||||||
|
/// Also used in other cases, for example
|
||||||
|
/// https://drafts.csswg.org/css2/visudet.html#block-replaced-width
|
||||||
|
pub fn used_size_as_if_inline_element(
|
||||||
&self,
|
&self,
|
||||||
containing_block: &ContainingBlock,
|
containing_block: &ContainingBlock,
|
||||||
style: &ComputedValues,
|
style: &ComputedValues,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue