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

Cherry-pick 3 ladybird PRs #25403

Merged
merged 4 commits into from
Nov 16, 2024
Merged

Cherry-pick 3 ladybird PRs #25403

merged 4 commits into from
Nov 16, 2024

Commits on Nov 16, 2024

  1. LibCore: Recognize .xht as XHTML in MIME parser for file names

    Fixes a bug when https://wpt.live/css/CSS2/positioning/abspos-001.xht
    saved as file fails because we incorrectly recognized its MIME type
    as HTML, leading to incorrect self-closing tag handling and thus
    incorrect rendering.
    
    (cherry picked from commit 71eded0471f0c4f200ffa74094e2c3809d9a1090)
    kalenikaliaksandr authored and nico committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    50ba0c8 View commit details
    Browse the repository at this point in the history
  2. LibJS: Perform TLA async function construction in the module context

    Previously it was only pushing the module context for the call to
    capture the module execution context. This is incorrect, as the capture
    occurs upon function construction. This resulted in it capturing the
    execution context that execute_module was called from, instead of the
    newly created module_context.
    https://github.com/LadybirdBrowser/ladybird/blob/f87041bf3a8c76dce547dbd1f64d32b119f5468c/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp#L92
    
    This can be demonstrated with the following setup:
    index.html:
    ```html
    <script>
        var foo = 1;
    </script>
    <script type="module">
        import {test} from "./scriptA.mjs";
    </script>
    ```
    
    scriptA.mjs:
    ```js
    function foo() {
    	return {a: "b"};
    }
    export let test = await foo();
    ```
    
    Before this fix, this would throw:
    ```
    [TypeError] 1 is not a function (evaluated from 'foo')
        at module code with top-level await
        at module code with top-level await
        at <unknown>
        at <unknown>
    ```
    
    Fixes SerenityOS#2245.
    
    (cherry picked from commit 6319dedbcd4d6e448b4cc2615e62eba5ac576887)
    Lubrsi authored and nico committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    89733ee View commit details
    Browse the repository at this point in the history
  3. AK: Ensure empty StringViews all compare as equal

    Before this change, a StringView with a character-data pointer would
    never compare as equal to one with a null pointer, even if they were
    both length 0. This could happen for example if one is
    default-initialized, and the other is created as a substring.
    
    (cherry picked from commit ec5101a1d3cc7bc9068fa4863e16aa482536929a)
    AtkinsSJ authored and nico committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    25e4ac5 View commit details
    Browse the repository at this point in the history
  4. AK: Add Utf8View::for_each_split_view() method

    Returns one Utf8View at a time, using a callback function to identify
    code points to split on.
    
    (cherry picked from commit 3f10a5701d9634e47111203b837283bdfc2d8b18)
    AtkinsSJ authored and nico committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    5057c5c View commit details
    Browse the repository at this point in the history