Allan can describe this better, but I'll give it a shot.
Currently, MozType attribute is set in |nsXFormsDelegateStub::Refresh()|, but
this is not good enough for elements that have CSS rules depending on MozType.
Example coming up.
Created attachment 200379 [details]
This is a modified testcase from the upload bug 275453. When it is first
loaded, it defaults to "anyURI" as the type of the bound node, so this selects
the "upload[mozType|type="http://www.w3.org/2001/XMLSchema#anyURI"]" CSS rule,
which in turn binds to the functional "xformswidget-upload".
If you then select "none" from the dropdown, this should select the default
"upload" CSS rule, which binds to "xformswidget-upload-disabled". But this
doesn't happen immediately. You first have to do something to cause the model
to refresh, at which point the buttons of the upload element will be disabled,
since the "xformswidget-upload-disabled" binding is now being used.
Quick thoughts: nsXFormsMDGEngine::SetNodeValue() should check if it sets the
value of @xsi:type, and inform the model to refresh the parent of the attribute.
Or directly set the type attribute on the parent.
Created attachment 218701 [details]
(In reply to comment #2)
> Quick thoughts: nsXFormsMDGEngine::SetNodeValue() should check if it sets the
> value of @xsi:type, and inform the model to refresh the parent of the attribute.
> Or directly set the type attribute on the parent.
Second thought: Kind of hacky, and involves a lot of checks for each recalculate step. Instead nsIXFormsControl::dependencies should return @xsi:type as a dependency (if it exists).
Created attachment 223762 [details] [diff] [review]
Adds @xsi:type as a dependency if it is present on the bound node of a control. That triggers a rebind and rebuild. The rebind is not strictly necessary, but a newly bound control might assume that it gets both a Bind() and a Refresh().
Comment on attachment 223762 [details] [diff] [review]
Changes to nsXFormsControlStubBase::ProcessNodeBind aren't related to this bug.
Without those, r=me
Created attachment 223763 [details] [diff] [review]
Fixed on trunk.