Closed Bug 679464 Opened 10 years ago Closed 10 years ago

Firefox 5.01 always renders html5 attributes regardless of doctype declaration


(Core :: DOM: Core & HTML, defect)

Not set





(Reporter: amerigohosting, Unassigned)



User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Build ID: 20110707182747

Steps to reproduce:

We have been using the tag "required='true'" on our tags for a long time, this has not been an issue since we have always been in xhtml strict mode.

We did this by using one of the following doctypes.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict //EN" "">

<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

And having a form like the following
<input type="text" required="true">
<input type="submit">

Our actual form is very very large, and has a javascript workflow powered by radio buttons.   Because of this several of the values will be empty on a submit.

Actual results:

On submit, the page says that you should enter values into the field (though it renders this box outside of the browser, either behind the top left tab, or under the browser window itself.

Expected results:

It should never have evaluated the html5 attribute "required"
Unless your serving the page as mimetype application/xhtml+xml your actually serving (broken) html, and that means the html5 parser will parse the document according to that.

Doctype doesn't matter for xhtml if the mimetype is wrong (according to specs). [1]

The html has a reserved namespace you should use for invented attributes and that's the data- prefix. It's both historically and future safe. [2]

In other words:
A HTML5 browser makes no difference between any doctypes which trigger standards mode

Component: General → DOM: Core & HTML
Depends on: 596511
OS: Mac OS X → All
Product: Firefox → Core
QA Contact: general → general
Hardware: x86 → All
Version: 5 Branch → Trunk
Closed: 10 years ago
Resolution: --- → INVALID
Actually, it wouldn't matter if the content were served as application/xhtml+xml, since the HTML5 spec redefines that type too.

But yes, this is the behavior the HTML5 spec requires.
You need to log in before you can comment on or make changes to this bug.