-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: The URL involved in the dynamic modification element inline style is not converted to an absolute path #768
base: master
Are you sure you want to change the base?
Conversation
Maybe we need transform all the style attribute here? |
Yes, indeed. I'll update it later. |
Is this to fix that there are URLs in the
|
@eoghanmurray I wrote some test case for this. |
Thanks for the test case! Is this going down the Is it necessary to update your test case with a shorthand one; |
const newPriority = target.style.getPropertyPriority(pname); | ||
if ( | ||
newValue !== old.style.getPropertyValue(pname) || | ||
newPriority !== old.style.getPropertyPriority(pname) | ||
) { | ||
newValue = transformAttribute( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could call absoluteToStylesheet
directly here on newValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like newValue = attributeToStylesheet(newValue);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(would need to import attributeToStylesheet and also maybe change it's href attribute to default to getHref() rather than importing getHref also)
const newPriority = target.style.getPropertyPriority(pname); | ||
if ( | ||
newValue !== old.style.getPropertyValue(pname) || | ||
newPriority !== old.style.getPropertyPriority(pname) | ||
) { | ||
newValue = transformAttribute( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(would need to import attributeToStylesheet and also maybe change it's href attribute to default to getHref() rather than importing getHref also)
@@ -490,12 +490,18 @@ export default class MutationBuffer { | |||
} | |||
const styleObj = item.attributes.style as styleAttributeValue; | |||
for (const pname of Array.from(target.style)) { | |||
const newValue = target.style.getPropertyValue(pname); | |||
let newValue = target.style.getPropertyValue(pname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought we might need to do the transformation here, but you are right to wait til after the comparison.
<button onclick='addDynamicBackgroundImage()'>add dynamic background image</button> | ||
<script> | ||
function addDynamicBackgroundImage() { | ||
document.querySelector('#div2').style.setProperty('background-image', 'url(dynamic.png)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The images are cute! However they do need to be downloaded by everyone who downloads rrweb ... so they can be removed without affecting the test case (it shouldn't matter for the purposes of the test whether they actually exist)
No description provided.