-
31 May 2010 6:34 AM #1
[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 :
-
31 May 2010 4:46 PM #2
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!
-
1 Jun 2010 4:46 AM #3
Ext version tested:
- Ext 3.2.0
- Ext 3.2.1
- Ext core 3.1.0
- ext
- Chrome 5.0
- Chrome 4.0
- Safari 4.0.5
- WinXP Pro
- 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 :
-
1 Jun 2010 6:18 AM #4
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!
-
28 Jul 2010 5:46 AM #5
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...
-
28 Jul 2010 2:15 PM #6Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
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.
-
29 Jul 2010 9:32 AM #7
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.
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[CLOSED-664] Ext.tree.TreePanel display error in WebKit / Adobe air
By piroman in forum Ext 3.x: BugsReplies: 6Last Post: 19 Mar 2010, 2:32 AM -
ext.isArray side effect
By atreyu in forum Community DiscussionReplies: 1Last Post: 10 Apr 2008, 4:50 AM -
[2.0.2]Ext.Element#getStyle() in IE breaks on error "style is null or not an object"
By Royan in forum Ext 2.x: Help & DiscussionReplies: 6Last Post: 3 Mar 2008, 1:29 AM -
Element.DISPLAY not taking effect
By super_drone in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 23 Jan 2008, 11:14 PM -
Element.getStyle()
By ann0yanc3 in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 9 Apr 2007, 4:56 AM


Reply With Quote