[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?


    Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

    Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

    Bien. Ocultar esta nota. Obtener más información.