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

Resetting style property via elt.style.xxx doesn't work #9377

Closed
paulrouget opened this issue Jan 19, 2016 · 2 comments
Closed

Resetting style property via elt.style.xxx doesn't work #9377

paulrouget opened this issue Jan 19, 2016 · 2 comments

Comments

@paulrouget
Copy link
Contributor

Here is an example. The div should turn transparent. It doesn't.

<div style="width:200px;height:200px;border:2px solid red;background:blue"></div>

<script>

  setTimeout(() => {
    document.querySelector("div").style.background = "";
  }, 1000);

</script>
@paulrouget
Copy link
Contributor Author

This breaks React and virtual-dom based libraries.

@paulrouget
Copy link
Contributor Author

Calling document.content_changed(node, NodeDamage::NodeStyleDamaged) in cssstyledeclaration.rs#RemoveProperty appears to fix this issue. I'll submit a PR.

bors-servo pushed a commit that referenced this issue Jan 27, 2016
Invalidate node style after style property removed

Fix #9377

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9378)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 27, 2016
Invalidate node style after style property removed

Fix #9377

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9378)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant