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

Issue 642603 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Modify iframe scrolling attr using javascript has no effect

Reported by 003...@gmail.com, Aug 31 2016

Issue description

Chrome 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.

 

Comment 1 by 003...@gmail.com, Aug 31 2016

In addition to scolling attr, name, marginwidth and marginheight may also need to fix;
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp?sq=package:chromium&rcl=1472599251&l=136
Cc: shouqun@chromium.org
Cc: rnimmagadda@chromium.org
Labels: Needs-Feedback
@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.
642603.mov
21.8 MB Download

Comment 4 by 003...@gmail.com, Aug 31 2016

@rnimmagadda: Thank you for your reply.
Instead of directly modifying the code, please click the input button in the demo.
demo.webm
1.5 MB View Download

Comment 5 by 003...@gmail.com, Aug 31 2016

Add Firefox screen-recording:
demo_firefox.webm
2.2 MB View Download

Comment 6 by 003...@gmail.com, 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.
Project Member

Comment 7 by sheriffbot@chromium.org, Sep 14 2016

Labels: -Needs-Feedback Needs-Review
Owner: rnimmagadda@chromium.org
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
Components: Blink>Scroll
Labels: -Pri-3 -Needs-Review M-54 OS-Linux OS-Mac OS-Windows Pri-2
Owner: ----
Status: Untriaged (was: Unconfirmed)
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
642603.mov
2.9 MB Download

Comment 9 by bokan@chromium.org, Oct 6 2016

Cc: lazyboy@chromium.org dcheng@chromium.org
Labels: -M-54 M-56
Owner: bokan@chromium.org
Status: Assigned (was: Untriaged)
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?
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?
I tried Edge and Safari, both have the expected behavior that the attribute change takes effect immediately, without need for a navigation or resize.
Cc: iclell...@chromium.org
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/
Cc: bokan@chromium.org
Owner: chaopeng@chromium.org
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).
Cc: kenrb@chromium.org alex...@chromium.org lfg@chromium.org
Components: Internals>Sandbox>SiteIsolation
We should fix this for remote frames as well, since this is the behavior that other browsers expose.
Status: Started (was: Assigned)
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?
#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.
Project Member

Comment 18 by bugdroid1@chromium.org, 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

Comment 19 by bokan@chromium.org, Nov 23 2016

Status: Fixed (was: Started)
Labels: Hotlist-Input-Dev

Sign in to add a comment