From c251f70e4b4e356ed42fd2dd509ef398e409e74c Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Fri, 15 Jan 1999 02:08:20 +0000 Subject: [PATCH] don't assert when not mapping anything without mapping function Checkin during red tree approved by sar --- content/html/style/src/nsHTMLAttributes.cpp | 8 +++++--- layout/html/style/src/nsHTMLAttributes.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/content/html/style/src/nsHTMLAttributes.cpp b/content/html/style/src/nsHTMLAttributes.cpp index 9aa14ca6a5d3..d33f6c1ae8ff 100644 --- a/content/html/style/src/nsHTMLAttributes.cpp +++ b/content/html/style/src/nsHTMLAttributes.cpp @@ -827,9 +827,11 @@ HTMLAttributesImpl::SetMappingFunction(nsMapAttributesFunc aMapFunc) NS_IMETHODIMP HTMLAttributesImpl::MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext) { - NS_ASSERTION(nsnull != mMapper, "no mapping function"); - if (nsnull != mMapper) { - (*mMapper)(this, aContext, aPresContext); + if (0 < mCount) { + NS_ASSERTION(nsnull != mMapper, "no mapping function"); + if (nsnull != mMapper) { + (*mMapper)(this, aContext, aPresContext); + } } return NS_OK; } diff --git a/layout/html/style/src/nsHTMLAttributes.cpp b/layout/html/style/src/nsHTMLAttributes.cpp index 9aa14ca6a5d3..d33f6c1ae8ff 100644 --- a/layout/html/style/src/nsHTMLAttributes.cpp +++ b/layout/html/style/src/nsHTMLAttributes.cpp @@ -827,9 +827,11 @@ HTMLAttributesImpl::SetMappingFunction(nsMapAttributesFunc aMapFunc) NS_IMETHODIMP HTMLAttributesImpl::MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext) { - NS_ASSERTION(nsnull != mMapper, "no mapping function"); - if (nsnull != mMapper) { - (*mMapper)(this, aContext, aPresContext); + if (0 < mCount) { + NS_ASSERTION(nsnull != mMapper, "no mapping function"); + if (nsnull != mMapper) { + (*mMapper)(this, aContext, aPresContext); + } } return NS_OK; }