Modify iframe scrolling attr using javascript has no effect
Reported by
003...@gmail.com,
Aug 31 2016
|
||||||||||||
Issue descriptionChrome Version: 51.0.2704.63, also can be found in 53 beta URLs (if applicable) : https://codepen.io/floatingstone/pen/ZpzAab Other browsers tested: Firefox: OK What steps will reproduce the problem? (1) Click the ”scrolling_test[yes]“ button to set scrolling attr value to "no"; (2) Try to scroll the iframe; What is the expected result? When scrolling attr value is setted to "no", iframe can‘t be scrolled. What happens instead? iframe still can be scrolled.
,
Aug 31 2016
,
Aug 31 2016
@003mjf: Could you please have a look at the attached video and let us know if this is the correct behavior to repro this issue. Else, provide us the screen-recording for better understanding. Thank you.
,
Aug 31 2016
@rnimmagadda: Thank you for your reply. Instead of directly modifying the code, please click the input button in the demo.
,
Aug 31 2016
Add Firefox screen-recording:
,
Sep 7 2016
It's almost a week since screen-recordings were attached. Could someone please look into this issue? I think this bug can be categorized into component:Blink>HTML>IFrame.
,
Sep 14 2016
Thank you for providing more feedback. Adding requester "rnimmagadda@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 30 2016
Able to repro this issue on Windows 7, MAC (10.11.6) & Ubuntu Trusty (14.04) for Google Chrome Stable Version - 53.0.2785.143 This is a Non-Regression issue existing from M30 - # 30.0.1549.0
,
Oct 6 2016
I can repro the issue. When scrolling is set to "no", I can still scroll. *But* if the page is resized, then I can't scroll the iframe anymore. I've tracked this down to the fact that we read the frame owner's scrollingMode attribute in layout(). I bet we have the same issue with the other attributes (as mentioned as a possibility in #1. Should be easy enough to call setNeedsLayout on the contentFrame() and I've confirmed this works so I'll submit a fix when I get some time. This gets a little more tricky for remote frames. FrameTreeNode::frame_owner_properties_ has a comment explicitly stating that the set properties won't take effect until the frame is next navigated. We could probably prod the remote frame to set layout and have it work as well. dcheng@/lazyboy@, does that sound about right or was this an explicit choice?
,
Oct 7 2016
The original intention when we implemented the remote frame code was to match the behavior of local frames and only have attribute changes be reflected on a new load in the frame. That being said, that's obviously kind of broken today since we can re-read this value during layout (we didn't check the resize case =) Sadly, this is something that was only specced in HTML4 and is underspecified. How do other UAs behave? In particular, Edge and IE?
,
Oct 7 2016
I tried Edge and Safari, both have the expected behavior that the attribute change takes effect immediately, without need for a navigation or resize.
,
Oct 18 2016
Should we clarify this behavior in the spec somewhere? This is also coming up for things like feature policy in https://codereview.chromium.org/2254533002/
,
Nov 7 2016
Not sure what we should be doing in remote frames but it seems pretty clear and straightforward to fix this for local frames. Chao, could you please take a look. The code that sets the scrolling mode is in FrameView::calculateScrollbarModes which gets called from layout. We should force recalculation of this (and other iframe attributes) when they're set (or schedule a layout).
,
Nov 7 2016
We should fix this for remote frames as well, since this is the behavior that other browsers expose.
,
Nov 10 2016
,
Nov 14 2016
HTMLFrameElementBase::frameOwnerPropertiesChanged is method get called when the attr update. For LocalFrame: This issue can be fix via adding FrameView::setNeedsLayout() to mark the frame need relayout in/after HTMLFrameElementBase::frameOwnerPropertiesChanged. For RemoteFrame: I don't see any method to mark frame need relayout in RemoteFrame. dcheng@ can you please give me some advice?
,
Nov 14 2016
#16: for RemoteFrames, seems like you might be able to call setNeedsLayout in WebFrame::setFrameOwnerProperties if the scrolling mode changed (and the WebFrame is local). When frameOwnerPropertiesChanged is called for a remote frame, the updated properties are plumbed through the browser process and to this function in the renderer process that has the corresponding local frame.
,
Nov 23 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2e671cf88d579e7a2392dff0383f47dae2655ab5 commit 2e671cf88d579e7a2392dff0383f47dae2655ab5 Author: chaopeng <chaopeng@chromium.org> Date: Wed Nov 23 00:55:32 2016 Support script modify iframe scrolling, marginWidth and marginHeight attr For scrolling: call FrameView::setNeddLayout in LocalFrame to update the behaviour. For marginWidth and marginHeight: call setIntegralAttribute to set the attr This patch works for LocalFrame and RemoteFrame, BUG= 642603 Review-Url: https://codereview.chromium.org/2507023002 Cr-Commit-Position: refs/heads/master@{#434047} [add] https://crrev.com/2e671cf88d579e7a2392dff0383f47dae2655ab5/third_party/WebKit/LayoutTests/http/tests/misc/iframe-script-modify-attr-expected.html [add] https://crrev.com/2e671cf88d579e7a2392dff0383f47dae2655ab5/third_party/WebKit/LayoutTests/http/tests/misc/iframe-script-modify-attr.html [add] https://crrev.com/2e671cf88d579e7a2392dff0383f47dae2655ab5/third_party/WebKit/LayoutTests/http/tests/misc/resources/iframe-big.html [modify] https://crrev.com/2e671cf88d579e7a2392dff0383f47dae2655ab5/third_party/WebKit/Source/core/dom/Document.cpp [modify] https://crrev.com/2e671cf88d579e7a2392dff0383f47dae2655ab5/third_party/WebKit/Source/core/dom/Document.h [modify] https://crrev.com/2e671cf88d579e7a2392dff0383f47dae2655ab5/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp [modify] https://crrev.com/2e671cf88d579e7a2392dff0383f47dae2655ab5/third_party/WebKit/Source/web/WebFrame.cpp
,
Nov 23 2016
,
Jan 5 2017
|
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by 003...@gmail.com
, Aug 31 2016