From dea3118b7e697718f78f1f59b021dc103b536bf3 Mon Sep 17 00:00:00 2001
From: "nisheeth%netscape.com"
Date: Sat, 1 Apr 2000 00:39:15 +0000
Subject: [PATCH] Fix for bug 15086. These changes bring us up to date with the
Feb 2000 XLink Working Draft. Thanks a lot to Heikki (heikki@citec.fi) for
providing these patches.
git-svn-id: svn://10.0.0.236/trunk@64828 18797224-902f-48f8-a5cc-f745e15eee43
---
.../content/base/public/nsINameSpaceManager.h | 1 +
.../content/base/src/nsNameSpaceManager.cpp | 5 +++
.../content/xml/content/src/nsXMLElement.cpp | 45 ++++++++++++++-----
.../xml/document/src/nsXMLContentSink.cpp | 2 -
mozilla/content/xml/tests/books/books.xml | 15 ++++---
mozilla/content/xml/tests/docbooktest.xml | 11 ++---
mozilla/content/xml/tests/toc/rights.xml | 21 ++++-----
mozilla/docshell/base/nsWebShell.cpp | 10 +++--
.../layout/base/public/nsINameSpaceManager.h | 1 +
.../layout/base/src/nsNameSpaceManager.cpp | 5 +++
mozilla/layout/doc/layout.css | 7 ++-
mozilla/layout/doc/layout.xml | 23 +++++-----
.../layout/xml/content/src/nsXMLElement.cpp | 45 ++++++++++++++-----
.../xml/document/src/nsXMLContentSink.cpp | 2 -
mozilla/layout/xml/tests/books/books.xml | 15 ++++---
mozilla/layout/xml/tests/docbooktest.xml | 11 ++---
mozilla/layout/xml/tests/toc/rights.xml | 21 ++++-----
mozilla/webshell/src/nsWebShell.cpp | 10 +++--
18 files changed, 157 insertions(+), 93 deletions(-)
diff --git a/mozilla/content/base/public/nsINameSpaceManager.h b/mozilla/content/base/public/nsINameSpaceManager.h
index 2ca75e7bd02..f2407dcfa31 100644
--- a/mozilla/content/base/public/nsINameSpaceManager.h
+++ b/mozilla/content/base/public/nsINameSpaceManager.h
@@ -35,6 +35,7 @@ class nsINameSpace;
#define kNameSpaceID_XMLNS 1 // not really a namespace, but it needs to play the game
#define kNameSpaceID_XML 2
#define kNameSpaceID_HTML 3
+#define kNameSpaceID_XLink 4
// 'html' is by definition bound to the namespace name "urn:w3-org-ns:HTML" XXX ???
// 'xml' is by definition bound to the namespace name "urn:Connolly:input:required" XXX
diff --git a/mozilla/content/base/src/nsNameSpaceManager.cpp b/mozilla/content/base/src/nsNameSpaceManager.cpp
index 4853b3e1f6f..eba5dabc22e 100644
--- a/mozilla/content/base/src/nsNameSpaceManager.cpp
+++ b/mozilla/content/base/src/nsNameSpaceManager.cpp
@@ -35,6 +35,7 @@ static const char kXMLNSNameSpaceURI[] = "";
static const char kXMLNameSpaceURI[] = "http://www.w3.org/XML/1998/namespace";
static const char kHTMLNameSpaceURI[] = "http://www.w3.org/TR/REC-html40"; // XXX?? "urn:w3-org-ns:HTML"??
static const char kXHTMLNameSpaceURI[] = "http://www.w3.org/1999/xhtml";
+static const char kXLinkNameSpaceURI[] = "http://www.w3.org/1999/xlink";
//-----------------------------------------------------------
// Name Space ID table support
@@ -111,18 +112,22 @@ static void AddRefTable()
nsString* xml = new nsString(kXMLNameSpaceURI);
nsString* html = new nsString(kHTMLNameSpaceURI);
nsString* xhtml = new nsString(kXHTMLNameSpaceURI);
+ nsString* xlink = new nsString(kXLinkNameSpaceURI);
gURIArray->AppendElement(xmlns); // ordering here needs to match IDs
gURIArray->AppendElement(xml);
gURIArray->AppendElement(html);
gURIArray->AppendElement(xhtml);
+ gURIArray->AppendElement(xlink);
NameSpaceURIKey xmlnsKey(xmlns);
NameSpaceURIKey xmlKey(xml);
NameSpaceURIKey htmlKey(html);
NameSpaceURIKey xhtmlKey(xhtml);
+ NameSpaceURIKey xlinkKey(xlink);
gURIToIDTable->Put(&xmlnsKey, (void*)kNameSpaceID_XMLNS);
gURIToIDTable->Put(&xmlKey, (void*)kNameSpaceID_XML);
gURIToIDTable->Put(&htmlKey, (void*)kNameSpaceID_HTML);
gURIToIDTable->Put(&xhtmlKey, (void*)kNameSpaceID_HTML);
+ gURIToIDTable->Put(&xlinkKey, (void*)kNameSpaceID_XLink);
}
NS_ASSERTION(nsnull != gURIToIDTable, "no URI table");
NS_ASSERTION(nsnull != gURIArray, "no URI array");
diff --git a/mozilla/content/xml/content/src/nsXMLElement.cpp b/mozilla/content/xml/content/src/nsXMLElement.cpp
index 56c29327ad1..898239979ef 100644
--- a/mozilla/content/xml/content/src/nsXMLElement.cpp
+++ b/mozilla/content/xml/content/src/nsXMLElement.cpp
@@ -50,9 +50,10 @@ NS_NewXMLElement(nsIXMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIXMLContentIID, (void**) aInstancePtrResult);
}
-static nsIAtom* kLinkAtom; // XXX these should get moved to nsXMLAtoms
+static nsIAtom* kSimpleAtom; // XXX these should get moved to nsXMLAtoms
static nsIAtom* kHrefAtom;
static nsIAtom* kShowAtom;
+static nsIAtom* kTypeAtom;
static PRUint32 kElementCount;
nsXMLElement::nsXMLElement(nsIAtom *aTag)
@@ -63,18 +64,20 @@ nsXMLElement::nsXMLElement(nsIAtom *aTag)
mContentID = 0;
if (0 == kElementCount++) {
- kLinkAtom = NS_NewAtom("link");
+ kSimpleAtom = NS_NewAtom("simple");
kHrefAtom = NS_NewAtom("href");
kShowAtom = NS_NewAtom("show");
+ kTypeAtom = NS_NewAtom("type");
}
}
nsXMLElement::~nsXMLElement()
{
if (0 == --kElementCount) {
- NS_RELEASE(kLinkAtom);
+ NS_RELEASE(kSimpleAtom);
NS_RELEASE(kHrefAtom);
NS_RELEASE(kShowAtom);
+ NS_RELEASE(kTypeAtom);
}
}
@@ -111,11 +114,25 @@ nsXMLElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
// XXX It sucks that we have to do a strcmp for
// every attribute set. It might be a bit more expensive
// to create an atom.
- if ((kNameSpaceID_XML == aNameSpaceID) &&
- (aName == kLinkAtom) && (aValue.Equals("simple"))) {
- mIsLink = PR_TRUE;
+ if ((kNameSpaceID_XLink == aNameSpaceID) &&
+ (kTypeAtom == aName)) {
+ if (aValue.Equals(kSimpleAtom, PR_FALSE)) {
+ // NOTE: This really is a link according to the XLink spec,
+ // 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;
+ }
}
+ // XXX If the XLink actuate attribute is present and its value is
+ // onLoad, we should obey that too [XLink 3.6.2].
+
return mInner.SetAttribute(aNameSpaceID, aName, aValue, aNotify);
}
@@ -142,7 +159,7 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
stateManager->SetContentState(this, NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_FOCUS);
NS_RELEASE(stateManager);
}
- *aEventStatus = nsEventStatus_eConsumeDoDefault;
+ *aEventStatus = nsEventStatus_eConsumeDoDefault;
}
break;
@@ -151,20 +168,23 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
if (nsEventStatus_eConsumeNoDefault != *aEventStatus) {
nsAutoString show, href, target;
nsIURI* baseURL = nsnull;
- nsLinkVerb verb = eLinkVerb_Replace;
- target.Truncate();
- GetAttribute(kNameSpaceID_None, kHrefAtom, href);
- GetAttribute(kNameSpaceID_None, kShowAtom, show);
+ nsLinkVerb verb = eLinkVerb_Undefined;
+ GetAttribute(kNameSpaceID_XLink, kHrefAtom, href);
+ GetAttribute(kNameSpaceID_XLink, kShowAtom, show);
// XXX Should probably do this using atoms
if (show.Equals("new")) {
verb = eLinkVerb_New;
}
+ else if (show.Equals("replace")) {
+ verb = eLinkVerb_Replace;
+ }
else if (show.Equals("embed")) {
verb = eLinkVerb_Embed;
}
if (nsnull != mInner.mDocument) {
baseURL = mInner.mDocument->GetDocumentURL();
+ // XXX XML Base W3C
}
ret = mInner.TriggerLink(aPresContext, verb, baseURL, href, target, PR_TRUE);
NS_IF_RELEASE(baseURL);
@@ -181,9 +201,10 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
{
nsAutoString href, target;
nsIURI* baseURL = nsnull;
- GetAttribute(kNameSpaceID_None, kHrefAtom, href);
+ GetAttribute(kNameSpaceID_XLink, kHrefAtom, href);
if (nsnull != mInner.mDocument) {
baseURL = mInner.mDocument->GetDocumentURL();
+ // XXX XML Base W3C
}
ret = mInner.TriggerLink(aPresContext, eLinkVerb_Replace, baseURL, href, target, PR_FALSE);
diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp
index eb4b38fedb0..93bdbae9372 100644
--- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp
+++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp
@@ -109,8 +109,6 @@ static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
nsINameSpaceManager* nsXMLContentSink::gNameSpaceManager = nsnull;
PRUint32 nsXMLContentSink::gRefCnt = 0;
-static void SetTextStringOnTextNode(const nsString& aTextString, nsIContent* aTextNode);
-
// XXX Open Issues:
// 1) html:style - Should we allow inline style? If so, the content
// sink needs to process the tag and invoke the CSS parser.
diff --git a/mozilla/content/xml/tests/books/books.xml b/mozilla/content/xml/tests/books/books.xml
index 74732a6a77c..fe3dafa7c87 100644
--- a/mozilla/content/xml/tests/books/books.xml
+++ b/mozilla/content/xml/tests/books/books.xml
@@ -5,7 +5,8 @@
-
+
@@ -25,7 +26,7 @@
- On the Road
+ On the RoadKerouac, Jack0140042598
@@ -37,7 +38,7 @@ On The Road, the most famous of Jack Kerouac's works, is not only the soul of th
- The Road Ahead
+ The Road AheadGates, Bill666666666
@@ -49,7 +50,7 @@ In a study, the founder of Microsoft presents his vision for the future in which
- The Road to Wellville
+ The Road to WellvilleBoyle, T. Coraghessan0140167188
@@ -61,7 +62,7 @@ A snobbish wife and her henpecked husband travel to Dr. Kellogg's spa in turn-of
- AAA Road Atlas 1999
+ AAA Road Atlas 1999A. A. A.1562512625
@@ -73,7 +74,7 @@ The definitive road atlas to the United States, Canada and Mexico.
- Bethlehem Road
+ Bethlehem RoadPerry, Anne0449219143
@@ -85,7 +86,7 @@ He might be elegant, but there's no mistaking it--the gentleman tied to the lamp
- 84 Charing Cross Road
+ 84 Charing Cross RoadHanff, Helene0140143505
diff --git a/mozilla/content/xml/tests/docbooktest.xml b/mozilla/content/xml/tests/docbooktest.xml
index 5eaa582fecf..79baa336014 100644
--- a/mozilla/content/xml/tests/docbooktest.xml
+++ b/mozilla/content/xml/tests/docbooktest.xml
@@ -1,7 +1,8 @@
-SoftQuad
+
+SoftQuad
Inc.
@@ -64,12 +65,12 @@ tokenized attribute values.
The following topics describe DOM attributes:
-Interface
+Interface
Attr
-
+
Interface Element
-
+
@@ -43,7 +44,7 @@ For estimated tax payments for tax years beginning in 1999, the safe harbor for
For more information on estimated tax, see
- Publication 505.
+ Publication 505.
@@ -52,7 +53,7 @@ For more information on estimated tax, see
For 1999, the health insurance deduction for the self-employed is increased from 45% to 60% of the amount you pay for medical insurance for yourself and your family. For more information, see chapter 10 in
- Publication 535.
+ Publication 535.
@@ -73,7 +74,7 @@ For 1999, the employer and employee will continue to pay:
Wage limits.
For social security tax, the maximum amount of 1999 wages subject to the tax has increased to $72,600. For Medicare tax, all covered 1999 wages are subject to the tax. There is no wage base limit. For information about these taxes, see
- Publication 15, Circular E, Employer's Tax Guide.
+ Publication 15, Circular E, Employer's Tax Guide.
@@ -110,7 +111,7 @@ For 1999, the employer and employee will continue to pay:
Wage limits. For social security tax, the maximum amount of 1999 wages subject to the tax has increased to $72,600. For Medicare tax, all covered 1999 wages are subject to the tax. There is no wage base limit. For information about these taxes and amounts to withhold, see
-Publication 15, Circular E, Employer's TaxGuide.
+Publication 15, Circular E, Employer's TaxGuide.
@@ -126,7 +127,7 @@ Under certain circumstances, the IRS can waive the penalty for a first-time depo
Electronic Deposit of Taxes
-If you were first required to deposit taxes by electronic funds transfer after June 30, 1997, the IRS will not impose the penalty for not doing so before July 1, 1999. Previously, the IRS had waived the penalty through December 31, 1998. For information about depositing taxes electronically, see Publication 15.
+If you were first required to deposit taxes by electronic funds transfer after June 30, 1997, the IRS will not impose the penalty for not doing so before July 1, 1999. Previously, the IRS had waived the penalty through December 31, 1998. For information about depositing taxes electronically, see Publication 15.
@@ -167,7 +168,7 @@ The maximum amount subject to the social security part for tax years beginning i
Hardship Distributions
-Beginning in 1999, hardship distributions from 401(k) plans and 403(b) plans are not eligible rollover distributions. They cannot be rolled over into a traditional IRA. For more information on traditional IRAs, see Publication 590.
+Beginning in 1999, hardship distributions from 401(k) plans and 403(b) plans are not eligible rollover distributions. They cannot be rolled over into a traditional IRA. For more information on traditional IRAs, see Publication 590.
@@ -184,8 +185,8 @@ Beginning in 1999, hardship distributions from 401(k) plans and 403(b) plans are
For estates of decedents dying after 1997, the executor can elect to deduct the adjusted value of a qualified family-owned business interest, up to a limited amount, from the gross estate. For more information, see section 2057 of the Internal Revenue Code and the instructions for Schedule T, Form 706, United States Estate (and Generation-Skipping Transfer) Tax Return.
-
-
+
+ Suit for Refund
@@ -253,7 +254,7 @@ For 1999, the tax on the use of international air travel facilities will be $12.
For 1999, the luxury tax on a passenger vehicle is reduced from 7% to 6% of the amount of the sales price that exceeds the base amount. The base amount for 1999 is $36,000.
-The base amount is increased for electric vehicles and clean-fuel vehicles. See Publication 510 for information on these amounts.
+The base amount is increased for electric vehicles and clean-fuel vehicles. See Publication 510 for information on these amounts.
diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp
index d3e25f91953..6ff0e7009bd 100644
--- a/mozilla/docshell/base/nsWebShell.cpp
+++ b/mozilla/docshell/base/nsWebShell.cpp
@@ -2207,11 +2207,12 @@ nsWebShell::HandleLinkClickEvent(nsIContent *aContent,
{
nsAutoString target(aTargetSpec);
-
switch(aVerb) {
case eLinkVerb_New:
target.Assign("_blank");
// Fall into replace case
+ case eLinkVerb_Undefined:
+ // Fall through, this seems like the most reasonable action
case eLinkVerb_Replace:
{
// for now, just hack the verb to be view-link-clicked
@@ -2226,9 +2227,10 @@ nsWebShell::HandleLinkClickEvent(nsIContent *aContent,
}
break;
case eLinkVerb_Embed:
+ // XXX TODO Should be similar to the HTML IMG ALT attribute handling
+ // in NS 4.x
default:
- ;
- // XXX Need to do this
+ NS_ABORT_IF_FALSE(0,"unexpected link verb");
}
}
@@ -2237,7 +2239,7 @@ nsWebShell::OnOverLink(nsIContent* aContent,
const PRUnichar* aURLSpec,
const PRUnichar* aTargetSpec)
{
- nsCOMPtr browserChrome(do_GetInterface(mTreeOwner));
+ nsCOMPtr browserChrome(do_GetInterface(mTreeOwner));
if(browserChrome)
browserChrome->SetOverLink(aURLSpec);
diff --git a/mozilla/layout/base/public/nsINameSpaceManager.h b/mozilla/layout/base/public/nsINameSpaceManager.h
index 2ca75e7bd02..f2407dcfa31 100644
--- a/mozilla/layout/base/public/nsINameSpaceManager.h
+++ b/mozilla/layout/base/public/nsINameSpaceManager.h
@@ -35,6 +35,7 @@ class nsINameSpace;
#define kNameSpaceID_XMLNS 1 // not really a namespace, but it needs to play the game
#define kNameSpaceID_XML 2
#define kNameSpaceID_HTML 3
+#define kNameSpaceID_XLink 4
// 'html' is by definition bound to the namespace name "urn:w3-org-ns:HTML" XXX ???
// 'xml' is by definition bound to the namespace name "urn:Connolly:input:required" XXX
diff --git a/mozilla/layout/base/src/nsNameSpaceManager.cpp b/mozilla/layout/base/src/nsNameSpaceManager.cpp
index 4853b3e1f6f..eba5dabc22e 100644
--- a/mozilla/layout/base/src/nsNameSpaceManager.cpp
+++ b/mozilla/layout/base/src/nsNameSpaceManager.cpp
@@ -35,6 +35,7 @@ static const char kXMLNSNameSpaceURI[] = "";
static const char kXMLNameSpaceURI[] = "http://www.w3.org/XML/1998/namespace";
static const char kHTMLNameSpaceURI[] = "http://www.w3.org/TR/REC-html40"; // XXX?? "urn:w3-org-ns:HTML"??
static const char kXHTMLNameSpaceURI[] = "http://www.w3.org/1999/xhtml";
+static const char kXLinkNameSpaceURI[] = "http://www.w3.org/1999/xlink";
//-----------------------------------------------------------
// Name Space ID table support
@@ -111,18 +112,22 @@ static void AddRefTable()
nsString* xml = new nsString(kXMLNameSpaceURI);
nsString* html = new nsString(kHTMLNameSpaceURI);
nsString* xhtml = new nsString(kXHTMLNameSpaceURI);
+ nsString* xlink = new nsString(kXLinkNameSpaceURI);
gURIArray->AppendElement(xmlns); // ordering here needs to match IDs
gURIArray->AppendElement(xml);
gURIArray->AppendElement(html);
gURIArray->AppendElement(xhtml);
+ gURIArray->AppendElement(xlink);
NameSpaceURIKey xmlnsKey(xmlns);
NameSpaceURIKey xmlKey(xml);
NameSpaceURIKey htmlKey(html);
NameSpaceURIKey xhtmlKey(xhtml);
+ NameSpaceURIKey xlinkKey(xlink);
gURIToIDTable->Put(&xmlnsKey, (void*)kNameSpaceID_XMLNS);
gURIToIDTable->Put(&xmlKey, (void*)kNameSpaceID_XML);
gURIToIDTable->Put(&htmlKey, (void*)kNameSpaceID_HTML);
gURIToIDTable->Put(&xhtmlKey, (void*)kNameSpaceID_HTML);
+ gURIToIDTable->Put(&xlinkKey, (void*)kNameSpaceID_XLink);
}
NS_ASSERTION(nsnull != gURIToIDTable, "no URI table");
NS_ASSERTION(nsnull != gURIArray, "no URI array");
diff --git a/mozilla/layout/doc/layout.css b/mozilla/layout/doc/layout.css
index 947cb411576..c8db6fb72e2 100644
--- a/mozilla/layout/doc/layout.css
+++ b/mozilla/layout/doc/layout.css
@@ -54,14 +54,17 @@ Components {
color: white;
cursor: pointer;
}
+
/* workaround for above rule not working */
-*[xml:link] {
+*[xlink:type] {
cursor: pointer;
}
+
/* workaround for above rule not working */
-*[show="replace"] {
+*[xlink:show="replace"] {
cursor: pointer;
}
+
Term {
display: block;
font-weight: bold;
diff --git a/mozilla/layout/doc/layout.xml b/mozilla/layout/doc/layout.xml
index 131b507f6cc..62d15e6b559 100644
--- a/mozilla/layout/doc/layout.xml
+++ b/mozilla/layout/doc/layout.xml
@@ -2,10 +2,11 @@
-
+Gecko Layout Engine
-Troy Chevalier
+Troy Chevalier8 August 1999Overview
@@ -22,29 +23,29 @@ by the style specification.
For more information on block layout, click
-here. For more information about
-line layout, click here.The table frame classes correspond to the HTML4 table spec, and in addition
to the table frame there are row group frames, row frames, column group frames,
diff --git a/mozilla/layout/xml/content/src/nsXMLElement.cpp b/mozilla/layout/xml/content/src/nsXMLElement.cpp
index 56c29327ad1..898239979ef 100644
--- a/mozilla/layout/xml/content/src/nsXMLElement.cpp
+++ b/mozilla/layout/xml/content/src/nsXMLElement.cpp
@@ -50,9 +50,10 @@ NS_NewXMLElement(nsIXMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIXMLContentIID, (void**) aInstancePtrResult);
}
-static nsIAtom* kLinkAtom; // XXX these should get moved to nsXMLAtoms
+static nsIAtom* kSimpleAtom; // XXX these should get moved to nsXMLAtoms
static nsIAtom* kHrefAtom;
static nsIAtom* kShowAtom;
+static nsIAtom* kTypeAtom;
static PRUint32 kElementCount;
nsXMLElement::nsXMLElement(nsIAtom *aTag)
@@ -63,18 +64,20 @@ nsXMLElement::nsXMLElement(nsIAtom *aTag)
mContentID = 0;
if (0 == kElementCount++) {
- kLinkAtom = NS_NewAtom("link");
+ kSimpleAtom = NS_NewAtom("simple");
kHrefAtom = NS_NewAtom("href");
kShowAtom = NS_NewAtom("show");
+ kTypeAtom = NS_NewAtom("type");
}
}
nsXMLElement::~nsXMLElement()
{
if (0 == --kElementCount) {
- NS_RELEASE(kLinkAtom);
+ NS_RELEASE(kSimpleAtom);
NS_RELEASE(kHrefAtom);
NS_RELEASE(kShowAtom);
+ NS_RELEASE(kTypeAtom);
}
}
@@ -111,11 +114,25 @@ nsXMLElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
// XXX It sucks that we have to do a strcmp for
// every attribute set. It might be a bit more expensive
// to create an atom.
- if ((kNameSpaceID_XML == aNameSpaceID) &&
- (aName == kLinkAtom) && (aValue.Equals("simple"))) {
- mIsLink = PR_TRUE;
+ if ((kNameSpaceID_XLink == aNameSpaceID) &&
+ (kTypeAtom == aName)) {
+ if (aValue.Equals(kSimpleAtom, PR_FALSE)) {
+ // NOTE: This really is a link according to the XLink spec,
+ // 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;
+ }
}
+ // XXX If the XLink actuate attribute is present and its value is
+ // onLoad, we should obey that too [XLink 3.6.2].
+
return mInner.SetAttribute(aNameSpaceID, aName, aValue, aNotify);
}
@@ -142,7 +159,7 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
stateManager->SetContentState(this, NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_FOCUS);
NS_RELEASE(stateManager);
}
- *aEventStatus = nsEventStatus_eConsumeDoDefault;
+ *aEventStatus = nsEventStatus_eConsumeDoDefault;
}
break;
@@ -151,20 +168,23 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
if (nsEventStatus_eConsumeNoDefault != *aEventStatus) {
nsAutoString show, href, target;
nsIURI* baseURL = nsnull;
- nsLinkVerb verb = eLinkVerb_Replace;
- target.Truncate();
- GetAttribute(kNameSpaceID_None, kHrefAtom, href);
- GetAttribute(kNameSpaceID_None, kShowAtom, show);
+ nsLinkVerb verb = eLinkVerb_Undefined;
+ GetAttribute(kNameSpaceID_XLink, kHrefAtom, href);
+ GetAttribute(kNameSpaceID_XLink, kShowAtom, show);
// XXX Should probably do this using atoms
if (show.Equals("new")) {
verb = eLinkVerb_New;
}
+ else if (show.Equals("replace")) {
+ verb = eLinkVerb_Replace;
+ }
else if (show.Equals("embed")) {
verb = eLinkVerb_Embed;
}
if (nsnull != mInner.mDocument) {
baseURL = mInner.mDocument->GetDocumentURL();
+ // XXX XML Base W3C
}
ret = mInner.TriggerLink(aPresContext, verb, baseURL, href, target, PR_TRUE);
NS_IF_RELEASE(baseURL);
@@ -181,9 +201,10 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
{
nsAutoString href, target;
nsIURI* baseURL = nsnull;
- GetAttribute(kNameSpaceID_None, kHrefAtom, href);
+ GetAttribute(kNameSpaceID_XLink, kHrefAtom, href);
if (nsnull != mInner.mDocument) {
baseURL = mInner.mDocument->GetDocumentURL();
+ // XXX XML Base W3C
}
ret = mInner.TriggerLink(aPresContext, eLinkVerb_Replace, baseURL, href, target, PR_FALSE);
diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
index eb4b38fedb0..93bdbae9372 100644
--- a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
+++ b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
@@ -109,8 +109,6 @@ static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
nsINameSpaceManager* nsXMLContentSink::gNameSpaceManager = nsnull;
PRUint32 nsXMLContentSink::gRefCnt = 0;
-static void SetTextStringOnTextNode(const nsString& aTextString, nsIContent* aTextNode);
-
// XXX Open Issues:
// 1) html:style - Should we allow inline style? If so, the content
// sink needs to process the tag and invoke the CSS parser.
diff --git a/mozilla/layout/xml/tests/books/books.xml b/mozilla/layout/xml/tests/books/books.xml
index 74732a6a77c..fe3dafa7c87 100644
--- a/mozilla/layout/xml/tests/books/books.xml
+++ b/mozilla/layout/xml/tests/books/books.xml
@@ -5,7 +5,8 @@
-
+
@@ -25,7 +26,7 @@
- On the Road
+ On the RoadKerouac, Jack0140042598
@@ -37,7 +38,7 @@ On The Road, the most famous of Jack Kerouac's works, is not only the soul of th
- The Road Ahead
+ The Road AheadGates, Bill666666666
@@ -49,7 +50,7 @@ In a study, the founder of Microsoft presents his vision for the future in which
- The Road to Wellville
+ The Road to WellvilleBoyle, T. Coraghessan0140167188
@@ -61,7 +62,7 @@ A snobbish wife and her henpecked husband travel to Dr. Kellogg's spa in turn-of
- AAA Road Atlas 1999
+ AAA Road Atlas 1999A. A. A.1562512625
@@ -73,7 +74,7 @@ The definitive road atlas to the United States, Canada and Mexico.
- Bethlehem Road
+ Bethlehem RoadPerry, Anne0449219143
@@ -85,7 +86,7 @@ He might be elegant, but there's no mistaking it--the gentleman tied to the lamp
- 84 Charing Cross Road
+ 84 Charing Cross RoadHanff, Helene0140143505
diff --git a/mozilla/layout/xml/tests/docbooktest.xml b/mozilla/layout/xml/tests/docbooktest.xml
index 5eaa582fecf..79baa336014 100644
--- a/mozilla/layout/xml/tests/docbooktest.xml
+++ b/mozilla/layout/xml/tests/docbooktest.xml
@@ -1,7 +1,8 @@
-SoftQuad
+
+SoftQuad
Inc.
@@ -64,12 +65,12 @@ tokenized attribute values.
The following topics describe DOM attributes:
-Interface
+Interface
Attr
-
+
Interface Element
-
+
@@ -43,7 +44,7 @@ For estimated tax payments for tax years beginning in 1999, the safe harbor for
For more information on estimated tax, see
- Publication 505.
+ Publication 505.
@@ -52,7 +53,7 @@ For more information on estimated tax, see
For 1999, the health insurance deduction for the self-employed is increased from 45% to 60% of the amount you pay for medical insurance for yourself and your family. For more information, see chapter 10 in
- Publication 535.
+ Publication 535.
@@ -73,7 +74,7 @@ For 1999, the employer and employee will continue to pay:
Wage limits.
For social security tax, the maximum amount of 1999 wages subject to the tax has increased to $72,600. For Medicare tax, all covered 1999 wages are subject to the tax. There is no wage base limit. For information about these taxes, see
- Publication 15, Circular E, Employer's Tax Guide.
+ Publication 15, Circular E, Employer's Tax Guide.
@@ -110,7 +111,7 @@ For 1999, the employer and employee will continue to pay:
Wage limits. For social security tax, the maximum amount of 1999 wages subject to the tax has increased to $72,600. For Medicare tax, all covered 1999 wages are subject to the tax. There is no wage base limit. For information about these taxes and amounts to withhold, see
-Publication 15, Circular E, Employer's TaxGuide.
+Publication 15, Circular E, Employer's TaxGuide.
@@ -126,7 +127,7 @@ Under certain circumstances, the IRS can waive the penalty for a first-time depo
Electronic Deposit of Taxes
-If you were first required to deposit taxes by electronic funds transfer after June 30, 1997, the IRS will not impose the penalty for not doing so before July 1, 1999. Previously, the IRS had waived the penalty through December 31, 1998. For information about depositing taxes electronically, see Publication 15.
+If you were first required to deposit taxes by electronic funds transfer after June 30, 1997, the IRS will not impose the penalty for not doing so before July 1, 1999. Previously, the IRS had waived the penalty through December 31, 1998. For information about depositing taxes electronically, see Publication 15.
@@ -167,7 +168,7 @@ The maximum amount subject to the social security part for tax years beginning i
Hardship Distributions
-Beginning in 1999, hardship distributions from 401(k) plans and 403(b) plans are not eligible rollover distributions. They cannot be rolled over into a traditional IRA. For more information on traditional IRAs, see Publication 590.
+Beginning in 1999, hardship distributions from 401(k) plans and 403(b) plans are not eligible rollover distributions. They cannot be rolled over into a traditional IRA. For more information on traditional IRAs, see Publication 590.
@@ -184,8 +185,8 @@ Beginning in 1999, hardship distributions from 401(k) plans and 403(b) plans are
For estates of decedents dying after 1997, the executor can elect to deduct the adjusted value of a qualified family-owned business interest, up to a limited amount, from the gross estate. For more information, see section 2057 of the Internal Revenue Code and the instructions for Schedule T, Form 706, United States Estate (and Generation-Skipping Transfer) Tax Return.
-
-
+
+ Suit for Refund
@@ -253,7 +254,7 @@ For 1999, the tax on the use of international air travel facilities will be $12.
For 1999, the luxury tax on a passenger vehicle is reduced from 7% to 6% of the amount of the sales price that exceeds the base amount. The base amount for 1999 is $36,000.
-The base amount is increased for electric vehicles and clean-fuel vehicles. See Publication 510 for information on these amounts.
+The base amount is increased for electric vehicles and clean-fuel vehicles. See Publication 510 for information on these amounts.
diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp
index d3e25f91953..6ff0e7009bd 100644
--- a/mozilla/webshell/src/nsWebShell.cpp
+++ b/mozilla/webshell/src/nsWebShell.cpp
@@ -2207,11 +2207,12 @@ nsWebShell::HandleLinkClickEvent(nsIContent *aContent,
{
nsAutoString target(aTargetSpec);
-
switch(aVerb) {
case eLinkVerb_New:
target.Assign("_blank");
// Fall into replace case
+ case eLinkVerb_Undefined:
+ // Fall through, this seems like the most reasonable action
case eLinkVerb_Replace:
{
// for now, just hack the verb to be view-link-clicked
@@ -2226,9 +2227,10 @@ nsWebShell::HandleLinkClickEvent(nsIContent *aContent,
}
break;
case eLinkVerb_Embed:
+ // XXX TODO Should be similar to the HTML IMG ALT attribute handling
+ // in NS 4.x
default:
- ;
- // XXX Need to do this
+ NS_ABORT_IF_FALSE(0,"unexpected link verb");
}
}
@@ -2237,7 +2239,7 @@ nsWebShell::OnOverLink(nsIContent* aContent,
const PRUnichar* aURLSpec,
const PRUnichar* aTargetSpec)
{
- nsCOMPtr browserChrome(do_GetInterface(mTreeOwner));
+ nsCOMPtr browserChrome(do_GetInterface(mTreeOwner));
if(browserChrome)
browserChrome->SetOverLink(aURLSpec);