RESOLVED FIXED 116319
webkit-backface-visibility on a parent element stops background-position from updating
https://bugs.webkit.org/show_bug.cgi?id=116319
Summary webkit-backface-visibility on a parent element stops background-position from...
Nathan Stitt
Reported 2013-05-17 08:24:22 PDT
If a parent element in the DOM has -webkit-backface-visibility: none applied, it's children no longer re-render when their background-position is updated. http://jsfiddle.net/nathanstitt/JcX4g/3/ will illustrate the issue. Observe how the magnifier image shows the high-resolution image when it's moved. Uncommenting line 3 ( webkit-backface-visibility) and re-rerunning the jsfiddle and the image never redraws, even though the attributes in the DOM are updated. I encountered this when using the flexslider library (http://flexslider.woothemes.com/), which applies the backface-visibility. Hope this helps, contact me if you need any further details.
Attachments
Testcase (592 bytes, text/html)
2013-05-18 12:20 PDT, Simon Fraser (smfr)
no flags
Patch (26.93 KB, patch)
2013-05-18 14:22 PDT, Simon Fraser (smfr)
no flags
Patch (11.41 KB, patch)
2013-06-15 23:12 PDT, Simon Fraser (smfr)
darin: review+
Nathan Stitt
Comment 1 2013-05-17 08:31:20 PDT
Forgot to mention, removing the div & re-adding it does force an update to the background-position and it will re-render properly. http://jsfiddle.net/JcX4g/5/ line 28 shows the work-around.
Nathan Stitt
Comment 2 2013-05-17 09:20:30 PDT
I've also prepared a plain javascript version of the test case: http://jsfiddle.net/nathanstitt/JcX4g/7/
Simon Fraser (smfr)
Comment 3 2013-05-18 12:17:29 PDT
The bug occurs when there's both a position change and a background-position change.
Radar WebKit Bug Importer
Comment 4 2013-05-18 12:20:36 PDT
Simon Fraser (smfr)
Comment 5 2013-05-18 12:20:43 PDT
Created attachment 202210 [details] Testcase
Simon Fraser (smfr)
Comment 6 2013-05-18 12:27:09 PDT
Not a recent regression.
Simon Fraser (smfr)
Comment 7 2013-05-18 12:43:07 PDT
Simon Fraser (smfr)
Comment 8 2013-05-18 12:46:13 PDT
The optimization added in r102952 is basically incorrect. RenderStyle::diff() returns StyleDifferenceLayoutPositionedMovementOnly, but that doesn't mean that some other property changes don't require repainting.
Simon Fraser (smfr)
Comment 9 2013-05-18 14:22:43 PDT
Simon Fraser (smfr)
Comment 10 2013-05-18 14:23:15 PDT
Comment on attachment 202216 [details] Patch Wrong bug.
Simon Fraser (smfr)
Comment 11 2013-06-15 23:12:57 PDT
Darin Adler
Comment 12 2013-06-16 08:50:08 PDT
Comment on attachment 204781 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=204781&action=review > Source/WebCore/rendering/RenderObject.h:1255 > + if (oldStyle && m_style->diffRequiresRepaint(oldStyle)) Is there some other level of the code already doing a diff? Is it bad for performance to do this here too? > Source/WebCore/rendering/style/RenderStyle.cpp:797 > + unsigned contextSensitiveProperties = 0; This should be named changedContextSensitiveProperties. Leaving out the word “changed” makes it hard to understand that this is an out argument and whether 0 is the correct value to initialize to.
Simon Fraser (smfr)
Comment 13 2013-06-16 09:01:13 PDT
(In reply to comment #12) > (From update of attachment 204781 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=204781&action=review > > > Source/WebCore/rendering/RenderObject.h:1255 > > + if (oldStyle && m_style->diffRequiresRepaint(oldStyle)) > > Is there some other level of the code already doing a diff? Is it bad for performance to do this here too? There is, but the earlier diff bailed early, never testing the repaint properties. So this isn't another full diff. > > Source/WebCore/rendering/style/RenderStyle.cpp:797 > > + unsigned contextSensitiveProperties = 0; > > This should be named changedContextSensitiveProperties. Leaving out the word “changed” makes it hard to understand that this is an out argument and whether 0 is the correct value to initialize to. Agreedn.
Simon Fraser (smfr)
Comment 14 2013-06-16 09:58:04 PDT
Note You need to log in before you can comment on or make changes to this bug.