Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Incorrect image width when using percentage inside grid layout #3199

Open
1 task
aplefull opened this issue Jan 9, 2025 · 1 comment
Open
1 task

Comments

@aplefull
Copy link

aplefull commented Jan 9, 2025

Summary

Pretty much what title says: image width should be 40px in reduced example, but it's 80px. (80px is image's native width)

Operating system

Linux

Steps to reproduce

N/A

Expected behavior

N/A

Actual behavior

N/A

URL for a reduced test case

N/A

HTML/SVG/etc. source for a reduced test case

<html>
    <div class="a">
        <img
            src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAPHRFWHRDb21tZW50AHhyOmQ6REFGczZCLWNXS1U6MzMsajozMzg5MzU5OTQxOTMxNjY4NDg5LHQ6MjMwODI5MDjOkql2AAAE6GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSdhZG9iZTpuczptZXRhLyc+CiAgICAgICAgPHJkZjpSREYgeG1sbnM6cmRmPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjJz4KCiAgICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9JycKICAgICAgICB4bWxuczpkYz0naHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8nPgogICAgICAgIDxkYzp0aXRsZT4KICAgICAgICA8cmRmOkFsdD4KICAgICAgICA8cmRmOmxpIHhtbDpsYW5nPSd4LWRlZmF1bHQnPlVudGl0bGVkIGRlc2lnbiAtIDM8L3JkZjpsaT4KICAgICAgICA8L3JkZjpBbHQ+CiAgICAgICAgPC9kYzp0aXRsZT4KICAgICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KCiAgICA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t1cLH7EeUDQByVvSei/BcpMR0C4AW00DwkW2GAdOHQyENwFA5OlX/N9dQRm/dkPADj7kX5mVGHa5EReEjLkaWcQToCKcV02/2AmhS+WhEIqrUNkFoxJeX6Cdo7xWZzZBqUgNuR5JKrvYReebdw3Y0bY65MT/gH8txVgMA//XhlVxoWGs7G2c6UPwUSHP8+OBg27q6Yc9svJq3qC0UmoG28Hw70FwgSaaOAi/jy5k0JF/HsvV5ghBN4LQiLwMIqW/m5E+qMdTnVixiXBK+4kRTNQYSbIW+RLO1ErqZV0dR02SnM8XGNb3Y2QLQy3nb2EWmNl4pKgvsy9+3Dy6wd8PCNHXp/R9dhzBmLfMI9Cc5nlgZGyZzc33AlPVWn3ERTlkbz8XaFJlqXxkL8ZciTRjJUnIxuLZbTnB+n/QymKpTv5vn0HrXcIBJh/27DsBJLumrCqdtwhn2u1XVgm15ZeFLfukr40OSPjfhBEdxsJw+k+FuIROoqqggEqxxFz5ApJKfEUOBSatlHkKUA27CBI/hqRW/o63eevq5aDhfvcbMGhz6pecWtYjx53GHL20PKZ7HKSv8UDx8wV99WJsRdoTqnn/f3sQmJOEzxiszfF4P7fq8fLzLLIbbgYFK1sxzpyD86Lgvr8p6N/rGYvs0Gnf8++PcWHnbiR0GcDjqx7VprVrYNVOPs2EdgGlFW1yESeu5hQCE2Im5gq9aOMoTCKsaAFkrestFaARLdGsAtAZAr7PfclNxCPBbUfz749wGha/pcOQ5wEypvONyLWoL3CO2A0eKlaVnHQNp8ZdufE+I/HhRird8lQOJr83e/2QPDw+P/4/f/34cOQMSY24AAAAASUVORK5CYII="
        />
    </div>
    
    <style>
        .a {
            width: 40px;
            display: grid;
            overflow: hidden;
            outline: 2px solid crimson;
        }
    
        img {
            width: 100%;
        }
    </style>
</html>

Log output and (if possible) backtrace

N/A

Screenshots or screen recordings

Chrome Ladybird

image

image

Build flags or config settings

No response

Contribute a patch?

  • I’ll contribute a patch for this myself.
@Psychpsyo
Copy link
Contributor

I think this is the same bug as in #2276.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants