Last Comment Bug 303625 - nsXFormsSubmissionElement::LoadReplaceAll uses wrong document
: nsXFormsSubmissionElement::LoadReplaceAll uses wrong document
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:
http://lxr.mozilla.org/seamonkey/sour...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-05 14:48 PDT by Christian :Biesinger (don't email me, ping me on IRC)
Modified: 2016-07-15 14:46 PDT (History)
4 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch (1.25 KB, patch)
2006-05-30 01:53 PDT, Allan Beaufour
bzbarsky: review+
Details | Diff | Splinter Review

Description Christian :Biesinger (don't email me, ping me on IRC) 2005-08-05 14:48:06 PDT
The code gets the ownerDocument and a container from that (in order to load a
new document there).

It seems to me like the code really wants to use the current document
(GetCurrentDoc()) of the node.
Comment 1 Allan Beaufour 2006-04-03 08:20:54 PDT
(In reply to comment #0)
> The code gets the ownerDocument and a container from that (in order to load a
> new document there).
> 
> It seems to me like the code really wants to use the current document
> (GetCurrentDoc()) of the node.

Nobody ever did anything about this. Why should we use GetCurrentDoc() instead? Mind you that it is an XTF element.
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2006-04-03 08:55:58 PDT
If the element comes from an XBL binding (could it?) then the owner doc and current doc would be different in XBL2 -- the owner doc would be the XBL binding document while the current doc would be the bound document.

More to the point, anything involving presentation (including containers) should be using the current document, since it's depending on messing with the "view" the element is in, not where the element hails from.
Comment 3 Allan Beaufour 2006-04-04 01:15:18 PDT
(In reply to comment #2)
> If the element comes from an XBL binding (could it?)

No.

> then the owner doc and current doc would be different in XBL2 -- the owner doc
> would be the XBL binding document while the current doc would be the bound 
> document.
> 
> More to the point, anything involving presentation (including containers)
> should be using the current document, since it's depending on messing with the
> "view" the element is in, not where the element hails from.

But the submission element has no visual representation.
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2006-04-04 07:06:43 PDT
> No.

So if XBL anonymous content includes a submission element nothing will happen?  What if XBL anonymous content includes a complete XForms form?

> But the submission element has no visual representation.

That's a matter of its CSS display type, no?
Comment 5 Allan Beaufour 2006-04-05 01:47:15 PDT
(In reply to comment #4)
> > No.
> 
> So if XBL anonymous content includes a submission element nothing will happen? 
> What if XBL anonymous content includes a complete XForms form?

Ah, sorry, understood that the wrong way around. submission's not going to be very happy unless it's a child of a model, but that said, you could stash it inside XBL anonymous content, yes.

> > But the submission element has no visual representation.
> 
> That's a matter of its CSS display type, no?

Hmmm, it inherits from nsIXTFGenericElement which iirc should have no visual representation.
Comment 6 Boris Zbarsky [:bz] (still a bit busy) 2006-04-05 08:38:06 PDT
> which iirc should have no visual representation.

It's just treated as "display: none !important" in the UA style sheet, basically.  Except hardcoded in C++ in a hacky way.

But back to the XBL anonymous content issue.  Would you be wanting to do the load in the XBL binding document, or the document the binding is attached to?  That's the line between GetOwnerDoc and GetCurrentDoc.

Comment 7 Allan Beaufour 2006-05-29 05:04:08 PDT
(In reply to comment #6)
> > which iirc should have no visual representation.
> 
> It's just treated as "display: none !important" in the UA style sheet,
> basically.  Except hardcoded in C++ in a hacky way.
> 
> But back to the XBL anonymous content issue.  Would you be wanting to do the
> load in the XBL binding document, or the document the binding is attached to? 
> That's the line between GetOwnerDoc and GetCurrentDoc.

(oops, this disappeared in my bugmail) We want to load in the document that the binding is attached to.
Comment 8 Boris Zbarsky [:bz] (still a bit busy) 2006-05-29 14:57:58 PDT
Then you want GetCurrentDoc() and this bug is valid.
Comment 9 Allan Beaufour 2006-05-30 01:53:03 PDT
Created attachment 223753 [details] [diff] [review]
Patch
Comment 10 Allan Beaufour 2006-05-30 08:19:18 PDT
Fixed on trunk.

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