script: Use encoding-parse algorithm when handling iframe and Document URL attributes (#43572)

This PR fixes iframe URL parsing to use document encoding, so non-UTF-8
pages reflect iframe.src correctly, and adds a WPT test for it.

Testing: added Test file 
Fixes: #43559

Signed-off-by: SharanRP <z8903830@gmail.com>
This commit is contained in:
Sharan Poojari
2026-03-23 19:18:11 +05:30
committed by GitHub
parent 1422d2a850
commit 34583dc66f
5 changed files with 39 additions and 7 deletions

View File

@@ -129,7 +129,7 @@ impl HTMLIFrameElement {
// Step 2.1. Let maybeURL be the result of encoding-parsing a URL given that attribute's value,
// relative to element's node document.
// Step 2.2. If maybeURL is not failure, then set url to maybeURL.
self.owner_document().base_url().join(&url).ok()
self.owner_document().encoding_parse_a_url(&url).ok()
}
})
// Step 1. Let url be the URL record about:blank.