Images 💾

Last commit ⭐

commit 1041dbb007653e654f3052c4d0ed81d27e1e789f
Author:     Andreas Kling <kling@serenityos.org>
AuthorDate: Sat Jan 20 20:15:09 2024 +0100
Commit:     Andreas Kling <kling@serenityos.org>
CommitDate: Sat Jan 20 23:29:51 2024 +0100

    LibWeb: Don't lose track of inline margins when collapsing whitespace
    
    When iterating inline level chunks for a piece of text like " hello ",
    we will get three separate items from InlineLevelIterator:
    
    - Text " "
    - Text "hello"
    - Text " "
    
    If the first item also had some leading margin (e.g margin-left: 10px)
    we would lose that information when deciding that the whitespace is
    collapsible.
    
    This patch fixes the issue by accumulating the amount of leading margin
    present in any collapsed whitespace items, and then adding them to the
    next non-whitespace item in IFC.
    
    It's a wee bit hackish, but so is the rest of the leading/trailing
    margin mechanism.
    
    This makes the header menu on https://www.gimp.org/ look proper. :^)