Closed Bug 5051 Opened 26 years ago Closed 25 years ago

boxes don't handle dynamic insertion & removal

Categories

(Core :: XUL, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: chuang, Assigned: slamm)

Details

(Whiteboard: waiting for engineer feedback)

Attachments

(4 files)

With the following code,  it shows the toolbar without buttons.

In /res/mailnews/messenger/mailshell.xul

....
    <toolbox>
      <toolbar include="resource:/res/mailnews/messenger/msgbar.xul"/>
    </toolbox>
....


In msgbar.xul

<?xml version="1.0"?>
<!DOCTYPE fragment>

<fragment xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
	xmlns:html="http://www.w3.org/TR/REC-html40">

	  <titledbutton src="resource:/res/mailnews/messenger/getmsg.gif"
align="bottom" value="Get Msg" onclick="MsgGetMessage()"/>

	  <titledbutton src="resource:/res/mailnews/messenger/newmsg.gif"
align="bottom" value="New Msg" onclick="MsgNewMessage()"/>

	  <titledbutton src="resource:/res/mailnews/messenger/reply.gif"
align="bottom" value="Reply" onclick="MsgReplyMessage()"/>

	  <titledbutton src="resource:/res/mailnews/messenger/forward.gif"
align="bottom" value="Forward" onclick="MsgForwardMessage()"/>

	  <titledbutton src="resource:/res/mailnews/messenger/trash.gif"
align="bottom" value="Delete" onclick="MsgDeleteMessage()"/>

	  <titledbutton src="resource:/res/mailnews/messenger/getmsg.gif"
align="bottom" value="Load News"
onclick="MsgLoadNewsMessage('news://news.mcom.com:119/35BE6AB1.55A14AE4@netscape
.com')"/>

          <spring flex="100%"/>

	  <titledbutton src="resource:/res/throbber/anims00.gif" align="right"
onclick="MsgHome('http://www.mozilla.org/')"/>

</fragment>
Add sspitzer@netscape.com to cc list
Status: NEW → ASSIGNED
Target Milestone: M5
Assignee: hyatt → evaughan
Status: ASSIGNED → NEW
I believe that something is wrong with boxes.  I have verified that the frame
gets created, and it even falls into the AppendFrames method of nsBoxFrame...
but once the reflow happens, the new element simply doesn't show up.

Reassigning to Eric.

I'm assuming that this problem is easily reproducible without even having to use
XUL fragments.  The code just doesn't appear to be quite right for dynamic
content insertion/appending yet.
Target Milestone: M5 → M6
This will get fixed when the new fixes for box layout get checked in. But they
won't be ready for M5.
Summary: XUL fragment doesn't work → boxes don't handle dynamic insertion & removal
Attached file XUL file (deleted) —
Attached file style sheet (deleted) —
Attached file the REAL test file (deleted) —
Added test files: ignore the first one (well, it demonstrates that you can
append content _outside_ the box). The second XUL file tries to append content
_in_ the box.
The sidebar depends on this fix too.
I can dynamically add titledbuttons or boxes to boxes, but text nodes do not get
added.
Status: NEW → ASSIGNED
Text can not be put in boxes directly. Text must be in lines so it must be in a
container that can provide them like a <p>, <div>, etc. If you need to put text
in a box. Place it in a div and then place the div in the box. If this works
please close out this bug out.

Thanks.
Adding the text to an html div tag worked. Is the following test case invalide
then?

   "the REAL test file,"
   http://bugzilla.mozilla.org/showattachment.cgi?attach_id=75
Attached file Adding text in div tag. (deleted) —
Adding text in a div tag only seems to work properly if I dynamically generate
the box too. Check out the attachment, "Adding text in div tag,"

   http://bugzilla.mozilla.org/showattachment.cgi?attach_id=171
Assignee: evaughan → kipp
Status: ASSIGNED → NEW
Ok this happens because I flow the div with a computed size of:
(0,NS_INTRINSICSIZE) but when I check the MaxElementSize returned its width is
0. I Rely on MaxElementSize to return the width of the largest element. I can
confirm that the text does have a computed width 165 but not sure who it does
not get returned.
Target Milestone: M6
Kipp is on sabbatical. Does this bug need fixing urgently?

[dbaron: removed milestone to get this bug back on our radar]
Target Milestone: M15
I am assuming this bug is not urgent, since no-one has said that it is.
Resetting target milestone to M15.

Shouldn't this bug be under one of the DOM components?
Assignee: kipp → evaughan
Since this is a box specific layout issue, and since I'm vacation for the next 3
weeks, I'm giving this back to evaughn. Assuming a real test case can be made
the implicates the html layout code, he can feel free to assign it back to me.

In addition, the best way to get max-element-size information is to give the
block an infinite width too (NS_INTRINSICSIZE). That may fix up the bug.
Assignee: evaughan → slamm
Ok this test case does not work anymore. Something is wrong with the javascript.
Slamm can you check to see if this is still broken?
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Sidebar dynamically adds/removes things from boxes fine. Marking fixed.
QA Contact: gerardok → ckritzer
Changing QA Contact to ckritzer@netscape.com.
BULK MOVE: Changing component from XUL to XP Toolkit/Widgets: XUL.  XUL 
component will be deleted.
Component: XUL → XP Toolkit/Widgets: XUL
slamm, sorry to bug you, but could you check with a recent build & comment?
Thanks dude! -ckritzer
Whiteboard: waiting for engineer feedback
Massive QA Contact update.
QA Contact: ckritzer → jrgm
Status: RESOLVED → VERIFIED
The code has totally changed.  The buttons display fine.  Veirfy aas fixed.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.