Closed
Bug 272406
Opened 21 years ago
Closed 21 years ago
External instance data not handled correctly
Categories
(Core Graveyard :: XForms, defect)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8beta1
People
(Reporter: allan, Assigned: smaug)
References
()
Details
Attachments
(1 file, 2 obsolete files)
5.18 KB,
patch
|
darin.moz
:
review+
|
Details | Diff | Splinter Review |
nsXFormsInstanceElement receives two Load() events, and calls
nsXFormsModelElement::InstanceLoadFinished() on the first call, which is
premature, resulting in a too early nsXFormsModelElement::FinishConstruction().
Reporter | ||
Comment 1•21 years ago
|
||
Checks whether it's first load or not. It seems somewhat stupid to do it this
way, but is there something in aEvent we could use?
Reporter | ||
Updated•21 years ago
|
Attachment #167424 -
Flags: review?(smaug)
Reporter | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Comment 2•21 years ago
|
||
Why are there two load events? Perhaps that indicates a gecko bug that we
should be concerned about?
Comment 3•21 years ago
|
||
I confirm that this patch works. Again, though, I'm not sure why it is necessary.
Comment 4•21 years ago
|
||
OK, in my testing the problem is with the comment here:
http://lxr.mozilla.org/mozilla/source/extensions/xforms/nsXFormsInstanceElement.cpp#76
It seems that CreateInstanceDocument does not fail, and so we actually end up
loading the external instance document twice! :(
Reporter | ||
Comment 5•21 years ago
|
||
(In reply to comment #4)
> OK, in my testing the problem is with the comment here:
>
http://lxr.mozilla.org/mozilla/source/extensions/xforms/nsXFormsInstanceElement.cpp#76
>
> It seems that CreateInstanceDocument does not fail, and so we actually end up
> loading the external instance document twice! :(
Are you sure it loads both times? As far as I could see we only got the instance
data on the last load. But, admitted, I did not use too much time on it.
Comment 6•21 years ago
|
||
This patch fixes the problem by ensuring that we ignore AttributeSet/Removed
notifications until after DoneAddingChildren. The patch is fairly
straightforward. I opted to use a boolean flag instead of attempting to modify
the notification mask on the XTF element wrapper because 1) we have no
backpointer to the XTF element wrapper, and 2) that would just be more code
anyways.
Assignee: allan → darin
Attachment #167424 -
Attachment is obsolete: true
Updated•21 years ago
|
Attachment #167608 -
Flags: review?(smaug)
Updated•21 years ago
|
Attachment #167424 -
Flags: review?(smaug)
Updated•21 years ago
|
Target Milestone: --- → mozilla1.8beta
Reporter | ||
Comment 7•21 years ago
|
||
(In reply to comment #6)
> Created an attachment (id=167608)
> v2 patch
Looks good. In fact, most of our XForms elements should have this. Do any of
them need to be informed about attribute changes before DoneAddingChildren is
called?
Assignee | ||
Comment 8•21 years ago
|
||
What happens if you add xf:instance element dynamically and then
modify the src attribute?
mIgnoreAttributeChanges is set true on Ctor, but never to false because
DoneAddingChildren() is called only during parsing.
Comment 9•21 years ago
|
||
> What happens if you add xf:instance element dynamically and then
> modify the src attribute?
> mIgnoreAttributeChanges is set true on Ctor, but never to false because
> DoneAddingChildren() is called only during parsing.
yup, i think that would be a problem. good catch. then, i think it means that
we need your patch to move BeginAddingChildren up earlier before AttributeSet.
another option would be to allow the thing to load from AttributeSet, and then
remember that it had already started loading so we can then not bother loading
it again in DoneAddingChildren. that might be better. thoughts?
Assignee | ||
Updated•21 years ago
|
Attachment #167608 -
Flags: review?(smaug) → review-
Assignee | ||
Comment 10•21 years ago
|
||
(In reply to comment #9)
>
> another option would be to allow the thing to load from AttributeSet, and then
> remember that it had already started loading so we can then not bother loading
> it again in DoneAddingChildren. that might be better. thoughts?
This sounds good.
Assignee | ||
Comment 11•21 years ago
|
||
But actually I prefer BeginAddingChildren. This way it is clear that
the initialization of the instance document happens in DoneAddingChildren().
Assignee: darin → smaug
Attachment #167608 -
Attachment is obsolete: true
Assignee | ||
Comment 12•21 years ago
|
||
Attachment #167930 -
Flags: review?(darin)
Comment 13•21 years ago
|
||
Comment on attachment 167930 [details] [diff] [review]
v3
r=darin
Attachment #167930 -
Flags: review?(darin) → review+
Comment 14•21 years ago
|
||
fixed-on-trunk
bug will be fixed for real once the patch for bug 272814 lands.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•