mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Store an OpaqueNode in boxes and fragments
This commit is contained in:
parent
47944a39fc
commit
abc2c15c28
8 changed files with 67 additions and 25 deletions
|
@ -13,12 +13,14 @@ use crate::style_ext::DisplayInside;
|
|||
use crate::ContainingBlock;
|
||||
use servo_arc::Arc;
|
||||
use std::convert::TryInto;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
|
||||
/// https://drafts.csswg.org/css-display/#independent-formatting-context
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct IndependentFormattingContext {
|
||||
pub tag: OpaqueNode,
|
||||
pub style: Arc<ComputedValues>,
|
||||
|
||||
/// If it was requested during construction
|
||||
|
@ -71,6 +73,7 @@ impl IndependentFormattingContext {
|
|||
content_sizes,
|
||||
);
|
||||
Self {
|
||||
tag: node.as_opaque(),
|
||||
style,
|
||||
content_sizes,
|
||||
contents: IndependentFormattingContextContents::Flow(bfc),
|
||||
|
@ -80,6 +83,7 @@ impl IndependentFormattingContext {
|
|||
Err(replaced) => {
|
||||
let content_sizes = content_sizes.compute(|| replaced.inline_content_sizes(&style));
|
||||
Self {
|
||||
tag: node.as_opaque(),
|
||||
style,
|
||||
content_sizes,
|
||||
contents: IndependentFormattingContextContents::Replaced(replaced),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue