Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    imat is on a distinguished road

      0  

    Default [CLOSED]Ext.Element.getStyle set display style property side-effect on webkit

    [CLOSED]Ext.Element.getStyle set display style property side-effect on webkit


    I ran into a webkit specific bug where my elements where added an extra display style (style="display:none;")
    After some debugging I found what I think is a bug in the Ext.Element.getStyle method.
    Here is the change to fix (always set back display from currentStyle)

    Code:
                         prop = chkCache(prop);
                         // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343
                         if(wk && /marginRight/.test(prop)){
    -                        display = this.getStyle('display');
    +                        display = el.style.display;
                             el.style.display = 'inline-block';
                         }
                         out = (v = el.style[prop]) ? v :

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,655
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Please follow the guidelines when posting to the bug forum: http://www.extjs.com/forum/showthrea...-the-Bug-Forum

    Thanks.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    imat is on a distinguished road

      0  

    Default



    Ext version tested:

    • Ext 3.2.0
    • Ext 3.2.1
    • Ext core 3.1.0
    Adapter used:
    • ext
    Browser versions tested against:
    • Chrome 5.0
    • Chrome 4.0
    • Safari 4.0.5
    Operating System:
    • WinXP Pro
    Description:
    • calling Ext.Element.getStyle('marginRight') on webkit browsers have the side effect of adding a display property in the style="" attribute.

    Test Case:

    Code:
    <html>
        <head>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core.js"></script>
            <script type="text/javascript">
            Ext.onReady(function(){
     
                var e = document.createElement('div');
                console.assert( ! e.style.display, 'no style.display set on element' );
                Ext.get(e).getStyle('marginRight');
                console.assert( ! e.style.display, 'getStyle() should produce no side-effect on style.display' );
     
            });
            </script>
     
        </head>
        <body>
        </body>
    </html>


    Steps to reproduce the problem:

    • see test case

    The result that was expected:
    • getStyle('marginRight') does not produce side-effect

    The result that occurs instead:
    • the style property of the element is altered to include its computed display.

    Possible fix:
    Code:
    @@ -5941,7 +5941,7 @@
                         prop = chkCache(prop);
                         // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343
                         if(wk && /marginRight/.test(prop)){
    -                        display = this.getStyle('display');
    +                        display = el.style.display;
                             el.style.display = 'inline-block';
                         }
                         out = (v = el.style[prop]) ? v :

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,655
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Right ok, this has since been fixed in SVN, which is why I was a bit confused. I'll mark this as closed.

    Thanks for the report.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    imat is on a distinguished road

      0  

    Default


    I'm curious, do you know in which svn revision it was fixed ?
    I still have the issue with 3.2.2.

    Also, I tried to build the trunk to test this,
    but JSBulder2 was not working for me ...
    $ java -jar JSBuilder2.jar -p ext-core.jsb2 -d ../out
    Loading the 'Ext Core' Project
    Loaded 2 Packages
    java.io.FileNotFoundException: null\src\ext-core\src\core\Ext.js (The system can
    not find the path specified)
    [.. repeat for each files ...]
    java.io.FileNotFoundException: null\src (The system cannot find the path specifi
    ed)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at com.extjs.FileHelper.copyDirectory(FileHelper.java:76)
    at com.extjs.JSBuilder2.copyResources(JSBuilder2.java:387)
    at com.extjs.JSBuilder2.main(JSBuilder2.java:43)
    Compressing output files...


  6. #6
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    21
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Looks like 225/226 is when it was fixed in the 3.3.x branch in core. Not sure about your building problem, there may be an issue in the core jsb2 file we're not aware of as we haven't created a separate core build in a little while now.

  7. #7
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    imat is on a distinguished road

      0  

    Default


    Ah in the 3.3.x branch, thanks :-)

    yeah for jsbuilder2 I dont know, I just extracted the jar from http://www.sencha.com/products/jsbuilder/
    and ran the above command, same results on any jsb2 file i've tried, using java -version 1.6.0_20.

    I looked at the revision and it doesnt look like it would have fixed the bug to me.
    Problem is that it use getComputedStyle to record previous state and el.style to reset it after.

    This is an important to me as it makes my app unusable (makes node sticky display:none)
    I'll try jsbuilder2 on another machine and stuff to try to build that;
    but please let me know if theres anything else I could do to help test.

Similar Threads

  1. Replies: 6
    Last Post: 19 Mar 2010, 2:32 AM
  2. ext.isArray side effect
    By atreyu in forum Community Discussion
    Replies: 1
    Last Post: 10 Apr 2008, 4:50 AM
  3. Replies: 6
    Last Post: 3 Mar 2008, 1:29 AM
  4. Element.DISPLAY not taking effect
    By super_drone in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 23 Jan 2008, 11:14 PM
  5. Element.getStyle()
    By ann0yanc3 in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 9 Apr 2007, 4:56 AM

Thread Participants: 2

Tags for this Thread