Closed Bug 436961 Opened 16 years ago Closed 16 years ago

firefox improperly applies standards compliance mode based on DTD not errors in page

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: nykevin.norris, Unassigned)

References

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5) Gecko/2008050509 Firefox/3.0b5 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5) Gecko/2008050509 Firefox/3.0b5 If there is a valid DTD at the beginning of the (x)htm(l) file, firefox assumes it's a valid file, even when gecko reports invalid code. As a result, the invalid website is parsed in standards compliance mode instead of quirks mode. If IE starts requiring DTDs (for invalid, MSIE compatible code), quirks mode won't work at all because it will never be triggered. To reproduce: I KNOW what a DTD is. It means "I am using valid code of format foo." But if the code is not valid (and the DTD is), surely it makes sense to switch to quirks mode? Suppose Microsoft changed MSIE to require a DTD? The web designers would figure this out and spread it by way of blog, and all of a sudden, the Internet (tm) doesn't work on firefox. Reproducible: Always Steps to Reproduce: 0. have a standards incompliant html authoring program installed (e.g. Dreamweaver) 1. Make a fairly complex web page/site (offline of course) 2. Confirm the presence of and/or add a valid doctype declaration per the instructions somewhere at www.w3c.org 3. View the page in Firefox. Check the page properties (right click -> view page info). Actual Results: It will be in "standards compliance mode." Expected Results: Since your page is littered with invalid code, it should have switched to quirks mode at some point during rendering. This is forwarded by reporter from #236960 in the Ubuntu Launchpad @ https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/236960 I wasn't entirely certain what to set severity to, so I left it at Normal. You might even call this an enhancement, if you look at it the right way...
We're not going to switch the entire document to quirks mode when we encounter one "obvious error" somewhere on the page. That would be extremely confusing. If there are "quirks" that you think we should also have in standards mode, please file bugs on each one. "Suppose Microsoft changed MSIE to require a DTD?" isn't plausible, IMO.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
Okay, so what if the page was made in Dreamweaver and has a DTD (that's where I encountered this error. Such pages DO EXIST)? How many errors is "enough" to trigger quirks? You say "infinity" i.e. it should never. I say make it (that number) sane and don't worry too much about bikeshed color (unless you think setting it to infinity is a Good Thing?)
Any number other than 0 or infinity would lead to bizarre behavior where (1) many dynamically-generated or templated pages would fall under quirks mode or standards mode depending on how long they are, and (2) pages would "switch modes" halfway through loading.
Okay... what about proprietary extensions? If proprietary extensions are detected, it should switch...?
No, for much the same reasons.
For N=1 problem 1 doesn't apply. If you download/inspect the HTML before loading it, problem 2 doesn't apply.
> If you download/inspect the HTML before loading it, problem 2 doesn't apply. We're not about to toss out incremental rendering. It's a huge performance feature, especially for dial-up users and slow web sites.
You need to log in before you can comment on or make changes to this bug.