Document-relative m-frame and content addressing (#72) #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently
src
attributes are interpreted as being relative to the page that the MML content has been loaded into. (e.g. anm-image
withsrc="/foo.png"
loaded on pagelocalhost:8080
would result in requestinghttp://localhost:8080/foo.png
)If the
m-image
was an element of a remote document (e.g. anm-frame
loaded fromws://example.com/
) thensrc="/foo.png"
should instead resolve tohttp://example.com/foo.png
.This PR resolves #72 by introducing addresses for the
RemoteDocument
element and then using those as the location to resolve relative paths. This means that content addressed from within anm-frame
will be relative to the address of them-frame
.This also works for
m-frame
s by using relative WebSocket addresses in the formws:///foo
from an origin ofhttp://example.com/bar/baz
. The WebSocket will resolve tows://example.com/foo
.What kind of changes does your PR introduce? (check at least one)
Does your PR introduce a breaking change? (check one)
If yes, please describe its impact and migration path for existing applications:
(It's unlikely that someone is using this behaviour intentionally)
If a remote document is loaded from an origin and then references relative paths that are assumed to be relative to the page that has loaded this document then the urls would now resolve relative to the remote document. The origin-relative content would have to be specified absolutely to retain the same behaviour.
Does your PR fulfil the following requirements?