Ticket #2530530 (accepted defect)
Reporter Tilo Mitra |
Opened: 07/13/11 Last modified: 09/24/12 Status: accepted Type: defect |
Owner Derek Gathright |
Target Release: BACKLOG Priority: P3 (normal) |
|---|---|---|---|
| Summary: | Applying WebkitTransform translateX() to an element changes scrollWidth as of Chrome 9 | ||
| Description: | Scrollview needs to account for this change, either through sniffing or by setting the axis of the scrolled element to (0,0), doing the necessary calcs and then resetting the axis as needed without Here's the related Chromium bug: |
||
| Type: | defect | Observed in Version: | development master |
| Component: | ScrollView | Severity: | S3 (normal) |
| Assigned To: | Derek Gathright | Target Release: | BACKLOG |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | #2529372 | |
| Browsers: | Firefox 4.x,Chrome | ||
| URL: | http://yuiblog.com/sandbox/chrome_bugs/translate-bug.html | ||
| Test Information: | |||
Change History
|
Posted: 07/21/11
|
|
Posted: 07/23/11
|
|
Posted: 07/23/11
So you mean it doesn't fix the problem for that scenario? or you see flicker for that scenario? (I'll take a look, but just thought I'd ask in the meantime) |
|
Posted: 07/23/11
Seems to work fine for me. See attached .mov a) Scroll all the way to the right edge Is it the scrollbar jumping which you're talking about? I think that's expected when you add a new image - you've got more content on the end now. It moves for the non-bounce case also. In terms of the fix, I'd still like to see if we can avoid scrollTo API, since it goes though: if (xSet) { if (ySet) { Since it's a browser level hack, I was thinking of just applying the transform directly to the dom: if (NATIVE_TRANSITION) { I think I added a _transform method for the h/w acceleration switching, which will get you the actual "transform" string, given an X,Y |
|
Posted: 07/25/11
This was the approx implementation (untested) I was thinking of: |
|
Posted: 07/25/11
Ok, pushed fix to origin/scrollview. It works great. Pls take a look. NOTE: FF 3.6. was exhibited same bug and yet NATIVE_TRANSITIONS was returning false so the fix was not being executed. I had to include an else block that just calls cb.setStyle(LEFT/TOP) to get it to work in FF 3.6. I'd like to merge this into master with your approval. |
|
Posted: 07/26/11
Cool. Feel free to check into master if it tests out OK on Webkit, FF [ we already discussed the general idea behind the fix ]. Now that I think about the FF 3.6 fix - maybe all the non native browsers have always had this problem [ it's just that ScrollView is used less in these browsers, so it's never been reported ]. That is, I can see how moving the contentBox over [ using top/left ] would have the same general scrollWidth impact as the translate so the else block makes sense for this entire set of non-native transform browsers. |
|
Posted: 07/26/11
So this didn't need to be -ve? cb.setStyle('transform', this._transform(origX, origY)); That is, not: cb.setStyle('transform', this._transform(-origX, -origY)); ?? |
|
Posted: 07/26/11
FYI, I pushed one more commit that makes IE6 happy. Code has now been tested on IE6, Chrome, Safari, FF3.6, FF4 and FF5. Will test on IE 7-9 tmrw. |
|
Posted: 07/26/11
Oh, and correct -- did not need to make the values negative. |
|
Posted: 07/26/11
[fix #2530530] Scrollview transform bug. |
|
Posted: 07/26/11
|
|
Posted: 07/26/11
[fix #2530530] Refactor -> add _moveTo method. |
|
Posted: 08/2/11
Reopening. Still broken on Chrome 12.0.742.122/MacOS 10.6 |
|
Posted: 08/2/11
|
|
Posted: 08/2/11
|
|
Posted: 08/2/11
|
|
Posted: 08/2/11
Fallback to using larger of bb.scrollWidth/Height or cb.scrollWidth/Heightnto account for FF (which clips cb.scrollWidth due to bb overflow:hidden) andnChrome (which clips bb.scrollWidth, when translated).nnFixes #2530530nnTested examples and manual scrollview-chrome-transform.html onnFF5, Chrome 12 (Win and MacOS), IE8 and Mobile Safari on the IPad. |
|
Posted: 08/18/11
|
|
Posted: 08/24/11
Reopening. I don't think it's fixed robustly enough. It's not fixing the issue in Safari 5.1, in certain use cases. |
|
Posted: 08/24/11
|
|
Posted: 08/24/11
|
|
Posted: 09/9/11
|
|
Posted: 09/9/11
|
|
Posted: 09/9/11
commit aa1e03f2af02ffea69e75323bf4fff95cbf736c5 Fixed issue with translate impacting scroll dimension calculations on Chrome 9+, |
|
Posted: 09/15/11
One more shot at making scrollWidth/Height calculations more robust in Found that even if we disable h/w accel on the ScrolView on which we're There is a h/w acceleration bug for Webkit in here somewhere. See #2530530 and aa1e03f2 Also added a combined manual scrollview test bed, to replace the older |
|
Posted: 09/16/11
Fixed issue with translate impacting scroll dimension calculations on Chrome 9+, translateZ applied for hw accel, was preventing the 3.4.0 fix from working, |
|
Posted: 09/16/11
One more shot at making scrollWidth/Height calculations more robust in Found that even if we disable h/w accel on the ScrolView on which we're There is a h/w acceleration bug for Webkit in here somewhere. See #2530530 and aa1e03f2 Also added a combined manual scrollview test bed, to replace the older |
|
Posted: 09/27/11
|
|
Posted: 02/10/12
Reopening this, and reassigning it to Derek (new SV owner). The flipping to 2d to work around the issue has it's own downsides [ flicker is evident, when you have a lot of content ]. Maybe we just go back to adding the transform amount to the scrollWidth. May still need to filter out the browsers which support transforms but have different behavior [ Safari 4 ]. |
|
Posted: 02/10/12
|
|
Posted: 02/10/12
Just some thoughts: Since all the browsers seem to be normalizing on adding the translation amount to scrollWidth, seems like we might as well just settle on that solution, to avoid the moving back/forth to/from 0,0 to get the right dimensions. We can test support if we really want to, while loading sv: var o = Y.Node.create("<div></div>"), o.setStyles({ i.setStyles({ body.append(o); var ACCOUNT_FOR_TRANSLATE = (o.get("scrollWidth") === 190); i.remove(true); And then in _getScrollDims(), get the translate amount from the computed style matrix, and add the translate amount to the scrollWidth. |
|
Posted: 02/19/12
Caridy, I've put an implementation of the above approach here, which should fix your flicker due to the 2d/3d switch. http://yuiblog.com/sandbox/yui/v340/scrollview/svtestbed.html It patches 3.4.1. Look at the code between START DIMS FIX and END DIMS FIX. Derek, I'll also push a version of it in scrollview-base to a github branch and post it here, for consideration for 3.5.0. |
|
Posted: 02/19/12
Here's the change to scrollview-base. Needs testing across the A-Grade before committing to 3.5.0. https://github.com/sdesai/yui3/commit/9d4439779a64d343ac907b86b0285bb54363a932 |
|
Posted: 02/19/12
Modified it a little to handle X and Y separately - turns out Y doesn't need fixing! Browsers need to make up their minds. https://github.com/sdesai/yui3/commit/b75138257e5e3ab102da9d67ed22b2a42e75a58a |
|
Posted: 03/27/12
|
|
Posted: 03/27/12
|
|
Posted: 07/30/12
|
|
Posted: 08/1/12
Moving 3.7.0 bugs to 3.6.x for triage. |
|
Posted: 09/19/12
Moving from 3.6.x to 3.CURRENT.NEXT |
|
Posted: 09/24/12
|
The following seems to work without flicker unless user has scrolled all the way to then and bounced back. Pushed to remote branch origin/scrollview. Test page is at src/scrollview/tests/manual/scrollview-chrome-transform.html.
Wondering if there is something about scrolling all the way to the end that results in a different state than a basic incremental scroll.