Bug 149489 - stop propagating custom scrollbar styles across iframe boundaries
Summary: stop propagating custom scrollbar styles across iframe boundaries
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-22 19:21 PDT by MuVen
Modified: 2015-09-26 14:43 PDT (History)
5 users (show)

See Also:


Attachments
IframeStlye Standardization (53.51 KB, image/jpeg)
2015-09-22 19:22 PDT, MuVen
no flags Details
testcase (1.87 KB, application/x-zip-compressed)
2015-09-22 23:03 PDT, MuVen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description MuVen 2015-09-22 19:21:23 PDT
Currently CustomScrollbars are created for html document/ scrollable div's if the body or document element posses PseudoStyle of SCROLLBAR.
While creating customscrollbars for iframes if ownerLayoutObject has PseudoStyle of SCROLLBAR then we create customscrollbars for iframe.

But as i see IFrame is a separate document which can hold its own style. As there is no standard spec for this case, i thought of proposing this
implementation: to create customscrollbars for IFrame if it posses its own PseudoStyle of SCROLLBAR, else create a regular scrollbar for that IFrame, 
which stops propagating customscrollbar styles across iframe boundaries.

The reason for porposing this intent to implementation is, an irregular creation of custom-scrollbar's in nested IFRAME's.
(which is quiet confusing as reported by one of our test engineers)


For example

consider 4 nested IFRAME's

IFRAME 1 => has PseudoStyle of SCROLLBAR with background = orange;
  IFRAME 2 => has PseudoStyle of SCROLLBAR with background = yellow;
    IFRAME 3 => doesnt has PseudoStyle of SCROLLBAR;
	  IFRAME 4 => doesnt has PseudoStyle of SCROLLBAR;
	  
please check the IFrameStyle-Standardization.jpg.


The iframe scrollbars are actually part of the document inside the iframe. As a result, you have to set the scrollbar styles in the document you are loading into the iframe, not in the document that contains the iframe and iframes generically can't inherit/access styles/scripts from their parent page.
Comment 1 MuVen 2015-09-22 19:22:15 PDT
Created attachment 261791 [details]
IframeStlye Standardization
Comment 2 Simon Fraser (smfr) 2015-09-22 22:55:55 PDT
Your screenshot of of Chromium, so you should report this against the Blink project. Does the problem reproduce in Safari on Mac?
Comment 3 MuVen 2015-09-22 23:03:00 PDT
@simon, Problem happens on apple safari even. 


as in the FrameView.cpp

PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientation) {

...
...
...
...
    // If we have an owning iframe/frame element, then it can set the custom scrollbar also.
    RenderWidget* frameRenderer = frame().ownerRenderer();
    if (frameRenderer && frameRenderer->style().hasPseudoStyle(SCROLLBAR))
        return RenderScrollbar::createCustomScrollbar(*this, orientation, nullptr, &frame());

As this part of code is executed, issue is seen in the safari.

Please find the attached testcase.

}
Comment 4 MuVen 2015-09-22 23:03:35 PDT
Created attachment 261799 [details]
testcase
Comment 5 Steve Kobes 2015-09-26 14:43:49 PDT
FYI, we discussed this in Blink on http://crbug.com/450577 and in https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/ULUvtsZ-YQY.

Consistency between Chrome and Safari was a particular concern since custom scrollbar styles are webkit-prefixed.  If WebKit changed this, Blink would probably follow.

The current behavior makes it possible to detect overflow in a cross-origin iframe, which may have security implications (http://sirdarckcat.blogspot.com/2013/09/matryoshka-wrapping-overflow-leak-on.html).