Closed Bug 96442 Opened 23 years ago Closed 23 years ago

Undocumented property dd-triggerrepaint for drag and drop

Categories

(Core :: XUL, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED WONTFIX
mozilla0.9.7

People

(Reporter: Mike_Brannigan, Assigned: hyatt)

Details

From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
BuildID:    20010717

Drag and Drop tree sort separators draw poorly without use of the undocumented 
dd-triggerrepaint property.

Any style-modifying code in the ondragover() handler, even if there will be no 
resultant change in the display (ie, setting an already-white background color 
to white), will cause tree sort separators to draw erratically, flickering or 
not cleaning up properly (leaving separator "trails"). Due to the trails, 
sortseparator functionality is compromised.

Reproducible: Always
Steps to Reproduce:
In a dragover observer for a tree widget, include code akin to this:

  onDragOver: function (evt,flavour,session){
       evt.target.setAttribute("style","background-color: white;");
  }



Actual Results:  Lace up the observers where appropriate, and you'll find drag 
functionality is drawn poorly as described above. 

Expected Results:  Sort separator functionality similar to the bookmarks manager




Workaround:

Adding two lines to the ondragover() handler solves this problem. 

Using the XULPlanet tutorial 
(http://www.xulplanet.com/tutorials/xultu/dragex.html), the resulting observer 
code would look like this:

Example 8.7.2:

var listObserver = { 
  onDragStart: function (evt,transferData,action){
    var txt=evt.target.getAttribute("elem");
    transferData.data=new TransferData();
    transferData.data.addDataForFlavour("text/unicode",txt);
  }
};

var boardObserver = {
  getSupportedFlavours : function () {
    var flavours = new FlavourSet();
    flavours.appendFlavour("text/unicode");
    return flavours;
  },

  onDragOver: function (evt,flavour,session) {
/*++*/       var treeItem = evt.target.parentNode.parentNode;    // get the 
treeitem that contains the cell that was dragged over
/*++*/	treeItem.setAttribute ("dd-triggerrepaint", 1 );         // repaint it
  },

  onDrop: function (evt,dropdata,session){
    if (dropdata.data!=""){
      var elem=document.createElement(dropdata.data);
      evt.target.appendChild(elem);
      elem.setAttribute("left",""+evt.pageX);
      elem.setAttribute("top",""+evt.pageY);
      elem.setAttribute("label",dropdata.data);
    }
  }
};
Status: UNCONFIRMED → NEW
Ever confirmed: true
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.7
What is the real defect here? Steps to reproduce?  (in plain English, please)
Not fixing tree bugs like this anymore.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → WONTFIX
Oh, just trees? verified wontfix
Status: RESOLVED → VERIFIED
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.