Opera's getComputedStyle returns incomplete data

Forums » Dev.Opera » General Web Development Discussions

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

30. July 2008, 23:20:56

cmawhorter

Posts: 1

Opera's getComputedStyle returns incomplete data

Opera's getComputedStyle is returning a value different from every other browser -- which I'm going to call wrong.

For example:

h1#logo { font-family: "Font Doesn't Exist", Arial; }


If I were to call getComputedStyle on #logo it would return [Arial] instead of ["Font Doesn't Exist", Arial]. I can see where Opera is coming from and it does make a little bit of sense to return the actual rendered style but I don't think it's appropriate. All other browsers return a correct value, even IE, albeit through their ghetto function.

I found this post which provides an unsolution: get Fontfamily from stylesheet - http://dev.opera.com/forums/topic/228179

Are there any other suggestions to getting the result I am expecting? Walking through the actual CSS file is unacceptable and impossible. Opera has been my browser for years and I always try to support it with everything I do but if there isn't a good solution for this I won't be able to on this project.

Other than that... keep up the good work. Dragonfly is looking good. It'd be great if it supported console.log, error, etc. and a multiline console.

On a side note:

I just upgraded the latest Opera and tried to take the survey offered on the download page and at least one question doesn't function correctly. Specifically the question asking to rate several features from 1-11. It will only let you choose any of the ratings once before it erases the previous selection.

On another side note:

This editor isn't working... I can't bold or italic anything. Highlighting and clicking on the buttons does nothing.

Thanks for reading.

10. November 2008, 15:31:06

Opera Software

hallvors

Opera Software

Posts: 1668

Originally posted by cmawhorter:

Opera's getComputedStyle is returning a value different from every other browser -- which I'm going to call wrong.

For example:

h1#logo { font-family: "Font Doesn't Exist", Arial; }


If I were to call getComputedStyle on #logo it would return [Arial] instead of ["Font Doesn't Exist", Arial].



This was by design but will be "fixed" smile

I can see where Opera is coming from and it does make a little bit of sense to return the actual rendered style but I don't think it's appropriate.



I thought the main point of getComputedStyle() would be to get the values that are actually used for rendering (though I'm possibly not tuned in to the CSS 2.1 definition of "computed")

All other browsers return a correct value, even IE, albeit through their ghetto function.

I found this post which provides an unsolution: get Fontfamily from stylesheet - http://dev.opera.com/forums/topic/228179

Are there any other suggestions to getting the result I am expecting? Walking through the actual CSS file is unacceptable and impossible. Opera has been my browser for years and I always try to support it with everything I do but if there isn't a good solution for this I won't be able to on this project.



I don't know any workaround either. But one major version update or so later things should work.

This editor isn't working... I can't bold or italic anything. Highlighting and clicking on the buttons does nothing.



Indeed. A script that expects <form id="replyform"> is used with markup <form id="postform">. Will complain..
--
My blog: miscoded
Stupid code from major websites uncovered and criticised
Contribute site fixes! - OTW&TA- all sites must work

Forums » Dev.Opera » General Web Development Discussions