View Full Version : Opera (dissapointment)
Vladdy
03-29-2003, 07:48 PM
Dowloaded and installed Opera 7.03 with the hope that bugs I encountered in 7 beta were fixed. Their statement on the home page was also encouraging: The standards support in Opera 7 has been improved with added support for DOM level 2 and CSS2; improved ECMAScript and HTML 4.01 support;... :mad:
First thing I found that dynamic script node creation does not work.
Now, personally I do not care about Opera (why should I, if not only they do not care about being compliant, and claim more than they delivered), and I understand that the only way they can be "the fastest browser on earth" is by omitting support for a number of things. And that is fine if they specifically target PDA and other devices as their market niche, where size and speed takes over feature support.
What I'm curious about, why anyone would use it on a PC, when Mozilla is available for free without all the ads and such :confused: :confused: :confused: :confused:
scroots
03-29-2003, 07:57 PM
I have opera 6.0 add free and i didn't pay a cent. I have done nothing illegal either.
scroots
Graeme Hackston
03-29-2003, 08:35 PM
7 is a big improvement but still incomplete.
What I find odd is it gets event.srcElement. As I understand it that's IE only.
liorean
03-29-2003, 10:25 PM
Op7 uses dom Events, but the ie Event object, is I remember correctly. The reason for this is that since it identifies as ie, many scripts will fork it into the ie path, and then it needs to use an ie compatible Event object.
As for dynamic addition of script elements, yes it does support it. What op7 does wrong is that it doesn't set most attributes, and it doesn't do post-load reparsing. These taken together means you can't load scripts dynamically in it.
Here's a testing-bookmarklet I used to learn what exactly op7 doesn't support:
javascript:
script:{
var
script=document.createElement('script'),
src=document.createAttribute('src'),
type=document.createAttribute('type'),
id=document.createAttribute('id'),
aClass=document.createAttribute('class');
id.value='id'+Math.round(1e6*Math.random());
src.value='import.js';
type.value='text/javascript';
aClass.value='class';
script.setAttributeNode(id);
script.setAttributeNode(src);
script.setAttributeNode(type);
script.setAttributeNode(aClass);
document.getElementsByTagName('head')[0].appendChild(script);
}
testing:{
var tests={
scriptElm:script||'doesn\'t exist',
srcAttr:src||'doesn\'t exist',
typeAttr:type||'doesn\'t exist',
idAttr:id||'doesn\'t exist',
classAttr:aClass||'doesn\'t exist',
srcSpec:src&&src.specified,
typeSpec:type&&type.specified,
idSpec:id&&id.specified,
classSpec:aClass&&aClass.specified,
srcValue:src&&'"'+src.value+'"',
typeValue:type&&'"'+type.value+'"',
idValue:id&&'"'+id.value+'"',
classValue:aClass&&'"'+aClass.value+'"',
scriptInHead:script&&script.parentNode==document.getElementsByTagName('head')[0],
scriptSource:script&&script.outerHTML||(new XMLSerializer).serializeToString(script),
};
for(var i in tests)
alert(i+': '+tests[i]);
}
void('Coded by liorean');
See, id and class attributes are set, not src or type. Script elements aren't the only ones affected by this - all elements are. Also interesting to note is a dissimilarity between moz and op7 - moz doesn't set Attr.specified to true, while op7 does. Op7 doesn't lie about the attributes it doesn't set, though. those are set to false.
Graeme Hackston
03-29-2003, 10:46 PM
Thanks for the info liorean. I guess they have no choice but to identify as IE. Keeping in step with IE proprietory code must be no fun.
You've also explained why this doesn't work.
document.getElementById('myCSS').disabled=true
liorean
03-29-2003, 10:49 PM
Oh, and to show that the reparsing also is lacking, I you can use outerHTML:
javascript:
script:{
var
script=document.createElement('script');
script.outerHTML='<script id="id'+Math.round(1e6*Math.random())+'" src="http://liorean.web-graphics.com/test.js" type="text/javascript" class="class"></script>';
document.getElementsByTagName('head')[0].appendChild(script);
}
testing:{
var tests={
scriptElm:script||'doesn\'t exist',
srcAttr:script.src||'doesn\'t exist',
typeAttr:script.type||'doesn\'t exist',
idAttr:script.id||'doesn\'t exist',
classAttr:script.className||'doesn\'t exist',
scriptInHead:script&&script.parentNode==document.getElementsByTagName('head')[0],
scriptSource:script&&script.outerHTML,
};
for(var i in tests)
alert(i+': '+tests[i]);
}
void('Coded by liorean');
And finally, to show that the ie5m version doesn't work, either:
javascript:
script:{
var
div=document.createElement('div');
div.innerHTML='<script id="id'+Math.round(1e6*Math.random())+'" src="http://liorean.web-graphics.com/test.js" type="text/javascript" class="class"></script>';
document.body.appendChild(script);
}
testing:{
var tests={
divElm:div||'doesn\'t exist',
scriptElm:div.firstChild||'doesn\'t exist',
srcAttr:div.firstChild.src||'doesn\'t exist',
typeAttr:div.firstChild.type||'doesn\'t exist',
idAttr:div.firstChild.id||'doesn\'t exist',
classAttr:div.firstChild.className||'doesn\'t exist',
scriptInDiv:div.firstChild.parentNode==div,
divInBody:div.parentNode==document.body,
divSource:div.innerHTML,
};
for(var i in tests)
alert(i+': '+tests[i]);
}
void('Coded by liorean');
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.