Skip to content

Commit

Permalink
ver up
Browse files Browse the repository at this point in the history
Signed-off-by: kokkiemouse <[email protected]>
  • Loading branch information
mineyoshikawasnow committed Jan 26, 2021
2 parents 2a6843c + 0b28701 commit 2c9273c
Show file tree
Hide file tree
Showing 789 changed files with 11,683 additions and 13,848 deletions.
7 changes: 6 additions & 1 deletion .cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,15 @@ git = "https://github.com/hsivonen/packed_simd"
replace-with = "vendored-sources"
rev = "0917fe780032a6bbb23d71be545f9c1834128d75"

[source."https://github.com/hsivonen/chardetng_c"]
git = "https://github.com/hsivonen/chardetng_c"
replace-with = "vendored-sources"
rev = "ed8a4c6f900a90d4dbc1d64b856e61490a1c3570"

[source."https://github.com/hsivonen/chardetng"]
git = "https://github.com/hsivonen/chardetng"
replace-with = "vendored-sources"
rev = "7d5e0608d3e012bdfea3bd199111e3546607dd31"
rev = "fd4ed671ef495af4dcda4c4cba3ef8d426db8af1"

[source."https://github.com/gfx-rs/naga"]
git = "https://github.com/gfx-rs/naga"
Expand Down
2 changes: 2 additions & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,5 @@ b9dd8e54c8ae449638635758a6571285655a4d0c FIREFOX_BETA_84_BASE
efceae9186cd456bb70240aa851855efb5afd316 FIREFOX_NIGHTLY_84_END
de82276dbe0fc291c5d9526a7dbc1b736010873a FIREFOX_BETA_85_BASE
22fc47c968f29a47ed15b282e2148aa5024d861e FIREFOX_NIGHTLY_85_END
fddc94978eb7f42cca5d199b94164d133facc3e7 FIREFOX_BETA_86_BASE
c2587d0631380f8479d44d4759ab820ac2c1a241 FIREFOX_NIGHTLY_86_END
7 changes: 3 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ opt-level = 1
opt-level = 1

[patch.crates-io]
chardetng = { git = "https://github.com/hsivonen/chardetng", rev="7d5e0608d3e012bdfea3bd199111e3546607dd31" }
chardetng = { git = "https://github.com/hsivonen/chardetng", rev="fd4ed671ef495af4dcda4c4cba3ef8d426db8af1" }
chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev="ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" }
libudev-sys = { path = "dom/webauthn/libudev-sys" }
packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="0917fe780032a6bbb23d71be545f9c1834128d75" }
rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="f3cace4fb8b53db0849c62af4fa62bade5a620f7" }
Expand Down
1 change: 0 additions & 1 deletion accessible/base/AccTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ enum AccType {
eHyperTextType,
eImageType,
eOuterDocType,
ePluginType,
eTextLeafType,

/**
Expand Down
4 changes: 1 addition & 3 deletions accessible/base/NotificationController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,7 @@ void NotificationController::WillRefresh(mozilla::TimeStamp aTime) {
continue;
}

nsIContent* ownerContent =
mDocument->DocumentNode()->FindContentForSubDocument(
childDoc->DocumentNode());
nsIContent* ownerContent = childDoc->DocumentNode()->GetEmbedderElement();
if (ownerContent) {
Accessible* outerDocAcc = mDocument->GetAccessible(ownerContent);
if (outerDocAcc && outerDocAcc->AppendChild(childDoc)) {
Expand Down
130 changes: 0 additions & 130 deletions accessible/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
#include "nsIObserverService.h"
#include "nsMenuPopupFrame.h"
#include "nsLayoutUtils.h"
#include "nsPluginFrame.h"
#include "nsTreeBodyFrame.h"
#include "nsTreeColumns.h"
#include "nsTreeUtils.h"
Expand All @@ -87,10 +86,6 @@
# include "XULTreeGridAccessibleWrap.h"
#endif

#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
# include "nsNPAPIPluginInstance.h"
#endif

using namespace mozilla;
using namespace mozilla::a11y;
using namespace mozilla::dom;
Expand Down Expand Up @@ -398,111 +393,6 @@ Accessible* nsAccessibilityService::GetRootDocumentAccessible(
return nullptr;
}

#ifdef XP_WIN
static StaticAutoPtr<nsTArray<nsCOMPtr<nsIContent> > > sPendingPlugins;
static StaticAutoPtr<nsTArray<nsCOMPtr<nsITimer> > > sPluginTimers;

class PluginTimerCallBack final : public nsITimerCallback, public nsINamed {
~PluginTimerCallBack() {}

public:
explicit PluginTimerCallBack(nsIContent* aContent) : mContent(aContent) {}

NS_DECL_ISUPPORTS

NS_IMETHOD Notify(nsITimer* aTimer) final {
if (!mContent->IsInUncomposedDoc()) return NS_OK;

PresShell* presShell = mContent->OwnerDoc()->GetPresShell();
if (presShell) {
DocAccessible* doc = presShell->GetDocAccessible();
if (doc) {
// Make sure that if we created an accessible for the plugin that wasn't
// a plugin accessible we remove it before creating the right
// accessible.
doc->RecreateAccessible(mContent);
sPluginTimers->RemoveElement(aTimer);
return NS_OK;
}
}

// We couldn't get a doc accessible so presumably the document went away.
// In this case don't leak our ref to the content or timer.
sPendingPlugins->RemoveElement(mContent);
sPluginTimers->RemoveElement(aTimer);
return NS_OK;
}

NS_IMETHOD GetName(nsACString& aName) final {
aName.AssignLiteral("PluginTimerCallBack");
return NS_OK;
}

private:
nsCOMPtr<nsIContent> mContent;
};

NS_IMPL_ISUPPORTS(PluginTimerCallBack, nsITimerCallback, nsINamed)
#endif

already_AddRefed<Accessible> nsAccessibilityService::CreatePluginAccessible(
nsPluginFrame* aFrame, nsIContent* aContent, Accessible* aContext) {
// nsPluginFrame means a plugin, so we need to use the accessibility support
// of the plugin.
if (aFrame->GetRect().IsEmpty()) return nullptr;

#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
RefPtr<nsNPAPIPluginInstance> pluginInstance = aFrame->GetPluginInstance();
if (pluginInstance) {
# ifdef XP_WIN
if (!sPendingPlugins->Contains(aContent) &&
(Preferences::GetBool("accessibility.delay_plugins") ||
Compatibility::IsJAWS() || Compatibility::IsWE())) {
RefPtr<PluginTimerCallBack> cb = new PluginTimerCallBack(aContent);
nsCOMPtr<nsITimer> timer;
NS_NewTimerWithCallback(
getter_AddRefs(timer), cb,
Preferences::GetUint("accessibility.delay_plugin_time"),
nsITimer::TYPE_ONE_SHOT);
sPluginTimers->AppendElement(timer);
sPendingPlugins->AppendElement(aContent);
return nullptr;
}

// We need to remove aContent from the pending plugins here to avoid
// reentrancy. When the timer fires it calls
// DocAccessible::ContentInserted() which does the work async.
sPendingPlugins->RemoveElement(aContent);

// Note: pluginPort will be null if windowless.
HWND pluginPort = nullptr;
aFrame->GetPluginPort(&pluginPort);

RefPtr<Accessible> accessible = new HTMLWin32ObjectOwnerAccessible(
aContent, aContext->Document(), pluginPort);
return accessible.forget();

# elif MOZ_ACCESSIBILITY_ATK
if (!AtkSocketAccessible::gCanEmbed) return nullptr;

// Note this calls into the plugin, so unexpected things may happen and
// aFrame may go away.
nsCString plugId;
nsresult rv = pluginInstance->GetValueFromPlugin(
NPPVpluginNativeAccessibleAtkPlugId, &plugId);
if (NS_SUCCEEDED(rv) && !plugId.IsEmpty()) {
RefPtr<AtkSocketAccessible> socketAccessible =
new AtkSocketAccessible(aContent, aContext->Document(), plugId);

return socketAccessible.forget();
}
# endif
}
#endif

return nullptr;
}

void nsAccessibilityService::DeckPanelSwitched(PresShell* aPresShell,
nsIContent* aDeckNode,
nsIFrame* aPrevBoxFrame,
Expand Down Expand Up @@ -1306,11 +1196,6 @@ bool nsAccessibilityService::Init() {
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::Accessibility,
"Active"_ns);

#ifdef XP_WIN
sPendingPlugins = new nsTArray<nsCOMPtr<nsIContent> >;
sPluginTimers = new nsTArray<nsCOMPtr<nsITimer> >;
#endif

// Now its safe to start platform accessibility.
if (XRE_IsParentProcess()) PlatformInit();

Expand Down Expand Up @@ -1344,16 +1229,6 @@ void nsAccessibilityService::Shutdown() {

SelectionManager::Shutdown();

#ifdef XP_WIN
sPendingPlugins = nullptr;

uint32_t timerCount = sPluginTimers->Length();
for (uint32_t i = 0; i < timerCount; i++)
sPluginTimers->ElementAt(i)->Cancel();

sPluginTimers = nullptr;
#endif

if (XRE_IsParentProcess()) PlatformShutdown();

gApplicationAccessible->Shutdown();
Expand Down Expand Up @@ -1510,11 +1385,6 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
case eOuterDocType:
newAcc = new OuterDocAccessible(aContent, document);
break;
case ePluginType: {
nsPluginFrame* pluginFrame = do_QueryFrame(aFrame);
newAcc = CreatePluginAccessible(pluginFrame, aContent, aContext);
break;
}
case eTextLeafType:
newAcc = new TextLeafAccessibleWrap(aContent, document);
break;
Expand Down
4 changes: 0 additions & 4 deletions accessible/base/nsAccessibilityService.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
class nsImageFrame;
class nsIArray;
class nsIPersistentProperties;
class nsPluginFrame;
class nsITreeView;

namespace mozilla {
Expand Down Expand Up @@ -116,9 +115,6 @@ class nsAccessibilityService final : public mozilla::a11y::DocManager,

Accessible* GetRootDocumentAccessible(mozilla::PresShell* aPresShell,
bool aCanCreate);
already_AddRefed<Accessible> CreatePluginAccessible(nsPluginFrame* aFrame,
nsIContent* aContent,
Accessible* aContext);

/**
* Adds/remove ATK root accessible for gtk+ native window to/from children
Expand Down
9 changes: 9 additions & 0 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,15 @@ void DocAccessible::AttributeChangedImpl(Accessible* aAccessible,
return;
}

if (aAttribute == nsGkAtoms::aria_multiline) {
bool isOn = elm->AttrValueIs(aNameSpaceID, aAttribute, nsGkAtoms::_true,
eCaseMatters);
RefPtr<AccEvent> event =
new AccStateChangeEvent(aAccessible, states::MULTI_LINE, isOn);
FireDelayedEvent(event);
return;
}

if (aAttribute == nsGkAtoms::id) {
RelocateARIAOwnedIfNeeded(elm);
ARIAActiveDescendantIDMaybeMoved(elm);
Expand Down
7 changes: 4 additions & 3 deletions accessible/mac/AccessibleWrap.mm
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,12 @@

case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
AccCaretMoveEvent* event = downcast_accEvent(aEvent);
int32_t caretOffset = event->GetCaretOffset();
MOXTextMarkerDelegate* delegate =
[MOXTextMarkerDelegate getOrCreateForDoc:aEvent->Document()];
[delegate setCaretOffset:eventTarget at:caretOffset];
if (event->IsSelectionCollapsed()) {
// If the selection is collapsed, invalidate our text selection cache.
MOXTextMarkerDelegate* delegate =
[MOXTextMarkerDelegate getOrCreateForDoc:aEvent->Document()];
int32_t caretOffset = event->GetCaretOffset();
[delegate setSelectionFrom:eventTarget
at:caretOffset
to:eventTarget
Expand Down
4 changes: 4 additions & 0 deletions accessible/mac/GeckoTextMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class GeckoTextMarker final {

bool operator<(const GeckoTextMarker& aPoint) const;

bool operator==(const GeckoTextMarker& aPoint) const {
return mContainer == aPoint.mContainer && mOffset == aPoint.mOffset;
}

AccessibleOrProxy mContainer;
int32_t mOffset;

Expand Down
3 changes: 2 additions & 1 deletion accessible/mac/GeckoTextMarker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ static bool DocumentExists(AccessibleOrProxy aDoc, uintptr_t aDocPtr) {
AXTextMarkerRef aTextMarker) {
MOZ_ASSERT(!aDoc.IsNull());
OpaqueGeckoTextMarker opaqueMarker;
if (AXTextMarkerGetLength(aTextMarker) == sizeof(OpaqueGeckoTextMarker)) {
if (aTextMarker &&
AXTextMarkerGetLength(aTextMarker) == sizeof(OpaqueGeckoTextMarker)) {
memcpy(&opaqueMarker, AXTextMarkerGetBytePtr(aTextMarker),
sizeof(OpaqueGeckoTextMarker));
if (DocumentExists(aDoc, opaqueMarker.mDoc)) {
Expand Down
53 changes: 51 additions & 2 deletions accessible/mac/MOXTextMarkerDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
@interface MOXTextMarkerDelegate : NSObject <MOXTextMarkerSupport> {
mozilla::a11y::AccessibleOrProxy mGeckoDocAccessible;
id mSelection;
id mCaret;
id mPrevCaret;
}

+ (id)getOrCreateForDoc:(mozilla::a11y::AccessibleOrProxy)aDoc;
Expand All @@ -30,12 +32,15 @@
to:(mozilla::a11y::AccessibleOrProxy)endContainer
at:(int32_t)endOffset;

- (void)setCaretOffset:(mozilla::a11y::AccessibleOrProxy)container
at:(int32_t)offset;

- (NSDictionary*)selectionChangeInfo;

- (void)invalidateSelection;

- (mozilla::a11y::GeckoTextMarkerRange)selection;

- (BOOL)selectionIsCollapsed;

// override
- (id)moxStartTextMarker;

Expand Down Expand Up @@ -107,3 +112,47 @@
- (void)moxSetSelectedTextMarkerRange:(id)textMarkerRange;

@end

namespace mozilla {
namespace a11y {

enum AXTextEditType {
AXTextEditTypeUnknown,
AXTextEditTypeDelete,
AXTextEditTypeInsert,
AXTextEditTypeTyping,
AXTextEditTypeDictation,
AXTextEditTypeCut,
AXTextEditTypePaste,
AXTextEditTypeAttributesChange
};

enum AXTextStateChangeType {
AXTextStateChangeTypeUnknown,
AXTextStateChangeTypeEdit,
AXTextStateChangeTypeSelectionMove,
AXTextStateChangeTypeSelectionExtend
};

enum AXTextSelectionDirection {
AXTextSelectionDirectionUnknown,
AXTextSelectionDirectionBeginning,
AXTextSelectionDirectionEnd,
AXTextSelectionDirectionPrevious,
AXTextSelectionDirectionNext,
AXTextSelectionDirectionDiscontiguous
};

enum AXTextSelectionGranularity {
AXTextSelectionGranularityUnknown,
AXTextSelectionGranularityCharacter,
AXTextSelectionGranularityWord,
AXTextSelectionGranularityLine,
AXTextSelectionGranularitySentence,
AXTextSelectionGranularityParagraph,
AXTextSelectionGranularityPage,
AXTextSelectionGranularityDocument,
AXTextSelectionGranularityAll
};
}
}
Loading

0 comments on commit 2c9273c

Please sign in to comment.