Merge autoland to mozilla-central. a=merge

This commit is contained in:
Dorel Luca 2020-07-31 12:45:12 +03:00
Родитель 0226b8feef 9b24bf03b8
Коммит 03794edd6e
12 изменённых файлов: 209 добавлений и 151 удалений

Просмотреть файл

@ -123,6 +123,16 @@ nsresult AccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
eventTarget = selEvent->Widget();
break;
}
case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
case nsIAccessibleEvent::EVENT_TEXT_REMOVED: {
Accessible* acc = aEvent->GetAccessible();
// If there is a text input ancestor, use it as the event source.
while (acc && GetTypeFromRole(acc->Role()) != [mozTextAccessible class]) {
acc = acc->Parent();
}
eventTarget = acc ? acc : aEvent->GetAccessible();
break;
}
default:
eventTarget = aEvent->GetAccessible();
break;
@ -179,6 +189,7 @@ nsresult AccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
AccTextChangeEvent* tcEvent = downcast_accEvent(aEvent);
[nativeAcc handleAccessibleTextChangeEvent:nsCocoaUtils::ToNSString(tcEvent->ModifiedText())
inserted:tcEvent->IsTextInserted()
inContainer:aEvent->GetAccessible()
at:tcEvent->GetStartOffset()];
break;
}

Просмотреть файл

@ -110,9 +110,15 @@ void ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset, bool aIsSele
void ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr, int32_t aStart,
uint32_t aLen, bool aIsInsert, bool aFromUser) {
mozAccessible* wrapper = GetNativeFromGeckoAccessible(aTarget);
ProxyAccessible* acc = aTarget;
// If there is a text input ancestor, use it as the event source.
while (acc && GetTypeFromRole(acc->Role()) != [mozTextAccessible class]) {
acc = acc->Parent();
}
mozAccessible* wrapper = GetNativeFromGeckoAccessible(acc ? acc : aTarget);
[wrapper handleAccessibleTextChangeEvent:nsCocoaUtils::ToNSString(aStr)
inserted:aIsInsert
inContainer:aTarget
at:aStart];
}

Просмотреть файл

@ -78,6 +78,7 @@ inline mozAccessible* GetNativeFromGeckoAccessible(mozilla::a11y::AccessibleOrPr
- (void)handleAccessibleTextChangeEvent:(NSString*)change
inserted:(BOOL)isInserted
inContainer:(const mozilla::a11y::AccessibleOrProxy&)container
at:(int32_t)start;
// internal method to retrieve a child at a given index.

Просмотреть файл

@ -7,7 +7,6 @@
#import "MacUtils.h"
#import "mozView.h"
#import "GeckoTextMarker.h"
#include "Accessible-inl.h"
#include "nsAccUtils.h"
@ -786,41 +785,11 @@ struct RoleDescrComparator {
return NO;
}
enum AXTextEditType {
AXTextEditTypeUnknown,
AXTextEditTypeDelete,
AXTextEditTypeInsert,
AXTextEditTypeTyping,
AXTextEditTypeDictation,
AXTextEditTypeCut,
AXTextEditTypePaste,
AXTextEditTypeAttributesChange
};
enum AXTextStateChangeType {
AXTextStateChangeTypeUnknown,
AXTextStateChangeTypeEdit,
AXTextStateChangeTypeSelectionMove,
AXTextStateChangeTypeSelectionExtend
};
- (void)handleAccessibleTextChangeEvent:(NSString*)change
inserted:(BOOL)isInserted
inContainer:(const AccessibleOrProxy&)container
at:(int32_t)start {
GeckoTextMarker startMarker(mGeckoAccessible, start);
NSDictionary* userInfo = @{
@"AXTextChangeElement" : self,
@"AXTextStateChangeType" : @(AXTextStateChangeTypeEdit),
@"AXTextChangeValues" : @[ @{
@"AXTextChangeValue" : (change ? change : @""),
@"AXTextChangeValueStartMarker" : startMarker.CreateAXTextMarker(),
@"AXTextEditType" : isInserted ? @(AXTextEditTypeTyping) : @(AXTextEditTypeDelete)
} ]
};
mozAccessible* webArea = GetNativeFromGeckoAccessible([self geckoDocument]);
[webArea moxPostNotification:NSAccessibilityValueChangedNotification withUserInfo:userInfo];
[self moxPostNotification:NSAccessibilityValueChangedNotification withUserInfo:userInfo];
// XXX: Eventually live region handling will go here.
}
- (void)handleAccessibleEvent:(uint32_t)eventType {
@ -843,16 +812,18 @@ enum AXTextStateChangeType {
case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
// We consider any caret move event to be a selected text change event.
// So dispatching an event for EVENT_TEXT_SELECTION_CHANGED would be reduntant.
id<MOXTextMarkerSupport> delegate = [self moxTextMarkerDelegate];
id<MOXTextMarkerSupport> delegate = [self moxTextMarkerDelegate];
id selectedRange = [delegate moxSelectedTextMarkerRange];
NSDictionary* userInfo = @{
@"AXTextChangeElement": self,
@"AXSelectedTextMarkerRange": (selectedRange ? selectedRange : [NSNull null])
@"AXTextChangeElement" : self,
@"AXSelectedTextMarkerRange" : (selectedRange ? selectedRange : [NSNull null])
};
mozAccessible* webArea = GetNativeFromGeckoAccessible([self geckoDocument]);
[webArea moxPostNotification:NSAccessibilitySelectedTextChangedNotification withUserInfo:userInfo];
[self moxPostNotification:NSAccessibilitySelectedTextChangedNotification withUserInfo:userInfo];
[webArea moxPostNotification:NSAccessibilitySelectedTextChangedNotification
withUserInfo:userInfo];
[self moxPostNotification:NSAccessibilitySelectedTextChangedNotification
withUserInfo:userInfo];
break;
}
}

Просмотреть файл

@ -68,6 +68,12 @@
#pragma mark - mozAccessible
// override
- (void)handleAccessibleTextChangeEvent:(NSString*)change
inserted:(BOOL)isInserted
inContainer:(const mozilla::a11y::AccessibleOrProxy&)container
at:(int32_t)start;
// override
- (void)handleAccessibleEvent:(uint32_t)eventType;

Просмотреть файл

@ -12,6 +12,7 @@
#include "TextLeafAccessible.h"
#import "mozTextAccessible.h"
#import "GeckoTextMarker.h"
using namespace mozilla;
using namespace mozilla::a11y;
@ -354,12 +355,48 @@ inline NSString* ToNSString(id aValue) {
#pragma mark - mozAccessible
enum AXTextEditType {
AXTextEditTypeUnknown,
AXTextEditTypeDelete,
AXTextEditTypeInsert,
AXTextEditTypeTyping,
AXTextEditTypeDictation,
AXTextEditTypeCut,
AXTextEditTypePaste,
AXTextEditTypeAttributesChange
};
enum AXTextStateChangeType {
AXTextStateChangeTypeUnknown,
AXTextStateChangeTypeEdit,
AXTextStateChangeTypeSelectionMove,
AXTextStateChangeTypeSelectionExtend
};
- (void)handleAccessibleTextChangeEvent:(NSString*)change
inserted:(BOOL)isInserted
inContainer:(const AccessibleOrProxy&)container
at:(int32_t)start {
GeckoTextMarker startMarker(container, start);
NSDictionary* userInfo = @{
@"AXTextChangeElement" : self,
@"AXTextStateChangeType" : @(AXTextStateChangeTypeEdit),
@"AXTextChangeValues" : @[ @{
@"AXTextChangeValue" : (change ? change : @""),
@"AXTextChangeValueStartMarker" : startMarker.CreateAXTextMarker(),
@"AXTextEditType" : isInserted ? @(AXTextEditTypeTyping) : @(AXTextEditTypeDelete)
} ]
};
mozAccessible* webArea = GetNativeFromGeckoAccessible([self geckoDocument]);
[webArea moxPostNotification:NSAccessibilityValueChangedNotification withUserInfo:userInfo];
[self moxPostNotification:NSAccessibilityValueChangedNotification withUserInfo:userInfo];
[self moxPostNotification:NSAccessibilityValueChangedNotification];
}
- (void)handleAccessibleEvent:(uint32_t)eventType {
switch (eventType) {
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
case nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE:
[self moxPostNotification:NSAccessibilityValueChangedNotification];
break;
default:
[super handleAccessibleEvent:eventType];
break;

Просмотреть файл

@ -114,13 +114,20 @@ async function synthKeyAndTestValueChanged(
synthKey,
synthEvent,
expectedId,
expectedTextSelectionId,
expectedChangeValue,
expectedEditType,
expectedWordAtLeft
) {
let valueChangedEvents = Promise.all([
waitForMacEventWithInfo("AXSelectedTextChanged", matchWebArea(expectedId)),
waitForMacEventWithInfo("AXSelectedTextChanged", matchInput(expectedId)),
waitForMacEventWithInfo(
"AXSelectedTextChanged",
matchWebArea(expectedTextSelectionId)
),
waitForMacEventWithInfo(
"AXSelectedTextChanged",
matchInput(expectedTextSelectionId)
),
waitForMacEventWithInfo("AXValueChanged", matchWebArea(expectedId)),
waitForMacEventWithInfo("AXValueChanged", matchInput(expectedId)),
]);
@ -146,94 +153,109 @@ async function synthKeyAndTestValueChanged(
);
}
async function focusIntoInputAndType(accDoc, inputId, innerContainerId) {
let selectionId = innerContainerId ? innerContainerId : inputId;
let input = getNativeInterface(accDoc, inputId);
ok(!input.getAttributeValue("AXFocused"), "input is not focused");
ok(input.isAttributeSettable("AXFocused"), "input is focusable");
let events = Promise.all([
waitForMacEvent(
"AXFocusedUIElementChanged",
iface => iface.getAttributeValue("AXDOMIdentifier") == inputId
),
waitForMacEventWithInfo("AXSelectedTextChanged", matchWebArea(selectionId)),
waitForMacEventWithInfo("AXSelectedTextChanged", matchInput(selectionId)),
]);
input.setAttributeValue("AXFocused", true);
await events;
async function testTextInput(
synthKey,
expectedChangeValue,
expectedWordAtLeft
) {
await synthKeyAndTestValueChanged(
synthKey,
null,
inputId,
selectionId,
expectedChangeValue,
AXTextEditTypeTyping,
expectedWordAtLeft
);
}
await testTextInput("h", "h", "h");
await testTextInput("e", "e", "he");
await testTextInput("l", "l", "hel");
await testTextInput("l", "l", "hell");
await testTextInput("o", "o", "hello");
await testTextInput(" ", " ", "hello");
// You would expect this to be useless but this is what VO
// consumes. I guess it concats the inserted text data to the
// word to the left of the marker.
await testTextInput("w", "w", " ");
await testTextInput("o", "o", "wo");
await testTextInput("r", "r", "wor");
await testTextInput("l", "l", "worl");
await testTextInput("d", "d", "world");
async function testTextDelete(expectedChangeValue, expectedWordAtLeft) {
await synthKeyAndTestValueChanged(
"KEY_Backspace",
null,
inputId,
selectionId,
expectedChangeValue,
AXTextEditTypeDelete,
expectedWordAtLeft
);
}
await testTextDelete("d", "worl");
await testTextDelete("l", "wor");
await synthKeyAndTestSelectionChanged("KEY_ArrowLeft", null, selectionId, "");
await synthKeyAndTestSelectionChanged(
"KEY_ArrowLeft",
{ shiftKey: true },
selectionId,
"o"
);
await synthKeyAndTestSelectionChanged(
"KEY_ArrowLeft",
{ shiftKey: true },
selectionId,
"wo"
);
await synthKeyAndTestSelectionChanged("KEY_ArrowLeft", null, selectionId, "");
await synthKeyAndTestSelectionChanged(
"KEY_Home",
{ shiftKey: true },
selectionId,
"hello "
);
await synthKeyAndTestSelectionChanged("KEY_ArrowLeft", null, selectionId, "");
await synthKeyAndTestSelectionChanged(
"KEY_ArrowRight",
{ shiftKey: true, altKey: true },
selectionId,
"hello"
);
}
// Test text input
addAccessibleTask(
`<a href="#">link</a> <input id="input">`,
async (browser, accDoc) => {
let input = getNativeInterface(accDoc, "input");
ok(!input.getAttributeValue("AXFocused"), "input is not focused");
ok(input.isAttributeSettable("AXFocused"), "input is focusable");
let events = Promise.all([
waitForMacEvent(
"AXFocusedUIElementChanged",
iface => iface.getAttributeValue("AXDOMIdentifier") == "input"
),
waitForMacEventWithInfo("AXSelectedTextChanged", matchWebArea("input")),
waitForMacEventWithInfo("AXSelectedTextChanged", matchInput("input")),
]);
input.setAttributeValue("AXFocused", true);
await events;
async function testTextInput(
synthKey,
expectedChangeValue,
expectedWordAtLeft
) {
await synthKeyAndTestValueChanged(
synthKey,
null,
"input",
expectedChangeValue,
AXTextEditTypeTyping,
expectedWordAtLeft
);
}
await testTextInput("h", "h", "h");
await testTextInput("e", "e", "he");
await testTextInput("l", "l", "hel");
await testTextInput("l", "l", "hell");
await testTextInput("o", "o", "hello");
await testTextInput(" ", " ", "hello");
// You would expect this to be useless but this is what VO
// consumes. I guess it concats the inserted text data to the
// word to the left of the marker.
await testTextInput("w", "w", " ");
await testTextInput("o", "o", "wo");
await testTextInput("r", "r", "wor");
await testTextInput("l", "l", "worl");
await testTextInput("d", "d", "world");
async function testTextDelete(expectedChangeValue, expectedWordAtLeft) {
await synthKeyAndTestValueChanged(
"KEY_Backspace",
null,
"input",
expectedChangeValue,
AXTextEditTypeDelete,
expectedWordAtLeft
);
}
await testTextDelete("d", "worl");
await testTextDelete("l", "wor");
await synthKeyAndTestSelectionChanged("KEY_ArrowLeft", null, "input", "");
await synthKeyAndTestSelectionChanged(
"KEY_ArrowLeft",
{ shiftKey: true },
"input",
"o"
);
await synthKeyAndTestSelectionChanged(
"KEY_ArrowLeft",
{ shiftKey: true },
"input",
"wo"
);
await synthKeyAndTestSelectionChanged("KEY_ArrowLeft", null, "input", "");
await synthKeyAndTestSelectionChanged(
"KEY_Home",
{ shiftKey: true },
"input",
"hello "
);
await synthKeyAndTestSelectionChanged("KEY_ArrowLeft", null, "input", "");
await synthKeyAndTestSelectionChanged(
"KEY_ArrowRight",
{ shiftKey: true, altKey: true },
"input",
"hello"
);
await focusIntoInputAndType(accDoc, "input");
}
);
// Test content editable
addAccessibleTask(
`<div id="input" contentEditable="true" tabindex="0" role="textbox" aria-multiline="true"><div id="inner"><br /></div></div>`,
async (browser, accDoc) => {
await focusIntoInputAndType(accDoc, "input", "inner");
}
);

Просмотреть файл

@ -18,17 +18,24 @@
using namespace mozilla;
RefPtr<SharedThreadPool> sFuzzThreadPool;
class FuzzRunner {
public:
explicit FuzzRunner(Benchmark* aBenchmark) : mBenchmark(aBenchmark) {}
void Run() {
// Assert we're on the main thread, otherwise `done` must be synchronized.
MOZ_ASSERT(NS_IsMainThread());
bool done = false;
mBenchmark->Init();
media::Await(
GetMediaThreadPool(MediaThreadType::PLAYBACK), mBenchmark->Run(),
[&](uint32_t aDecodeFps) {}, [&](const MediaResult& aError) {});
mBenchmark->Run()->Then(
// Non DocGroup-version of AbstractThread::MainThread() is fine for
// testing.
AbstractThread::MainThread(), __func__,
[&](uint32_t aDecodeFps) { done = true; }, [&]() { done = true; });
// Wait until benchmark completes.
SpinEventLoopUntil([&]() { return done; });
return;
}
@ -36,13 +43,6 @@ class FuzzRunner {
RefPtr<Benchmark> mBenchmark;
};
static int FuzzingInitMedia(int* argc, char*** argv) {
// Grab a strong reference to the media thread pool to avoid thread
// leaks. For more information, see bug 1567170.
sFuzzThreadPool = GetMediaThreadPool(MediaThreadType::PLAYBACK);
return 0;
}
#define MOZ_MEDIA_FUZZER(_name) \
static int FuzzingRunMedia##_name(const uint8_t* data, size_t size) { \
if (!size) { \
@ -54,8 +54,7 @@ static int FuzzingInitMedia(int* argc, char*** argv) {
runner.Run(); \
return 0; \
} \
MOZ_FUZZING_INTERFACE_RAW(FuzzingInitMedia, FuzzingRunMedia##_name, \
Media##_name);
MOZ_FUZZING_INTERFACE_RAW(nullptr, FuzzingRunMedia##_name, Media##_name);
MOZ_MEDIA_FUZZER(ADTS);
MOZ_MEDIA_FUZZER(Flac);

Просмотреть файл

@ -40,10 +40,8 @@ bool DocumentChannelParent::Init(dom::CanonicalBrowsingContext* aContext,
if (loadState->GetChannelInitialized()) {
promise = DocumentLoadListener::ClaimParentLoad(
getter_AddRefs(mDocumentLoadListener), loadState->GetLoadIdentifier());
if (!promise) {
return false;
}
} else {
}
if (!promise) {
bool isDocumentLoad =
aArgs.elementCreationArgs().type() ==
DocumentChannelElementCreationArgs::TDocumentCreationArgs;

Просмотреть файл

@ -894,7 +894,13 @@ auto DocumentLoadListener::ClaimParentLoad(DocumentLoadListener** aListener,
RefPtr<DocumentLoadListener> loadListener = do_QueryObject(parentChannel);
registrar->DeregisterChannels(aLoadIdent);
MOZ_ASSERT(loadListener && loadListener->mOpenPromise);
if (!loadListener) {
// The parent went away unexpectedly.
*aListener = nullptr;
return nullptr;
}
MOZ_DIAGNOSTIC_ASSERT(loadListener->mOpenPromise);
loadListener.forget(aListener);
return (*aListener)->mOpenPromise;

Просмотреть файл

@ -171,6 +171,7 @@ scheme = https
[test_DOMInputPasswordAdded_fired_between_DOMContentLoaded_and_load_events.html]
scheme = https
support-files = slow_image.sjs
skip-if = xorigin # Hangs
[test_form_action_1.html]
skip-if = (xorigin && fission) # Hangs
[test_form_action_2.html]

Просмотреть файл

@ -40,9 +40,9 @@ Current requirements are:
- Special ASan Nightly Firefox Build
- `Linux
Download <https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.nightly.latest.firefox.linux64-asan-reporter-opt/artifacts/public/build/target.tar.bz2>`__
Download <https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.shippable.latest.firefox.linux64-asan-reporter-opt/artifacts/public/build/target.tar.bz2>`__
- `Windows
Download <https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.nightly.latest.firefox.win64-asan-reporter-nightly-repackage-signing/artifacts/public/build/target.installer.exe>`__
Download <https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.shippable.latest.firefox.win64-asan-reporter-shippable-repackage-signing/artifacts/public/build/target.installer.exe>`__
If you are already using regular Nightly, it should be safe to share the
profile with the regular Nightly instance. If you normally use a beta or