added support for doc quality

This commit is contained in:
rickg 1998-06-23 01:34:25 +00:00
parent 3c43366f5f
commit 4b202376f1
14 changed files with 72 additions and 22 deletions

View File

@ -23,6 +23,7 @@
#include "nsHTMLDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIViewManager.h"
#include "nsHTMLTokens.h"
#include "nsCRT.h"
#include "prtime.h"
@ -132,7 +133,7 @@ public:
virtual PRBool AddLeaf(const nsIParserNode& aNode);
virtual void WillBuildModel(void);
virtual void DidBuildModel(void);
virtual void DidBuildModel(PRInt32 aQualityLevel);
virtual void WillInterrupt(void);
virtual void WillResume(void);
@ -1367,16 +1368,31 @@ HTMLContentSink::WillBuildModel(void)
StartLayout();
}
/**
* This method gets called when the parser concludes the process
* of building the content model via the content sink.
*
* @update 5/7/98 gess
* @param aQualityLevel describes how well formed the doc was.
* 0=GOOD; 1=FAIR; 2=POOR;
* @update 6/21/98 gess
*/
void
HTMLContentSink::DidBuildModel(void)
{
void HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel) {
PR_LogPrint("DidBuildModel");
PRInt32 i, ns = mDocument->GetNumberOfShells();
for (i = 0; i < ns; i++) {
nsIPresShell* shell = mDocument->GetShellAt(i);
if (nsnull != shell) {
nsIViewManager* vm = shell->GetViewManager();
if(vm) {
vm->SetQuality(nsContentQuality(aQualityLevel));
}
NS_RELEASE(vm);
NS_RELEASE(shell);
}
}
ReflowNewContent();
mDocument->EndLoad();
}
@ -1404,6 +1420,7 @@ HTMLContentSink::WillResume(void)
{
}
//----------------------------------------------------------------------
nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,

View File

@ -301,7 +301,7 @@ PRInt32 CNavDTD::DidBuildModel(PRInt32 anErrorCode){
CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE);
}
if(mSink) {
mSink->DidBuildModel();
mSink->DidBuildModel(1);
}
return result;

View File

@ -303,7 +303,7 @@ PRInt32 COtherDTD::DidBuildModel(PRInt32 anErrorCode){
CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE);
}
if(mSink) {
mSink->DidBuildModel();
mSink->DidBuildModel(0);
}
return result;

View File

@ -442,7 +442,7 @@ void nsHTMLContentSink::WillBuildModel(void){
*
* @update 5/7/98 gess
*/
void nsHTMLContentSink::DidBuildModel(void){
void nsHTMLContentSink::DidBuildModel(PRInt32 aQualityLevel){
}
/**
@ -465,3 +465,4 @@ void nsHTMLContentSink::WillResume(void) {
}

View File

@ -127,9 +127,11 @@ class nsHTMLContentSink : public nsIHTMLContentSink {
* This method gets called when the parser concludes the process
* of building the content model via the content sink.
*
* @param aQualityLevel describes how well formed the doc was.
* 0=GOOD; 1=FAIR; 2=POOR;
* @update 5/7/98 gess
*/
virtual void DidBuildModel(void);
virtual void DidBuildModel(PRInt32 aQualityLevel);
/**
* This method gets called when the parser gets i/o blocked,

View File

@ -92,9 +92,11 @@ class nsIContentSink : public nsISupports {
* This method gets called when the parser concludes the process
* of building the content model via the content sink.
*
* @param aQualityLevel describes how well formed the doc was.
* 0=GOOD; 1=FAIR; 2=POOR;
* @update 5/7/98 gess
*/
virtual void DidBuildModel(void)=0;
virtual void DidBuildModel(PRInt32 aQualityLevel)=0;
/**
* This method gets called when the parser gets i/o blocked,

View File

@ -226,9 +226,11 @@ class nsIHTMLContentSink : public nsIContentSink {
* This method gets called when the parser concludes the process
* of building the content model via the content sink.
*
* @param aQualityLevel describes how well formed the doc was.
* 0=GOOD; 1=FAIR; 2=POOR;
* @update 5/7/98 gess
*/
virtual void DidBuildModel(void)=0;
virtual void DidBuildModel(PRInt32 aQualityLevel)=0;
/**
* This method gets called when the parser gets i/o blocked,
@ -246,6 +248,7 @@ class nsIHTMLContentSink : public nsIContentSink {
* @update 5/7/98 gess
*/
virtual void WillResume(void)=0;
};

View File

@ -23,6 +23,7 @@
#include "nsHTMLDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIViewManager.h"
#include "nsHTMLTokens.h"
#include "nsCRT.h"
#include "prtime.h"
@ -132,7 +133,7 @@ public:
virtual PRBool AddLeaf(const nsIParserNode& aNode);
virtual void WillBuildModel(void);
virtual void DidBuildModel(void);
virtual void DidBuildModel(PRInt32 aQualityLevel);
virtual void WillInterrupt(void);
virtual void WillResume(void);
@ -1367,16 +1368,31 @@ HTMLContentSink::WillBuildModel(void)
StartLayout();
}
/**
* This method gets called when the parser concludes the process
* of building the content model via the content sink.
*
* @update 5/7/98 gess
* @param aQualityLevel describes how well formed the doc was.
* 0=GOOD; 1=FAIR; 2=POOR;
* @update 6/21/98 gess
*/
void
HTMLContentSink::DidBuildModel(void)
{
void HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel) {
PR_LogPrint("DidBuildModel");
PRInt32 i, ns = mDocument->GetNumberOfShells();
for (i = 0; i < ns; i++) {
nsIPresShell* shell = mDocument->GetShellAt(i);
if (nsnull != shell) {
nsIViewManager* vm = shell->GetViewManager();
if(vm) {
vm->SetQuality(nsContentQuality(aQualityLevel));
}
NS_RELEASE(vm);
NS_RELEASE(shell);
}
}
ReflowNewContent();
mDocument->EndLoad();
}
@ -1404,6 +1420,7 @@ HTMLContentSink::WillResume(void)
{
}
//----------------------------------------------------------------------
nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,

View File

@ -301,7 +301,7 @@ PRInt32 CNavDTD::DidBuildModel(PRInt32 anErrorCode){
CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE);
}
if(mSink) {
mSink->DidBuildModel();
mSink->DidBuildModel(1);
}
return result;

View File

@ -303,7 +303,7 @@ PRInt32 COtherDTD::DidBuildModel(PRInt32 anErrorCode){
CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE);
}
if(mSink) {
mSink->DidBuildModel();
mSink->DidBuildModel(0);
}
return result;

View File

@ -442,7 +442,7 @@ void nsHTMLContentSink::WillBuildModel(void){
*
* @update 5/7/98 gess
*/
void nsHTMLContentSink::DidBuildModel(void){
void nsHTMLContentSink::DidBuildModel(PRInt32 aQualityLevel){
}
/**
@ -465,3 +465,4 @@ void nsHTMLContentSink::WillResume(void) {
}

View File

@ -127,9 +127,11 @@ class nsHTMLContentSink : public nsIHTMLContentSink {
* This method gets called when the parser concludes the process
* of building the content model via the content sink.
*
* @param aQualityLevel describes how well formed the doc was.
* 0=GOOD; 1=FAIR; 2=POOR;
* @update 5/7/98 gess
*/
virtual void DidBuildModel(void);
virtual void DidBuildModel(PRInt32 aQualityLevel);
/**
* This method gets called when the parser gets i/o blocked,

View File

@ -92,9 +92,11 @@ class nsIContentSink : public nsISupports {
* This method gets called when the parser concludes the process
* of building the content model via the content sink.
*
* @param aQualityLevel describes how well formed the doc was.
* 0=GOOD; 1=FAIR; 2=POOR;
* @update 5/7/98 gess
*/
virtual void DidBuildModel(void)=0;
virtual void DidBuildModel(PRInt32 aQualityLevel)=0;
/**
* This method gets called when the parser gets i/o blocked,

View File

@ -226,9 +226,11 @@ class nsIHTMLContentSink : public nsIContentSink {
* This method gets called when the parser concludes the process
* of building the content model via the content sink.
*
* @param aQualityLevel describes how well formed the doc was.
* 0=GOOD; 1=FAIR; 2=POOR;
* @update 5/7/98 gess
*/
virtual void DidBuildModel(void)=0;
virtual void DidBuildModel(PRInt32 aQualityLevel)=0;
/**
* This method gets called when the parser gets i/o blocked,
@ -246,6 +248,7 @@ class nsIHTMLContentSink : public nsIContentSink {
* @update 5/7/98 gess
*/
virtual void WillResume(void)=0;
};