Closed Bug 287244 Opened 19 years ago Closed 19 years ago

DOCTYPE should not imply a default namespace

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: annevk, Assigned: annevk)

Details

(Keywords: testcase)

Attachments

(3 files)

For at least one DOCTYPE SVG implies a default namespace for the document, which
is incorrect, since even if that DTD defined some default namespace, we are not
a validating parser.

jwatt pointed out that the only place in the source code where that DOCTYPE is
specified is here:
<http://lxr.mozilla.org/seamonkey/source/parser/htmlparser/src/nsExpatDriver.cpp#229>
Attached image testcase
Attached patch patchSplinter Review
This would fix the bug. I think svg.dtd can be removed as well after this
change.
Attachment #178789 - Flags: superreview?(bzbarsky)
Attachment #178789 - Flags: review+
Bradley, does this patch seem reasonable to you?
If the file removed, this should change too:
 <http://lxr.mozilla.org/seamonkey/source/layout/svg/base/src/Makefile.in#110>
Does the SVG testsuite wor with this? The initial SVG spec required that we
magically imply the xmlns, but since we're not a validating parser, we didn't.
That did get changed, but I'm not sure whast out there wihtout the appropriate
namespace on the <svg>.
(In reply to comment #6)
> Does the SVG testsuite wor with this? The initial SVG spec required that we
> magically imply the xmlns, but since we're not a validating parser, we didn't.
> That did get changed, but I'm not sure whast out there wihtout the appropriate
> namespace on the <svg>.

An old version of the DTD, published in an ancient draft, defaulted the xmlns. The spec didn't require 
that it be magically defaulted, that only worked in (at least partially) validating parsers. For purposes of 
SVG processing I would recommend to completely ignore the DOCTYPE (except the internal subset of 
course). There will be no DOCTYPE for 1.2, it is completely deprecated.
Note also that we only do this for an ancient DTD that should not be used anyway.
Comment on attachment 178789 [details] [diff] [review]
patch

sr=bzbarsky, though if that makes svg.dtd unused I'd like to see a followup
patch removing references to it and removing the file....
Attachment #178789 - Flags: superreview?(bzbarsky) → superreview+
So who needs to review this?
Attachment #179490 - Flags: superreview?(bzbarsky)
Attachment #179490 - Flags: review?(tor)
Attachment #179490 - Flags: superreview?(bzbarsky) → superreview+
Attachment #179490 - Flags: review?(tor) → review+
Assignee: general → bug
Both patches have been checked in by timeless. Marking FIXED.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: