o
    Zh0hf                     @   s  d Z ddlZddlmZ G dd dZG dd deZG d	d
 d
eZG dd deZG dd deeZG dd deZ	G dd deZ
G dd de
eZG dd de
ZG dd de
ZG dd deeZG dd deZG dd deeZG dd  d eeZG d!d" d"eeZG d#d$ d$eZG d%d& d&eZG d'd( d(eZG d)d* d*eZG d+d, d,eZG d-d. d.eZG d/d0 d0eZG d1d2 d2eZG d3d4 d4eZG d5d6 d6eZG d7d8 d8eZG d9d: d:eeZG d;d< d<ee
ZG d=d> d>eZ G d?d@ d@e eZ!G dAdB dBe e
Z"dS )Cu  Classes for all types of boxes in the CSS formatting structure / box model.

See https://www.w3.org/TR/CSS21/visuren.html

Names are the same as in CSS 2.1 with the exception of ``TextBox``. In
WeasyPrint, any text is in a ``TextBox``. What CSS calls anonymous inline boxes
are text boxes but not all text boxes are anonymous inline boxes.

See https://www.w3.org/TR/CSS21/visuren.html#anonymous

Abstract classes, should not be instantiated:

* Box
* BlockLevelBox
* InlineLevelBox
* BlockContainerBox
* ReplacedBox
* ParentBox
* AtomicInlineLevelBox

Concrete classes:

* PageBox
* BlockBox
* InlineBox
* InlineBlockBox
* BlockReplacedBox
* InlineReplacedBox
* TextBox
* LineBox
* Various table-related Box subclasses

All concrete box classes whose name contains "Inline" or "Block" have one of
the following "outside" behavior:

* Block-level (inherits from :class:`BlockLevelBox`)
* Inline-level (inherits from :class:`InlineLevelBox`)

and one of the following "inside" behavior:

* Block container (inherits from :class:`BlockContainerBox`)
* Inline content (InlineBox and :class:`TextBox`)
* Replaced content (inherits from :class:`ReplacedBox`)

… with various combinasions of both.

See respective docstrings for details.

    N   )computed_from_cascadedc                   @   s  e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdZdZdZdZdZdZdZdd ZdOddZdd	 Zd
d Zedd Zdd Zdd ZdPddZdd Zdd Zdd Z dd Z!dd Z"dd  Z#d!d" Z$d#d$ Z%d%d& Z&d'd( Z'd)d* Z(d+d, Z)d-d. Z*d/d0 Z+d1d2 Z,d3d4 Z-d5d6 Z.d7d8 Z/d9d: Z0d;d< Z1d=d> Z2d?d@ Z3dAdB Z4dCdD Z5dEdF Z6dGdH Z7dIdJ Z8dKdL Z9dMdN Z:dS )QBoxz"Abstract base class for all boxes.FNc                 C   s   | j S Nchildrenself r
   [/var/www/html/rh/venv/lib/python3.10/site-packages/weasyprint/formatting_structure/boxes.pyall_childrenU   s   zBox.all_childrenc                 c   s>    | V  | j D ]}|st|tr||E dH  q|V  qdS )z9A flat generator for a box, its children and descendants.N)r   
isinstancer   descendants)r	   placeholderschildr
   r
   r   r   X   s   
zBox.descendantsc                 C   s$   || _ || _|| _t | _g | _d S r   )element_tagelementstylesetremove_decoration_sidesr   )r	   r   r   r   r
   r
   r   __init__a   s
   
zBox.__init__c                 C      dt | j d| j dS N< >)type__name__r   r   r
   r
   r   __repr__h      zBox.__repr__c                 O   s.   t i |jdd}| |j||jg|R i |S )z6Return an anonymous box that inherits from ``parent``.N)cascadedparent_styler   )r   r   r   r   )clsparentargskwargsr   r
   r
   r   anonymous_fromk   s   zBox.anonymous_fromc                 C   s$   t | }||}|j| j |S )zReturn shallow copy of the box.)r   __new____dict__update)r	   r"   new_boxr
   r
   r   copyr   s   
zBox.copyc                 C   s   |   S )z?Return a copy of the box with recursive copies of its children.)r+   r   r
   r
   r   deepcopy|   s   zBox.deepcopyr   c                 C   s`   ||  krdkrdS  |  j |7  _ |  j|7  _|  D ]}|r&| s-|||| qdS )uc   Change the box’s position.

        Also update the children’s positions accordingly.

        r   N)
position_x
position_yr   
is_floated	translate)r	   dxdyignore_floatsr   r
   r
   r   r0      s   zBox.translatec                 C      | j | j | j S )zWidth of the padding box.)widthpadding_leftpadding_rightr   r
   r
   r   padding_width      zBox.padding_widthc                 C   r4   )zHeight of the padding box.)heightpadding_toppadding_bottomr   r
   r
   r   padding_height   r9   zBox.padding_heightc                 C      |   | j | j S )zWidth of the border box.)r8   border_left_widthborder_right_widthr   r
   r
   r   border_width      zBox.border_widthc                 C   r>   )zHeight of the border box.)r=   border_top_widthborder_bottom_widthr   r
   r
   r   border_height   rB   zBox.border_heightc                 C   r>   )z)Width of the margin box (aka. outer box).)rA   margin_leftmargin_rightr   r
   r
   r   margin_width      zBox.margin_widthc                 C   r>   )z*Height of the margin box (aka. outer box).)rE   
margin_topmargin_bottomr   r
   r
   r   margin_height   rI   zBox.margin_heightc                 C      | j | j | j | j S )z0Absolute horizontal position of the content box.)r-   rF   r6   r?   r   r
   r
   r   content_box_x      zBox.content_box_xc                 C   rM   )z.Absolute vertical position of the content box.)r.   rJ   r;   rC   r   r
   r
   r   content_box_y   rO   zBox.content_box_yc                 C   r4   )z0Absolute horizontal position of the padding box.)r-   rF   r?   r   r
   r
   r   padding_box_x   r9   zBox.padding_box_xc                 C   r4   )z.Absolute vertical position of the padding box.)r.   rJ   rC   r   r
   r
   r   padding_box_y   r9   zBox.padding_box_yc                 C      | j | j S )z/Absolute horizontal position of the border box.)r-   rF   r   r
   r
   r   border_box_x      zBox.border_box_xc                 C   rS   )z-Absolute vertical position of the border box.)r.   rJ   r   r
   r
   r   border_box_y   rU   zBox.border_box_yc                 C   s   |   |  |  |  fS z=Return the (x, y, w, h) rectangle where the box is clickable.)rT   rV   rA   rE   r   r
   r
   r   hit_area   s   zBox.hit_areac              
   C   sT  | j \}}| j\}}| j\}	}
| j\}}td|| }td|| }td|| }td|| }td|	| }	td|
| }
td|| }td|| }|  | }|  | }|  | | }|  | | }t	dgdd ||| f|||	 f||| f|||
 ffD  }|||||| || f|| || f|	| |
| f|| || ffS )zPosition, size and radii of a box inside the outer border box.

        bt, br, bb, and bl are distances from the outer border box,
        defining a rectangle to be rounded.

        r      c                 S   s    g | ]\}}|d kr|| qS )r   r
   ).0extent	sum_radiir
   r
   r   
<listcomp>   s
    z#Box.rounded_box.<locals>.<listcomp>)
border_top_left_radiusborder_top_right_radiusborder_bottom_right_radiusborder_bottom_left_radiusmaxrT   rV   rA   rE   min)r	   btbrbbbltlrxtlrytrrxtrrybrrxbrryblrxblryxyr5   r:   ratior
   r
   r   rounded_box   s:   








zBox.rounded_boxc                 C   s(   |  | j| | j| | j| | j| S r   rs   rC   r@   rD   r?   )r	   rr   r
   r
   r   rounded_box_ratio   s   zBox.rounded_box_ratioc                 C   s   |  | j| j| j| jS )z?Return the position, size and radii of the rounded padding box.rt   r   r
   r
   r   rounded_padding_box  s   zBox.rounded_padding_boxc                 C   s   |  ddddS )z>Return the position, size and radii of the rounded border box.r   )rs   r   r
   r
   r   rounded_border_box  s   zBox.rounded_border_boxc                 C   s0   |  | j| j | j| j | j| j | j| j S )z?Return the position, size and radii of the rounded content box.)	rs   rC   r;   r@   r7   rD   r<   r?   r6   r   r
   r
   r   rounded_content_box  s   



zBox.rounded_content_boxc                 C      | j d dv S )z#Return whether this box is floated.float)leftrightr   r   r
   r
   r   r/        zBox.is_floatedc                 C   s   | j d dkS )z&Return whether this box is a footnote.rz   footnoter}   r   r
   r
   r   is_footnote  r~   zBox.is_footnotec                 C   ry   )z>Return whether this box is in the absolute positioning scheme.position)absolutefixedr}   r   r
   r
   r   is_absolutely_positioned!  r~   zBox.is_absolutely_positionedc                 C   s   | j d d dkS )z-Return whether this box is a running element.r   r   z	running()r}   r   r
   r
   r   
is_running%  r9   zBox.is_runningc                 C   s"   |   p|  p|  p|   S )z*Return whether this box is in normal flow.)r/   r   r   r   r   r
   r
   r   is_in_normal_flow)  s
   zBox.is_in_normal_flowc                 C   s>   t | tpt | tp| jd dv p| jd dko| jd dkS )z&Return whether this box is monolithic.overflow)autoscrollhiddenr:   r   )r   AtomicInlineLevelBoxReplacedBoxr   r   r
   r
   r   is_monolithic/  s   
zBox.is_monolithicc                 C   sR   |   p(|  p(| jp(t| tot| t p(t| to!| jd dkp(d| jd v S )z?Return whether this box establishes a block formatting context.r   visiblez	flow-rootdisplay)r/   r   	is_columnr   BlockContainerBoxBlockBoxr   r   r
   r
   r   establishes_formatting_context9  s   z"Box.establishes_formatting_contextc                 C      | j d | j d fS )z!Return start and end page values.pager}   r   r
   r
   r   page_valuesF  rI   zBox.page_valuesc                 C   s2   ddl m} | jdur| jjdkr|| jdS dS )z>Return whether this link should be stored as a PDF attachment.r   )element_has_link_typeNa
attachmentF)htmlr   r   tag)r	   r   r
   r
   r   is_attachmentL  s   zBox.is_attachmentc                 C   s8   | j d dkr| jdur| jjdv rt| ttf S dS )z(Return whether this box is a form input.
appearancer   N)buttoninputselecttextareaF)r   r   r   r   LineBoxTextBoxr   r
   r
   r   is_inputV  s   zBox.is_inputc                 C   s   | j du rdS | j jdkS )z*Return whether this box is a form element.NFform)r   r   r   r
   r
   r   is_form^  s   
zBox.is_form)Fr   r   F);r   
__module____qualname____doc__proper_table_childinternal_table_or_captiontabular_containerleading_collapsible_spacetrailing_collapsible_spaceis_table_wrapperis_flex_itemis_grid_itemis_for_root_elementr   	is_leadertransformation_matrixbookmark_label
string_setr   cached_counter_valuesmissing_linkr   r   r   r   classmethodr&   r+   r,   r0   r8   r=   rA   rE   rH   rL   rN   rP   rQ   rR   rT   rV   rX   rs   ru   rv   rw   rx   r/   r   r   r   r   r   r   r   r   r   r   r
   r
   r
   r   r   8   sr    
	


-


r   c                       sT   e Zd ZdZ fddZdd Zdd Zdd	 Zd
d Zdd Z	 fddZ
  ZS )	ParentBoxzA box that has children.c                    s   t  ||| t|| _d S r   )superr   tupler   )r	   r   r   r   r   	__class__r
   r   r   g  s   zParentBox.__init__c                 C   sH   | j | t| d| d t| d| d t| d| dd dS )z4Set to 0 the margin, padding and border of ``side``.margin_r   padding_border__widthN)r   addsetattr)r	   sider
   r
   r   _reset_spacingk  s   zParentBox._reset_spacingc                 C   s6   | j d dkr	d S |r| d |r| d d S d S )Nbox_decoration_breakclonetopbottomr   r   )r	   startendr
   r
   r   remove_decorationr  s   
zParentBox.remove_decorationc                 C   s   |   }||_t | _|S )z8Create a new equivalent box with given ``new_children``.)r+   r   r   r   )r	   new_childrenr*   r
   r
   r   copy_with_childrenz  s   zParentBox.copy_with_childrenc                 C   s"   |   }tdd | jD |_|S )Nc                 s   s    | ]}|  V  qd S r   )r,   rZ   r   r
   r
   r   	<genexpr>  s    z%ParentBox.deepcopy.<locals>.<genexpr>)r+   listr   )r	   resultr
   r
   r   r,     s   zParentBox.deepcopyc                 C   s0   | j sJ | jD ]}t|tr|  S qtd)z!Get the table wrapped by the box.zTable wrapper without a table)r   r   r   TableBox
ValueError)r	   r   r
   r
   r   get_wrapped_table  s   


zParentBox.get_wrapped_tablec                    s   t   \}}dd | jD }|rFt|dkr-|d  }|d p"|}|d p(|}||fS |d |d }}| d p=|}| d pE|}||fS )Nc                 S   s   g | ]}|  r|qS r
   )r   r   r
   r
   r   r]     s
    z)ParentBox.page_values.<locals>.<listcomp>rY   r   )r   r   r   len)r	   start_value	end_valuer   r   	start_boxend_boxr   r
   r   r     s   zParentBox.page_values)r   r   r   r   r   r   r   r   r,   r   r   __classcell__r
   r
   r   r   r   e  s    	r   c                   @   s   e Zd ZdZdZdS )BlockLevelBoxzA box that participates in an block formatting context.

    An element with a ``display`` value of ``block``, ``list-item`` or
    ``table`` generates a block-level box.

    N)r   r   r   r   	clearancer
   r
   r
   r   r     s    r   c                   @      e Zd ZdZdS )r   aj  A box that contains only block-level boxes or only line boxes.

    A box that either contains only block-level boxes or establishes an inline
    formatting context and thus contains only line boxes.

    A non-replaced element with a ``display`` value of ``block``,
    ``list-item``, ``inline-block`` or 'table-cell' generates a block container
    box.

    Nr   r   r   r   r
   r
   r
   r   r         r   c                   @   r   )r   zA block-level box that is also a block container.

    A non-replaced element with a ``display`` value of ``block``, ``list-item``
    generates a block box.

    Nr   r
   r
   r
   r   r     r   r   c                       s,   e Zd ZdZdZdZe fddZ  ZS )r   aK  A box that represents a line in an inline formatting context.

    Can only contain inline-level boxes.

    In early stages of building the box tree a single line box contains many
    consecutive inline boxes. Later, during layout phase, each line boxes will
    be split into multiple line boxes, one for each actual line.

    clipnonec                    s8   t  j|g|R i |}|jd dkr|jd |_|S )Nr   r   text_overflow)r   r&   r   r   )r"   r#   r$   r%   boxr   r
   r   r&     s   zLineBox.anonymous_from)	r   r   r   r   r   block_ellipsisr   r&   r   r
   r
   r   r   r     s    	r   c                   @   s   e Zd ZdZdd ZdS )InlineLevelBoxaQ  A box that participates in an inline formatting context.

    An inline-level box that is not an inline box is said to be "atomic". Such
    boxes are inline blocks, replaced elements and inline tables.

    An element with a ``display`` value of ``inline``, ``inline-table``, or
    ``inline-block`` generates an inline-level box.

    c                 C   sT   | j d dkr	d S | j d dk}|r| |rdnd |r(| |r#dnd d S d S )Nr   r   	directionltrr{   r|   r   )r	   r   r   r   r
   r
   r   r     s   z InlineLevelBox.remove_decorationN)r   r   r   r   r   r
   r
   r
   r   r     s    	r   c                   @   s   e Zd ZdZdZdd ZdS )	InlineBoxa  An inline box with inline children.

    A box that participates in an inline formatting context and whose content
    also participates in that inline formatting context.

    A non-replaced element with a ``display`` value of ``inline`` generates an
    inline box.

    Nc                 C   s   |   | j|  |  fS rW   )rT   r.   rA   rL   r   r
   r
   r   rX     s   
zInlineBox.hit_area)r   r   r   r   link_annotationrX   r
   r
   r
   r   r     s    	r   c                       s,   e Zd ZdZdZ fddZdd Z  ZS )r   zA box that contains only text and has no box children.

    Any text in the document ends up in a text box. What CSS calls "anonymous
    inline boxes" are also text boxes.

    r   c                    s"   |sJ t  ||| || _d S r   )r   r   text)r	   r   r   r   r   r   r
   r   r     s   
zTextBox.__init__c                 C   s   |sJ |   }||_|S )z?Return a new TextBox identical to this one except for the text.)r+   r   )r	   r   r*   r
   r
   r   copy_with_text  s   zTextBox.copy_with_text)r   r   r   r   justification_spacingr   r   r   r
   r
   r   r   r     s
    r   c                   @   r   )r   zpAn atomic box in an inline formatting context.

    This inline-level box cannot be split for line breaks.

    Nr   r
   r
   r
   r   r     r   r   c                   @   r   )InlineBlockBoxzA box that is both inline-level and a block container.

    It behaves as inline on the outside and as a block on the inside.

    A non-replaced element with a 'display' value of 'inline-block' generates
    an inline-block box.

    Nr   r
   r
   r
   r   r      r   r   c                       s    e Zd ZdZ fddZ  ZS )r   u   A box whose content is replaced.

    For example, ``<img>`` are replaced: their content is rendered externally
    and is opaque from CSS’s point of view.

    c                    s   t  ||| || _d S r   )r   r   replacement)r	   r   r   r   r   r   r
   r   r   2  s   
zReplacedBox.__init__)r   r   r   r   r   r   r
   r
   r   r   r   +  s    r   c                   @   r   )BlockReplacedBoxzA box that is both replaced and block-level.

    A replaced element with a ``display`` value of ``block``, ``liste-item`` or
    ``table`` generates a block-level replaced box.

    Nr   r
   r
   r
   r   r   7  r   r   c                   @   r   )InlineReplacedBoxzA box that is both replaced and inline-level.

    A replaced element with a ``display`` value of ``inline``,
    ``inline-table``, or ``inline-block`` generates an inline-level replaced
    box.

    Nr   r
   r
   r
   r   r   @  r   r   c                       s6   e Zd ZdZdZdd Zd fdd	Zd	d
 Z  ZS )r   z(Box for elements with ``display: table``Tc                 C   s   t | j| jS r   )	itertoolschainr   column_groupsr   r
   r
   r   r   P  s   zTableBox.all_childrenr   Fc                    s&    fdd| j D | _ t  ||S )Nc                    s   g | ]}|  qS r
   r
   )rZ   r   r1   r
   r   r]   T  s    z&TableBox.translate.<locals>.<listcomp>)column_positionsr   r0   )r	   r1   r2   r3   r   r   r   r0   S  s   
zTableBox.translatec                 C   r   )Nr   r}   r   r
   r
   r   r   X  s   zTableBox.page_valuesr   )	r   r   r   r   r   r   r0   r   r   r
   r
   r   r   r   J  s    r   c                   @   r   )InlineTableBoxz/Box for elements with ``display: inline-table``Nr   r
   r
   r
   r   r   \  r   r   c                   @   s,   e Zd ZdZdZdZdZeefZ	dZ
dZdS )TableRowGroupBoxz2Box for elements with ``display: table-row-group``TFN)r   r   r   r   r   r   r   r   r   proper_parents	is_header	is_footerr
   r
   r
   r   r   `  s    r   c                   @   s&   e Zd ZdZdZdZdZeee	fZ
dS )TableRowBoxz,Box for elements with ``display: table-row``TN)r   r   r   r   r   r   r   r   r   r   r   r
   r
   r
   r   r   l  s    r   c                   @   sT   e Zd ZdZdZdZeefZdZ	dZ
dZdZdZdZdZdZdd Zedd ZdS )	TableColumnGroupBoxz5Box for elements with ``display: table-column-group``Tr   c                 C   s   dd | j D S )z3Return cells that originate in the group's columns.c                 S   s   g | ]}|  D ]}|qqS r
   )	get_cells)rZ   columncellr
   r
   r   r]     s
    z1TableColumnGroupBox.get_cells.<locals>.<listcomp>r   r   r
   r
   r   r    s   zTableColumnGroupBox.get_cellsc                 C   sD   | j rt| j S ztt| jdd dW S  ty!   Y dS w Nspan rY   )r   r   rb   intr   getstripr   r   r
   r
   r   r    s   
zTableColumnGroupBox.spanN)r   r   r   r   r   r   r   r   r   rJ   rK   rF   rG   r;   r<   r6   r7   r  propertyr  r
   r
   r
   r   r  t  s     r  c                   @   sV   e Zd ZdZdZdZeeefZ	dZ
dZdZdZdZdZdZdZdd Zedd ZdS )	TableColumnBoxz/Box for elements with ``display: table-column``Tr   c                 C   s   t )zRReturn cells that originate in the column.

        Is set on instances.

        )NotImplementedErrorr   r
   r
   r   r    s   zTableColumnBox.get_cellsc                 C   s4   zt t| jdd dW S  ty   Y dS w r  )rb   r  r   r	  r
  r   r   r
   r
   r   r    s
   zTableColumnBox.spanN)r   r   r   r   r   r   r   r   r  r   rJ   rK   rF   rG   r;   r<   r6   r7   r  r  r  r
   r
   r
   r   r    s     
r  c                       s$   e Zd ZdZdZ fddZ  ZS )TableCellBoxz-Box for elements with ``display: table-cell``Tc              	      s   t  j|i | ztt| jdd d| _W n tt	fy(   d| _Y nw ztt| jdd d| _
W d S  tt	fyJ   d| _
Y d S w )Ncolspanr  rY   rowspanr   )r   r   rb   r  r   r	  r
  r  AttributeErrorr   r  )r	   r$   r%   r   r
   r   r     s   "
$zTableCellBox.__init__)r   r   r   r   r   r   r   r
   r
   r   r   r    s    r  c                   @   s    e Zd ZdZdZdZeefZdS )TableCaptionBoxz0Box for elements with ``display: table-caption``TN)	r   r   r   r   r   r   r   r   r   r
   r
   r
   r   r    s
    r  c                       s@   e Zd ZdZ fddZdd Zedd Zedd	 Z  Z	S )
PageBoxzBox for a page.

    Initially the whole document will be in the box for the root element.
    During layout a new page box is created after every page break.

    c                       || _ t jd |d g d d S N)r   r   r   r   )	page_typer   r   )r	   r  r   r   r
   r   r        
zPageBox.__init__c                 C   r   r   )r   r   r  r   r
   r
   r   r     r   zPageBox.__repr__c                    s    fdddD S )Nc                    s    i | ]}| j d |  jqS )bleed_)r   value)rZ   r   r   r
   r   
<dictcomp>  s    z!PageBox.bleed.<locals>.<dictcomp>)r   r|   r   r{   r
   r   r
   r   r   bleed  s   
zPageBox.bleedc                 C   sL   | j d  | j d  |  | j d  | j d  |  | j d  | j d  fS )Nr{   r   r|   r   )r  rH   rL   r   r
   r
   r   
bleed_area  s   zPageBox.bleed_area)
r   r   r   r   r   r   r  r  r  r   r
   r
   r   r   r    s    
r  c                       (   e Zd ZdZ fddZdd Z  ZS )	MarginBoxz3Box in page margins, as defined in CSS3 Paged Mediac                    r  r  )
at_keywordr   r   )r	   r  r   r   r
   r   r     r  zMarginBox.__init__c                 C   r   r   )r   r   r  r   r
   r
   r   r     r   zMarginBox.__repr__r   r   r   r   r   r   r   r
   r
   r   r   r        r  c                       r  )FootnoteAreaBoxz-Box displaying footnotes, as defined in GCPM.c                    r  r  )r   r   r   )r	   r   r   r   r
   r   r      r  zFootnoteAreaBox.__init__c                 C   s   dt | j dS )Nr   z @footnote>)r   r   r   r
   r
   r   r     s   zFootnoteAreaBox.__repr__r   r
   r
   r   r   r"    r!  r"  c                   @   r   )FlexContainerBoxz$A box that contains only flex-items.Nr   r
   r
   r
   r   r#  
  r   r#  c                   @   r   )FlexBoxzA box that is both block-level and a flex container.

    It behaves as block on the outside and as a flex container on the inside.

    Nr   r
   r
   r
   r   r$    r   r$  c                   @   r   )InlineFlexBoxzA box that is both inline-level and a flex container.

    It behaves as inline on the outside and as a flex container on the inside.

    Nr   r
   r
   r
   r   r%    r   r%  c                   @   r   )GridContainerBoxz$A box that contains only grid-items.Nr   r
   r
   r
   r   r&    r   r&  c                   @   r   )GridBoxzA box that is both block-level and a grid container.

    It behaves as block on the outside and as a grid container on the inside.

    Nr   r
   r
   r
   r   r'  "  r   r'  c                   @   r   )InlineGridBoxzA box that is both inline-level and a grid container.

    It behaves as inline on the outside and as a grid container on the inside.

    Nr   r
   r
   r
   r   r(  *  r   r(  )#r   r   cssr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r"  r#  r$  r%  r&  r'  r(  r
   r
   r
   r   <module>   sH    2  /A
		
"!