Closed Bug 313315 Opened 19 years ago Closed 18 years ago

MozType not dynamically updated

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jhpedemonte, Assigned: allan)

Details

(Keywords: fixed1.8.0.5, fixed1.8.1)

Attachments

(3 files, 1 obsolete file)

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.
Attached file testcase
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.
Attached file testcase (non-upload)
Assignee: aaronr → xforms
(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).
Attached patch Patch (obsolete) — Splinter 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().
Assignee: xforms → allan
Status: NEW → ASSIGNED
Attachment #223762 - Flags: review?(Olli.Pettay)
Comment on attachment 223762 [details] [diff] [review]
Patch

Changes to nsXFormsControlStubBase::ProcessNodeBind aren't related to this bug.
Without those, r=me
Attachment #223762 - Flags: review?(Olli.Pettay) → review+
Attached patch Patch v2Splinter Review
Attachment #223762 - Attachment is obsolete: true
Attachment #223763 - Flags: review?(doronr)
Attachment #223763 - Flags: review?(doronr) → review+
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Keywords: fixed1.8.0.5
Keywords: fixed1.8.1
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: