nsXFormsSubmissionElement::LoadReplaceAll uses wrong document

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
12 years ago
10 months ago

People

(Reporter: Biesinger, Assigned: Allan Beaufour)

Tracking

({fixed1.8.0.5, fixed1.8.1})

Trunk
fixed1.8.0.5, fixed1.8.1

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

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.
(Assignee)

Comment 1

11 years ago
(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.
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.
(Assignee)

Comment 3

11 years ago
(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.
> 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?
(Assignee)

Comment 5

11 years ago
(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.
> 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.

(Assignee)

Updated

11 years ago
Assignee: aaronr → xforms
(Assignee)

Comment 7

11 years ago
(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.
Then you want GetCurrentDoc() and this bug is valid.
Flags: blocking1.9a2?
(Assignee)

Comment 9

11 years ago
Created attachment 223753 [details] [diff] [review]
Patch
Assignee: xforms → allan
Status: NEW → ASSIGNED
Attachment #223753 - Flags: review?(bzbarsky)
Attachment #223753 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 10

11 years ago
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
Whiteboard: xf-to-branch
(Assignee)

Updated

11 years ago
Keywords: fixed1.8.0.5
(Assignee)

Updated

11 years ago
Keywords: fixed1.8.1
(Assignee)

Updated

11 years ago
Whiteboard: xf-to-branch
Flags: blocking1.9a2?
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.