Skip to content

Commit

Permalink
Rename ReplacedContent::used_size to used_size_as_if_inline_element
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Dec 10, 2019
1 parent e86222d commit 14ddf39
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/layout_2020/flow/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ fn layout_atomic<'box_tree>(

let fragment = match atomic.as_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 content_rect = Rect { start_corner, size };
BoxFragment {
Expand Down
2 changes: 1 addition & 1 deletion components/layout_2020/flow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ fn layout_in_flow_replaced_block_level<'a>(
style: &Arc<ComputedValues>,
replaced: &ReplacedContent,
) -> 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 padding = style.padding().percentages_relative_to(cbis);
Expand Down
9 changes: 6 additions & 3 deletions components/layout_2020/replaced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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-height
pub fn used_size(
/// https://drafts.csswg.org/css2/visudet.html#inline-replaced-width
/// https://drafts.csswg.org/css2/visudet.html#inline-replaced-height
///
/// 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,
containing_block: &ContainingBlock,
style: &ComputedValues,
Expand Down

0 comments on commit 14ddf39

Please sign in to comment.