mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibWeb: Let LineBuilder decide on Y-coordinate for float insertion
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Instead of reaching into the IFC of the LineBuilder from the BFC, we should let LineBuilder determine how to deal with the running vertical float clearance. No functional changes.
This commit is contained in:
parent
6d911a6baa
commit
23f0fddeab
Notes:
github-actions[bot]
2025-04-01 14:03:51 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/23f0fddeabe Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4168
3 changed files with 2 additions and 4 deletions
|
@ -1051,7 +1051,7 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer
|
|||
// First we place the box normally (to get the right y coordinate.)
|
||||
// If we have a LineBuilder, we're in the middle of inline layout, otherwise this is block layout.
|
||||
if (line_builder) {
|
||||
auto y = max(line_builder->y_for_float_to_be_inserted_here(box), line_builder->inline_formatting_context().vertical_float_clearance());
|
||||
auto y = line_builder->y_for_float_to_be_inserted_here(box);
|
||||
box_state.set_content_y(y + box_state.margin_box_top());
|
||||
} else {
|
||||
place_block_level_element_in_normal_flow_vertically(box, y + box_state.margin_top);
|
||||
|
|
|
@ -162,7 +162,7 @@ CSSPixels LineBuilder::y_for_float_to_be_inserted_here(Box const& box)
|
|||
candidate_block_offset = highest_intersection_bottom.value();
|
||||
}
|
||||
|
||||
return candidate_block_offset;
|
||||
return max(candidate_block_offset, m_context.vertical_float_clearance());
|
||||
}
|
||||
|
||||
bool LineBuilder::should_break(CSSPixels next_item_width)
|
||||
|
|
|
@ -46,8 +46,6 @@ public:
|
|||
void recalculate_available_space();
|
||||
CSSPixels y_for_float_to_be_inserted_here(Box const&);
|
||||
|
||||
auto& inline_formatting_context() { return m_context; }
|
||||
|
||||
void did_introduce_clearance(CSSPixels);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue