| 101 | } |
| 102 | |
| 103 | bool 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 | |
| 142 | void litehtml::element::calc_document_size( litehtml::size& sz, int x /*= 0*/, int y /*= 0*/ ) |
| 143 | { |
no test coverage detected