diff --git a/extensions/xforms/nsXFormsContextContainer.cpp b/extensions/xforms/nsXFormsContextContainer.cpp index 0a11c07ba2e8..0ee581ea120d 100644 --- a/extensions/xforms/nsXFormsContextContainer.cpp +++ b/extensions/xforms/nsXFormsContextContainer.cpp @@ -82,9 +82,12 @@ protected: /** The context size for the element */ PRInt32 mContextSize; + /** Does this element have the repeat-index? */ + PRBool mHasIndex; + public: nsXFormsContextContainer() - : mContextPosition(1), mContextSize(1) {} + : mContextPosition(1), mContextSize(1), mHasIndex(PR_FALSE) {} NS_DECL_ISUPPORTS_INHERITED @@ -260,12 +263,13 @@ NS_IMETHODIMP nsXFormsContextContainer::SetIndexState(PRBool aHasIndex) { if (mElement) { - NS_NAMED_LITERAL_STRING(repIndex, "repeat-index"); + mHasIndex = aHasIndex; + NS_NAMED_LITERAL_STRING(classStr, "class"); if (aHasIndex) { - mElement->SetAttribute(repIndex, - NS_LITERAL_STRING("1")); + mElement->SetAttribute(classStr, + NS_LITERAL_STRING("xf-repeat-item xf-repeat-index")); } else { - mElement->RemoveAttribute(repIndex); + mElement->SetAttribute(classStr, NS_LITERAL_STRING("xf-repeat-item")); } } return NS_OK; @@ -273,8 +277,10 @@ nsXFormsContextContainer::SetIndexState(PRBool aHasIndex) NS_IMETHODIMP nsXFormsContextContainer::GetIndexState(PRBool *aHasIndex) -{ - return mElement->HasAttribute(NS_LITERAL_STRING("repeat-index"), aHasIndex); +{ + NS_ENSURE_ARG(aHasIndex); + *aHasIndex = mHasIndex; + return NS_OK; } // Factory diff --git a/extensions/xforms/resources/content/select.xml b/extensions/xforms/resources/content/select.xml index 78eaeedb9755..f6c933aaeef4 100644 --- a/extensions/xforms/resources/content/select.xml +++ b/extensions/xforms/resources/content/select.xml @@ -83,6 +83,7 @@ diff --git a/extensions/xforms/resources/content/select1.xml b/extensions/xforms/resources/content/select1.xml index c440faab7989..23458e70889b 100644 --- a/extensions/xforms/resources/content/select1.xml +++ b/extensions/xforms/resources/content/select1.xml @@ -67,7 +67,7 @@ onclick="this.parentNode.parentNode.handleControlClick();" onkeypress="this.parentNode.parentNode.handleKeyPress(event);" onkeyup="this.parentNode.parentNode.handleKeyUp(event);" - /> - + @@ -177,6 +177,7 @@