-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make scrollbars visible on mac screenshots #10972
Comments
cc/ @youennf |
@davidsgrogan do you know what is that causes scrollbars to be visible in content_shell? In Safari, is the problem that the scrollbars are visible to a user, but not captured in the screenshot? Or that they aren't visible at all? |
@foolip They're not visible to the user; scrollbars on macOS by default disappear except when scrolling. |
Ah, right. @youennf, any way to change the default? |
@foolip Of course, that moves us away from the configuration that most users run with, which might also be problematic (e.g., if we want to test disappearing scrollbar interaction with things like percentage widths and the |
There's a custom "theme" special for form controls and scrollbars: |
@mrego that's all |
Some digging around content_shell reveals:
Eventually checked by https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/scroll/scrollbar_theme.cc?l=384&rcl=6156ddee9c553723c0bdbfb2bae14865cecca53f which causes ScrollbarThemeMock to be used instead of ScrollbarThemeMac. The ScrollbarThemeMock header says @jeremyroman or @progers , could you confirm and possibly loop in someone who was part of tackling this issue (mac doesn't show scrollbars by default) in content_shell? |
There are similar things on WebKit: This is a screenshot of how scrollbars are visible when running tests in WebKit on Mac platform, |
As a somehow related note I've found this property: This should allow to know what to do with scrollbars sizes on the test, |
Right. The property that rego pointed to are meant precisely for that kind of thing. Since there's both user demand for this, and they would solve the problem for tests, I'd suggest trying to implement that. |
Until now, nothing defined what the scrollbars should look like or how much space, if any, they should take. This css property gives some control over that |
@davidsgrogan, sometimes we want to test behavior on mac as it would be in the default configuration (with scrollbar hiding), and sometimes we want to force scrollbars on. The testrunner supports both configurations. I don't quite understand your question; do you want to change something in this area? |
@progers Sorry, I was asking if you could confirm that the code I linked to in #10972 (comment) is indeed how layout tests force scrollbars on when we want them to. I did not realize we have the option to run layout tests with or without scrollbars forced on, but it makes total sense. How is that controlled? Do individual layout tests specify in the test itself? |
Hmm, if this needs to be controlled dynamically, I wonder if it could be a WebDriver API. @kereliuk, WDYT? |
@davidsgrogan, I think these are the two flags: // controls the overlay behavior where scrollbars do not take up space. As far as I l know, these are set individually in tests. I think the default is to use the mock theme and not use overlay scrollbars. |
@foolip I interpret |
@davidsgrogan, that was me triaging all infra issues via https://foolip.github.io/ecosystem-infra-rotation/. Right now it looks like there doesn't exist any standardized and implemented CSS that would solve the problem. Would support for Concretely, as long as the tests are passing in content_shell, I would probably leave them failing in Chrome on wpt.fyi and point to this issue, or an issue to implement something in Chrome that'd solve the problem. |
Yep,
The issue is that tests are passing where they should fail, i.e. Safari and Chrome<=67 on mac. https://wpt.fyi/results/css/css-tables/height-distribution/percentage-sizing-of-table-cell-children-002.html should show everything as failing, but Safari shows as passing. I suppose instead of using the |
I guess that does present a bit of a problem, people are less likely to prioritize tests that are incorrectly passing than incorrectly failing, so if we use only Would the same CSS in all tests involving scrollbars work? In that case perhaps we could have a shared CSS file like your scrollbars.css in https://chromium-review.googlesource.com/c/chromium/src/+/1054770 plus We've been trying to remove prefixed things from wpt when they would cause things to pass without the unprefixed things being supported, but this is the other way around. @jgraham may have opinions on whether we should be keen on prefixed things to make things fail correctly. |
That would for sure work for layout tests that depend on scrollbars to change the content box size. But are you suggesting to automatically inject that css into pages that wpt detects has scrollbars? That might obviate tests whose whole point is to check overlay scrollbars, but I'm at the frontier of my knowledge here and don't really know. But if you're suggesting test authors manually use a common scrollbars.css when they know it's needed on mac, then I think that would work, though then a test author would have to be somewhat aware of this issue in the first place.
I think you're suggesting to add |
I ended up submitting https://chromium-review.googlesource.com/c/chromium/src/+/1054770 as-is with its ad hoc solution to this problem. I'm not sure what the long-term solution should be. Ideally we would run all the tests in multiple configurations -- default scrollbars, overlay scrollbars, mock scrollbars -- because tests should pass in each, but that's obviously too expensive. So perhaps we want to add something to webdriver (#10972 (comment)) that does something like what @progers showed in @kereliuk, WDYT? |
Tests that exercise layout's response to scrollbars can bogusly pass on mac because mac doesn't show scrollbars even with overflow:scroll.
I discovered this when looking at a test @mrego added with a Blink bugfix. The bug was when table cells have scrollbars, their %height children were sized incorrectly. Chrome 66 is buggy and Chrome 68 is correct. Safari STP 55 and below is buggy. But the test passes in Chrome 66 and Safari on macOS because no scrollbars appear that would affect layout.
I proposed a quick fix of styling the scrollbars in this test with ::-webkit-scrollbar* and friends. But perhaps the test runner should always apply something more rigorous on mac and not leave it to individual tests? Blink does something similar in its testing.
https://jsfiddle.net/dgrogan/me8esewq/4/ shows actual and expected renderings with both default and custom scrollbars. If you run it on chrome 68 linux, chrome 68 mac, chrome 66 linux, chrome 66 mac, Safari, etc you'll see what the issue is.
/cc @mstensho @gsnedders
The text was updated successfully, but these errors were encountered: