Skip to content
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

Removal / dynamic changes to the <link> / <style>'s media attribute don't work. #20118

Open
emilio opened this issue Feb 25, 2018 · 1 comment
Open

Comments

@emilio
Copy link
Member

@emilio emilio commented Feb 25, 2018

Maybe changes work before #20115, it's not totally clear to me, but removals definitely don't... We should fix that.

@emilio
Copy link
Member Author

@emilio emilio commented Feb 25, 2018

Testcase for <style>, which is equally broken:

<!doctype html>
<style>
  p { color: red; }
</style>
<style id="style-with-media" media="not all">
  p { color: green; }
</style>
<p>Should be green</p>
<script>
  document.getElementById("style-with-media").removeAttribute("media");
</script>

<link> is broken in the same way:

<!doctype html>
<style>
  p { color: red; }
</style>
<link id="style-with-media" href="data:text/css;charset=UTF-8,p%7Bcolor%3Agreen%7D" rel="stylesheet" media="not all">
<p>Should be green</p>
<script>
  document.getElementById("style-with-media").removeAttribute("media");
</script>
@emilio emilio changed the title Removal / dynamic changes to the <link media> attribute don't work. Removal / dynamic changes to the <link> / <style>'s media attribute don't work. Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.