[Webkit-unassigned] [Bug 101055] setting UL padding-right in a setTimeout does not update LI elements inside the list

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 7 05:44:02 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=101055





--- Comment #5 from Radu Brehar <radu at evanghelic.ro>  2012-11-07 05:45:35 PST ---
I have found a workaround to this bug.

In order for child LI elements of the UL container to be correctly displayed, I had to toggle the display of the UL, and also adjust the size of the UL.

Basically the code is now the following:

setTimeout(function(){
    console.log('setting padding');
    var container = document.getElementById('container'),
        containerStyle = container.style;

    containerStyle.borderRightWidth = '20px'; //or containerStyle.paddingRight

    //workaround: force reflow&repaint 
    //- changing display to none and setting it again to the previous value   
    //is not enough. We need to change width as well

    var display = containerStyle.display;

    containerStyle.display = 'none';
    containerStyle.width = container.offsetWidth + 'px';
    containerStyle.width = '100%';
    containerStyle.display = display;

   //workaround END

    console.log('done!');
}, 2000);

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list