0

Is there a way to avoid HTML 5 parser ? My app has the following doctype:

DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"

And I wish that it's interpreted with HTML4 definitions not HTML5

EDIT:

My question reason is to solve this: Chrome popup Please Fill Out this Field

Community
  • 1
  • 1
TiagoDias
  • 1,785
  • 1
  • 16
  • 21
  • What HTML 5 parser are you referring to? – Arjen Apr 12 '11 at 15:07
  • Why? HTML5 adds to and builds on HTML4.01. Anything valid in HTML4.01 will not trip up an HTML5 parser. In practice, browsers do not include separate parsers for each version of HTML. One parser will cover DOCTYPE-less HTML, HTML2.0, and HTML5. – TRiG Apr 12 '11 at 15:09
  • I think it will be parsed as HTML 4, as the HTML5 doctype doesn't contain any version information like " " – Naren Sisodiya Apr 12 '11 at 15:09
  • Could you explain, why you need this? For a web developer the parser used by the browser shouldn't make much of a difference. – RoToRa Apr 12 '11 at 15:11
  • 1
    @TRiG — ` – Quentin Apr 12 '11 at 15:11
  • @David. Good point. (Interestingly, the main W3 Validator accepts that, but the W3 Unicorn validator doesn't like it.) – TRiG Apr 12 '11 at 15:34
  • @TRiG — it passed the Unicorn HTML validation when I checked it. It just fell over when the CSS parser tried to find CSS in it. – Quentin Apr 12 '11 at 15:43

3 Answers3

3

New answer based on updated question:

It isn't the HTML 5 parsing rules you have a problem with, it is support for HTML 5 attributes. No, you can't override this. If you don't want to use things that are new in HTML 5 — don't use them in your document!


Original answer:

No, there isn't.

The HTML 5 parsing rules are mostly "What browsers have been doing for the last decade and a half anyway".

This just lets us get away from having perfectly valid SGML features with limited support in the language (and validators which pass them as valid).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

You problem has nothing to do with HTML 4 and HTML 5 (and not even their parsers). It has to do with that fact, that you invented your own non-standard attributes (which you shouldn't have done in the first place), and now new standardized attributes (or attributes in the process of being standardized) are colliding with them.

See also my answer at the your other question.

Community
  • 1
  • 1
RoToRa
  • 37,635
  • 12
  • 69
  • 105
0

Thank U All but specially thank to me college who knew how to solve my problem:

http://www.w3.org/TR/html5/association-of-controls-and-forms.html#attr-fs-formnovalidate

You can disable the validation in the form.

TiagoDias
  • 1,785
  • 1
  • 16
  • 21