FuckTheWorld / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

chromedriver to pass --disable-overlay-scrollbar to Chrome by default #1136

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Overlay scroll bars mess up screenshots that chromedriver returns. I wonder if 
disabling them by default - by passing --disable-overlay-scrollbar command line 
switch to Chrome - is a good idea.

chromedriver users can still enable (un-disable) the overlay scroll bars if 
needed by passing "disable-overlay-scrollbar" with chromeOption called 
"excludeSwitches" ( 
https://sites.google.com/a/chromium.org/chromedriver/capabilities#TOC-chromeOpti
ons-object )

Original issue reported on code.google.com by vlotoshn...@gmail.com on 23 Jun 2015 at 10:24

GoogleCodeExporter commented 9 years ago
Related here (although not necessarily a final answer to anything), the spec 
currently says in
https://w3c.github.io/webdriver/webdriver-spec.html#current-top-level-browsing-c
ontext

that 

"If the remote end is unable to capture the entire Document, then the part of 
the Document currently displayed in UI of the browser must be captured without 
additional chrome such as scrollbars and browser chrome."

Original comment by vlotoshn...@gmail.com on 23 Jun 2015 at 10:28

GoogleCodeExporter commented 9 years ago
Hmm no scrollbars...what about when the scrollbar is inside a frame/iframe?

Also, if we're not using overlay scrollbars then we're be using regular 
old-fashioned scrollbars. Should we return a cropped image (could be flaky for 
screenshot tests) or should we return a screenshot of the page as if it was 
rendered in a wider window (this would not reflect what the browser is actually 
showing)?

Original comment by samu...@chromium.org on 15 Jul 2015 at 7:51

GoogleCodeExporter commented 9 years ago
First, I apologize for quoting the part of the spec that's out-a-date. As of 
the Santa Clara face-to-face, the decision on the screenshots was that document 
screenshots are explicitly the viewport only and element screenshots are of the 
element but cropped by the viewport if element doesn't fit.

Then yes, the old fashioned scroll bars, I thought that's what 
--disable-overlay-scrollbar does. Old fashioned scroll bars in the frames, yes. 
I made a couple of screenshots of what all the scroll bars look like in both 
modes with Chrome 43.0.2357 an 
http://ci.seleniumhq.org:2310/common/frameScrollPage.html
(note that with --enable-overlay-scrollbar iframes' scroll bars look different 
from the old fashioned by aren't really "overlay" and also look different from 
main document's scroll bars).

I think the screenshot should just represent what the page looks like, as 
rendered, in the viewport of the current size. That would include frame's 
scroll bars as they are (why could that be flaky?..) and it may or may not 
include  main document's scroll bars (I don't care as long as it does the same 
thing every time I take a screenshot; added 
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27646#c1 for the spec to 
hopefully be explicit about that).

Lastly, I don't anymore believe that I have a hard proof that overlay scroll 
bars "mess up screenshots that chromedriver returns". So perhaps this is not a 
super high priority ..

Original comment by vlotoshn...@gmail.com on 15 Jul 2015 at 10:31

Attachments: