mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Prevent time-traveling leading inline metrics
In `InlineLevelIterator`, whenever we call `skip_to_next()` and enter a node with box model metrics, we could potentially accumulate leading and trailing metrics. This lead to a weird situation where an element with `display: inline-block` could adopt the leading metrics of an inline element that follows it, since we perform the call to `add_extra_box_model_metrics_to_item()` too late. Move `skip_to_next()` down so it no longer interferes with the `Item` we're creating. The test expectation for `atomic-inline-with-percentage-vertical-align.html` is updated, although neither the old nor new results are 100% accurate since either box jumps one pixel to the right.
This commit is contained in:
committed by
Alexander Kalenik
parent
de24bc5d26
commit
30efcd0d00
Notes:
github-actions[bot]
2025-06-20 18:00:38 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/30efcd0d00d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5149
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<style>
|
||||
div {
|
||||
border: 1px solid red;
|
||||
}
|
||||
#a i {
|
||||
display: inline-block;
|
||||
}
|
||||
#a b {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#b i {
|
||||
padding-right: 20px;
|
||||
}
|
||||
#b b {
|
||||
display: inline-block;
|
||||
}
|
||||
#c b {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
#c u {
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
<div id="a"><i>inline-block</i><b>inline</b><u>inline</u></div>
|
||||
<div id="b"><i>inline</i><b>inline-block</b><u>inline</u></div>
|
||||
<div id="c"><i>inline</i><b>inline</b><u>inline-block</u></div>
|
||||
Reference in New Issue
Block a user