Closed Bug 270651 Opened 20 years ago Closed 15 years ago

Multiple insertion points for xtf

Categories

(Core Graveyard :: XTF, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bryner, Assigned: alex)

Details

For implementing XForms select, I set up anonymous content like this:

<html:label>
  <html:span/>
  <html:select/>
</html:label>

Then, suppose you have XForms content like this:

<xforms:select>
  <xforms:label>Pick one:</xforms:label>
  <xforms:item>
    <xforms:label>Item 1</xforms:label>
    <xforms:value>val1</xforms:value>
  </xforms:item>
</xforms:select>

Since I'm implementing the <xforms:item> using an anonymous <html:option>, I'd
like the insertion point for those to be the <html:select>.  However, the label
element for the <xforms:select> needs to go inside the <span> instead.

In XBL, you could solve this as follows:

<html:label>
  <html:span>
    <xbl:children includes="label"/>
  <html:select/>
    <xbl:children/>
  </html:select>
</html:label>

It would be great if we could work out something similar for XTF.
Note that XBL insertion points have a _lot_ of issues (including wrong or
underdefined behavior).  If we're going to copy them for XTF, it'd be good to at
least clearly define the behavior....
Bryner and I were talking about this, and we thought an API like this might make
sense:

  nsIXTFVisual {
    nsIDOMElement getInsertionPoint(in nsIDOMNode explicitChild);
  };

Thoughts?
What would that actually return?  And how would the return value be used?

How would various parts of layout that depend on DOM order (eg z-ordering) work?
 They don't work at all well with XBL right now, and I'm not sure whether we
care for XTF.
bz: I don't have answers to all of your questions, as I really don't know that
much about how XTF hooks into the layout engine.  But, let me try to answer your
first question: The return value would be similar to the return value of
nsIXTFVisual::GetInsertionPoint().  That is, it indicates the DOM element that
is to be the "parent" of the given explicit child node.  The returned DOM
element may be part of the XTF visual's anonymous content.  Does that make sense?
OK.  Where in the child list of the insertion point does the new content go? 
Can there be other (anonymous) kids of that node?

Is this all documented somewhere, perchance, so I can just read up on it?
No longer blocks: 270572
Assignee: bryner → alex
QA Contact: xtf
nsIXTFVisual (and its friends) are long gone.  WONTFIX?
Yes.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.