New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 15 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug


Sign in to add a comment
link

Issue 595826: Implement API to expose the Visual Viewport to developers.

Reported by ymalik@chromium.org, Mar 17 2016 Project Member

Issue description

Bug to track the progress of the Visual Viewport API.

See  issue 571297  for motivation.
 

Comment 1 by ymalik@chromium.org, Mar 17 2016

Status: Started (was: Assigned)

Comment 2 by bugdroid1@chromium.org, Apr 4 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e7ff0a19a888c470f0fa149e922f35b4f8fe5539

commit e7ff0a19a888c470f0fa149e922f35b4f8fe5539
Author: ymalik <ymalik@chromium.org>
Date: Mon Apr 04 23:22:10 2016

Visual viewport API initial implementation.

Adds a new visualViewport object to document that contains visual
viewport information.

A visualviewportchanged event fires everytime the visual viewport is
resized or scrolled.

WICG proposal: https://github.com/WICG/ViewportAPI

BUG= 595826 

Review URL: https://codereview.chromium.org/1814013002

Cr-Commit-Position: refs/heads/master@{#385047}

[add] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions-expected.txt
[add] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions.html
[add] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/LayoutTests/fast/dom/viewport/visualviewportchanged-event-fired-expected.txt
[add] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/LayoutTests/fast/dom/viewport/visualviewportchanged-event-fired-window-resized-expected.txt
[add] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/LayoutTests/fast/dom/viewport/visualviewportchanged-event-fired-window-resized.html
[add] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/LayoutTests/fast/dom/viewport/visualviewportchanged-event-fired.html
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/core/core.gypi
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/core/dom/Document.idl
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/core/events/EventTypeNames.in
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/core/frame/VisualViewport.h
[add] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/core/frame/VisualViewport.idl
[modify] https://crrev.com/e7ff0a19a888c470f0fa149e922f35b4f8fe5539/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in

Comment 3 by bokan@chromium.org, Apr 5 2016

Components: Blink>Scroll
Labels: Hotlist-Input-Dev OS-All

Comment 4 by bobvanto...@adrime.com, Apr 8 2016

@bokan, I have some questions about the propose API. Please let me know if this is not the right place for these questions:

1. Can you explain why the proposed API places the `visualViewport` object on the `document` scope? I don't see why it isn't on the `window` object. Especially since it seems to be something that is more closely related to the viewport than the page itself.

2. The `pageScale` variable implies that the page scales when you visually zoom, while this isn't the case. just `scale` or `zoomLevel` seem more representative of what the value returns.

3. Will there also be a suggestion for something like a `pageViewport` or `layoutViewport`? Especially since we'd like to be able to get a combined zoom level of both the visual and page viewports.

4. I have suggestion to rename the `scrollTop` to `panningTop` or `panningY`. Same goes for `scrollLeft`. This seems like a more accurate name, since the `scrollTop` value adds ambiguity. Panning values would be the values that need to be added to the detected scroll.

5. ...now that I think of it.. why are you using `clientWidth`? Shouldn't just `width` suffice?

6. Will the `window.innerWidth` still be available after proposing these changes, or should we expect that backwards compatibility will be broken?


I hope I'm not bugging you too much with these questions :).

Thanks in advance for taking the time to answer them!

Comment 5 by ymalik@chromium.org, Apr 8 2016

3. Will there also be a suggestion for something like a `pageViewport` or `layoutViewport`? Especially since we'd like to be able to get a combined zoom level of both the visual and page viewports.

layoutViewport can be queried using similar properties in document.scrollingElement (for example, document.scrollingElement.scrollTop). 


4. I have suggestion to rename the `scrollTop` to `panningTop` or `panningY`. Same goes for `scrollLeft`. This seems like a more accurate name, since the `scrollTop` value adds ambiguity. Panning values would be the values that need to be added to the detected scroll.

visualViewport.scrollTop and visualViewport.scrollLeft are analogous to 'element.scrollTop' and 'element.scrollLeft (more specifically document.scrollingElement.scrollTop/Left), where in the latter case, it's the layout viewport's position relative to the document and in the former case, it is the visual viewport's position relative to the layout viewport.

5. ...now that I think of it.. why are you using `clientWidth`? Shouldn't just `width` suffice?

Again, I think clientWidth and clientHeight is more consistent with that of it's layout viewport counterparts (document.scrollingElement.clientWidth/Height). 

6. Will the `window.innerWidth` still be available after proposing these changes, or should we expect that backwards compatibility will be broken?

window.innerWidth, and others will be made relative to the layout viewport as proposed in  issue 489206 .

Comment 6 by pp.k...@gmail.com, Apr 8 2016

As usual, I disagree with the last statement: window.innerWidth/Height should continue exposing the visual viewport dimensions for reasons of backward compatibility and cross-browser compatibility. (EVERY other browser does so, including the ones no one but me has ever heard of. Chrome cannot unilaterally change a de-facto standard.)

Other than that I like the current proposal as a starting point; it certainly covers the most important areas.

One question about pageScale: this measures the visual viewport's scale relative to WHAT? 

Is it relative to the layout viewport? That sounds logical, but right now the scale directive in the meta viewport is relative to the ideal layout viewport (the one you get when you do width=device-width), even when the layout viewport has different dimensions. I couldn't figure out the answer by looking at the code example, since it doesn't include the <head> and we don't know if it contains a meta viewport or not.

Also, I'm in favour of dropping the weird Apple-speak 'scale' for 'zoom', which is what you would expect. So pageZoom, or possibly viewportZoom, or just zoom.

Finally, I'm somewhat sympathetic to the idea of adding this API to window instead of document. I see why you'd want to maintain equivalency between document.documentElement.clientWidth and document.visualViewport.clientWidth, but strictly speaking the visual viewport is not a part of the document. So there's a tension here.

Comment 7 by bobvanto...@adrime.com, Apr 11 2016

Thanks for your reply, @ymalik.

I second the points that @pp.k makes, so I'll leave it at that. Thanks for listening.

Comment 8 by bokan@chromium.org, Apr 11 2016

Re #4:

1) We're somewhat averse to adding properties to the `window` object since it'll more likely conflict with variable names in use by apps

2) I'm not really sure what you mean about the page not scaling but we probably have a different notion of `page`. That said, you're right that `scale` or `scaleFactor` is probably just as good without any additional terms so that may make more sense (zoom is typically reserved for Ctrl+/- type zooming).

3) To add to ymalik@'s answer, document.scrollingElement.clientWidth/Height currently refer to the layout viewport *but* document.scrollingElement.scrollTop/Left refer to the visual viewport. The only way I know of today to get the position of the layout viewport is keeping an invisible, position: absolute, dummy element at window.scrollX/Y and getting its location relative to the layout viewport using getBoundingClientRect. If you then subtract that location from window.scrollX/Y you get the layout viewport's location. I have a half-baked test page kind of demonstrating this: bokan.ca/demo/vvapi/test.html *duct-tape alert*

As you can see, it's completely arbitrary what viewport various properties relate to and this is one of the reasons we'd like to make window.innerWidth/Height and scrollX/Y refer to the layout viewport.

5) clientWidth is used to make it clear that scrollbars are not included in the dimensions (analogous to Element.clientWidth)

Comment 9 by bokan@chromium.org, Apr 11 2016

Re #6:

>One question about pageScale: this measures the visual viewport's scale relative to WHAT?

pageScale is the scaling factor applied to the pixels on the page. In the absence of `browser zoom` (ctrl+/- zooming), this would be the ratio of DIPs to CSS pixels.

>Is it relative to the layout viewport? That sounds logical, but right now the scale directive in the meta viewport is relative to the ideal layout viewport (the one you get when you do width=device-width), even when the layout viewport has different dimensions. I couldn't figure out the answer by looking at the code example, since it doesn't include the <head> and we don't know if it contains a meta viewport or not.

It's the same as `scale` in the viewport meta and so relative to the "ideal layout viewport". That is, scale=1 means that 1 CSS pixel == 1 DIP. I'll update the explainer to make that clearer.

>Also, I'm in favour of dropping the weird Apple-speak 'scale' for 'zoom', which is what you would expect. So pageZoom, or possibly viewportZoom, or just zoom.

I worry about adding to the confusion between `browser zoom` (ctrl+/-) and `pinch zoom`. Internally, our terminology is that pinch-zoom applies "scale" and ctrl+/- applies zoom. Though maybe since it's on the visualViewport object it's clear enough? I'd be ok calling it viewport.zoom; we'll see what other browser implementors think.

> Finally, I'm somewhat sympathetic to the idea of adding this API to window instead of document. I see why you'd want to maintain equivalency between document.documentElement.clientWidth and document.visualViewport.clientWidth, but strictly speaking the visual viewport is not a part of the document.

We put it on document so it doesn't clash with existing applications' namespace. I agree window might be a better place for it conceptually. Again, we'll see what other browsers think.

Comment 10 by bobvanto...@adrime.com, Apr 12 2016

Re #8/#9:

Thanks!

>I worry about adding to the confusion between `browser zoom` (ctrl+/-) and `pinch zoom`. Internally, our terminology is that pinch-zoom applies "scale" and ctrl+/- applies zoom. Though maybe since it's on the visualViewport object it's clear enough? I'd be ok calling it viewport.zoom; we'll see what other browser implementors think.

I agree with @pp.k on the 'scale vs. zoom' topic. The naming convention should probably be decided based on an external user's or developer's standpoint. Other browsers might have different internal naming conventions.

For the record: This point is a lot less important to me than the following one.

> As you can see, it's completely arbitrary what viewport various properties relate to and this is one of the reasons we'd like to make window.innerWidth/Height and scrollX/Y refer to the layout viewport.

Even though I agree that the term window.innerWidth is a bit ambiguous, we have come to rely on it like this. How's about we review this change after the new visual and layout viewport variables have landed in Chrome stable? Breaking backwards compatibility seems to be something we should avoid if it is not absolutely necessary.

Comment 11 by bokan@chromium.org, Apr 12 2016

>Even though I agree that the term window.innerWidth is a bit ambiguous, we have come to rely on it like this. How's about we review this change after the new visual and layout viewport variables have landed in Chrome stable? Breaking backwards compatibility seems to be something we should avoid if it is not absolutely necessary.

This was hotly debated in  issue 571297  so I don't want to rehash here but in any case we'll land this API first and separately.

Comment 12 by bobvanto...@adrime.com, Apr 12 2016

Roger that. Thanks again.

Comment 13 by rbyers@chromium.org, Apr 12 2016

There's been some great design discussion here, thanks!  But please
remember to file the essential debates as GitHub issues at
https://github.com/WICG/ViewportAPI to make sure everyone can find the
history, other vendors have equal opportunity, and that any substantial
contributions get IP protection.

Comment 14 by helmut.e...@gmail.com, Apr 18 2016

I just used the experimental visualViewport API in Canary. The returned pageScale values were very useful
for my WebGL stuff.

1. The viewport.clientWidth, however, seems to include the space taken by a scrollbar (tested on a desktop browser window) while the proposed spec says it does not. I think this behaviour is good on the one hand side, because it more closely resembles the windows.innerWidth while on the other hand it is bad for positioning something device-fixed on the right, because it might be covered by the scrollbar.

2. I tried to run the example from the proposed spec in Version 52.0.2710.0 canary (64-bit) by copying the example to a file and opening it with developer tools emulating a S5 phone. When pinch-zooming in the bottom bar moved out of the screen.

3. When using viewport.clientWidth inside a document that is displayed inside an iframe, it returns a width that is far bigger than the complete document, possibly the viewport of the enclosing document.

4. On a desktop  viewport.clientWidth does not seem to honor the browser zoom level.

Comment 15 by bokan@chromium.org, Apr 19 2016

Thanks! This is all highly useful feedback!

1. I'll look into this, if true that's definitely a bug in our implementation. I think "exclude scrollbar" is probably much more useful, as you mention.

2. I wrote that without having an implementation to test on :). I'll take a look and fix it.

3. Thanks, another potential bug I'll look at.

4. Right, I hadn't thought much about how the zooms interact but my instinct is that visualViewport.clientWidth should be in CSS pixels and so be affected by the browser zoom level. I'll take a look.

Comment 16 by bokan@chromium.org, Apr 19 2016

Filed  issue 604926 ,  issue 604928 , and  issue 604932  to track the fixes.

Comment 17 by bokan@chromium.org, May 4 2016

Blocking: 410894

Comment 18 by bugdroid1@chromium.org, Jun 3 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/900d90568dd674bd31fa0a5b25fa4b368e9c67ae

commit 900d90568dd674bd31fa0a5b25fa4b368e9c67ae
Author: bokan <bokan@chromium.org>
Date: Fri Jun 03 23:47:37 2016

Move document.visualViewport to window.visualViewport

The `window` object is a more natural place for the visualViewport API. The
original concern was causing breaking changes since this would clash with any
variable in the global scrope called `visualViewport` but a search through
httpArchive found that this is unlikely to be an issue.

BUG= 595826 

Review-Url: https://codereview.chromium.org/2025393003
Cr-Commit-Position: refs/heads/master@{#397845}

[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/Window/resources/window-property-collector.js
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions-expected.txt
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions.html
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-custom-scrollbars.html
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-under-browser-zoom.html
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/fast/dom/viewport/visualviewportchanged-event-fired.html
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/Source/core/dom/Document.idl
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/Source/core/frame/DOMWindow.h
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
[modify] https://crrev.com/900d90568dd674bd31fa0a5b25fa4b368e9c67ae/third_party/WebKit/Source/core/frame/Window.idl

Comment 20 by ymalik@chromium.org, Jun 23 2016

Blockedon: 622817

Comment 21 by ymalik@chromium.org, Jun 23 2016

Blockedon: 604928

Comment 22 by ymalik@chromium.org, Jun 23 2016

Blockedon: 604926

Comment 23 by ymalik@chromium.org, Jun 23 2016

Blockedon: 604932

Comment 24 by bugdroid1@chromium.org, Jun 28 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c3d5388c0c298a1811b70b8d56c223aebc8d1d39

commit c3d5388c0c298a1811b70b8d56c223aebc8d1d39
Author: ymalik <ymalik@chromium.org>
Date: Tue Jun 28 05:42:58 2016

Rename visualViewport.pageScale to visualViewport.scale

https://github.com/WICG/ViewportAPI/issues/8

BUG= 595826 

Review-Url: https://codereview.chromium.org/2105473002
Cr-Commit-Position: refs/heads/master@{#402410}

[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
[delete] https://crrev.com/27dababee786ced06203d85922b1068527d72398/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions-expected.txt
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions.html
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-iframe.html
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-under-browser-zoom.html
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/Source/core/frame/DOMVisualViewport.cpp
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/Source/core/frame/DOMVisualViewport.h
[modify] https://crrev.com/c3d5388c0c298a1811b70b8d56c223aebc8d1d39/third_party/WebKit/Source/core/frame/VisualViewport.idl

Comment 25 by ymalik@chromium.org, Jun 28 2016

Blockedon: 624068

Comment 26 by bugdroid1@chromium.org, Jun 28 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/138923ac69f895f225d668b8f677ef147103ac70

commit 138923ac69f895f225d668b8f677ef147103ac70
Author: ymalik <ymalik@chromium.org>
Date: Tue Jun 28 19:36:15 2016

Make visualViewport.scrollTop/Left readonly.

BUG= 595826 

Review-Url: https://codereview.chromium.org/2101393002
Cr-Commit-Position: refs/heads/master@{#402513}

[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-resize-events-fired.html
[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions.html
[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-under-browser-zoom.html
[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/Source/core/frame/DOMVisualViewport.cpp
[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/Source/core/frame/DOMVisualViewport.h
[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/Source/core/frame/VisualViewport.h
[modify] https://crrev.com/138923ac69f895f225d668b8f677ef147103ac70/third_party/WebKit/Source/core/frame/VisualViewport.idl

Comment 27 by bugdroid1@chromium.org, Jul 12 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa9981935add4f5b027b7b5188ba3204cae9dd94

commit fa9981935add4f5b027b7b5188ba3204cae9dd94
Author: ymalik <ymalik@chromium.org>
Date: Tue Jul 12 04:05:11 2016

Rename DOMVisualViewport to VisualViewport in Window.idl

BUG= 595826 

Review-Url: https://codereview.chromium.org/2136113002
Cr-Commit-Position: refs/heads/master@{#404777}

[modify] https://crrev.com/fa9981935add4f5b027b7b5188ba3204cae9dd94/third_party/WebKit/Source/core/frame/Window.idl

Comment 28 by ymalik@chromium.org, Jul 18 2016

Blockedon: 629082

Comment 29 by bokan@chromium.org, Jul 20 2016

Hi everyone. Chrome Canary should now have an initial implementation of the visual viewport API behind a runtime flag. You can see the details and some examples here: https://github.com/WICG/ViewportAPI. The visual viewport API can be turned on with chrome://flags/#enable-experimental-web-platform-features. Please try it out and feel free to file GitHub issues with feedback/suggestions/criticisms/etc.

Thanks!

Comment 30 by ymalik@chromium.org, Jul 22 2016

Blockedon: 629801

Comment 31 by bokan@chromium.org, Aug 4 2016

Blockedon: 634424

Comment 32 by bokan@chromium.org, Aug 5 2016

Blocking: 635031

Comment 33 by bokan@chromium.org, Aug 5 2016

Blocking: -410894

Comment 34 by bokan@chromium.org, Aug 10 2016

Blockedon: 636421

Comment 35 by bugdroid1@chromium.org, Aug 12 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c646cb7d4a37fa4630078912263d07e39ccb2430

commit c646cb7d4a37fa4630078912263d07e39ccb2430
Author: ymalik <ymalik@chromium.org>
Date: Fri Aug 12 03:25:15 2016

visualViewport should be [SameObject, Replaceable]

BUG= 595826 

Review-Url: https://codereview.chromium.org/2235403002
Cr-Commit-Position: refs/heads/master@{#411540}

[modify] https://crrev.com/c646cb7d4a37fa4630078912263d07e39ccb2430/third_party/WebKit/Source/core/frame/Window.idl

Comment 36 by ymalik@chromium.org, Sep 29 2016

Blockedon: 651592

Comment 37 by aelias@chromium.org, Nov 4 2016

Blocking: 404315

Comment 38 by ymalik@chromium.org, Nov 15 2016

Cc: ymalik@chromium.org
Owner: bokan@chromium.org
Status: Assigned (was: Started)
The following things are remaining here:
- Writing supporting web platform tests
- Improving the spec based on feedback received on WICG (https://github.com/WICG/ViewportAPI/issues)

Comment 39 by bokan@chromium.org, Dec 12 2016

Blocking: 634333

Comment 40 by bokan@chromium.org, Mar 1 2017

Blocking: -404315

Comment 41 by bugdroid1@chromium.org, May 25 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fad476c5b04ee86096641a9ed979239b72c11483

commit fad476c5b04ee86096641a9ed979239b72c11483
Author: bokan <bokan@chromium.org>
Date: Thu May 25 00:05:58 2017

Rename VisualViewport properties to match updated spec

This patch changes names in the API to match the updates to the spec
since the initial implementation. Specifically:

window.visualViewport -> window.view
scrollLeft -> offsetLeft
scrollTop -> offsetTop
pageX -> pageLeft
pageY -> pageTop
clientWidth -> width
clientHeight -> height

Spec: https://wicg.github.io/ViewportAPI/spec.html

BUG= 595826 

Review-Url: https://codereview.chromium.org/2901203002
Cr-Commit-Position: refs/heads/master@{#474484}

[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/read-viewport-size-causes-layout.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/read-viewport-size-in-iframe-causes-layout.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/resize-event-fired-window-resized.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-resize-events-fired.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-custom-scrollbars.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-iframe.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-under-browser-zoom.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointerevent_touch-action-pinch_zoom_touch.html
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/DOMVisualViewport.cpp
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/DOMVisualViewport.h
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/VisualViewport.h
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/VisualViewport.idl
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/frame/Window.idl
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/fad476c5b04ee86096641a9ed979239b72c11483/tools/metrics/histograms/enums.xml

Comment 42 by bokan@chromium.org, Jun 19 2017

Status: Fixed (was: Assigned)
Implementation here is finished, all that's left is to flip the flag. Those interested can follow progress on  issue 635031  which tracks shipping.

Comment 43 by bugdroid1@chromium.org, Jun 27 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82

commit 43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82
Author: David Bokan <bokan@chromium.org>
Date: Tue Jun 27 00:39:21 2017

Rename window.view to visualViewport

Renaming `view` to `visualViewport`. This is in response to potential
compat impact of `window.view`. See
https://github.com/WICG/ViewportAPI/issues/42

Bug:  595826 
Change-Id: I9a8651cb5e877e2204b5dd84bdba8d423a389806
Reviewed-on: https://chromium-review.googlesource.com/546756
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482492}
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-dimensions-custom-scrollbars-manual.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-dimensions-scrollbars-manual.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-no-resize-event-on-overflow-recalc.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-offset-manual.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-page-manual.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-read-size-causes-layout.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-read-size-in-iframe-causes-layout.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-resize-event-manual.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-resize-event-on-load-overflowing-page.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-scale-iframe-manual.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-scale-manual.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-scroll-event-manual.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-scrollbars-cause-resize.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-type.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-unscaled-scale-iframe.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-unscaled-scale.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-unscaled-scroll-iframe.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-unscaled-scroll.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-unscaled-size-iframe.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/external/wpt/viewport/viewport-unscaled-size.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/read-viewport-size-causes-layout.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/read-viewport-size-in-iframe-causes-layout.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/resize-event-fired-window-resized.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/scroll-resize-events-fired.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/verify-viewport-dimensions.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-custom-scrollbars.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-iframe.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-under-browser-zoom.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-scrollbars-cause-resize.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointerevent_touch-action-pinch_zoom_touch.html
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
[modify] https://crrev.com/43eb70f8c3b14a54f5b8a2f9ccb06236a70b0c82/third_party/WebKit/Source/core/frame/Window.idl

Comment 44 by bugdroid1@chromium.org, Jun 28 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2bf9f7501126e8daecdb53c532bf176059abf596

commit 2bf9f7501126e8daecdb53c532bf176059abf596
Author: David Bokan <bokan@chromium.org>
Date: Wed Jun 28 16:21:26 2017

Make `window.visualViewport` match IDL from spec.

`window.visualViewport` should never return null. I've made the change
to the IDL to clarify that and also prevent returning nullptr from
LocalDOMWindow::visualViewport.

I also renamed view_ to visualViewport_ in LocalDOMWindow as I missed
this in my renaming patch https://crrev.com/c/546756/

Bug:  595826 
Change-Id: I24e009e2b2ae0ecfbad66ccf565c03dcea7df24d
Reviewed-on: https://chromium-review.googlesource.com/550262
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483012}
[modify] https://crrev.com/2bf9f7501126e8daecdb53c532bf176059abf596/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
[modify] https://crrev.com/2bf9f7501126e8daecdb53c532bf176059abf596/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
[modify] https://crrev.com/2bf9f7501126e8daecdb53c532bf176059abf596/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/2bf9f7501126e8daecdb53c532bf176059abf596/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
[modify] https://crrev.com/2bf9f7501126e8daecdb53c532bf176059abf596/third_party/WebKit/Source/core/frame/Window.idl

Sign in to add a comment