MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / get_predefined_height

Method get_predefined_height

player/NymphCastPlayer/litehtml/src/element.cpp:103–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103bool litehtml::element::get_predefined_height(int& p_height) const
104{
105 css_length h = get_css_height();
106 if(h.is_predefined())
107 {
108 p_height = m_pos.height;
109 return false;
110 }
111 if(h.units() == css_units_percentage)
112 {
113 element::ptr el_parent = parent();
114 if (!el_parent)
115 {
116 position client_pos;
117 get_document()->container()->get_client_rect(client_pos);
118 p_height = h.calc_percent(client_pos.height);
119 return true;
120 } else
121 {
122 int ph = 0;
123 if (el_parent->get_predefined_height(ph))
124 {
125 p_height = h.calc_percent(ph);
126 if (is_body())
127 {
128 p_height -= content_margins_height();
129 }
130 return true;
131 } else
132 {
133 p_height = m_pos.height;
134 return false;
135 }
136 }
137 }
138 p_height = get_document()->cvt_units(h, get_font_size());
139 return true;
140}
141
142void litehtml::element::calc_document_size( litehtml::size& sz, int x /*= 0*/, int y /*= 0*/ )
143{

Callers 4

render_boxMethod · 0.80
render_tableMethod · 0.80
apply_relative_shiftMethod · 0.80
calc_max_heightMethod · 0.80

Calls 6

is_predefinedMethod · 0.80
unitsMethod · 0.80
get_client_rectMethod · 0.80
containerMethod · 0.80
calc_percentMethod · 0.80
cvt_unitsMethod · 0.80

Tested by

no test coverage detected