We can save on the cost of AddRef and Release by using IsContentOfType instead of QI'ing to nsIStyledContent. nsIStyledContent is implemented only by content of type ELEMENT, so if that succeeds, we can just cast. Speeds up RuleProcessorData ctor by about 8% according to quantify.
Created attachment 197302 [details] [diff] [review] patch
Comment on attachment 197302 [details] [diff] [review] patch r+sr=dbaron if you add an assertion in the constructor, outside the if, that nsCOMPtr<nsIStyledContent>(do_QueryInterface(aContent)) == mStyledContent.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.