Use size and position in XPath expressions. Bug 265460, r=smaug+doronr, a=mkaply
git-svn-id: svn://10.0.0.236/trunk@174040 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -694,9 +694,6 @@ nsXFormsRepeatElement::Refresh()
|
||||
rv = mHTMLElement->GetOwnerDocument(getter_AddRefs(domDoc));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAutoString strSize;
|
||||
strSize.AppendInt(contextSize);
|
||||
|
||||
mMaxIndex = contextSize;
|
||||
for (PRUint32 i = 1; i < mMaxIndex + 1; ++i) {
|
||||
// Create <contextcontainer>
|
||||
@@ -706,15 +703,12 @@ nsXFormsRepeatElement::Refresh()
|
||||
getter_AddRefs(riElement));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Set context size, context position, and model as attributes
|
||||
// Set model as attribute
|
||||
if (!modelID.IsEmpty()) {
|
||||
riElement->SetAttribute(NS_LITERAL_STRING("model"), modelID);
|
||||
}
|
||||
nsAutoString strPos; strPos.AppendInt(i);
|
||||
riElement->SetAttribute(NS_LITERAL_STRING("contextposition"), strPos);
|
||||
riElement->SetAttribute(NS_LITERAL_STRING("contextsize"), strSize);
|
||||
|
||||
// Get and set context node
|
||||
// Get context node
|
||||
nsCOMPtr<nsIXFormsContextControl> riContext = do_QueryInterface(riElement);
|
||||
NS_ENSURE_TRUE(riContext, NS_ERROR_FAILURE);
|
||||
|
||||
@@ -724,8 +718,9 @@ nsXFormsRepeatElement::Refresh()
|
||||
|
||||
nsCOMPtr<nsIDOMElement> contextElement = do_QueryInterface(contextNode);
|
||||
NS_ENSURE_TRUE(contextElement, NS_ERROR_FAILURE);
|
||||
|
||||
rv = riContext->SetContextNode(contextElement);
|
||||
|
||||
// Set context node, position, and size
|
||||
rv = riContext->SetContext(contextElement, i, contextSize);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Iterate over template children, clone them, and append them to <contextcontainer>
|
||||
|
||||
Reference in New Issue
Block a user