#1 2016-07-14 18:11:05

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

[SOLVED] Problem with GetStyle ?

Hello,
Could it be possible that the behavior changed for that action ? I have tested with the "background" CSS property and get different results depending on the browser used (webapp) :

  • debugger, Internet Explorer, Edge, Firefox : style not applied and not got

  • Opera : style applied in full

backgroundstyle.png

The test app could be downloaded here

Thanks

Last edited by svanneste (2016-07-14 18:27:05)

Offline

#2 2016-07-14 18:23:30

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [SOLVED] Problem with GetStyle ?

Hello Samuel,

Try to use "background-color" instead of "background".

Offline

#3 2016-07-14 18:26:49

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [SOLVED] Problem with GetStyle ?

Thanks David. It was under my eyes ; I must be more careful in the future

Offline

#4 2016-07-14 18:29:42

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [SOLVED] Problem with GetStyle ?

Hello Samuel,

Please, don't worry at all! "background" is and old CSS property that probably is now deprecated. But may I am wrong: I just try with "background-color" and find it working. On the other hand, when something works in one browser, but not in others... probably we must to follow the "others"... smile

Offline

#5 2016-07-14 18:33:39

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [SOLVED] Problem with GetStyle ?

Hello Samuel,

Ok. Apparently "background" is not deprecated, so, for some reason that I can't understand, major browsers complains about when retrieve such property. Since we can use another CSS property for the same thing... and they works... probably we no need to go ahead, IMHO.

Offline

#6 2016-07-14 18:37:37

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [SOLVED] Problem with GetStyle ?

Hello David,

Yes, we must be careful with such CSS properties (in fact, I will apply the style by reading each, that's not a problem at all now that we know why it acts like this smile)

Offline

#7 2016-07-14 21:13:33

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: [SOLVED] Problem with GetStyle ?

Hello Samuel,

Well. The problem is apparently the way in which App Builder retrieves the CSS properties. They use the "ComputedStyle" way, and, for some reason (and in some browsers) they appear to don't return the expected value for "shorthand" properties like "background".

Probably this is like that because such kind of properties can contains more than one value... then the behind function can't return a computed value at all. This doesn't happend with "background-color", since they are a property that have just one value, which can be computed and then returned without problems.

I can't found information about this right now, but my bid is for this Samuel, since they have some logic, do you?

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.