How FireFox interprets style attributes

Necuno

Court Jester
Joined
Sep 27, 2005
Messages
58,567
I hate it when programmers who write code blames another piece of software for their ****ty code. You tell the PC what to do.

If you save "xyz" into the editor for your database and it saves as "yyyyyyyyyzzzzzzjajajajajajajajaa" then it's YOUR CODE. Not the browser who just sits there and interprets YOUR CODE into a viewable format.

it is them demonz :mad:
 

guest2013-1

guest
Joined
Aug 22, 2003
Messages
19,800
it is them demonz :mad:

Sometimes I really have to laugh at this. My previous boss usually said "If the PC tells you you're wrong, you are"

But most people are so adamant they're right (myself included) that it "can't be my code"

I've learned at least that I need to double triple check my stuff before blaming someone else...
 

cybershark

Expert Member
Joined
Apr 11, 2006
Messages
1,319
I've used FCKeditor a lot and I'm sure it's FCKeditor doing that and not Firefox.
 

IdlePhaedrus

Expert Member
Joined
Jan 31, 2005
Messages
1,582
A bit more on this. The code in FCKEditor was somewhat mixed up, and just getting FF to convince it that it was IE did not appear to be an option.

Then I checked out all the free editors mentioned here: http://www.geektips.net/119/best-free-wysiwyg-html-editor.html

All of them did exactly the same thing with the exception of TinyMCE, which also did it, but only in FireFoxe's "view source" not their own "view source", which was interesting, so I did some further investigation. I might have some of this wrong, it is all new to me, so don't get antsy if there is an incorrect observation, just be nice and point it out.

When FireFox (and all browsers I suppose) download and interpret a web page, they scan through the Document Object Model and compute internally how to present that page. These are known as computed styles, rather than 'inline styles'.

Now, when FCKEditor or any of the other editors above, besides TinyMCE switches to Source / HTML view, what it gets back from FF is the computed styles, not the original styles.

It would appear, that when accessing the DOM via javascript in the "standard" manner, whatever that might be, IE will return the original style attributes, but FF returns the computed style attributes, and this is why the original style attributes get lost in FF in these editors.

An interesting tool that helped in this investigation is the DOM inspector for FireFox described here: http://www.clagnut.com/blog/340/

It was using this that I found out about computed styles, and found that it was the computed styles that were going through to the text editors via javascript requests from FF.
 

Necuno

Court Jester
Joined
Sep 27, 2005
Messages
58,567
Sometimes I really have to laugh at this. My previous boss usually said "If the PC tells you you're wrong, you are"

But most people are so adamant they're right (myself included) that it "can't be my code"

I've learned at least that I need to double triple check my stuff before blaming someone else...

well sometimes it is the simplest ****ups that get you ex. instead of comparing the actual record id in sql for update, you use one of the other foreign id keys...
 

IdlePhaedrus

Expert Member
Joined
Jan 31, 2005
Messages
1,582
Have played around with TinyMCE because it would have been a preferred solution considering this CSS issue with Firefox, but it simply cannot handle tables as well as FCKEditor so it is not an option.

I think I am just going to disable HTML editing if it is being served to FireFox. It is only a back-end requirement. I never thought I would have to discriminate against FF, but there you go.
 

Necuno

Court Jester
Joined
Sep 27, 2005
Messages
58,567
lol, or maybe you should learn to properly design cross browser websites like most of us do here...
 

IdlePhaedrus

Expert Member
Joined
Jan 31, 2005
Messages
1,582
lol, or maybe you should learn to properly design cross browser websites like most of us do here...

The problem is not with my code, and it's cross-browser capability, it is with the OPENSOURCE html editor(s) that I am trying to use and THEIR cross browser capability, just to make that point crystal clear.

If you are so good at this cross-browser capability stuff, YOU find an in-line HTML editor that handles tables well, and does not use FireFox's computed styles instead of the original styles, given that the user who inputs the html has no knowledge of HTML or standards at all.

Your comment was singularly unhelpful and pretty pathetic given the amount of background given in my posts, which, you obviously have not taken the time to read.

<table cellspacing="0" cellpadding="0" width="600" border="1" style="border-right: medium none; table-layout: fixed; border-top: medium none; border-left: medium none; width: 600px; border-bottom: medium none; border-collapse: collapse">
<tbody>
<tr>
<td valign="top" width="234" style="border-right: 0.5pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: 0.5pt solid; width: 234px; padding-top: 0cm; border-bottom: 0.5pt solid"><span style="font-size: 10pt; font-family: Arial">One</span></td>
<td valign="top" width="161" style="border-right: 0.5pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: medium none; width: 160px; padding-top: 0cm; border-bottom: 0.5pt solid"><span style="font-size: 10pt; font-family: Arial">Two</span></td>
<td valign="top" width="206" style="border-right: 0.5pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: medium none; width: 206px; padding-top: 0cm; border-bottom: 0.5pt solid"><span style="font-size: 10pt; font-family: Arial">Three</span></td>
</tr>
</tbody>
</table>
 

Necuno

Court Jester
Joined
Sep 27, 2005
Messages
58,567
The problem is not with my code, and it's cross-browser capability, it is with the OPENSOURCE html editor(s) that I am trying to use and THEIR cross browser capability, just to make that point crystal clear.

If you are so good at this cross-browser capability stuff, YOU find an in-line HTML editor that handles tables well, and does not use FireFox's computed styles instead of the original styles, given that the user who inputs the html has no knowledge of HTML or standards at all.

Your comment was singularly unhelpful and pretty pathetic given the amount of background given in my posts, which, you obviously have not taken the time to read.

<table cellspacing="0" cellpadding="0" width="600" border="1" style="border-right: medium none; table-layout: fixed; border-top: medium none; border-left: medium none; width: 600px; border-bottom: medium none; border-collapse: collapse">
<tbody>
<tr>
<td valign="top" width="234" style="border-right: 0.5pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: 0.5pt solid; width: 234px; padding-top: 0cm; border-bottom: 0.5pt solid"><span style="font-size: 10pt; font-family: Arial">One</span></td>
<td valign="top" width="161" style="border-right: 0.5pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: medium none; width: 160px; padding-top: 0cm; border-bottom: 0.5pt solid"><span style="font-size: 10pt; font-family: Arial">Two</span></td>
<td valign="top" width="206" style="border-right: 0.5pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0cm; border-left: medium none; width: 206px; padding-top: 0cm; border-bottom: 0.5pt solid"><span style="font-size: 10pt; font-family: Arial">Three</span></td>
</tr>
</tbody>
</table>

when epenis too small use caps ? :rolleyes:,

i would suggest then stop putting in bananas into an automation and cry foul when oranges comes out unexpectedly- rather go learn why this is happening. ie really has some "bad habits" encoded at its core, where as it would asume or let it be rather than to be more inline with actual standards afaik.

furthermore i and definitely not some of us here are not your™ coding monkeys who will feed you on command, most of us has actually learn what we know by investigation and being resourceful over just wanting the spoon each time; have you actually opened a browser window and tried to look and learn for the answers ?

How to Search the Internet efficiently
 
Last edited:

IdlePhaedrus

Expert Member
Joined
Jan 31, 2005
Messages
1,582
Fine, you obviously have an issue with my coding skills, and my understanding of how browsers and HTML and CSS work.

However, you have not presented a resolution, or a helpful response, and generally just attacked me at a personal level.

Basically, you have just said "I can do it better than you, nah, nah, you're a f***wit, and aren't I just the greatest?"; well, I wish you the best of luck in your future endeavours, because, I don't think they are very bright.

I will no longer seek help from MyBB, the forum has quite obviously become degraded.

Good bye,
Phaedrus
 

Necuno

Court Jester
Joined
Sep 27, 2005
Messages
58,567
Fine, you obviously have an issue with my coding skills, and my understanding of how browsers and HTML and CSS work.

However, you have not presented a resolution, or a helpful response, and generally just attacked me at a personal level.

Basically, you have just said "I can do it better than you, nah, nah, you're a f***wit, and aren't I just the greatest?"; well, I wish you the best of luck in your future endeavours, because, I don't think they are very bright.

I will no longer seek help from MyBB, the forum has quite obviously become degraded.

Good bye,
Phaedrus

thank you and good luck :)
 
Top