Viewport changes unexpectedly

Not reproducible Issue #4385036


Aug 26, 2015
This issue is public.
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce


Repro Steps:

  1. Navigate to this URL:, which has a 640x640 green div containing the current value of window.innerWidth (that value may not appear until you resize the window for the first time).
  2. Shrink the window horizontally so that it is less than 640 pixels wide (ie the @-ms-viewport style starts to take affect). Note that window.innerWidth at this point is reported as 640 (as it should because of the @-ms-viewport style).
  3. Shrink the window vertically such that the green square is, say, half obscured (eg ~300 pixels).
  4. Scroll the window down somewhat (eg one mouse wheel step). Sometimes you can see a vertical scrollbar and sometimes you can’t, for what it’s worth, but regardless you can still scroll the window down.
  5. Enlarge the window horizontally to be wide enough to see the whole width of the green rectangle. There should be a vertical scrollbar visible at this point.
  6. Click the vertical scrollbar tab and drag it to the top of the scrollbar. DO NOT scroll using the mouse scroll wheel or the up/down arrows on the scrollbar. This just makes it easier to see the problem below – the problem happens regardless of the way you scroll here.
  7. Take note of the value of window.innerWidth.
  8. Scroll down a step using either the scroll wheel or the down arrow on the vertical scrollbar.

Unexpected behavior:
At this point, a horizontal scrollbar appears, and if you scroll up to the top of the page you can see that window.innerWidth is less than it was at step 7. The green rectangle at this point is larger than 640 pixels wide, ie we’ve zoomed in a bit. See attached graphic comparing the page before and after step 8 – all three of these unexpected results are visible there. Also, if you shrink the window horizontally such that window.innerWidth stops decreasing (ie the the @-ms-viewport style takes effect), window.innerWidth is less than it should be (eg 623 when it should never be smaller than ~634).

Expected Results:

When the window is large enough to display the full width of the 640px-wide div, I do not expect a horizontal scrollbar to be present. I expect window.innerWidth to be equal to that width in CSS pixels. On a devicePixelRatio==1 display, I expect the width of the rectangle to be 640 pixels. I expect window.innerWidth to never be less than 640 minus the scrollbar width, ie ~634px.

Actual Results:

Dev Channel specific:



0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Christian F.”

      Changed Assigned To from “Christian F.” to “Matt R.”

      Changed Assigned To from “Matt R.” to “IE S.”

      Changed Status to “Not reproducible”

    • Hello,

      Thank you for providing this information about the issue. After thorough testing, we are unable to reproduce this problem in Edge. Please test this behavior in our latest creator’s update 15063 or the insider build 16199.

      Best Wishes,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in