mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Use base URL for link loading
This commit is contained in:
parent
ff71d8f2c9
commit
c6975a1680
Notes:
github-actions[bot]
2024-08-13 13:35:13 +00:00
Author: https://github.com/vpzomtrrfrt
Commit: c6975a1680
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1036
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/shannonbooth
3 changed files with 20 additions and 2 deletions
1
Tests/LibWeb/Text/expected/base/link-element-base.txt
Normal file
1
Tests/LibWeb/Text/expected/base/link-element-base.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
document background: rgb(255, 0, 0)
|
17
Tests/LibWeb/Text/input/base/link-element-base.html
Normal file
17
Tests/LibWeb/Text/input/base/link-element-base.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<base href="..">
|
||||||
|
<link rel="stylesheet" href="body-background-color-red.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
window.onload = () => {
|
||||||
|
println("document background: " + getComputedStyle(document.body).backgroundColor);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -228,8 +228,8 @@ HTMLLinkElement::LinkProcessingOptions HTMLLinkElement::create_link_options()
|
||||||
// referrer policy the state of el's referrerpolicy content attribute
|
// referrer policy the state of el's referrerpolicy content attribute
|
||||||
options.referrer_policy = ReferrerPolicy::from_string(get_attribute(AttributeNames::referrerpolicy).value_or(""_string)).value_or(ReferrerPolicy::ReferrerPolicy::EmptyString);
|
options.referrer_policy = ReferrerPolicy::from_string(get_attribute(AttributeNames::referrerpolicy).value_or(""_string)).value_or(ReferrerPolicy::ReferrerPolicy::EmptyString);
|
||||||
// FIXME: source set el's source set
|
// FIXME: source set el's source set
|
||||||
// base URL document's URL
|
// base URL document's document base URL
|
||||||
options.base_url = document.url();
|
options.base_url = document.base_url();
|
||||||
// origin document's origin
|
// origin document's origin
|
||||||
options.origin = document.origin();
|
options.origin = document.origin();
|
||||||
// environment document's relevant settings object
|
// environment document's relevant settings object
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue