зеркало из https://github.com/mozilla/pjs.git
Bug 403841: nsContentUtils::CreateContextualFragment needs to deal with being passed nodes other than elements. Patch by luser. r/sr=sicking
This commit is contained in:
Родитель
ef15e6bed5
Коммит
802e9dd89f
|
@ -3223,6 +3223,10 @@ nsContentUtils::CreateContextualFragment(nsIDOMNode* aContextNode,
|
|||
nsAutoTArray<nsAutoString, 32> tagStack;
|
||||
nsAutoString uriStr, nameStr;
|
||||
|
||||
// just in case we have a text node
|
||||
if (!content->IsNodeOfType(nsINode::eELEMENT))
|
||||
content = content->GetParent();
|
||||
|
||||
while (content && content->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
nsAutoString& tagName = *tagStack.AppendElement();
|
||||
NS_ENSURE_TRUE(&tagName, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
|
|
@ -119,6 +119,7 @@ _TEST_FILES = test_bug5141.html \
|
|||
test_bug403852.html \
|
||||
test_bug403868.xml \
|
||||
test_bug405182.html \
|
||||
test_bug403841.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
Загрузка…
Ссылка в новой задаче