Struct layout_2020::table::Table

source ·
pub struct Table {
    style: Arc<ComputedValues>,
    grid_style: Arc<ComputedValues>,
    grid_base_fragment_info: BaseFragmentInfo,
    pub captions: Vec<TableCaption>,
    pub column_groups: Vec<TableTrackGroup>,
    pub columns: Vec<TableTrack>,
    pub row_groups: Vec<TableTrackGroup>,
    pub rows: Vec<TableTrack>,
    pub slots: Vec<Vec<TableSlot>>,
    pub size: TableSize,
    anonymous: bool,
}

Fields§

§style: Arc<ComputedValues>

The style of this table. These are the properties that apply to the “wrapper” ie the element that contains both the grid and the captions. Not all properties are actually used on the wrapper though, such as background and borders, which apply to the grid.

§grid_style: Arc<ComputedValues>

The style of this table’s grid. This is an anonymous style based on the table’s style, but eliminating all the properties handled by the “wrapper.”

§grid_base_fragment_info: BaseFragmentInfo

The BaseFragmentInfo for this table’s grid. This is necessary so that when the grid has a background image, it can be associated with the table’s node.

§captions: Vec<TableCaption>

The captions for this table.

§column_groups: Vec<TableTrackGroup>

The column groups for this table.

§columns: Vec<TableTrack>

The columns of this table defined by <colgroup> | display: table-column-group and <col> | display: table-column elements as well as display: table-column.

§row_groups: Vec<TableTrackGroup>

The rows groups for this table defined by <tbody>, <thead>, and <tfoot>.

§rows: Vec<TableTrack>

The rows of this table defined by <tr> or display: table-row elements.

§slots: Vec<Vec<TableSlot>>

The content of the slots of this table.

§size: TableSize

The size of this table.

§anonymous: bool

Whether or not this Table is anonymous.

Implementations§

source§

impl Table

source

pub(crate) fn construct<'dom>( context: &LayoutContext<'_>, info: &NodeAndStyleInfo<impl NodeExt<'dom>>, grid_style: Arc<ComputedValues>, contents: NonReplacedContents, propagated_text_decoration_line: TextDecorationLine, ) -> Self

source

pub(crate) fn construct_anonymous<'dom, Node>( context: &LayoutContext<'_>, parent_info: &NodeAndStyleInfo<Node>, contents: Vec<AnonymousTableContent<'dom, Node>>, propagated_text_decoration_line: TextDecorationLine, ) -> IndependentFormattingContext
where Node: NodeExt<'dom>,

source

fn push_new_slot_to_last_row(&mut self, slot: TableSlot)

Push a new slot into the last row of this table.

source

pub(super) fn resolve_slot_at( &self, coords: Point2D<usize, UnknownUnit>, ) -> Vec<ResolvedSlotAndLocation<'_>>

Find ResolvedSlotAndLocation of all the slots that cover the slot at the given coordinates. This recursively resolves all of the TableSlotCells that cover the target and returns a ResolvedSlotAndLocation for each of them. If there is no slot at the given coordinates or that slot is an empty space, an empty vector is returned.

source

fn create_spanned_slot_based_on_cell_above( &self, target_coords: Point2D<usize, UnknownUnit>, ) -> Option<TableSlot>

Create a TableSlot::Spanned for the target cell at the given coordinates. If no slots cover the target, then this returns None. Note: This does not handle slots that cover the target using colspan, but instead only considers slots that cover this slot via rowspan. colspan should be handled by appending to the return value of this function.

source§

impl Table

source

fn border_spacing(&self) -> LogicalVec2<Au>

source

fn total_border_spacing(&self) -> LogicalVec2<Au>

source

pub(crate) fn inline_content_sizes( &mut self, layout_context: &LayoutContext<'_>, containing_block_for_children: &IndefiniteContainingBlock<'_>, ) -> ContentSizes

source

fn get_column_measure_for_column_at_index( &self, writing_mode: WritingMode, column_index: usize, ) -> CellOrTrackMeasure

source

fn get_row_measure_for_row_at_index( &self, writing_mode: WritingMode, row_index: usize, ) -> CellOrTrackMeasure

source

pub(crate) fn layout( &self, layout_context: &LayoutContext<'_>, positioning_context: &mut PositioningContext, containing_block_for_children: &ContainingBlock<'_>, containing_block_for_table: &ContainingBlock<'_>, ) -> IndependentLayout

source§

impl Table

source

pub(crate) fn new( style: Arc<ComputedValues>, grid_style: Arc<ComputedValues>, base_fragment_info: BaseFragmentInfo, ) -> Self

source

fn get_slot(&self, coords: Point2D<usize, UnknownUnit>) -> Option<&TableSlot>

Return the slot at the given coordinates, if it exists in the table, otherwise return None.

source

fn resolve_first_cell_coords( &self, coords: Point2D<usize, UnknownUnit>, ) -> Option<Point2D<usize, UnknownUnit>>

source

fn resolve_first_cell( &self, coords: Point2D<usize, UnknownUnit>, ) -> Option<&TableSlotCell>

Trait Implementations§

source§

impl Debug for Table

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Serialize for Table

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Table

§

impl !RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl !UnwindSafe for Table

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> MaybeBoxed<Box<T>> for T

source§

fn maybe_boxed(self) -> Box<T>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,