зеркало из https://github.com/mozilla/gecko-dev.git
Bug 222342: Speed up txStylesheet::isStripSpaceAllowed by not filtering textnodes in the root of a document and by earlyreturning if there are no stripspace rules.
r=Pike sr=peterv
This commit is contained in:
Родитель
21a1ef2ab5
Коммит
3ec93e622e
|
@ -275,7 +275,8 @@ txStylesheet::getKeyMap()
|
|||
PRBool
|
||||
txStylesheet::isStripSpaceAllowed(Node* aNode, txIMatchContext* aContext)
|
||||
{
|
||||
if (!aNode) {
|
||||
PRInt32 frameCount = mStripSpaceTests.Count();
|
||||
if (!aNode || frameCount == 0) {
|
||||
return MB_FALSE;
|
||||
}
|
||||
|
||||
|
@ -283,7 +284,7 @@ txStylesheet::isStripSpaceAllowed(Node* aNode, txIMatchContext* aContext)
|
|||
case Node::ELEMENT_NODE:
|
||||
{
|
||||
// check Whitespace stipping handling list against given Node
|
||||
PRInt32 i, frameCount = mStripSpaceTests.Count();
|
||||
PRInt32 i;
|
||||
for (i = 0; i < frameCount; ++i) {
|
||||
txStripSpaceTest* sst =
|
||||
NS_STATIC_CAST(txStripSpaceTest*, mStripSpaceTests[i]);
|
||||
|
@ -304,10 +305,6 @@ txStylesheet::isStripSpaceAllowed(Node* aNode, txIMatchContext* aContext)
|
|||
return MB_FALSE;
|
||||
return isStripSpaceAllowed(aNode->getParentNode(), aContext);
|
||||
}
|
||||
case Node::DOCUMENT_NODE:
|
||||
{
|
||||
return MB_TRUE;
|
||||
}
|
||||
}
|
||||
return MB_FALSE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче