Skip to content

Commit a9badb5

Browse files
author
Cristian Tuns
committed
Revert "Bug 1966443: Skip NUL characters in text that is copied to clipboard or dragged r=gstoll,dom-core,edgar" for causing mochitest failures in test_dnd_ignoreNuls.html
This reverts commit 1affb70. Revert "Bug 1966443: Clean up after tests that open context menus r=masayuki" This reverts commit a2ba53f. Revert "Bug 1966443: Ignore NULs in clipboard paste and DND drop operations r=stransky,geckoview-reviewers,mac-reviewers,bradwerth,tcampbell" This reverts commit 220cc23. Revert "Bug 1966443: Make synthesizeMockDragAndDrop usable in plain mochitests r=edgar" This reverts commit 9e6fb6b.
1 parent 02384a7 commit a9badb5

26 files changed

+208
-646
lines changed

dom/base/nsContentAreaDragDrop.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,6 @@ nsresult DragDataProducer::Produce(DataTransfer* aDataTransfer, bool* aCanDrag,
640640
data = do_QueryInterface(supports);
641641
if (NS_SUCCEEDED(rv)) {
642642
data->GetData(mHtmlString);
643-
// Do not add NULs to DND text.
644-
mHtmlString.StripChar(L'\0');
645643
}
646644
rv = transferable->GetTransferData(kHTMLContext, getter_AddRefs(supports));
647645
data = do_QueryInterface(supports);
@@ -657,8 +655,6 @@ nsresult DragDataProducer::Produce(DataTransfer* aDataTransfer, bool* aCanDrag,
657655
data = do_QueryInterface(supports);
658656
NS_ENSURE_SUCCESS(rv, rv); // require plain text at a minimum
659657
data->GetData(mTitleString);
660-
// Do not add NULs to DND text.
661-
mTitleString.StripChar(L'\0');
662658
}
663659

664660
// default text value is the URL

dom/ipc/BrowserChild.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
#include "mozilla/layers/ImageBridgeChild.h"
8181
#include "mozilla/layers/InputAPZContext.h"
8282
#include "mozilla/layers/WebRenderLayerManager.h"
83-
#include "mozilla/widget/WidgetLogging.h"
8483
#include "nsCommandParams.h"
8584
#include "nsContentPermissionHelper.h"
8685
#include "nsContentUtils.h"
@@ -144,6 +143,16 @@ using namespace mozilla::layout;
144143
using namespace mozilla::widget;
145144
using mozilla::layers::GeckoContentController;
146145

146+
extern mozilla::LazyLogModule sWidgetDragServiceLog;
147+
#define __DRAGSERVICE_LOG__(logLevel, ...) \
148+
MOZ_LOG(sWidgetDragServiceLog, logLevel, __VA_ARGS__)
149+
#define DRAGSERVICE_LOGD(...) \
150+
__DRAGSERVICE_LOG__(mozilla::LogLevel::Debug, (__VA_ARGS__))
151+
#define DRAGSERVICE_LOGI(...) \
152+
__DRAGSERVICE_LOG__(mozilla::LogLevel::Info, (__VA_ARGS__))
153+
#define DRAGSERVICE_LOGE(...) \
154+
__DRAGSERVICE_LOG__(mozilla::LogLevel::Error, (__VA_ARGS__))
155+
147156
static const char BEFORE_FIRST_PAINT[] = "before-first-paint";
148157

149158
static uint32_t sConsecutiveTouchMoveCount = 0;
@@ -2126,11 +2135,10 @@ mozilla::ipc::IPCResult BrowserChild::RecvRealDragEvent(
21262135
nsCOMPtr<nsIDragSession> dragSession = GetDragSession();
21272136
DRAGSERVICE_LOGD(
21282137
"[%p] %s | aEvent.mMessage: %s | aDragAction: %u | aDropEffect: %u | "
2129-
"widgetRelativePt: (%d,%d) | dragSession: %p",
2138+
"dragSession: %p",
21302139
this, __FUNCTION__,
21312140
NS_ConvertUTF16toUTF8(dom::Event::GetEventName(aEvent.mMessage)).get(),
2132-
aDragAction, aDropEffect, static_cast<int>(localEvent.mRefPoint.x),
2133-
static_cast<int>(localEvent.mRefPoint.y), dragSession.get());
2141+
aDragAction, aDropEffect, dragSession.get());
21342142
if (dragSession) {
21352143
dragSession->SetDragAction(aDragAction);
21362144
dragSession->SetTriggeringPrincipal(aPrincipal);

testing/mochitest/tests/SimpleTest/DragParentContextBase.sys.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,23 @@ export class DragParentContextBase {
1313
// Browsing context that the related element is in
1414
browsingContext = null;
1515

16-
constructor(aSubtypeName, aBrowsingContext, aParams, aSpecialPowers) {
16+
constructor(
17+
aSubtypeName,
18+
aBrowsingContext,
19+
aParams,
20+
aSpecialPowers,
21+
aOk,
22+
aIs,
23+
aInfo
24+
) {
1725
Object.assign(this, aParams);
1826
this.params = aParams;
1927
this.subtypeName = aSubtypeName;
2028
this.browsingContext = aBrowsingContext;
2129
this.specialPowers = aSpecialPowers;
30+
this.ok = aOk;
31+
this.is = aIs;
32+
this.info = aInfo;
2233
}
2334

2435
getElementPositions() {

testing/mochitest/tests/SimpleTest/DragSourceParentContext.sys.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ import { DragParentContextBase } from "./DragParentContextBase.sys.mjs";
77

88
/* global content */
99
export class DragSourceParentContext extends DragParentContextBase {
10-
constructor(aBrowsingContext, aParams, aSpecialPowers) {
11-
super("dragSource", aBrowsingContext, aParams, aSpecialPowers);
10+
constructor(aBrowsingContext, aParams, aSpecialPowers, aOk, aIs, aInfo) {
11+
super(
12+
"dragSource",
13+
aBrowsingContext,
14+
aParams,
15+
aSpecialPowers,
16+
aOk,
17+
aIs,
18+
aInfo
19+
);
1220
}
1321

1422
initialize() {

testing/mochitest/tests/SimpleTest/DragTargetParentContext.sys.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ import { DragParentContextBase } from "./DragParentContextBase.sys.mjs";
77

88
/* global content */
99
export class DragTargetParentContext extends DragParentContextBase {
10-
constructor(aBrowsingContext, aParams, aSpecialPowers) {
11-
super("dragTarget", aBrowsingContext, aParams, aSpecialPowers);
10+
constructor(aBrowsingContext, aParams, aSpecialPowers, aOk, aIs, aInfo) {
11+
super(
12+
"dragTarget",
13+
aBrowsingContext,
14+
aParams,
15+
aSpecialPowers,
16+
aOk,
17+
aIs,
18+
aInfo
19+
);
1220
}
1321

1422
initialize() {

0 commit comments

Comments
 (0)