Closed
Bug 452787
Opened 16 years ago
Closed 16 years ago
Couldn't drag elements which contain text or it is difficult for empty elements
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: laurent, Assigned: enndeakin)
References
(Regressed 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
2.42 KB,
text/html
|
Details | |
3.71 KB,
patch
|
smaug
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
With the new HTML5 drag and drop API, I found an issue:
- if a div is draggable, the drag cannot start if it contains text.
- If it is empty, we should first click on it (by pushing and releasing the mouse button), and then we can begin a drag.
- If the div have the -moz-user-select:none;, all works as expected.
Look at the given html page to see this behaviors.
Flags: blocking1.9.1?
Assignee | ||
Comment 1•16 years ago
|
||
This patch checks the draggable attribute within the mouse down for selection handling.
Attachment #336138 -
Flags: superreview?(roc)
Attachment #336138 -
Flags: review?(Olli.Pettay)
Comment 2•16 years ago
|
||
Comment on attachment 336138 [details] [diff] [review]
allow dragging within a selection
> // static
> PRBool
>+nsContentUtils::ContentIsDraggable(nsIContent* aContent)
>+{
>+ nsCOMPtr<nsIDOMNSHTMLElement> htmlElement = do_QueryInterface(aContent);
>+ if (htmlElement) {
>+ PRBool draggable = PR_FALSE;
>+ htmlElement->GetDraggable(&draggable);
>+ if (draggable)
>+ return PR_TRUE;
>+ }
>+
>+ // special handling for content area image and link dragging
>+ return IsDraggableImage(aContent) || IsDraggableLink(aContent);
>+}
What if image or link has dragable="false", should this return PR_FALSE in that case?
nsHTMLImageElement and nsHTMLAnchorElement have their own implementation for ::GetDraggable.
Assignee | ||
Comment 3•16 years ago
|
||
> What if image or link has dragable="false", should this return PR_FALSE in that
> case?
Such as:
nsCOMPtr<nsIDOMNSHTMLElement> htmlElement = do_QueryInterface(aContent);
if (htmlElement) {
PRBool draggable = PR_FALSE;
htmlElement->GetDraggable(&draggable);
if (draggable)
return PR_TRUE;
if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::draggable,
nsGkAtoms::_false, eIgnoreCase)
return PR_FALSE;
}
?
Comment 4•16 years ago
|
||
Um, I wasn't CC'd to this bug - sorry didn't notice the comment.
But yes, something like that if you can't find any better way.
Assignee | ||
Comment 5•16 years ago
|
||
Attachment #336138 -
Attachment is obsolete: true
Attachment #337086 -
Flags: superreview?(roc)
Attachment #337086 -
Flags: review?(Olli.Pettay)
Attachment #336138 -
Flags: superreview?(roc)
Attachment #336138 -
Flags: review?(Olli.Pettay)
Updated•16 years ago
|
Attachment #337086 -
Flags: review?(Olli.Pettay) → review+
Attachment #337086 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Updated•16 years ago
|
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•16 years ago
|
Flags: blocking1.9.1? → in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•