Bug 1067325 - Control syntax highlighting via a class. r=hsivonen

This commit is contained in:
J. Ryan Stinnett
2015-05-23 18:17:50 -05:00
parent 375b366378
commit 515fc0da45
10 changed files with 28 additions and 50 deletions

View File

@@ -53,8 +53,6 @@ nsHtml5Highlighter::nsHtml5Highlighter(nsAHtml5TreeOpSink* aOpSink)
, mInlinesOpen(0)
, mInCharacters(false)
, mBuffer(nullptr)
, mSyntaxHighlight(Preferences::GetBool("view_source.syntax_highlight",
true))
, mOpSink(aOpSink)
, mCurrentRun(nullptr)
, mAmpersand(nullptr)
@@ -713,9 +711,6 @@ nsHtml5Highlighter::AppendCharacters(const char16_t* aBuffer,
void
nsHtml5Highlighter::AddClass(const char16_t* aClass)
{
if (!mSyntaxHighlight) {
return;
}
mOpQueue.AppendElement()->InitAddClass(CurrentNode(), aClass);
}
@@ -751,9 +746,6 @@ nsHtml5Highlighter::AddBase(const nsString& aValue)
void
nsHtml5Highlighter::AddErrorToCurrentNode(const char* aMsgId)
{
if (!mSyntaxHighlight) {
return;
}
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
NS_ASSERTION(treeOp, "Tree op allocation failed.");
treeOp->Init(CurrentNode(), aMsgId);
@@ -762,9 +754,6 @@ nsHtml5Highlighter::AddErrorToCurrentNode(const char* aMsgId)
void
nsHtml5Highlighter::AddErrorToCurrentRun(const char* aMsgId)
{
if (!mSyntaxHighlight) {
return;
}
NS_PRECONDITION(mCurrentRun, "Adding error to run without one!");
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
NS_ASSERTION(treeOp, "Tree op allocation failed.");
@@ -775,9 +764,6 @@ void
nsHtml5Highlighter::AddErrorToCurrentRun(const char* aMsgId,
nsIAtom* aName)
{
if (!mSyntaxHighlight) {
return;
}
NS_PRECONDITION(mCurrentRun, "Adding error to run without one!");
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
NS_ASSERTION(treeOp, "Tree op allocation failed.");
@@ -789,9 +775,6 @@ nsHtml5Highlighter::AddErrorToCurrentRun(const char* aMsgId,
nsIAtom* aName,
nsIAtom* aOther)
{
if (!mSyntaxHighlight) {
return;
}
NS_PRECONDITION(mCurrentRun, "Adding error to run without one!");
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
NS_ASSERTION(treeOp, "Tree op allocation failed.");
@@ -801,9 +784,6 @@ nsHtml5Highlighter::AddErrorToCurrentRun(const char* aMsgId,
void
nsHtml5Highlighter::AddErrorToCurrentAmpersand(const char* aMsgId)
{
if (!mSyntaxHighlight) {
return;
}
NS_PRECONDITION(mAmpersand, "Adding error to ampersand without one!");
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
NS_ASSERTION(treeOp, "Tree op allocation failed.");
@@ -813,9 +793,6 @@ nsHtml5Highlighter::AddErrorToCurrentAmpersand(const char* aMsgId)
void
nsHtml5Highlighter::AddErrorToCurrentSlash(const char* aMsgId)
{
if (!mSyntaxHighlight) {
return;
}
NS_PRECONDITION(mSlash, "Adding error to slash without one!");
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
NS_ASSERTION(treeOp, "Tree op allocation failed.");