[Webkit-unassigned] [Bug 239647] New: HTMLMediaElement.currentSrc property is not correct when using Document.adoptNode() method

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 22 02:59:28 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=239647

            Bug ID: 239647
           Summary: HTMLMediaElement.currentSrc property is not correct
                    when using Document.adoptNode() method
           Product: WebKit
           Version: Safari 15
          Hardware: Mac (Intel)
                OS: macOS 12
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zuckjet at gmail.com

Suppose we are visiting a Single Page Application(SPA), which url on the browser is "https://xxxxxxx.com/home/self". Since this is a SPA, website server has no real html located in 'https://xxxxxxx.com/home/self', it just has a single html, which located in 'https://xxxxxxx.com', as for other path such as 'home/self', it is just html5 history api.


```
documentClone.adoptNode(this.documentElement)
```

Let me explain more:

documentClone is just a empty page, which html structure is like: `<html><head></head><body></body></html>`.

this.documentElement is another document, and we can suppose it is loaded from another website page, we call it Page A later.
Page A is a Single Page Application, which url is like: "https://xxxxxxx.com/home/self".
this.documentElement has a `<img>` child, which structure is like "<html> ...   <img id="img" src="assets/aa/bb.png">    ...</html>".


Befor calling `documentClone.adoptNode(this.documentElement)`, when i run `this.documentElement.getElementById('img').currentSrc`, it will return "https://xxxxxxx.com/assets/aa/bb.png".
After calling `documentClone.adoptNode(this.documentElement).getElementById('img').currentSrc`, it will return "https://xxxxxxx.com/home/self/assets/aa/bb.png"

Other browsers will return "https://xxxxxxx.com/assets/aa/bb.png", and before Safari 15.4(MacOS)  it will return "https://xxxxxxx.com/assets/aa/bb.png". But for  Safari 15.4(MacOS), it will return "https://xxxxxxx.com/home/self/assets/aa/bb.png". Maybe this is produced along with Safari 15.4 release.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220422/c06106d8/attachment-0001.htm>


More information about the webkit-unassigned mailing list