LibWeb: Fixed non-spec processing of margin and padding
This commit is contained in:
parent
5f9d80d8bc
commit
ae3353bdbc
Notes:
sideshowbarker
2024-07-19 06:43:15 +09:00
Author: https://github.com/eskalVAR 🔰 Commit: https://github.com/SerenityOS/serenity/commit/ae3353bdbc4 Pull-request: https://github.com/SerenityOS/serenity/pull/2202 Issue: https://github.com/SerenityOS/serenity/issues/2201
1 changed files with 4 additions and 4 deletions
|
@ -315,12 +315,12 @@ void LayoutBlock::compute_position()
|
|||
box_model().offset().left = style.length_or_fallback(CSS::PropertyID::Left, zero_value, containing_block.width());
|
||||
}
|
||||
|
||||
box_model().margin().top = style.length_or_fallback(CSS::PropertyID::MarginTop, zero_value, containing_block.height());
|
||||
box_model().margin().bottom = style.length_or_fallback(CSS::PropertyID::MarginBottom, zero_value, containing_block.height());
|
||||
box_model().margin().top = style.length_or_fallback(CSS::PropertyID::MarginTop, zero_value, containing_block.width());
|
||||
box_model().margin().bottom = style.length_or_fallback(CSS::PropertyID::MarginBottom, zero_value, containing_block.width());
|
||||
box_model().border().top = style.length_or_fallback(CSS::PropertyID::BorderTopWidth, zero_value);
|
||||
box_model().border().bottom = style.length_or_fallback(CSS::PropertyID::BorderBottomWidth, zero_value);
|
||||
box_model().padding().top = style.length_or_fallback(CSS::PropertyID::PaddingTop, zero_value, containing_block.height());
|
||||
box_model().padding().bottom = style.length_or_fallback(CSS::PropertyID::PaddingBottom, zero_value, containing_block.height());
|
||||
box_model().padding().top = style.length_or_fallback(CSS::PropertyID::PaddingTop, zero_value, containing_block.width());
|
||||
box_model().padding().bottom = style.length_or_fallback(CSS::PropertyID::PaddingBottom, zero_value, containing_block.width());
|
||||
|
||||
float position_x = box_model().margin().left.to_px()
|
||||
+ box_model().border().left.to_px()
|
||||
|
|
Loading…
Add table
Reference in a new issue