PDA

View Full Version : [FIXED-1061] Ext.ux.Portal: style issue in Google Chrome



BroadridgeSF1
17 Jun 2010, 1:23 PM
http://www.sencha.com/deploy/dev/examples/portal/portal.html

If you view the above example in Google Chrome, the third column doesn't get the style defined:
style:'padding:10px'

Anyone any idea?

BroadridgeSF1
18 Jun 2010, 9:19 AM
21018

Condor
18 Jun 2010, 11:30 AM
This has been reported before.

Unfortunately, it's a bug in Chrome (The V8 engine is loosing the RegExp.exec progress after the second call) and can't be fixed in Ext.

BroadridgeSF1
18 Jun 2010, 12:52 PM
I personally think this is an issue with 3.2. It works fine in 3.1.1, but since the upgrade to 3.2, it is broken in chrome.

So, I am saying that it worked fine in Chrome in version 3.1.1. It is broken in 3.2.

Are you saying that the RegExp.exec progress issue wasn't there in 3.1.1?

evant
27 Jun 2010, 9:20 PM
It's been resolved in SVN. The regex used for applyStyles has been changed and as such was subject to this issue:

http://stackoverflow.com/questions/2645273/javascript-regular-expression-literal-persists-between-function-calls

uptodate
28 Jun 2010, 11:28 PM
have you a fix for this problem or a override function to fix the problem in my application ? thx for helps

acidtonic
4 Jul 2010, 9:04 PM
I'm also hit by this in my application. Any workaround for the rest of us/

Condor
4 Jul 2010, 9:53 PM
This patch should do the trick:

(function(){
var cssRe = new RegExp("([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?", "gi");
Ext.DomHelper.applyStyles = function(el, styles){
if (styles) {
var matches;
el = Ext.fly(el);
if (typeof styles == "function") {
styles = styles.call();
}
if (typeof styles == "string") {
while ((matches = cssRe.exec(styles))) {
el.setStyle(matches[1], matches[2]);
}
} else if (typeof styles == "object") {
el.setStyle(styles);
}
}
};
});

uptodate
5 Jul 2010, 10:32 PM
thx condor this helps

acidtonic
6 Jul 2010, 8:27 PM
I don't believe this is working for me. Unless I'm applying it wrong... Just run this at the beginning of Ext.onReady correct?

My behavior is basically the first portal that loads has two .50 width columns. The left most side will be shifted up by about 5 or 10 pixels and every other portal loaded after will be correct. My app has tabs each with a portal and rearrangeable graphs. Only on Chrome does this happen. (5.0.375.86 (49890) Ubuntu 10.04).

So I assume one of three things.

1. I'm applying it wrong.
2. My issue is a different one so this patch doesn't apply to me.
3. This patch might only fix the issue for a specific version of chrome and mine is still broken.

I'm not getting any errors and the page works fine with the fix attached... the padding bug is still present though. My source looks like this.....


Ext.onReady( function () {
(function(){
var cssRe = new RegExp("([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?", "gi");
Ext.DomHelper.applyStyles = function(el, styles){
if (styles) {
var matches;
el = Ext.fly(el);
if (typeof styles == "function") {
styles = styles.call();
}
if (typeof styles == "string") {
while ((matches = cssRe.exec(styles))) {
el.setStyle(matches[1], matches[2]);
}
} else if (typeof styles == "object") {
el.setStyle(styles);
}
}
};
});
//My widgets here

Condor
6 Jul 2010, 10:39 PM
1. It's better to include the patch before Ext.onReady, but your method isn't wrong.
2. Could be.
3. Could be.

You'll have to post your code to see if your code or Chrome RegExp caching is the problem.