Closed
Bug 255610
Opened 20 years ago
Closed 20 years ago
document.implementation.hasFeature('XHTML', '2.0') should return true
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: martin.honnen, Assigned: vhaarr+bmo)
Details
(Whiteboard: [good first bug])
Attachments
(2 files)
1.48 KB,
application/xhtml+xml
|
Details | |
1.17 KB,
patch
|
bzbarsky
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
The DOM Level 2 HTML specification in its introduction at http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-1176245063 says the following about feature strings: A DOM application may use the hasFeature(feature, version) method of the DOMImplementation interface with parameter values "HTML" and "2.0" (respectively) to determine whether or not this module is supported by the implementation. In addition to the feature string "HTML", the feature string "XHTML" (version string "2.0") can be used to check if the implementation supports XHTML (this is equivalent to checking the features "XML" and "HTML"). As Mozilla supports XHTML and furthermore returns true for the feature/version 'HTML'/'2.0' and 'XML'/'2.0' it should return true from document.implementation.hasFeature('XHTML', '2.0') but returns false. Tested with Mozilla 1.8a3 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040813. I will upload a test case which demonstrates the results Mozilla returns for the relevant DOM feature/version combinations.
Reporter | ||
Comment 1•20 years ago
|
||
Reporter | ||
Comment 2•20 years ago
|
||
The hasFeature method is implemented here: http://lxr.mozilla.org/seamonkey/source/content/base/src/nsDocument.cpp#331 and calls the InternalIsSupported method implemented here: http://lxr.mozilla.org/seamonkey/source/content/base/src/nsGenericElement.cpp#1134 so all that probably needs to changed is some hard-coded check for XHTML, 2.0 as follows } else if (PL_strcasecmp(f, "Views") == 0 || PL_strcasecmp(f, "StyleSheets") == 0 || PL_strcasecmp(f, "Core") == 0 || PL_strcasecmp(f, "CSS") == 0 || PL_strcasecmp(f, "CSS2") == 0 || PL_strcasecmp(f, "Events") == 0 || // PL_strcasecmp(f, "UIEvents") == 0 || PL_strcasecmp(f, "MouseEvents") == 0 || PL_strcasecmp(f, "MouseScrollEvents") == 0 || PL_strcasecmp(f, "HTMLEvents") == 0 || PL_strcasecmp(f, "Range") == 0 || PL_strcasecmp(F, "XHTML") == 0) { if (aVersion.IsEmpty() || PL_strcmp(v, "2.0") == 0) { *aReturn = PR_TRUE; } }
Reporter | ||
Comment 3•20 years ago
|
||
I made a typo in the previous comment, code should be } else if (PL_strcasecmp(f, "Views") == 0 || PL_strcasecmp(f, "StyleSheets") == 0 || PL_strcasecmp(f, "Core") == 0 || PL_strcasecmp(f, "CSS") == 0 || PL_strcasecmp(f, "CSS2") == 0 || PL_strcasecmp(f, "Events") == 0 || // PL_strcasecmp(f, "UIEvents") == 0 || PL_strcasecmp(f, "MouseEvents") == 0 || PL_strcasecmp(f, "MouseScrollEvents") == 0 || PL_strcasecmp(f, "HTMLEvents") == 0 || PL_strcasecmp(f, "Range") == 0 || PL_strcasecmp(f, "XHTML") == 0) { if (aVersion.IsEmpty() || PL_strcmp(v, "2.0") == 0) { *aReturn = PR_TRUE; } }
Comment 4•20 years ago
|
||
Mozilla doesn't support XHTML 2.0. XHTML 2.0 isn't anywhere near recommendation yet, I suspect this is invalid.
OS: Windows XP → All
Hardware: PC → All
Comment 5•20 years ago
|
||
This has nothing to do with XHTML 2.0.
Reporter | ||
Comment 6•20 years ago
|
||
The bug is not about XHTML 2.0 support but about DOM support for the defined DOM feature XHTML for the DOM Level 2.0.
Assignee | ||
Comment 8•20 years ago
|
||
Patches nsGenericElement.cpp to include XHTML check. The testcase in this bug returns true in the last check on Firefox trunk with this patch.
Attachment #169238 -
Flags: review?(bzbarsky)
Comment 9•20 years ago
|
||
Comment on attachment 169238 [details] [diff] [review] patch to that effect r=bzbarsky. jst, could you sr?
Attachment #169238 -
Flags: superreview?(jst)
Attachment #169238 -
Flags: review?(bzbarsky)
Attachment #169238 -
Flags: review+
Comment 10•20 years ago
|
||
Comment on attachment 169238 [details] [diff] [review] patch to that effect sr=jst
Attachment #169238 -
Flags: superreview?(jst) → superreview+
Updated•20 years ago
|
Assignee: general → bugmail
Assignee | ||
Comment 11•20 years ago
|
||
Thanks for the reviews.
Attachment 169238 [details] [diff] checked in to seamonkey trunk by bernd.
-> FIXED.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•