[SOLVED] Problem with GetStyle ?


Samuel Vanneste

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) :
[list=*]

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

  • Opera : style applied in full


  • The test app could be downloaded here

    Thanks


    decsoft

    Hello Samuel,

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



    Samuel Vanneste

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


    decsoft

    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"... :)



    decsoft

    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.



    Samuel Vanneste

    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 :))


    decsoft

    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?


    Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

    This website uses some useful cookies to store your preferences.

    I agree. Hide this note. Give me more information.