Summary: | Implement document.compatMode | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Geoffrey Garen <ggaren> | ||||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | ap, magic, sam | ||||||
Priority: | P2 | ||||||||
Version: | 523.x (Safari 3) | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 9117 | ||||||||
Attachments: |
|
Description
Geoffrey Garen
2007-08-23 11:55:19 PDT
Created attachment 16147 [details] implementation in the Document interface here is a patch to implement document.compatMode. I used the followings links to match the FF behavior; but i'm not sure if compatMode should be declared in the Document interface or in HTMLDocument: - http://www.whatwg.org/specs/web-apps/current-work/multipage/section-documents.html - http://developer.mozilla.org/en/docs/DOM:document.compatMode So if we are in Strict mode (or AlmostStrict), we return 'CSS1Compat', otherwie we return 'BackCompat'. Comment on attachment 16147 [details]
implementation in the Document interface
The "{" should be on a new line.
+String Document::compatMode() const {
+ return inCompatMode() ? "BackCompat" : "CSS1Compat";
+}
I don't think there is any reason for [ConvertNullStringTo=Undefined] as null is not a possible return value.
+ readonly attribute [ConvertNullStringTo=Undefined] DOMString compatMode;
Also, does this attribute make sense for Documents other HTML documents? If not, can we put this in the HTMLDocument? r- for now.
I would also like to see a test for when we are in AlmostStrict mode. Created attachment 16167 [details]
Implement compatMode (in HTMLDocument interface)
Here is the previous patch with all needed corrections (compatMode now belongs to HTMLDocument), and a new test case (now, there is one for each ParseMode)
(In reply to comment #2) > Also, does this attribute make sense for Documents other HTML documents? It works for XHTML in Firefox, so it probably does with our current code organization. Comment on attachment 16167 [details]
Implement compatMode (in HTMLDocument interface)
Implementing in HTMLDocument is ok for now - eventually we'll move all HTMLDocument stuff to be on all documents.
r=me for feature-branch
These landed tests fail for me: fast/dom/compatMode-AlmostStrict.html -> failed . fast/dom/compatMode-Compat.html -> failed . fast/dom/compatMode-Strict.html -> failed -SUCCESS +FAILURE |