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

Conversation

kalenikaliaksandr and others added 4 commits November 15, 2024 21:22
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)
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)
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)
Returns one Utf8View at a time, using a callback function to identify
code points to split on.

(cherry picked from commit 3f10a5701d9634e47111203b837283bdfc2d8b18)
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 16, 2024
@nico nico merged commit b647a74 into SerenityOS:master Nov 16, 2024
11 checks passed
@nico nico deleted the bulk_sync_1731721022 branch November 16, 2024 04:09
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 16, 2024
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

Successfully merging this pull request may close these issues.

4 participants