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

Styling / layout bug when zooming. #15801

Closed
glennw opened this issue Mar 2, 2017 · 2 comments
Closed

Styling / layout bug when zooming. #15801

glennw opened this issue Mar 2, 2017 · 2 comments

Comments

@glennw
Copy link
Member

@glennw glennw commented Mar 2, 2017

Test case:

<!DOCTYPE html>
<html>
  <head>
    <style type="text/css">
      div {
        position: absolute;
        width: 80%;
        left: 10%;
        height: 100px;
        background: red;
      }
    </style>
  </head>
  <body>
    <div></div>
  </body>
</html>

If you use the recently landed page zoom support (Ctrl, Shift, + and Ctrl, -) to zoom in and out of the page, it doesn't correctly calculate the size and position of the div. However, running it with -i to disable incremental layout makes it work correctly (it then matches Gecko).

It looks like maybe the % elements aren't being restyled / calculated? I confirmed that it's detecting the viewport size has changed in layout, but didn't investigate any further.

@glennw
Copy link
Member Author

@glennw glennw commented Mar 2, 2017

@emilio
Copy link
Member

@emilio emilio commented Mar 2, 2017

Yeah, this is likely a layout bug (not a styling bug, given the computed styles don't change at all). We're supposed to handle it in layout_thread: https://github.com/servo/servo/blob/master/components/layout_thread/lib.rs#L1077

Either that needs_reflow logic is wrong, or viewport_size_changed is false? I can take a look tomorrow probably.

emilio added a commit to emilio/servo that referenced this issue Mar 3, 2017
Fixes servo#15801
@bors-servo bors-servo closed this in 8832b5a Mar 3, 2017
clementmiao added a commit to clementmiao/servo that referenced this issue Apr 7, 2017
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
2 participants
You can’t perform that action at this time.