From 0e313006303c6252dd0499b3a3e2a59a48925caf Mon Sep 17 00:00:00 2001 From: rickg Date: Wed, 22 Apr 1998 20:22:59 +0000 Subject: [PATCH] tweaked the API to be more DTD-like git-svn-id: svn://10.0.0.236/trunk@517 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/CNavDTD.cpp | 17 ++++++++++++++++- mozilla/htmlparser/src/CNavDTD.h | 14 +++++++++++++- mozilla/htmlparser/src/COtherDTD.cpp | 18 +++++++++++++++++- mozilla/htmlparser/src/COtherDTD.h | 14 +++++++++++++- mozilla/htmlparser/src/nsHTMLDTD.cpp | 18 ++++++++++++++++-- mozilla/htmlparser/src/nsHTMLDTD.h | 14 +++++++++++++- mozilla/htmlparser/src/nsIDTD.h | 14 +++++++++++++- mozilla/parser/htmlparser/src/CNavDTD.cpp | 17 ++++++++++++++++- mozilla/parser/htmlparser/src/CNavDTD.h | 14 +++++++++++++- mozilla/parser/htmlparser/src/COtherDTD.cpp | 18 +++++++++++++++++- mozilla/parser/htmlparser/src/COtherDTD.h | 14 +++++++++++++- mozilla/parser/htmlparser/src/nsHTMLDTD.cpp | 18 ++++++++++++++++-- mozilla/parser/htmlparser/src/nsHTMLDTD.h | 14 +++++++++++++- mozilla/parser/htmlparser/src/nsIDTD.h | 14 +++++++++++++- 14 files changed, 202 insertions(+), 16 deletions(-) diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index 6b4b54b57bc..cc980ffac5f 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -291,8 +291,23 @@ PRBool CNavDTD::VerifyContextStack(eHTMLTags aStack[],PRInt32 aCount) const { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- -PRInt32 CNavDTD::CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const { +PRInt32 CNavDTD::ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const { PRInt32 result=0; return result; } +/** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the parent down to the + * child. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- +PRInt32 CNavDTD::BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const { + PRInt32 result=0; + return result; +} diff --git a/mozilla/htmlparser/src/CNavDTD.h b/mozilla/htmlparser/src/CNavDTD.h index 6014335290a..73a27e6e612 100644 --- a/mozilla/htmlparser/src/CNavDTD.h +++ b/mozilla/htmlparser/src/CNavDTD.h @@ -138,7 +138,19 @@ class CNavDTD : public nsHTMLDTD { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- - virtual PRInt32 CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const; + virtual PRInt32 ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; + + /** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- + virtual PRInt32 BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; }; diff --git a/mozilla/htmlparser/src/COtherDTD.cpp b/mozilla/htmlparser/src/COtherDTD.cpp index 8076122a835..5a71babaaac 100644 --- a/mozilla/htmlparser/src/COtherDTD.cpp +++ b/mozilla/htmlparser/src/COtherDTD.cpp @@ -280,6 +280,7 @@ PRBool COtherDTD::VerifyContextStack(eHTMLTags aStack[],PRInt32 aCount) const { } + /** ------------------------------------------------------- * This method tries to design a context map (without actually * changing our parser state) from the parent down to the @@ -291,8 +292,23 @@ PRBool COtherDTD::VerifyContextStack(eHTMLTags aStack[],PRInt32 aCount) const { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- -PRInt32 COtherDTD::CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const { +PRInt32 COtherDTD::ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const { PRInt32 result=0; return result; } +/** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the parent down to the + * child. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- +PRInt32 COtherDTD::BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const { + PRInt32 result=0; + return result; +} diff --git a/mozilla/htmlparser/src/COtherDTD.h b/mozilla/htmlparser/src/COtherDTD.h index 1d9d174d692..58463bdf108 100644 --- a/mozilla/htmlparser/src/COtherDTD.h +++ b/mozilla/htmlparser/src/COtherDTD.h @@ -139,7 +139,19 @@ class COtherDTD : public nsHTMLDTD { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- - virtual PRInt32 CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const; + virtual ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; + + /** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- + virtual PRInt32 BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; }; diff --git a/mozilla/htmlparser/src/nsHTMLDTD.cpp b/mozilla/htmlparser/src/nsHTMLDTD.cpp index a15c89c4d16..ce31e0619cf 100644 --- a/mozilla/htmlparser/src/nsHTMLDTD.cpp +++ b/mozilla/htmlparser/src/nsHTMLDTD.cpp @@ -682,8 +682,22 @@ PRBool nsHTMLDTD::VerifyContextStack(eHTMLTags aStack[],PRInt32 aCount) const { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- -PRInt32 nsHTMLDTD::CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const { - PRInt32 result=0; +PRInt32 nsHTMLDTD::ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const{ + int result=0; return result; } +/** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- +PRInt32 nsHTMLDTD::BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const{ + int result=0; + return result; +} diff --git a/mozilla/htmlparser/src/nsHTMLDTD.h b/mozilla/htmlparser/src/nsHTMLDTD.h index fc53ae6e9d1..6dc00d41456 100644 --- a/mozilla/htmlparser/src/nsHTMLDTD.h +++ b/mozilla/htmlparser/src/nsHTMLDTD.h @@ -138,7 +138,19 @@ class nsHTMLDTD : public nsIDTD { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- - virtual PRInt32 CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const; + virtual ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; + + /** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- + virtual BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; }; diff --git a/mozilla/htmlparser/src/nsIDTD.h b/mozilla/htmlparser/src/nsIDTD.h index 162d282ec46..ca85255cf40 100644 --- a/mozilla/htmlparser/src/nsIDTD.h +++ b/mozilla/htmlparser/src/nsIDTD.h @@ -104,7 +104,19 @@ class nsIDTD : public nsISupports { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- - virtual PRInt32 CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const=0; + virtual PRInt32 ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const=0; + + /** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- + virtual PRInt32 BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const=0; }; diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index 6b4b54b57bc..cc980ffac5f 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -291,8 +291,23 @@ PRBool CNavDTD::VerifyContextStack(eHTMLTags aStack[],PRInt32 aCount) const { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- -PRInt32 CNavDTD::CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const { +PRInt32 CNavDTD::ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const { PRInt32 result=0; return result; } +/** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the parent down to the + * child. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- +PRInt32 CNavDTD::BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const { + PRInt32 result=0; + return result; +} diff --git a/mozilla/parser/htmlparser/src/CNavDTD.h b/mozilla/parser/htmlparser/src/CNavDTD.h index 6014335290a..73a27e6e612 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.h +++ b/mozilla/parser/htmlparser/src/CNavDTD.h @@ -138,7 +138,19 @@ class CNavDTD : public nsHTMLDTD { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- - virtual PRInt32 CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const; + virtual PRInt32 ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; + + /** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- + virtual PRInt32 BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; }; diff --git a/mozilla/parser/htmlparser/src/COtherDTD.cpp b/mozilla/parser/htmlparser/src/COtherDTD.cpp index 8076122a835..5a71babaaac 100644 --- a/mozilla/parser/htmlparser/src/COtherDTD.cpp +++ b/mozilla/parser/htmlparser/src/COtherDTD.cpp @@ -280,6 +280,7 @@ PRBool COtherDTD::VerifyContextStack(eHTMLTags aStack[],PRInt32 aCount) const { } + /** ------------------------------------------------------- * This method tries to design a context map (without actually * changing our parser state) from the parent down to the @@ -291,8 +292,23 @@ PRBool COtherDTD::VerifyContextStack(eHTMLTags aStack[],PRInt32 aCount) const { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- -PRInt32 COtherDTD::CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const { +PRInt32 COtherDTD::ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const { PRInt32 result=0; return result; } +/** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the parent down to the + * child. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- +PRInt32 COtherDTD::BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const { + PRInt32 result=0; + return result; +} diff --git a/mozilla/parser/htmlparser/src/COtherDTD.h b/mozilla/parser/htmlparser/src/COtherDTD.h index 1d9d174d692..58463bdf108 100644 --- a/mozilla/parser/htmlparser/src/COtherDTD.h +++ b/mozilla/parser/htmlparser/src/COtherDTD.h @@ -139,7 +139,19 @@ class COtherDTD : public nsHTMLDTD { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- - virtual PRInt32 CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const; + virtual ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; + + /** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- + virtual PRInt32 BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; }; diff --git a/mozilla/parser/htmlparser/src/nsHTMLDTD.cpp b/mozilla/parser/htmlparser/src/nsHTMLDTD.cpp index a15c89c4d16..ce31e0619cf 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLDTD.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLDTD.cpp @@ -682,8 +682,22 @@ PRBool nsHTMLDTD::VerifyContextStack(eHTMLTags aStack[],PRInt32 aCount) const { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- -PRInt32 nsHTMLDTD::CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const { - PRInt32 result=0; +PRInt32 nsHTMLDTD::ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const{ + int result=0; return result; } +/** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- +PRInt32 nsHTMLDTD::BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const{ + int result=0; + return result; +} diff --git a/mozilla/parser/htmlparser/src/nsHTMLDTD.h b/mozilla/parser/htmlparser/src/nsHTMLDTD.h index fc53ae6e9d1..6dc00d41456 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLDTD.h +++ b/mozilla/parser/htmlparser/src/nsHTMLDTD.h @@ -138,7 +138,19 @@ class nsHTMLDTD : public nsIDTD { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- - virtual PRInt32 CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const; + virtual ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; + + /** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- + virtual BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const; }; diff --git a/mozilla/parser/htmlparser/src/nsIDTD.h b/mozilla/parser/htmlparser/src/nsIDTD.h index 162d282ec46..ca85255cf40 100644 --- a/mozilla/parser/htmlparser/src/nsIDTD.h +++ b/mozilla/parser/htmlparser/src/nsIDTD.h @@ -104,7 +104,19 @@ class nsIDTD : public nsISupports { * @return Non zero count of intermediate nodes; * 0 if unable to comply */ //---------------------------------------------------- - virtual PRInt32 CreateContextMapBetween(PRInt32 aParent,PRInt32 aChild) const=0; + virtual PRInt32 ForwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const=0; + + /** ------------------------------------------------------- + * This method tries to design a context map (without actually + * changing our parser state) from the child up to the parent. + * + * @update gess4/6/98 + * @param aParent -- tag type of parent + * @param aChild -- tag type of child + * @return Non zero count of intermediate nodes; + * 0 if unable to comply + */ //---------------------------------------------------- + virtual PRInt32 BackwardPropagate(PRInt32 aVector[],PRInt32 aParent,PRInt32 aChild) const=0; };