1 #ifndef LITEHTML_RENDER_INLINE_CONTEXT_H
2 #define LITEHTML_RENDER_INLINE_CONTEXT_H
4 #include "render_block.h"
9 * An inline formatting context is established by a block container box that contains no block-level boxes.
10 * https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
12 class render_item_inline_context
: public render_item_block
15 * Structure contains elements with display: inline
17 * - element: render_item with display: inline
18 * - boxes: rectangles represented inline element content. There are can be many boxes if content
19 * is split into some lines
20 * - start_box: the start position of currently calculated box
24 std::shared_ptr
<render_item
> element
;
25 position::vector boxes
;
28 explicit inlines_item(const std::shared_ptr
<render_item
>& el
) : element(el
) {}
31 std::vector
<std::unique_ptr
<litehtml::line_box
> > m_line_boxes
;
34 int _render_content(int x
, int y
, bool second_pass
, const containing_block_context
&self_size
, formatting_context
* fmt_ctx
) override
;
35 void fix_line_width(element_float flt
,
36 const containing_block_context
&self_size
, formatting_context
* fmt_ctx
) override
;
38 std::list
<std::unique_ptr
<line_box_item
> > finish_last_box(bool end_of_render
, const containing_block_context
&self_size
);
39 void place_inline(std::unique_ptr
<line_box_item
> item
, const containing_block_context
&self_size
, formatting_context
* fmt_ctx
);
40 int new_box(const std::unique_ptr
<line_box_item
>& el
, line_context
& line_ctx
, const containing_block_context
&self_size
, formatting_context
* fmt_ctx
);
41 void apply_vertical_align() override
;
43 explicit render_item_inline_context(std::shared_ptr
<element
> src_el
) : render_item_block(std::move(src_el
)), m_max_line_width(0)
46 std::shared_ptr
<render_item
> clone() override
48 return std::make_shared
<render_item_inline_context
>(src_el());
51 int get_base_line() override
;
55 #endif //LITEHTML_RENDER_INLINE_CONTEXT_H