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

iframe content does not resize when iframe element is resized #8301

Closed
paulrouget opened this issue Nov 3, 2015 · 4 comments
Closed

iframe content does not resize when iframe element is resized #8301

paulrouget opened this issue Nov 3, 2015 · 4 comments

Comments

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Nov 3, 2015

<style>
  iframe {
    border: 1px solid black;
    height: 200px;
  }
</style>

<iframe width='200' src="data:text/html,<style>html{background:red}</style>"></iframe>

<script>
  setTimeout(() => {
    document.querySelector('iframe').width = 400;
  }, 2000);
</script>
@eefriedman
Copy link
Contributor

@eefriedman eefriedman commented Nov 3, 2015

(This works correctly from the perspective of content; it just doesn't get drawn on the screen correctly.)

I thought this was a duplicate, but I can't seem to find it.

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Nov 3, 2015

It's a regression. Started with 1a494b1.

/cc @mrobinson

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Nov 3, 2015

I thought this was a duplicate, but I can't seem to find it.

Maybe you were thinking of issue #8081 where iframe content is not drawn after navigation.

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Nov 3, 2015

@paulrouget I've confirmed this and have a fix locally. I think the actual culprit is #7423. That would not be too surprising because it was a major rework to fix an architectural flaw. I'll try to get a PR ready today.

mrobinson added a commit to mrobinson/servo that referenced this issue Nov 3, 2015
When a layer containing an iframe changes, we also need to resize the
root layer of the subpage. This ensures that content from the child
layer tree is masked to the new size.

Fixes servo#8301.
bors-servo added a commit that referenced this issue Nov 4, 2015
Properly resize iframe root layers

When a layer containing an iframe changes, we also need to resize the
root layer of the subpage. This ensures that content from the child
layer tree is masked to the new size.

Fixes #8301.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8322)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Nov 4, 2015
Properly resize iframe root layers

When a layer containing an iframe changes, we also need to resize the
root layer of the subpage. This ensures that content from the child
layer tree is masked to the new size.

Fixes #8301.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8322)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Nov 4, 2015
Properly resize iframe root layers

When a layer containing an iframe changes, we also need to resize the
root layer of the subpage. This ensures that content from the child
layer tree is masked to the new size.

Fixes #8301.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8322)
<!-- Reviewable:end -->
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
3 participants
You can’t perform that action at this time.