Skip navigation.

Posts tagged with "compatibility"

IE8 Interoperability

, , , ...

The news that IE8 specially configures intranet pages to display in a compatibility mode is no surprise to me.

I blogged about Microsoft's compatibility problem several months ago, and decided that they needed two browsers - one for private intranets and one for the public Internet. All Microsoft have done here is roll all that into a single browser.

Håkon is wrong to complain about that. Microsoft have no choice unless they don't want any of their corporate customers to upgrade to IE8. How would that help improve web standards? No, the best way to improve web standards is to allow private sites backward compatibility, while allowing public sites to default to web standards. That will allow the maximum number of users to upgrade to the vastly more standards-compliant IE8, which in spite of how a lot of people feel, will eventually become the most widely-used browser.

Håkon is not wrong to complain about the broken page icon. Icons in status bars are usually there to draw your attention to them, indicating something important or a potential problem. From a users point of view, being in standards compliant mode is neither. All users care about is if the page looks and works OK. Web developers will ensure that will be true for their IE visitors. It is absolutely wrong to associate a broken page icon with standards compliant web pages and rendering modes.

What would be useful is an icon to indicate whenever the browser has had to guess how to handle broken page code - typically invalid HTML or CSS. Browsers should never have to guess. If they do, then web developers are relying on luck for correct display. Developers should want something more reliable than that, and their users certainly do!

That's really what everyone wants. That every web page should just work. No buttons, no icons, no special rendering modes (it's OK if the different modes are hidden, as they are now). Everyone agreeing to and using the same standard is the only way to get there.

Poor Javascript Coding Quality

, , ,

What is it with Javascript programmers these days? Doesn't anybody know how to program?

I was investigating why tinyMCE 2 (.1.3) is failing in Opera in some circumstances, and what did I find?

Exhibit 1:
if (tos.getEditorTemplate) editorTemplate = tos.getEditorTemplate(this.settings, this.editorId);
deltaWidth = editorTemplate.delta_width ? editorTemplate.delta_width: 0;
The if statement is there for a reason - to initialize editorTemplate to something useful - but what happens if the statement is false? editorTemplate does not get initialized. Look at the following statement - the potentially uninitialized editorTemplate is used! That would generate an error in any browser.

Exhibit 2:
getRng: function() {
  var s = this.getSel();
  if (s == null) return null;
  if (tinyMCE.isRealIE) return s.createRange();
  if (tinyMCE.isSafari && !s.getRangeAt) return '' + window.getSelection();
  if (s.rangeCount > 0) return s.getRangeAt(0);
  return null
},
isCollapsed: function() {
  var r = this.getRng();
  if (r.item) return false;
  return r.boundingWidth == 0 || this.getSel().isCollapsed
},
getRng is obviously capable of returning null. The very next function, isCollapsed, calls it and immediately uses the returned value without checking for null. That will generate an error in any browser.

It doesn't matter how other browsers somehow manage to avoid these obvious bugs - this is just plain crappy coding.

The worst thing is, this is typical of the sort of code that makes the web go. It's a wonder it works at all.

The Myth of the Robustness Principle

, , , ...

... As It Applies To The Web

The Robustness Principle (AKA Postel's Law) was conceived during the writing of the TCP Internet communications protocol, back in 1981. It is often quoted as:

Be conservative in what you send, liberal in what you accept.


Sometimes it is quoted on the Opera user support forums by people frustrated with Opera's seeming inability to handle web sites as well as Internet Explorer or Firefox. The reasons behind all the web compatibility problems are many and varied, and beyond the scope of this post. The purpose of this post is to show that the application of the Robustness Principle is at least partly responsible for some of the so-called Opera compatility problems.

Application of the Principle

When it comes to web browsers, it's typically the second part of the Principle that's stressed, never the first. The truth is, for robust "it just works" functionality, both parts are equally important.

It is vitally important that when faced with some hiccup in the data, browsers do not fall over. Hence, "be liberal in what you accept". It is just as important when sending data, to make sure that it conforms to all the published rules. Any communication involves at least two parties, and in order to be successful, the language used must be the same. If you're not certain exactly how your language may be interpreted by the receiver, you should make sure what you say is as simple and correct as possible. Hence, "be conservative in what you send".

Browser developers have almost turned themselves inside-out doing the "be liberal in what you accept" part. Web developers have virtually ignored the "be conservative in what you send" part.

What does "being conservative" mean for a web developer? At the very least it means the code should conform to published standards, namely the HTML/XHTML, CSS and ECMAScript standards from the W3C and ECMA organisations respectively. That's the only way to ensure that everybody (browsers and developers) are speaking the same language.

Where the specifications are clear, web developers should follow the spec. Where the specifications are unclear, or where they say things like "the results are implementation dependent", then web developers must expect different browsers to do different things and code accordingly (the most robust thing to do would be to avoid unclear functionality completely).

Beyond that, it also means web developers should limit themselves to features widely supported by most browsers. As an example, for nearly a decade HTML 4.01 has specified that you can align table cell contents on a character - for instance, "." to align on decimal points. Very handy for tables of numbers, yet I don't know of a single browser that supports that. (In the defence of browsers, support for that feature is not required.)

If you were to sample sites on the web at random, and test them to see if they conformed to published standards, you'd find probably more than 99% would fail. In essence, that means that web developers have failed to meet their half of the Robustness Principle.

However, even simply following the published rules is not enough. The fundamental problem with the Robustness Principle is that the rules change. Things that were incorrect and therefore ignored according to the Principle, can become correct and require specific behavior as they are implemented. As browsers implement new functionality their behavior naturally changes from earlier browsers that ignored unimplemented features. This is where some "incompatibilities" emerge.

WebForms2

WebForms2 is an extensive addition to the HTML specification. It adds significant functionality to the form controls provided by web browsers, including date (calendar) pickers and field format validation, among many others.

This new functionality has naturally required new HTML parameters (attributes) to be defined in order to request the new functionality. The problem is that many web sites were already using the same parameters for their own use!

The thing is, before WebForms2, the use of such parameters was illegal if you followed the HTML standard. Technically speaking, web sites should not have been using such parameters at all, but following the guide of the Robustness Principle, browsers silently accepted the illegal code.

Then a year or so back, Opera became the first browser to implement WebForms2. Web sites broke, because the illegal attributes they had been using suddenly took on new meaning and different functionality under WebForms2.

For example, this is the reason Opera cannot download printer drivers from the Epson Australia web site. One of the pages in the download process uses a WebForms2 parameter in such a way as to break the Epson Australia server scripts, which results in a never-ending loop of download questions, and Opera never getting to the actual download.

addEventListener

This is how standards-compliant browsers such as Opera, Firefox and Safari allow events to be used on web pages. This function takes three parameters: the type of event to be listened for, the function listening for the event (handling it), and a flag indicating if it is a "capturing" listener or not. Don't worry about what "capturing" means. The truth is, I don't really know the specifics! The specifics aren't important, anyway.

What's important is that up until a few months ago not one browser supported the "capturing" mode - the only mode they supported was the "non-capturing" mode. Following the Robustness Principle, if a web developer happened to request the "capturing" mode, the browsers all helpfully ignored that request and selected the "non-capturing" mode instead.

The problem is that a few months ago, Opera became the first browser to support the "capturing" mode. Suddenly, a good number of web sites stopped working. This was because they were requesting "capturing" mode event listeners, but were coded to only work correctly in the "non-capturing" mode. Browsers had previously accepted the unsupported "capturing" mode without a murmur, giving web developers no indication anything was wrong.

display:inline-block

This is a bit of CSS that is well-supported by Opera and Safari, poorly supported by Internet Explorer, and not supported at all by Firefox. Nevertheless, I have seen several web sites use it, and always in such a way that Internet Explorer ignored it. The result is that Internet Explorer and Firefox effectively ignored the command (following the Robustness Principle), while Opera and Safari understood and processed it. The result is a corrupted web site display in Opera and Safari, but a perfect looking web site in Internet Explorer and Firefox.

"display:inline-block" isn't the only problem CSS. Threads on the Microsoft TechNet forum have huge extra spaces all over the place. This is because the site uses "white-space:pre-wrap", which is again only supported by Opera and Safari. The forthcoming Firefox 3 adds support for that CSS, so Firefox 3 has worse compatibility with that site compared with Firefox 2.

Being Robust is not Being Compatible

This post should by now have clearly demonstrated that simple acceptance of incorrect code will have significant consequences later on. The pain avoided today is simply deferred until tomorrow.

In many ways, the Robustness Principle is actually creating a web that is less robust! It certainly does nothing to fix compatibility problems - rather it creates them!

The solution to web site compatibility problems cannot be found in the Robustness Principle.

No Clear Solution

There is no easy solution to these sorts of problems. The only real solution is to get web developers to avoid unsupported features and to rigorously stick to published rules for HTML, CSS and JavaScript. However, the first browser to dump the Robustness Principle and refuse to accept broken code would quickly become an outcast and ignored by both web developers and users alike.

Education, while keeping the Robustness Principle is in my opinion one of the better solutions. The best example of this I've seen is the iCab smiley. If all browsers could implement a similar feature it would provide a subtle hint to web developers that all is not right with their code. They might be less likely to produce incorrect code if they knew that their visitors could easily see that their code was incorrect.

Such a feature would not fix all incompatibility problems, but it would be a big step in the right direction.

Everybody - web surfers, web developers, browser developers - we all want a web that "just works". Blind acceptance of incorrect code is not the answer. The solution must lie elsewhere.

TPG Web Menus

, ,

There's been some discussion on the Opera forums about Opera and web compatibility, which has prompted me to blog this for future reference...

The navigation menus on the TPG web site are nearly unreadable in Opera, but fine in IE, Firefox, etc. More code Opera just can't handle?

Nope.

http://www.tpg.com.au/res/js/stm31a.js

These are old SoThink menus, long since updated by SoThink, but TPG persists in using them.

Line 1010:
nVER=parseFloat(a.substring(a.indexOf("Opera ")+6,a.length));


The menus are sniffing for "Opera " - note the space. That only appears in the User Agent string when Opera is identifying as Firefox or IE (which works around the problem). For Opera identifying as itself, the space isn't there, which results in the sniffing failing and the script determining that Opera is version 0! Which is too old for the script to handle.

The fix is trivial - delete the space:
nVER=parseFloat(a.substring(a.indexOf("Opera")+6,a.length));


I emailed the TPG web master many, many months ago (probably a year or two, now), giving them the exact file name, line number and change to make. Could they find the time to delete a single character? I guess not. :frown:

Opera 10 is too old! Again!

, ,

Last post I talked about a website with broken version sniffing. It's now been a little over a week since then. I emailed them at the time, but have yet to receive a reply of any sort. The problem still exists, so I don't feel guilty at all about naming that web site now...

:hat: Congratulations to ... The Australian Bureau of Meterology!

... and their browser sniffer: http://mirror.bom.gov.au/products/IDR.browser_check.v07.js

The "good" news is that Opera is far from the only application to suffer from this sort of short-sightedness. I mentioned that IE has the same problem on the same site, and a comment to my previous post mentions Flash version sniffing with the same affliction.

Although the cynic in me suspects that sites will have different Flash version sniffing code for different browsers, and only the path followed by Opera will have the bug. I will be very happy to be wrong, though!

EDIT: It's now 19-December-2008, and I've just received notification from the BOM that they have fixed their code. Finally!

Opera 10 is too old!

, , ,

Not that Opera have released version 10 (yet!), but it looks like at least one site is going to reject Opera when they do. And where there's one site, no doubt there's hundreds of others :frown: Thankfully, a quick search doesn't quickly turn up anything similar, although there are plenty of other bad examples.

Anyway, here's the problem code:
if (navigator.userAgent.toLowerCase().indexOf("opera") != -1)
{
   isOpera = true;
   i = navigator.userAgent.indexOf("Opera") + 6;
   v = parseInt(navigator.userAgent.substring(i, i+1));
   if(v < 7)
      isOperaOld = true;
}
Need a clue? The substring will return exactly one character - the first digit of the version. Still need help? Version 10 will be identified as version 1.

If you're one of those people irritated at how poorly Opera appears to handle web site scripting - this is one of the bigger reasons. It's straight-out careless programming without thought.

I'll mention that the site in question isn't delivering bugs to just Opera. Their corresponding IE code had the exact same problem, except that IE is quite a bit further away from version 10 than Opera.

The problem remains for Opera:
  1. Opera release version 10.
  2. Web sites stop working in Opera, all other browsers work fine.
  3. "Opera is a crappy browser, never works!"
Yet, where is the bug? What should Opera do about it? Never release a browser with a version where the first digit is between zero and six inclusive? Will the Opera after 9.5 be 70.0? :insane:

UPDATE: Bit late, but Hallvord has blogged on this too: 10 is the one.

Cloaked document.all support

, , ,

For the latest Opera snapshot, hidden document.all functionality has been implemented.

Even if this results in some web sites breaking, this is good news on the "web site compatibility" front, as now all non-IE browsers (Opera, Firefox and Safari) now handle document.all in more-or-less the same way. Web developers love consistency!

D-Link Sucks

, , ,

I've recent bought a rather fancy D-Link PoE Switch, specifically a DES-1316 "Web Smart Switch".

s/Smart/Dumb/


I cannot surf to it using Opera, but I can with IE, Firefox, and even Safari. The reason is that the switch totally violates the HTTP protocol spec and does not output any HTTP headers! All it sends is the content. It's up to the browser to guess what sort of data is coming back! :faint:

It also doesn't help when a request for "logo.gif" returns a JPEG image!

I'm absolutely astounded that anybody could come up with such a brain-dead implementation. Heck, I've got an 8-bit microcontroller HTTP server implementation (which includes an Ethernet and TCP/IP stack too) that manages to conform to the HTTP protocol in less than 32KB. I'm sure the switch has a little more grunt behind it than that.

I'm also disappointed that the other browsers, especially Firefox and Safari (I have no expectations from IE), actually accept this rubbish.

The D-Link response to my emailed query was also predictable:

...we do not officially support Opera browser on the DES-1316. We would like to suggest you use Firefox or IE6/7...



And why should D-Link withdraw their heads from their rear passages when other browsers are being so "nice"?

This looks like another case where Opera have to once again descend into the gutter...

bug 298653

FoxSports Cricket Pages

,

For a while I've been wondering why the "on strike" cricket bat on the FoxSport cricket results pages (example) has been misplaced in Opera, but OK in Firefox and IE. The HTML code is:
<strong class="on-strike" title="On strike">On strike</strong>
which looks simple enough. The cricket bat image is put in using CSS styles.

It turns out the problem is caused by the CSS styles, and the way the site works around IE bugs and a Firefox missing feature. The styles in question are at the end of http://www.foxsports.com.au/css/ashes/0,24345,,00.css :
.on-strike {
display:inline-block;
text-indent:-9000px;
width:21px;
height:22px;
position:absolute;
margin-top:-4px;
margin-left:2px;
background: transparent url("/images/bat.gif") 0 0 no-repeat;
}

* html .on-strike {
position:static;
display:inline;
}
The on-strike element is a <strong>, which by default is an inline element. The CSS standards say that text-indent and width/height do not apply to inline elements - they only apply to block elements. The text-indent is needed to shift the text off the screen and the width/height are needed for the cricket bat image to show correctly.

IE has buggy inline support, which allows the text-indent and width/height to be applied as the site requires.

Firefox and Opera follow the standards, so the site has ensured they don't get IEs inline styling via the "* html" hack. Firefox doesn't support display:inline-block, so the site works around that by specifying position:absolute, which forces the browser to treat the element as a block. Opera supports both display:inline-block and position:absolute and the combination of the two results in the misplaced cricket bat.

If display:inline-block is removed from the styles, Opera displays the page just like Firefox, i.e. correctly.

What I don't understand is why the site didn't ditch all the styling funny business and just have:
<img src="/images/bat.gif" width="21" height="22" alt="On strike" title="On strike" />
:confused:

Broken DPI Licensing Site

, , ,

I'm quite convinced now that the web is built almost exclusively by people who have no idea what they're doing. They plug away with some random code, poking and prodding until it works in whatever browser they happen to be using (usually some recent version of Internet Explorer).

Take for example my local government Department of Planning and Infrastructure. They have a Licensing service where you can pay your license fees online. Clicking the "Pay online here" link at the top right takes you to a page with a simple "Go to online payments" button. Clicking that button in Opera takes you to a 404 page, while in IE and Firefox you see the correct payments page.

Another Opera bug? Hardly. Here's the relevant code in full:
function snif() {
  var fullAppStr=navigator.appName;
  var fullVerStr=navigator.appVersion;
  var mac = fullAppStr.indexOf("acintosh");
  var msie = fullAppStr.indexOf("icrosoft");
  var verStr = fullVerStr;                
  if (fullVerStr.indexOf('[')>0)  {
    verStr = fullVerStr.substring(0,fullVerStr.indexOf('['));
  } 
  else {
    verStr = fullVerStr.substring(fullVerStr.indexOf('MSIE')+4,fullVerStr.length);
    verStr = verStr.substring(0,verStr.indexOf(';'));
  };       
  // msie < 5.0 or navigator < 4.75
  if ( ( (msie >= 0) && (parseFloat(verStr) < 5.0) ) ||
       ( (msie < 0) && (parseFloat(verStr) < 4.75) ) ) { 
    payWin=open("settings.html", "displayWindow","width=700,height=400,status=no,toolbar=no,menubar=no,scrollbars=yes,resize=yes,top=100,left=35");
  } else {location.href='https://paylicence.transport.wa.gov.au/trelisWeb/trelis_jump_start/singlePayment.html'};            
}
Boiled down, it works out that non-IE browsers that have the digits 0, 1, 2, 3 or 4 as the fourth character in their navigator.appVersion string will be sent to the non-existent settings page, all others will be sent to the payment page.

IE goes to the payment because its navigator.appVersion string is "4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" - it has "MSIE" in the string, which means the "6.0" version is correctly parsed out.

Firefox goes to the payment page because its navigator.appVersion string is "5.0 (Windows; en-US)" - the fourth character is a space, which becomes version NaN (not a number). Any comparsion with NaN is false, which lets Firefox through to the payment page.

Opera gets sent to the settings page because its navigator.appVersion string is "9.10 (Windows NT 5.1; U; en)" - the fourth character is "0", which becomes version zero - too old!

To get past this code in Opera is simple - change the site-specific preferences to get Opera to Identify as Firefox or Internet Explorer. However, you then bump into server-side browser sniffing on the payment site - Opera gets an XML file with error data. The solution is the same.

It's always disappointing when Opera is stymied by such inempt programming. Most users would just see another site that doesn't work in Opera - nudging them back to IE or Firefox (or whatever they used before Opera) - even though the fault lies with the site, not Opera.
Download Opera, the fastest and most secure browser
November 2009
S M T W T F S
October 2009December 2009
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30