Closed
Bug 105640
Opened 23 years ago
Closed 23 years ago
Expose the mode [strict/quirks] to web content
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla0.9.7
People
(Reporter: fabian, Assigned: fabian)
References
()
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
sicking
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4+)
Gecko/20010919
BuildID: 20011019
I filed this bug after Stephan Tolksdorf's newsgroup post "Strict and standards
compliant mode" of oct 17th.
It links to an article (see the URL field) that claims that the best way to know
whether we're in strict or quirks mode is this:
var d=document.doctype
strict=(d&&d.systemId)?(d.systemId.indexOf("strict")>-1)?true:(d.publicId.indexOf("transitional")>-1)?true:false:(d.publicId.indexOf("transitional")==-1)?true:false
If this is true (and I believe it is), it is my opinion that we should expose
the mode as a simple property of the document.
IE has a property called document.compatMode. It takes two values:
CSS1Compat and BackCompat (strings). Maybe we could implement that.
I'm just filing this bug to make sure we take a decision instead of ignoring it.
Feel free of course to mark wontfix.
Reproducible: Always
Steps to Reproduce:
1. Load above
2.
3.
Actual Results: Blah
Expected Results: Bleh
Comment 1•23 years ago
|
||
It'd be nice to provide this information to JavaScript/DOM. I'm not sure that
Microsoft's property and string results make sense for Mozilla, but it may be
helpful to web developers if Mozilla provides the same property. Using the same
property and BackCompat result would probably be sufficient. We could return
something different when in strict mode.
Microsoft's documentation about compatMode is here:
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/compatmode.asp
Assignee | ||
Comment 2•23 years ago
|
||
Comment on attachment 55377 [details] [diff] [review]
Proposed fix. Let me know if we want this for XML docs as well.
IMHO we don't want this on XML documents. They should always be in strict mode AFAIK
r=sicking
Attachment #55377 -
Flags: review+
Assignee | ||
Comment 4•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #55377 -
Attachment is obsolete: true
Attachment #55377 -
Flags: review+ → needs-work+
Comment 5•23 years ago
|
||
Comment on attachment 56787 [details] [diff] [review]
Better fix.
sr=jst
Attachment #56787 -
Flags: superreview+
Comment on attachment 56787 [details] [diff] [review]
Better fix.
r=sicking
Attachment #56787 -
Flags: review+
Assignee | ||
Comment 7•23 years ago
|
||
-> Mozilla 0.9.7, not a feature critical for 0.9.6.
Reassigning to myself, though I hope jst will check it in when the tree opens :-)
Assignee: jst → hidday
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla0.9.7
Comment 8•23 years ago
|
||
I don't think we want to return CSS1Compat. That would leave no clear way for
authors to determine if the layout was IE's CSS1Compat or Gecko's CSS1Compat. I
think it would be better to return "GeckoStrict". or some such.
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 9•23 years ago
|
||
I think it's a good idea.
Comment 10•23 years ago
|
||
Determining if a script runs in IE or Gecko is something script writers do any
way, I think we should be compatible with IE wrt this string so that people
don't need to check for two strings if they don't need to distinguish between IE
and Gecko, which they can do already anyway. The biggest reason for adding
support for this property was to be compatible with IE, and if we start using
different strings we're not exactly compatible wrt this property.
I vote for using the patch we already have.
Assignee | ||
Comment 11•23 years ago
|
||
Marking, like, FIXED!
thanks for the reviews and the checkin :-)
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 12•23 years ago
|
||
FYI: http://gemal.dk/browserspy/document.html now also shows the "compatMode"
mode...
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•