Bug 453520, links inside fieldsets should be draggable,r+sr=roc
authorNeil Deakin <neil@mozilla.com>
Mon, 08 Sep 2008 12:09:35 -0400
changeset 18986 cda8d65ccb61c38b025d85b747926b3b28fe3597
parent 18985 0be39583186de7e8a3704bd1c706b29ff73edbe9
child 18987 4a10d0a41108fa77665c598d72f0a4d84598c062
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs453520
milestone1.9.1b1pre
Bug 453520, links inside fieldsets should be draggable,r+sr=roc
content/base/src/nsContentAreaDragDrop.cpp
content/events/test/test_dragstart.html
--- a/content/base/src/nsContentAreaDragDrop.cpp
+++ b/content/base/src/nsContentAreaDragDrop.cpp
@@ -889,17 +889,20 @@ nsTransferableFactory::Produce(nsDOMData
 
   // check if the node is inside a form control. If so, dragging will be
   // handled in editor code (nsPlaintextDataTransfer::DoDrag). Don't set
   // aCanDrag to false however, as we still want to allow the drag.
   nsCOMPtr<nsIContent> findFormNode = mSelectionTargetNode;
   nsIContent* findFormParent = findFormNode->GetParent();
   while (findFormParent) {
     nsCOMPtr<nsIFormControl> form(do_QueryInterface(findFormParent));
-    if (form && form->GetType() != NS_FORM_OBJECT)
+    if (form && form->GetType() != NS_FORM_OBJECT &&
+                form->GetType() != NS_FORM_FIELDSET &&
+                form->GetType() != NS_FORM_LEGEND &&
+                form->GetType() != NS_FORM_LABEL)
       return NS_OK;
     findFormParent = findFormParent->GetParent();
   }
     
   // if set, serialize the content under this node
   nsCOMPtr<nsIContent> nodeToSerialize;
   *aDragSelection = PR_FALSE;
 
--- a/content/events/test/test_dragstart.html
+++ b/content/events/test/test_dragstart.html
@@ -518,20 +518,24 @@ function expectError(fn, eid, testid)
 </script>
 
 </head>
 
 <body style="height: 300px; overflow: auto;" onload="setTimeout(runTests, 0)">
 
 <div id="draggable" ondragstart="doDragStartSelection(event)">This is a <em>draggable</em> bit of text.</div>
 
+<fieldset>
 <a id="link" href="http://www.mozilla.org/" ondragstart="doDragStartLink(event)">mozilla.org</a>
+</fieldset>
 
+<label>
 <img id="image" src="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%18%00%00%00%18%02%03%00%00%00%9D%19%D5k%00%00%00%04gAMA%00%00%B1%8F%0B%FCa%05%00%00%00%0CPLTE%FF%FF%FF%FF%FF%FF%F7%DC%13%00%00%00%03%80%01X%00%00%00%01tRNS%08N%3DPT%00%00%00%01bKGD%00%88%05%1DH%00%00%00%09pHYs%00%00%0B%11%00%00%0B%11%01%7Fd_%91%00%00%00%07tIME%07%D2%05%0C%14%0C%0D%D8%3F%1FQ%00%00%00%5CIDATx%9C%7D%8E%CB%09%C0%20%10D%07r%B7%20%2F%E9wV0%15h%EA%D9%12D4%BB%C1x%CC%5C%1E%0C%CC%07%C0%9C0%9Dd7()%C0A%D3%8D%E0%B8%10%1DiCHM%D0%AC%D2d%C3M%F1%B4%E7%FF%10%0BY%AC%25%93%CD%CBF%B5%B2%C0%3Alh%CD%AE%13%DF%A5%F7%E0%03byW%09A%B4%F3%E2%00%00%00%00IEND%AEB%60%82"
      ondragstart="doDragStartImage(event)">
+</label>
 
 <input id="input" value="Text in a box" ondragstart="doDragStartInput(event)">
 
 <div ondragstart="onDragStartDraggable(event)">
   <div id="dragtrue" draggable="true">
     This is a <span id="spantrue">draggable</span> area.
   </div>
   <div id="dragfalse" draggable="false">