Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

strict mode/casual mode or developer mode/surfer mode

0 views
Skip to first unread message

Martin Schrode

unread,
Oct 5, 2002, 3:33:18 AM10/5/02
to
For developers, when creating HTML pages, it would be good if Opera
would use a strict rendering mode. If there's an error, stop displaying
the page. For casual surfing it would be best if Opera would try to do
some guessing. So I'd like to be able to toggle between developer and
surfer mode.

Marek Mänd

unread,
Oct 5, 2002, 5:44:50 AM10/5/02
to
"Martin Schrode" <use...@schrode.net> wrote

If you write clean code, there are no errors in it.
If there are, then these errors are on parser side
and you dont have the power and influence over them...
And why would you want to write erroneous code in the first place? =S

But seriously - if that mode gets implemented it should be possible
to enable only through menus-preferences and not through some
by default install appearing button as it makes no sense for
an average houswife - would be only confusing...

marekmand

Vladimir Georgiev

unread,
Oct 5, 2002, 6:44:05 AM10/5/02
to

Probably Martin wants to use Opera as a kind of validator when he writes
pages. May be that's why he needs the developper mode. This would mean
that doesn't want to write erroneous code. He probably even wants to
write error-free code (as in fact I would also like me to write :-)

And he needs the surfer mode when he onyly wants to have an usual
surfing experience.

Timothy J. Luoma

unread,
Oct 5, 2002, 1:09:45 PM10/5/02
to

This would be a good option. Amaya does something like this, I think,
but it lacks so much functionality that you can't really use it.

Martin pointed out a few mistakes I had made in the 30 Days series,
which was XHTML 1.0 Strict. But mistakes happen. I had checked it
several times, but the mistakes were subtle enough that I hadn't seen
them, and Opera was able to error-correct enough that I didn't see the
problem.

With the mistake that I had made (I removed a <span> without removing
the </span>) it would be easy to spot and throw and error, saying:

"line 37: closing tag found without opening tag: </span>"

TjL


--
30 Days to becoming an Opera Lover http://www.tntluoma.com/switch
Day 30: And More... http://tntluoma.com/opera/lover/day30-andmore/
OperaBlog: Beyond30 http://tntluoma.com/opera/beyond30/

Tim Altman

unread,
Oct 5, 2002, 5:00:06 PM10/5/02
to
On Sat, 05 Oct 2002 13:09:45 -0400, "Timothy J. Luoma"
<tj_l...@hotmail.com> wrote:

>Martin Schrode wrote:
>> For developers, when creating HTML pages, it would be good if Opera
>> would use a strict rendering mode. If there's an error, stop displaying
>> the page. For casual surfing it would be best if Opera would try to do
>> some guessing. So I'd like to be able to toggle between developer and
>> surfer mode.
>
>This would be a good option. Amaya does something like this, I think,
>but it lacks so much functionality that you can't really use it.
>
>Martin pointed out a few mistakes I had made in the 30 Days series,
>which was XHTML 1.0 Strict. But mistakes happen. I had checked it
>several times, but the mistakes were subtle enough that I hadn't seen
>them, and Opera was able to error-correct enough that I didn't see the
>problem.
>
>With the mistake that I had made (I removed a <span> without removing
>the </span>) it would be easy to spot and throw and error, saying:
>
>"line 37: closing tag found without opening tag: </span>"

Why not just validate your code...?

--
Tim Altman

roy...@myrealSP-AMbox.com
No SP-AM is good spam.

Marek Mänd

unread,
Oct 6, 2002, 6:45:02 AM10/6/02
to
"Tim Altman"
> Why not just validate your code...?

People are laizy - you know =)
And why validate - why not just write cean code in the first place...?

marekmand

Tim Altman

unread,
Oct 6, 2002, 9:40:59 AM10/6/02
to
On Sun, 6 Oct 2002 13:45:02 +0300, Marek Mänd <cador.soft@@mail.ee>
wrote:

You can write clean code and still make mistakes. We're not
perfect, you know. ;)

Timothy J. Luoma

unread,
Oct 6, 2002, 9:41:35 AM10/6/02
to

People make mistakes in web pages for the same reasons that people make
mistakes anywhere else, including spelling mistakes.

The difference is that mistakes here can cause the page to render
incorrectly.

I don't intend to write bad code.

I do validate my pages.

But mistakes in HTML can happen the same way mistakes happen in any
"language":

- people might make mistakes that they don't realize (not as familiar
with the language as some other people)

- people might make mistakes that are unintentional (hrm...
unintentional mistake... that might be a little tiny bit redundant... I
don't know that one could make an intentional mistake, after all, how
could you then say it was a mistake?).

Anyway, I can't tell you how many times I've written a page and then
decided to clean something up and accidentally left a </div> or a
</span>... if it is a quick edit, you might not always validate.

And it gets harder to deal with the more complicated the site gets, and
as you grow from building static pages to using scripting like PHP where
one "page" comes from several source files.

Rijk van Geijtenbeek

unread,
Oct 6, 2002, 9:40:04 PM10/6/02
to
On Sun, 06 Oct 2002 09:41:35 -0400, "Timothy J. Luoma"
<tj_l...@hotmail.com> wrote:
>Marek Mänd wrote:
>> "Tim Altman"

>>>Why not just validate your code...?

..

>Anyway, I can't tell you how many times I've written a page and then
>decided to clean something up and accidentally left a </div> or a
></span>... if it is a quick edit, you might not always validate.

That's a problem I recognize :)
If you'd send your pages as text/xhtml+xml, Opera would treat them like
well formed XML instead of like tagsoup, and stop parsing after it finds
an error.


--
If you don't like having choices | Rijk van Geijtenbeek
made for you, you should start | Documentation & QA
making your own. - Neal Stephenson | mailto:ri...@opera.com

Timothy J. Luoma

unread,
Oct 7, 2002, 5:43:59 PM10/7/02
to
Rijk van Geijtenbeek wrote:

> If you'd send your pages as text/xhtml+xml, Opera would treat them like
> well formed XML instead of like tagsoup, and stop parsing after it finds
> an error.

LOL.... and that would only shut out how many browsers?

quick test.... Moz 1.1 and IE6 don't show it, but Opera6.05 does ;-)

Hrm... I suppose I could sniff for Opera and send it a different file type.

Rijk van Geijtenbeek

unread,
Oct 7, 2002, 7:57:14 PM10/7/02
to
On Mon, 07 Oct 2002 17:43:59 -0400, "Timothy J. Luoma"
<tj_l...@hotmail.com> wrote:

>Rijk van Geijtenbeek wrote:
>
>> If you'd send your pages as text/xhtml+xml, Opera would treat them like
>> well formed XML instead of like tagsoup, and stop parsing after it finds
>> an error.
>
>LOL.... and that would only shut out how many browsers?
>
>quick test.... Moz 1.1 and IE6 don't show it, but Opera6.05 does ;-)
>
>Hrm... I suppose I could sniff for Opera and send it a different file type.

I admit that the intended audience of the Opera Lover series is mainly
non-Opera users :)

Leons Petrazickis

unread,
Oct 8, 2002, 10:46:29 PM10/8/02
to
Marek Mänd wrote:
> by default install appearing button as it makes no sense for
> an average houswife - would be only confusing...

Ditto for the average househusband. In fact, that applies to any average
housespouse.

Is Opera aimed at the average housespouse market anyways?:)

Leons Petrazickis
import java.lang.disclaimer;

Christoph Schneegans

unread,
Oct 9, 2002, 8:33:16 AM10/9/02
to
Rijk van Geijtenbeek wrote:

> If you'd send your pages as text/xhtml+xml, Opera would treat them
> like well formed XML instead of like tagsoup, and stop parsing
> after it finds an error.

text/xhtml+xml? application/xhtml+xml is registered, and Opera supports
it, as well as text/xml and application/xml. What's the sense of
another MIME type for XHTML?

--
<http://schneegans.de/>

Howard Brazee

unread,
Oct 9, 2002, 9:40:04 AM10/9/02
to

On 8-Oct-2002, Leons Petrazickis <spamsuxPET...@sprint.ca> wrote:

> Ditto for the average househusband. In fact, that applies to any average
> housespouse.
>
> Is Opera aimed at the average housespouse market anyways?:)

If not, whom is it aimed for?

One target is people who don't have lots of resources - which sounds like a
house spouse more than an office worker. (Office workers often don't have a
choice about which browser they use).

Of course when house spouses can't get to their bank's web page, they switch to
a browser that does work there.

Jonny Axelsson

unread,
Oct 9, 2002, 10:58:36 PM10/9/02
to

I think the MIME type application/xhtml+xml was intended. I find the strict
to draconian error handling in XML to be very helpful as an author. It is
more immediately annoying (if you do forget a </span>, you will get an error
message instead of the rest of the page), but it is a real time saver in the
longer run as you will not be as plagued with the subtle ways of failing
(some Javascript or style that doesn't work as intended on browser X).

The XML window is really a debugger, though it is more cryptic than it needs
to be. The fatal error messages always include two numbers NN:MM, where NN
is the line number where the error was discovered and MM is the character
position in that line. This is truly helpful, especially as it only triggers
on well-formedness errors (the nasty sort of error that is particularily
likely to cause problems) and not on validity errors (for those you need to
use the validator). Well-formed first, valid afterwards makes a lot of
sense.


Jonny Axelsson,
Documentation,
Opera Software

Kevin W

unread,
Oct 10, 2002, 4:05:41 AM10/10/02
to
Rijk van Geijtenbeek wrote:
> If you'd send your pages as text/xhtml+xml, Opera would treat them like
> well formed XML instead of like tagsoup, and stop parsing after it finds
> an error.

Really?? Can we have an example, please?

Also, would this work if I set the MIME type on a local drive (Windows98
> Start > Settings > Folder Options > File Types > XHTML file > Edit >
Content Type (MIME) = application/xhtml+xml). I tried it and Opera
still parsed my bad markup, probably because setting the MIME type this
way doesn't really set the MIME type.

Jonny Axelsson

unread,
Oct 10, 2002, 4:58:27 AM10/10/02
to
On Thu, 10 Oct 2002 18:05:41 +1000, Kevin W <kev...@fastem.com.invalid>
wrote:

> Really?? Can we have an example, please?
>
> Also, would this work if I set the MIME type on a local drive (Windows98
> > Start > Settings > Folder Options > File Types > XHTML file > Edit >
> Content Type (MIME) = application/xhtml+xml). I tried it and Opera
> still parsed my bad markup, probably because setting the MIME type this
> way doesn't really set the MIME type.

What version of Opera do you have? This MIME type is rather recent. We added
it as soon as the RFC came out, but that still means that versions of Opera
earlier than 6.0 will not process it. This really doesn't matter. You can
still use text/xml or application/xml for the same effect.

What does matter is the namespace. If it hasn't got the XHTML namespace, it
isn't XHTML. Make sure the document starts with:

<html xmlns="http://www.w3.org/1999/xhtml">

The XML namespace attribute (xmlns) will be treated as an unknown attribute
by an HTML browser (or Opera if you later save the same document as .html,
text/html), so apart from that the document will no longer validate as HTML
4.01, it will do no harm.


You can also (in Opera and Mozilla) add XHTML to any XML document with the
same mechanism, but in this case you should use the prefixed version:

<paragraph>Some arbitrary XML with <x:a href="http://www.example.org"
xmlns:x="http://www.w3.org/1999/xhtml">an HTML link</x:a> embedded.
</paragraph>

For "x" you can use any string, but for IE compatibiliry it is best to use
"html", that is <html:a ...>...</html:a>.

Timothy J. Luoma

unread,
Oct 10, 2002, 12:31:01 PM10/10/02
to
Kevin W wrote:
> Rijk van Geijtenbeek wrote:
>
>> If you'd send your pages as text/xhtml+xml, Opera would treat them like
>> well formed XML instead of like tagsoup, and stop parsing after it finds
>> an error.
>
> Really?? Can we have an example, please?

Sure:

http://www.tntluoma.com/tests/badlyformed.xhtml

> Also, would this work if I set the MIME type on a local drive (Windows98
> > Start > Settings > Folder Options > File Types > XHTML file > Edit >
> Content Type (MIME) = application/xhtml+xml). I tried it and Opera
> still parsed my bad markup, probably because setting the MIME type this
> way doesn't really set the MIME type.

Try adding this line:

<meta http-equiv="content-type"
content="application/xhtml+xml; charset=iso-8859-1" />

in the <head> </head>

TjL

ps -- I talked about this topic on 'beyond30' today:

http://tntluoma.com/opera/beyond30/

--
30 Days to becoming an Opera Lover http://www.tntluoma.com/switch

OperaBlog: Beyond30 http://tntluoma.com/opera/beyond30/

Kevin W

unread,
Oct 13, 2002, 2:46:25 AM10/13/02
to
Timothy J. Luoma wrote:
> http://www.tntluoma.com/tests/badlyformed.xhtml

Thanks, that's cool!

> Try adding this line:
>
> <meta http-equiv="content-type"
> content="application/xhtml+xml; charset=iso-8859-1" />

Hmm... that doesn't work. Doesn't matter anyway.

0 new messages