aboutsummaryrefslogtreecommitdiffstats
path: root/include/litehtml/render_block_context.h
blob: c69389832c5c3d15cf8504daebfcf48a2c1110fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef LITEHTML_RENDER_BLOCK_CONTEXT_H
#define LITEHTML_RENDER_BLOCK_CONTEXT_H

#include "render_block.h"

namespace litehtml
{
	/**
	 * In a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a
	 * containing block.
	 * https://www.w3.org/TR/CSS22/visuren.html#block-formatting
	 */
	class render_item_block_context : public render_item_block
	{
	protected:
		int _render_content(int x, int y, bool second_pass, const containing_block_context &self_size, formatting_context* fmt_ctx) override;

	public:
		explicit render_item_block_context(std::shared_ptr<element>  src_el) : render_item_block(std::move(src_el))
		{}

		std::shared_ptr<render_item> clone() override
		{
			return std::make_shared<render_item_block_context>(src_el());
		}
		int get_first_baseline() override;
		int get_last_baseline() override;
	};
}

#endif //LITEHTML_RENDER_BLOCK_CONTEXT_H