From 56fb7f80ee5d5f166507f7727b1cf0c351a98d86 Mon Sep 17 00:00:00 2001 From: "heikki%netscape.com" Date: Fri, 25 Jan 2002 00:07:45 +0000 Subject: [PATCH] Bug 44458, enable XHTML entities when an XHTML doctype with public id is present in an XML document. r=rbs@maths.uq.edu.au, sr=jst. git-svn-id: svn://10.0.0.236/trunk@112779 18797224-902f-48f8-a5cc-f745e15eee43 --- .../mac/build_scripts/MozillaBuildList.pm | 3 + mozilla/content/xml/content/src/Makefile.in | 5 + mozilla/content/xml/content/src/makefile.win | 1 + .../content/xml/content/src/nsXMLElement.cpp | 3 - mozilla/content/xml/content/src/xhtml11.dtd | 284 ++++++++++++++++++ mozilla/htmlparser/src/nsExpatDriver.cpp | 10 +- .../parser/htmlparser/src/nsExpatDriver.cpp | 10 +- mozilla/xpinstall/packager/packages-mac | 1 + .../xpinstall/packager/packages-static-unix | 1 + .../xpinstall/packager/packages-static-win | 1 + mozilla/xpinstall/packager/packages-unix | 1 + mozilla/xpinstall/packager/packages-win | 1 + 12 files changed, 314 insertions(+), 7 deletions(-) create mode 100644 mozilla/content/xml/content/src/xhtml11.dtd diff --git a/mozilla/build/mac/build_scripts/MozillaBuildList.pm b/mozilla/build/mac/build_scripts/MozillaBuildList.pm index eb4bdd04e80..75496d1ec73 100644 --- a/mozilla/build/mac/build_scripts/MozillaBuildList.pm +++ b/mozilla/build/mac/build_scripts/MozillaBuildList.pm @@ -191,6 +191,9 @@ sub InstallNonChromeResources() #// #// Make aliases of resource files #// + + MakeAlias(":mozilla:content:xml:content:src:xhtml11.dtd", "$dist_dir"."dtd:"); + if (! $main::options{mathml}) { MakeAlias(":mozilla:layout:html:document:src:ua.css", "$resource_dir"); diff --git a/mozilla/content/xml/content/src/Makefile.in b/mozilla/content/xml/content/src/Makefile.in index 94fca2475f9..d3efcba2701 100644 --- a/mozilla/content/xml/content/src/Makefile.in +++ b/mozilla/content/xml/content/src/Makefile.in @@ -64,3 +64,8 @@ INCLUDES += \ -I$(srcdir)/../../../base/src \ $(NULL) +EXPORT_RESOURCE_CONTENT = \ + $(srcdir)/xhtml11.dtd \ + $(NULL) +libs:: + $(INSTALL) $(EXPORT_RESOURCE_CONTENT) $(DIST)/bin/dtd diff --git a/mozilla/content/xml/content/src/makefile.win b/mozilla/content/xml/content/src/makefile.win index 7adf32a867a..0d3c325023c 100644 --- a/mozilla/content/xml/content/src/makefile.win +++ b/mozilla/content/xml/content/src/makefile.win @@ -63,6 +63,7 @@ include <$(DEPTH)\config\rules.mak> libs:: $(LIBRARY) $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib + $(MAKE_INSTALL) xhtml11.dtd $(DIST)\bin\dtd clobber:: rm -f $(DIST)\lib\$(LIBRARY_NAME).lib diff --git a/mozilla/content/xml/content/src/nsXMLElement.cpp b/mozilla/content/xml/content/src/nsXMLElement.cpp index dd4a8f04537..a77a3accc8a 100644 --- a/mozilla/content/xml/content/src/nsXMLElement.cpp +++ b/mozilla/content/xml/content/src/nsXMLElement.cpp @@ -288,9 +288,6 @@ nsXMLElement::SetAttr(nsINodeInfo *aNodeInfo, // we do not need to check other attributes. If there // is no href attribute, then this link is simply // untraversible [XLink 3.2]. - // XXX If a parent of this element is already a simple link, then this - // must not create a link of its own, this is just a normal element - // inside the parent simple XLink element [XLink 3.2]. mIsLink = PR_TRUE; } else { mIsLink = PR_FALSE; diff --git a/mozilla/content/xml/content/src/xhtml11.dtd b/mozilla/content/xml/content/src/xhtml11.dtd new file mode 100644 index 00000000000..be96d4f8aa8 --- /dev/null +++ b/mozilla/content/xml/content/src/xhtml11.dtd @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/htmlparser/src/nsExpatDriver.cpp b/mozilla/htmlparser/src/nsExpatDriver.cpp index e36ea919eec..b0c63c3d232 100644 --- a/mozilla/htmlparser/src/nsExpatDriver.cpp +++ b/mozilla/htmlparser/src/nsExpatDriver.cpp @@ -403,9 +403,15 @@ struct nsCatalogEntry { const char* mLocalDTD; }; +// The order of this table is guestimated to be in the optimum order static const nsCatalogEntry kCatalogTable[] = { - {"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "mathml.dtd"}, - {"-//W3C//DTD SVG 20001102//EN", "svg.dtd"}, + {"-//W3C//DTD XHTML 1.0 Transitional//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML 1.1//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML 1.0 Strict//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML 1.0 Frameset//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML Basic 1.0//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "mathml.dtd" }, + {"-//W3C//DTD SVG 20001102//EN", "svg.dtd" }, {nsnull, nsnull} }; diff --git a/mozilla/parser/htmlparser/src/nsExpatDriver.cpp b/mozilla/parser/htmlparser/src/nsExpatDriver.cpp index e36ea919eec..b0c63c3d232 100644 --- a/mozilla/parser/htmlparser/src/nsExpatDriver.cpp +++ b/mozilla/parser/htmlparser/src/nsExpatDriver.cpp @@ -403,9 +403,15 @@ struct nsCatalogEntry { const char* mLocalDTD; }; +// The order of this table is guestimated to be in the optimum order static const nsCatalogEntry kCatalogTable[] = { - {"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "mathml.dtd"}, - {"-//W3C//DTD SVG 20001102//EN", "svg.dtd"}, + {"-//W3C//DTD XHTML 1.0 Transitional//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML 1.1//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML 1.0 Strict//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML 1.0 Frameset//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML Basic 1.0//EN", "xhtml11.dtd" }, + {"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "mathml.dtd" }, + {"-//W3C//DTD SVG 20001102//EN", "svg.dtd" }, {nsnull, nsnull} }; diff --git a/mozilla/xpinstall/packager/packages-mac b/mozilla/xpinstall/packager/packages-mac index f7cab157747..0dc69d96fa5 100644 --- a/mozilla/xpinstall/packager/packages-mac +++ b/mozilla/xpinstall/packager/packages-mac @@ -246,6 +246,7 @@ viewer:defaults:wallet:DistinguishedSchema.tbl viewer:defaults:wallet:SchemaStrings.tbl viewer:defaults:wallet:PositionalSchema.tbl viewer:defaults:wallet:StateSchema.tbl +viewer:dtd:* viewer:res:html:* viewer:res:html.css viewer:res:quirk.css diff --git a/mozilla/xpinstall/packager/packages-static-unix b/mozilla/xpinstall/packager/packages-static-unix index 58072a866a1..2366ea9d58f 100644 --- a/mozilla/xpinstall/packager/packages-static-unix +++ b/mozilla/xpinstall/packager/packages-static-unix @@ -207,6 +207,7 @@ bin/res/rdf/folder-open.gif bin/res/rdf/loading.gif bin/res/ua.css bin/res/forms.css +bin/dtd/* ;debug menus reference samples dir - remove for actual releases: bin/res/samples/* bin/res/builtin/htmlBindings.xml diff --git a/mozilla/xpinstall/packager/packages-static-win b/mozilla/xpinstall/packager/packages-static-win index 71602d096fc..98025b158ab 100644 --- a/mozilla/xpinstall/packager/packages-static-win +++ b/mozilla/xpinstall/packager/packages-static-win @@ -207,6 +207,7 @@ bin\res\loading-image.gif bin\res\broken-image.gif bin\res\html\* bin\res\fonts\* +bin\dtd\* bin\defaults\wallet\VcardSchema.tbl bin\defaults\wallet\FieldSchema.tbl bin\defaults\wallet\SchemaConcat.tbl diff --git a/mozilla/xpinstall/packager/packages-unix b/mozilla/xpinstall/packager/packages-unix index bf3e1f019c6..70c96795e5e 100644 --- a/mozilla/xpinstall/packager/packages-unix +++ b/mozilla/xpinstall/packager/packages-unix @@ -295,6 +295,7 @@ bin/res/rdf/folder-open.gif bin/res/rdf/loading.gif bin/res/ua.css bin/res/forms.css +bin/dtd/* ;debug menus reference samples dir - remove for actual releases: bin/res/samples/* bin/res/builtin/htmlBindings.xml diff --git a/mozilla/xpinstall/packager/packages-win b/mozilla/xpinstall/packager/packages-win index 1852194a8d2..036ab9e255c 100644 --- a/mozilla/xpinstall/packager/packages-win +++ b/mozilla/xpinstall/packager/packages-win @@ -291,6 +291,7 @@ bin\res\loading-image.gif bin\res\broken-image.gif bin\res\html\* bin\res\fonts\* +bin\dtd\* bin\defaults\wallet\VcardSchema.tbl bin\defaults\wallet\FieldSchema.tbl bin\defaults\wallet\SchemaConcat.tbl