Last Comment Bug 313315 - MozType not dynamically updated
: MozType not dynamically updated
Status: RESOLVED FIXED
: fixed1.8.0.5, fixed1.8.1
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Allan Beaufour
: Stephen Pride
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-21 13:58 PDT by jhp (no longer active)
Modified: 2016-07-15 14:46 PDT (History)
4 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
testcase (2.35 KB, application/xhtml+xml)
2005-10-21 14:06 PDT, jhp (no longer active)
no flags Details
testcase (non-upload) (2.21 KB, application/xhtml+xml)
2006-04-17 10:16 PDT, Allan Beaufour
no flags Details
Patch (3.46 KB, patch)
2006-05-30 03:42 PDT, Allan Beaufour
bugs: review+
Details | Diff | Splinter Review
Patch v2 (1.84 KB, patch)
2006-05-30 04:01 PDT, Allan Beaufour
doronr: review+
Details | Diff | Splinter Review

Description jhp (no longer active) 2005-10-21 13:58:40 PDT
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.
Comment 1 jhp (no longer active) 2005-10-21 14:06:09 PDT
Created attachment 200379 [details]
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.
Comment 2 Allan Beaufour 2005-10-22 11:35:57 PDT
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.
Comment 3 Allan Beaufour 2006-04-17 10:16:50 PDT
Created attachment 218701 [details]
testcase (non-upload)
Comment 4 Allan Beaufour 2006-05-30 03:16:54 PDT
(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).
Comment 5 Allan Beaufour 2006-05-30 03:42:42 PDT
Created attachment 223762 [details] [diff] [review]
Patch

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 6 Olli Pettay [:smaug] 2006-05-30 03:51:04 PDT
Comment on attachment 223762 [details] [diff] [review]
Patch

Changes to nsXFormsControlStubBase::ProcessNodeBind aren't related to this bug.
Without those, r=me
Comment 7 Allan Beaufour 2006-05-30 04:01:30 PDT
Created attachment 223763 [details] [diff] [review]
Patch v2
Comment 8 Allan Beaufour 2006-05-30 06:41:35 PDT
Fixed on trunk.

Note You need to log in before you can comment on or make changes to this bug.