Closed
Bug 1473029
Opened 6 years ago
Closed 6 years ago
Don't use nsScriptableRegion within drag services
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, enhancement, P3)
Core
DOM: Copy & Paste and Drag & Drop
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: enndeakin, Assigned: enndeakin)
References
Details
Attachments
(4 files, 3 obsolete files)
4.72 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
17.08 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
6.10 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
31.49 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•6 years ago
|
||
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Attachment #8989437 -
Attachment description: Part 2, remove the region arguments from InvokeDragSession and InvokeDragSessionWithImage → Part 4, have nsTreeBodyFrame::GetSelectionRegion use nsIntRegion instead of nsIScriptableRegion
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Priority: -- → P3
Assignee | ||
Updated•6 years ago
|
Attachment #8989436 -
Flags: review?(mstange)
Assignee | ||
Updated•6 years ago
|
Attachment #8989440 -
Flags: review?(mstange)
Assignee | ||
Updated•6 years ago
|
Attachment #8989438 -
Flags: review?(mstange)
Assignee | ||
Updated•6 years ago
|
Attachment #8989437 -
Flags: review?(mstange)
Updated•6 years ago
|
Attachment #8989436 -
Flags: review?(mstange) → review+
Updated•6 years ago
|
Attachment #8989440 -
Flags: review?(mstange) → review+
Comment 5•6 years ago
|
||
Comment on attachment 8989438 [details] [diff] [review] Part 3 - convert drag services to internally use nsIntRegion instead ns nsIScriptableRegion Review of attachment 8989438 [details] [diff] [review]: ----------------------------------------------------------------- ::: widget/nsBaseDragService.cpp @@ +258,5 @@ > // are in the wrong coord system, so turn off mouse capture. > nsIPresShell::ClearMouseCapture(nullptr); > > nsresult rv = InvokeDragSessionImpl(aTransferableArray, > + mRegion.IsEmpty() ? nullptr : &mRegion, Could you make mRegion a Maybe<>, instead of treating empty regions specially? And then you could make this parameter a "const Maybe<CSSIntRegion>& aRegion" and wouldn't need to pass around a raw pointer. @@ +651,5 @@ > CSSIntRect dragRect; > if (aRegion) { > // the region's coordinates are relative to the root frame > + IntRect bounds = aRegion->GetBounds(); > + dragRect.SetRect(bounds.x, bounds.y, bounds.width, bounds.height); This indicates that the coordinates in the region are CSS int pixels. Could you make the region a CSSIntRegion?
Comment 6•6 years ago
|
||
Comment on attachment 8989437 [details] [diff] [review] Part 4, have nsTreeBodyFrame::GetSelectionRegion use nsIntRegion instead of nsIScriptableRegion Review of attachment 8989437 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/xul/tree/nsTreeBodyFrame.h @@ +85,5 @@ > nsresult GetTreeBody(mozilla::dom::Element **aElement); > int32_t RowHeight() const; > int32_t RowWidth(); > int32_t GetHorizontalPosition() const; > + void GetSelectionRegion(nsIntRegion& aRegion); Instead of using an outparam, could you make this return a Maybe<CSSIntRegion>?
Assignee | ||
Comment 7•6 years ago
|
||
Attachment #8989438 -
Attachment is obsolete: true
Attachment #8989438 -
Flags: review?(mstange)
Attachment #8997019 -
Flags: review?(mstange)
Assignee | ||
Comment 8•6 years ago
|
||
Attachment #8989437 -
Attachment is obsolete: true
Attachment #8989437 -
Flags: review?(mstange)
Attachment #8997020 -
Flags: review?(mstange)
Comment 9•6 years ago
|
||
Comment on attachment 8997019 [details] [diff] [review] Part 3.2 - convert drag services to internally use nsIntRegion instead ns nsIScriptableRegion Review of attachment 8997019 [details] [diff] [review]: ----------------------------------------------------------------- Is the mutating aRegion->MoveBy call in PresShell::RenderNode the only reason why the parameters are not const references? I think it would be better to make a copy there, instead of mutating the region that the caller passes in. And then you could change everything to "const Maybe<CSSIntRegion>& aRegion".
Updated•6 years ago
|
Attachment #8997020 -
Flags: review?(mstange) → review+
Assignee | ||
Comment 10•6 years ago
|
||
Attachment #8997019 -
Attachment is obsolete: true
Attachment #8997019 -
Flags: review?(mstange)
Attachment #8997488 -
Flags: review?(mstange)
Comment 11•6 years ago
|
||
Comment on attachment 8997488 [details] [diff] [review] Part 3.3 - convert drag services to internally use nsIntRegion instead ns nsIScriptableRegion Review of attachment 8997488 [details] [diff] [review]: ----------------------------------------------------------------- Looks great, thanks! ::: widget/nsBaseDragService.cpp @@ +638,5 @@ > CSSIntRect dragRect; > if (aRegion) { > // the region's coordinates are relative to the root frame > + CSSIntRect bounds = aRegion->GetBounds(); > + dragRect.SetRect(bounds.x, bounds.y, bounds.width, bounds.height); I think this can become dragRect = aRegion->GetBounds();
Attachment #8997488 -
Flags: review?(mstange) → review+
Comment 12•6 years ago
|
||
Pushed by neil@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c7b40644b111 move the tree drag region handling into nsBaseDragService::InvokeDragSessionWithImage, r=mstange https://hg.mozilla.org/integration/mozilla-inbound/rev/b2955b86592b remove the region arguments from InvokeDragSession and InvokeDragSessionWithImage, r=mstange https://hg.mozilla.org/integration/mozilla-inbound/rev/8727297a0248 convert drag services to internally use CSSIntRegion instead ns nsIScriptableRegion, r=mstange https://hg.mozilla.org/integration/mozilla-inbound/rev/74554b2b65bf have nsTreeBodyFrame::GetSelectionRegion use nsIntRegion instead of nsIScriptableRegion, r=mstange
Comment 13•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c7b40644b111 https://hg.mozilla.org/mozilla-central/rev/b2955b86592b https://hg.mozilla.org/mozilla-central/rev/8727297a0248 https://hg.mozilla.org/mozilla-central/rev/74554b2b65bf
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•