зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to s-c.
This commit is contained in:
Коммит
5530f7c7e6
1
.hgtags
1
.hgtags
|
@ -91,3 +91,4 @@ fd72dbbd692012224145be1bf13df1d7675fd277 FIREFOX_AURORA_17_BASE
|
|||
cf8750abee06cde395c659f8ecd8ae019d7512e3 FIREFOX_AURORA_19_BASE
|
||||
5bb309998e7050c9ee80b0147de1e473f008e221 FIREFOX_AURORA_20_BASE
|
||||
cc37417e2c284aed960f98ffa479de4ccdd5c7c3 FIREFOX_AURORA_21_BASE
|
||||
1c070ab0f9db59f13423b9c1db60419f7a9098f9 FIREFOX_AURORA_22_BASE
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "TextAttrs.h"
|
||||
|
||||
#include "Accessible-inl.h"
|
||||
#include "HyperTextAccessibleWrap.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsCoreUtils.h"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -239,7 +239,7 @@ nsAccUtils::GetSelectableContainer(Accessible* aAccessible, uint64_t aState)
|
|||
|
||||
Accessible* parent = aAccessible;
|
||||
while ((parent = parent->Parent()) && !parent->IsSelect()) {
|
||||
if (Role(parent) == nsIAccessibleRole::ROLE_PANE)
|
||||
if (parent->Role() == roles::PANE)
|
||||
return nullptr;
|
||||
}
|
||||
return parent;
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
#ifndef nsAccUtils_h_
|
||||
#define nsAccUtils_h_
|
||||
|
||||
#include "nsIAccessible.h"
|
||||
#include "nsIAccessibleRole.h"
|
||||
#include "mozilla/a11y/Accessible.h"
|
||||
#include "nsIAccessibleText.h"
|
||||
|
||||
#include "nsAccessibilityService.h"
|
||||
|
@ -192,18 +191,6 @@ public:
|
|||
*/
|
||||
static nsIntPoint GetScreenCoordsForParent(Accessible* aAccessible);
|
||||
|
||||
/**
|
||||
* Return the role of the given accessible.
|
||||
*/
|
||||
static uint32_t Role(nsIAccessible *aAcc)
|
||||
{
|
||||
uint32_t role = nsIAccessibleRole::ROLE_NOTHING;
|
||||
if (aAcc)
|
||||
aAcc->GetRole(&role);
|
||||
|
||||
return role;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ARIA attribute characteristics for a given ARIA attribute.
|
||||
*
|
||||
|
@ -240,12 +227,12 @@ public:
|
|||
/**
|
||||
* Return true if the given accessible is embedded object.
|
||||
*/
|
||||
static bool IsEmbeddedObject(nsIAccessible *aAcc)
|
||||
static bool IsEmbeddedObject(Accessible* aAcc)
|
||||
{
|
||||
uint32_t role = Role(aAcc);
|
||||
return role != nsIAccessibleRole::ROLE_TEXT_LEAF &&
|
||||
role != nsIAccessibleRole::ROLE_WHITESPACE &&
|
||||
role != nsIAccessibleRole::ROLE_STATICTEXT;
|
||||
uint32_t role = aAcc->Role();
|
||||
return role != roles::TEXT_LEAF &&
|
||||
role != roles::WHITESPACE &&
|
||||
role != roles::STATICTEXT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include "mozilla/a11y/Compatibility.h"
|
||||
#include "HTMLWin32ObjectAccessible.h"
|
||||
#endif
|
||||
|
||||
|
@ -63,6 +64,7 @@
|
|||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/Util.h"
|
||||
#include "nsDeckFrame.h"
|
||||
|
||||
|
@ -210,6 +212,45 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
static StaticAutoPtr<nsTArray<nsCOMPtr<nsIContent> > > sPendingPlugins;
|
||||
static StaticAutoPtr<nsTArray<nsCOMPtr<nsITimer> > > sPluginTimers;
|
||||
|
||||
class PluginTimerCallBack MOZ_FINAL : public nsITimerCallback
|
||||
{
|
||||
public:
|
||||
PluginTimerCallBack(nsIContent* aContent) : mContent(aContent) {}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHODIMP Notify(nsITimer* aTimer) MOZ_FINAL
|
||||
{
|
||||
nsIPresShell* ps = mContent->OwnerDoc()->GetShell();
|
||||
if (ps) {
|
||||
DocAccessible* doc = ps->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;
|
||||
}
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS1(PluginTimerCallBack, nsITimerCallback)
|
||||
#endif
|
||||
|
||||
already_AddRefed<Accessible>
|
||||
nsAccessibilityService::CreatePluginAccessible(nsObjectFrame* aFrame,
|
||||
nsIContent* aContent,
|
||||
|
@ -225,6 +266,23 @@ nsAccessibilityService::CreatePluginAccessible(nsObjectFrame* aFrame,
|
|||
if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) &&
|
||||
pluginInstance) {
|
||||
#ifdef XP_WIN
|
||||
if (!sPendingPlugins->Contains(aContent) &&
|
||||
(Preferences::GetBool("accessibility.delay_plugins") ||
|
||||
Compatibility::IsJAWS() || Compatibility::IsWE())) {
|
||||
nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
|
||||
nsRefPtr<PluginTimerCallBack> cb = new PluginTimerCallBack(aContent);
|
||||
timer->InitWithCallback(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);
|
||||
|
@ -1004,6 +1062,11 @@ nsAccessibilityService::Init()
|
|||
NS_LITERAL_CSTRING("Active"));
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
sPendingPlugins = new nsTArray<nsCOMPtr<nsIContent> >;
|
||||
sPluginTimers = new nsTArray<nsCOMPtr<nsITimer> >;
|
||||
#endif
|
||||
|
||||
gIsShutdown = false;
|
||||
|
||||
// Now its safe to start platform accessibility.
|
||||
|
@ -1030,6 +1093,16 @@ 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
|
||||
|
||||
// Application is going to be closed, shutdown accessibility and mark
|
||||
// accessibility service as shutdown to prevent calls of its methods.
|
||||
// Don't null accessibility service static member at this point to be safe
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "nsAccessibleRelation.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsIAccessibleRelation.h"
|
||||
#include "nsIAccessibleRole.h"
|
||||
#include "nsEventShell.h"
|
||||
#include "nsTextEquivUtils.h"
|
||||
#include "Relation.h"
|
||||
|
@ -2654,7 +2655,8 @@ Accessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
|
|||
return false;
|
||||
|
||||
for (uint32_t idx = aIndex + 1; idx < mChildren.Length(); idx++) {
|
||||
NS_ASSERTION(mChildren[idx]->mIndexInParent == idx - 1, "Accessible child index doesn't match");
|
||||
NS_ASSERTION(static_cast<uint32_t>(mChildren[idx]->mIndexInParent) == idx - 1,
|
||||
"Accessible child index doesn't match");
|
||||
mChildren[idx]->mIndexInParent = idx;
|
||||
}
|
||||
|
||||
|
@ -2685,7 +2687,8 @@ Accessible::RemoveChild(Accessible* aChild)
|
|||
}
|
||||
|
||||
for (uint32_t idx = index + 1; idx < mChildren.Length(); idx++) {
|
||||
NS_ASSERTION(mChildren[idx]->mIndexInParent == idx, "Accessible child index doesn't match");
|
||||
NS_ASSERTION(static_cast<uint32_t>(mChildren[idx]->mIndexInParent) == idx,
|
||||
"Accessible child index doesn't match");
|
||||
mChildren[idx]->mIndexInParent = idx - 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -781,6 +781,37 @@ HyperTextAccessible::GetRelativeOffset(nsIPresShell* aPresShell,
|
|||
return hyperTextOffset;
|
||||
}
|
||||
|
||||
int32_t
|
||||
HyperTextAccessible::FindWordBoundary(int32_t aOffset, nsDirection aDirection,
|
||||
EWordMovementType aWordMovementType)
|
||||
{
|
||||
// Convert hypertext offset to frame-relative offset.
|
||||
int32_t offsetInFrame = aOffset, notUsedOffset = aOffset;
|
||||
nsRefPtr<Accessible> accAtOffset;
|
||||
nsIFrame* frameAtOffset =
|
||||
GetPosAndText(offsetInFrame, notUsedOffset, nullptr, nullptr,
|
||||
nullptr, getter_AddRefs(accAtOffset));
|
||||
if (!frameAtOffset) {
|
||||
if (aOffset == CharacterCount()) {
|
||||
// Asking for start of line, while on last character.
|
||||
if (accAtOffset)
|
||||
frameAtOffset = accAtOffset->GetFrame();
|
||||
}
|
||||
NS_ASSERTION(frameAtOffset, "No start frame for text getting!");
|
||||
if (!frameAtOffset)
|
||||
return -1;
|
||||
|
||||
// We're on the last continuation since we're on the last character.
|
||||
frameAtOffset = frameAtOffset->GetLastContinuation();
|
||||
}
|
||||
|
||||
// Return hypertext offset of the boundary of the found word.
|
||||
return GetRelativeOffset(mDoc->PresShell(), frameAtOffset, offsetInFrame,
|
||||
accAtOffset, eSelectWord, aDirection,
|
||||
(aWordMovementType == eStartWord),
|
||||
aWordMovementType);
|
||||
}
|
||||
|
||||
/*
|
||||
Gets the specified text relative to aBoundaryType, which means:
|
||||
BOUNDARY_CHAR The character before/at/after the offset is returned.
|
||||
|
@ -973,13 +1004,57 @@ HyperTextAccessible::GetTextBeforeOffset(int32_t aOffset,
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (aBoundaryType == BOUNDARY_CHAR) {
|
||||
GetCharAt(aOffset, eGetBefore, aText, aStartOffset, aEndOffset);
|
||||
return NS_OK;
|
||||
}
|
||||
int32_t offset = ConvertMagicOffset(aOffset);
|
||||
if (offset < 0)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
return GetTextHelper(eGetBefore, aBoundaryType, aOffset,
|
||||
aStartOffset, aEndOffset, aText);
|
||||
switch (aBoundaryType) {
|
||||
case BOUNDARY_CHAR:
|
||||
GetCharAt(offset, eGetBefore, aText, aStartOffset, aEndOffset);
|
||||
return NS_OK;
|
||||
|
||||
case BOUNDARY_WORD_START: {
|
||||
if (offset == 0) { // no word before 0 offset
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// If the offset is a word start then move backward to find start offset
|
||||
// (end offset is the given offset). Otherwise move backward twice to find
|
||||
// both start and end offsets.
|
||||
int32_t midOffset = FindWordBoundary(offset, eDirPrevious, eStartWord);
|
||||
*aEndOffset = FindWordBoundary(midOffset, eDirNext, eStartWord);
|
||||
if (*aEndOffset == offset) {
|
||||
*aStartOffset = midOffset;
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
}
|
||||
|
||||
*aStartOffset = FindWordBoundary(midOffset, eDirPrevious, eStartWord);
|
||||
*aEndOffset = midOffset;
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
}
|
||||
|
||||
case BOUNDARY_WORD_END: {
|
||||
if (offset == 0) { // no word before 0 offset
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Move word backward twice to find start and end offsets.
|
||||
*aEndOffset = FindWordBoundary(offset, eDirPrevious, eEndWord);
|
||||
*aStartOffset = FindWordBoundary(*aEndOffset, eDirPrevious, eEndWord);
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
}
|
||||
|
||||
case BOUNDARY_LINE_START:
|
||||
case BOUNDARY_LINE_END:
|
||||
case BOUNDARY_ATTRIBUTE_RANGE:
|
||||
return GetTextHelper(eGetBefore, aBoundaryType, aOffset,
|
||||
aStartOffset, aEndOffset, aText);
|
||||
|
||||
default:
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -991,117 +1066,50 @@ HyperTextAccessible::GetTextAtOffset(int32_t aOffset,
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsSelectionAmount selectionAmount = eSelectWord;
|
||||
int32_t offset = ConvertMagicOffset(aOffset);
|
||||
if (offset < 0)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
EWordMovementType wordMovementType = eDefaultBehavior;
|
||||
bool forwardBack = true;
|
||||
bool moveForwardThenBack = true;
|
||||
|
||||
switch (aBoundaryType) {
|
||||
case BOUNDARY_CHAR:
|
||||
return GetCharAt(aOffset, eGetAt, aText, aStartOffset, aEndOffset) ?
|
||||
NS_OK : NS_ERROR_INVALID_ARG;
|
||||
|
||||
case BOUNDARY_WORD_START:
|
||||
wordMovementType = eStartWord;
|
||||
break;
|
||||
case BOUNDARY_WORD_START: {
|
||||
uint32_t textLen = CharacterCount();
|
||||
if (offset == textLen) {
|
||||
*aStartOffset = *aEndOffset = textLen;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
case BOUNDARY_WORD_END:
|
||||
wordMovementType = eEndWord;
|
||||
forwardBack = false;
|
||||
break;
|
||||
*aEndOffset = FindWordBoundary(offset, eDirNext, eStartWord);
|
||||
*aStartOffset = FindWordBoundary(*aEndOffset, eDirPrevious, eStartWord);
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
}
|
||||
|
||||
case BOUNDARY_WORD_END: {
|
||||
if (offset == 0) {
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*aStartOffset = FindWordBoundary(offset, eDirPrevious, eEndWord);
|
||||
*aEndOffset = FindWordBoundary(*aStartOffset, eDirNext, eEndWord);
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
}
|
||||
|
||||
case BOUNDARY_LINE_START:
|
||||
case BOUNDARY_LINE_END:
|
||||
case BOUNDARY_ATTRIBUTE_RANGE:
|
||||
return GetTextHelper(eGetAt, aBoundaryType, aOffset,
|
||||
aStartOffset, aEndOffset, aText);
|
||||
break;
|
||||
|
||||
case BOUNDARY_ATTRIBUTE_RANGE:
|
||||
{
|
||||
nsresult rv = GetTextAttributes(false, aOffset,
|
||||
aStartOffset, aEndOffset, nullptr);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
}
|
||||
|
||||
default:
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
int32_t offset = ConvertMagicOffset(aOffset);
|
||||
if (offset < 0)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
uint32_t textLen = CharacterCount();
|
||||
if (forwardBack) {
|
||||
if (offset == textLen) {
|
||||
*aStartOffset = *aEndOffset = textLen;
|
||||
return NS_OK;
|
||||
}
|
||||
} else {
|
||||
if (offset == 0) {
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert offsets to frame-relative
|
||||
int32_t startOffset = offset, endOffset = offset;
|
||||
nsRefPtr<Accessible> startAcc;
|
||||
nsIFrame* startFrame = GetPosAndText(startOffset, endOffset, nullptr, nullptr,
|
||||
nullptr, getter_AddRefs(startAcc));
|
||||
if (!startFrame) {
|
||||
if (offset == textLen) {
|
||||
// Asking for start of line, while on last character
|
||||
if (startAcc)
|
||||
startFrame = startAcc->GetFrame();
|
||||
}
|
||||
NS_ASSERTION(startFrame, "No start frame for text getting!");
|
||||
if (!startFrame)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// We're on the last continuation since we're on the last character.
|
||||
startFrame = startFrame->GetLastContinuation();
|
||||
}
|
||||
|
||||
offset = GetRelativeOffset(mDoc->PresShell(), startFrame, startOffset,
|
||||
startAcc, selectionAmount,
|
||||
(forwardBack ? eDirNext : eDirPrevious),
|
||||
forwardBack, wordMovementType);
|
||||
|
||||
if (forwardBack)
|
||||
*aEndOffset = offset;
|
||||
else
|
||||
*aStartOffset = offset;
|
||||
|
||||
startOffset = endOffset = offset;
|
||||
startFrame = GetPosAndText(startOffset, endOffset, nullptr, nullptr,
|
||||
nullptr, getter_AddRefs(startAcc));
|
||||
if (!startFrame) {
|
||||
if (offset == textLen) {
|
||||
// Asking for start of line, while on last character
|
||||
if (startAcc)
|
||||
startFrame = startAcc->GetFrame();
|
||||
}
|
||||
NS_ASSERTION(startFrame, "No start frame for text getting!");
|
||||
if (!startFrame)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// We're on the last continuation since we're on the last character.
|
||||
startFrame = startFrame->GetLastContinuation();
|
||||
}
|
||||
|
||||
offset = GetRelativeOffset(mDoc->PresShell(), startFrame, startOffset,
|
||||
startAcc, selectionAmount,
|
||||
(forwardBack ? eDirPrevious : eDirNext),
|
||||
forwardBack, wordMovementType);
|
||||
|
||||
if (forwardBack)
|
||||
*aStartOffset = offset;
|
||||
else
|
||||
*aEndOffset = offset;
|
||||
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -263,6 +263,12 @@ protected:
|
|||
return aOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an offset of the found word boundary.
|
||||
*/
|
||||
int32_t FindWordBoundary(int32_t aOffset, nsDirection aDirection,
|
||||
EWordMovementType aWordMovementType);
|
||||
|
||||
/*
|
||||
* This does the work for nsIAccessibleText::GetText[At|Before|After]Offset
|
||||
* @param aType, eGetBefore, eGetAt, eGetAfter
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
function doTest()
|
||||
{
|
||||
SimpleTest.expectAssertions(54);
|
||||
SimpleTest.expectAssertions(44);
|
||||
|
||||
// __o__n__e__w__o__r__d__\n
|
||||
// 0 1 2 3 4 5 6 7
|
||||
|
@ -197,96 +197,36 @@
|
|||
"textarea", kOk, kOk, kOk);
|
||||
|
||||
// BOUNDARY_WORD_START
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"divbr", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"editablebr", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"divbr", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"editablebr", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_START, "oneword\n\n", 0, 9,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(13, BOUNDARY_WORD_START, "two ", 9, 13,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(18, BOUNDARY_WORD_START, "two ", 9, 13,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"divbr", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"editablebr", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_START, "two ", 9, 13,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"divbr", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"editablebr", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_START, "oneword\n\n", 0, 9, IDs);
|
||||
testTextBeforeOffset(13, BOUNDARY_WORD_START, "two ", 9, 13, IDs);
|
||||
testTextBeforeOffset(18, BOUNDARY_WORD_START, "two ", 9, 13, IDs);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_START, "words\n", 13, 19, IDs);
|
||||
|
||||
// BOUNDARY_WORD_END
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"divbr", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"editablebr", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_END, "oneword", 0, 7,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_END, "oneword", 0, 7,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(12, BOUNDARY_WORD_END, "oneword", 0, 7,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(12, BOUNDARY_WORD_END, "oneword", 0, 7, IDs);
|
||||
testTextBeforeOffset(13, BOUNDARY_WORD_END, "\n\ntwo", 7, 12, IDs);
|
||||
testTextBeforeOffset(18, BOUNDARY_WORD_END, "\n\ntwo", 7, 12, IDs);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_END, " words", 12, 18,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"editablebr", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(13, BOUNDARY_WORD_END, "\n\ntwo", 7, 12,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"divbr", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"editablebr", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(18, BOUNDARY_WORD_END, "\n\ntwo", 7, 12,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"divbr", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"editablebr", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_END, " words", 13, 18,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"divbr", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
|
||||
|
@ -523,6 +463,16 @@
|
|||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=612331">
|
||||
Bug 612331
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="getTextAtOffset for word boundaries: beginning of a new life"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=853340">
|
||||
Bug 853340
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="getTextBeforeOffset for word boundaries: evolving"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=855732">
|
||||
Bug 855732
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
src="../text.js"></script>
|
||||
<script type="application/javascript">
|
||||
if (navigator.platform.startsWith("Mac")) {
|
||||
SimpleTest.expectAssertions(0, 28);
|
||||
SimpleTest.expectAssertions(0, 20);
|
||||
} else {
|
||||
SimpleTest.expectAssertions(28);
|
||||
SimpleTest.expectAssertions(20);
|
||||
}
|
||||
|
||||
function doTest()
|
||||
|
@ -218,108 +218,28 @@
|
|||
testCharBeforeOffset(IDs, 15, "d", 14, 15);
|
||||
|
||||
// BOUNDARY_WORD_START
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(5, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_START, "hello ", 0, 6,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_START, "hello ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_START, "hello ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_START, "my ", 6, 9,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_START, "my ", 6, 9,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(14, BOUNDARY_WORD_START, "my ", 6, 9,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_START, "my ", 6, 9,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(5, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_START, "hello ", 0, 6, IDs);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_START, "hello ", 0, 6, IDs);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_START, "hello ", 0, 6, IDs);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_START, "my ", 6, 9, IDs);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_START, "my ", 6, 9, IDs);
|
||||
testTextBeforeOffset(14, BOUNDARY_WORD_START, "my ", 6, 9, IDs);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_START, "friend", 9, 15, IDs);
|
||||
|
||||
// BOUNDARY_WORD_END
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(5, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_END, "hello ", 0, 6,
|
||||
"input", kTodo, kTodo, kOk,
|
||||
"div", kTodo, kTodo, kOk,
|
||||
"editable", kTodo, kTodo, kOk,
|
||||
"textarea", kTodo, kTodo, kOk);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_END, "hello ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_END, "hello ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_END, " my", 5, 8,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_END, " my", 5, 8,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(14, BOUNDARY_WORD_END, " my", 5, 8,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_END, " my", 5, 8,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(5, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_END, "hello", 0, 5, IDs);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_END, "hello", 0, 5, IDs);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_END, "hello", 0, 5, IDs);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_END, " my", 5, 8, IDs);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_END, " my", 5, 8, IDs);
|
||||
testTextBeforeOffset(14, BOUNDARY_WORD_END, " my", 5, 8, IDs);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_END, " my", 5, 8, IDs);
|
||||
|
||||
// BOUNDARY_LINE_START
|
||||
testTextBeforeOffset(0, BOUNDARY_LINE_START, "", 0, 0,
|
||||
|
@ -463,7 +383,19 @@
|
|||
|
||||
<a target="_blank"
|
||||
title="nsIAccessibleText getText related function tests for html:input,html:div and html:textarea"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=452769">Mozilla Bug 452769</a>
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=452769">
|
||||
Bug 452769
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="getTextAtOffset for word boundaries: beginning of a new life"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=853340">
|
||||
Bug 853340
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="getTextBeforeOffset for word boundaries: evolving"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=855732">
|
||||
Bug 855732
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
src="../text.js"></script>
|
||||
<script type="application/javascript">
|
||||
if (navigator.platform.startsWith("Mac")) {
|
||||
SimpleTest.expectAssertions(0, 11);
|
||||
SimpleTest.expectAssertions(0, 3);
|
||||
} else {
|
||||
SimpleTest.expectAssertions(11);
|
||||
SimpleTest.expectAssertions(3);
|
||||
}
|
||||
|
||||
function doTest()
|
||||
|
@ -198,163 +198,39 @@
|
|||
testCharBeforeOffset(IDs, 19, " ", 18, 19);
|
||||
|
||||
// BOUNDARY_WORD_START
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(5, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_START, "Brave ", 0, 6,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_START, "Brave ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_START, "Brave ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(11, BOUNDARY_WORD_START, "Sir ", 6, 11,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_START, "Sir ", 6, 11,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(16, BOUNDARY_WORD_START, "Sir ", 6, 11,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(17, BOUNDARY_WORD_START, "Sir ", 6, 11,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(18, BOUNDARY_WORD_START, "Sir ", 6, 11,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_START, "Robin ", 11, 19,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(20, BOUNDARY_WORD_START, "Robin ", 11, 19,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(21, BOUNDARY_WORD_START, "Robin ", 11, 19,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(5, BOUNDARY_WORD_START, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_START, "Brave ", 0, 6, IDs);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_START, "Brave ", 0, 6, IDs);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_START, "Brave ", 0, 6, IDs);
|
||||
testTextBeforeOffset(11, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
|
||||
testTextBeforeOffset(16, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
|
||||
testTextBeforeOffset(17, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
|
||||
testTextBeforeOffset(18, BOUNDARY_WORD_START, "Sir ", 6, 11, IDs);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_START, "Robin ", 11, 19, IDs);
|
||||
testTextBeforeOffset(20, BOUNDARY_WORD_START, "Robin ", 11, 19, IDs);
|
||||
testTextBeforeOffset(21, BOUNDARY_WORD_START, "Robin ", 11, 19, IDs);
|
||||
|
||||
// BOUNDARY_WORD_END
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(4, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(5, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_END, "Brave", 0, 5,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_END, "Brave", 0, 5,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_END, "Brave", 0, 5,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_END, "Brave", 0, 5,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_END, " Sir", 5, 9,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(11, BOUNDARY_WORD_END, " Sir", 5, 9,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_END, " Sir", 5, 9,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(16, BOUNDARY_WORD_END, " Sir", 5, 9,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(17, BOUNDARY_WORD_END, " Robin", 9, 16,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(18, BOUNDARY_WORD_END, " Robin", 9, 16,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_END, " Robin", 9, 16,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(21, BOUNDARY_WORD_END, " Robin", 9, 16,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(22, BOUNDARY_WORD_END, " Robin", 9, 16,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(4, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(5, BOUNDARY_WORD_END, "", 0, 0, IDs);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_END, "Brave", 0, 5, IDs);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_END, "Brave", 0, 5, IDs);
|
||||
testTextBeforeOffset(8, BOUNDARY_WORD_END, "Brave", 0, 5, IDs);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_END, "Brave", 0, 5, IDs);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_END, " Sir", 5, 9, IDs);
|
||||
testTextBeforeOffset(11, BOUNDARY_WORD_END, " Sir", 5, 9, IDs);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_END, " Sir", 5, 9, IDs);
|
||||
testTextBeforeOffset(16, BOUNDARY_WORD_END, " Sir", 5, 9, IDs);
|
||||
testTextBeforeOffset(17, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextBeforeOffset(18, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextBeforeOffset(21, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextBeforeOffset(22, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// getTextAtOffset
|
||||
|
@ -492,7 +368,19 @@
|
|||
|
||||
<a target="_blank"
|
||||
title="getText... methods tests on string with whitespaces for plain text containers"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=610568">Mozilla Bug 610568</a>
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=610568">
|
||||
Bug 610568
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="getTextAtOffset for word boundaries: beginning of a new life"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=853340">
|
||||
Bug 853340
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="getTextBeforeOffset for word boundaries: evolving"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=855732">
|
||||
Bug 855732
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -58,7 +58,6 @@ exports.IDBTransaction = Ci.nsIIDBTransaction;
|
|||
exports.IDBOpenDBRequest = Ci.nsIIDBOpenDBRequest;
|
||||
exports.IDBVersionChangeEvent = Ci.nsIIDBVersionChangeEvent;
|
||||
exports.IDBDatabase = Ci.nsIIDBDatabase;
|
||||
exports.IDBFactory = Ci.nsIIDBFactory;
|
||||
exports.IDBIndex = Ci.nsIIDBIndex;
|
||||
exports.IDBObjectStore = Ci.nsIIDBObjectStore;
|
||||
exports.IDBRequest = Ci.nsIIDBRequest;
|
||||
|
|
|
@ -9,8 +9,8 @@ if (xulApp.versionInRange(xulApp.platformVersion, "16.0a1", "*")) {
|
|||
new function tests() {
|
||||
|
||||
const { indexedDB, IDBKeyRange, DOMException, IDBCursor, IDBTransaction,
|
||||
IDBOpenDBRequest, IDBVersionChangeEvent, IDBDatabase, IDBFactory,
|
||||
IDBIndex, IDBObjectStore, IDBRequest
|
||||
IDBOpenDBRequest, IDBVersionChangeEvent, IDBDatabase, IDBIndex,
|
||||
IDBObjectStore, IDBRequest
|
||||
} = require("sdk/indexed-db");
|
||||
|
||||
exports["test indexedDB is frozen"] = function(assert){
|
||||
|
@ -25,7 +25,7 @@ exports["test indexedDB is frozen"] = function(assert){
|
|||
exports["test db variables"] = function(assert) {
|
||||
[ indexedDB, IDBKeyRange, DOMException, IDBCursor, IDBTransaction,
|
||||
IDBOpenDBRequest, IDBOpenDBRequest, IDBVersionChangeEvent,
|
||||
IDBDatabase, IDBFactory, IDBIndex, IDBObjectStore, IDBRequest
|
||||
IDBDatabase, IDBIndex, IDBObjectStore, IDBRequest
|
||||
].forEach(function(value) {
|
||||
assert.notEqual(typeof(value), "undefined", "variable is defined");
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
MOZ_APP_BASENAME=B2G
|
||||
MOZ_APP_VENDOR=Mozilla
|
||||
|
||||
MOZ_APP_VERSION=22.0a1
|
||||
MOZ_APP_VERSION=23.0a1
|
||||
MOZ_APP_UA_NAME=Firefox
|
||||
|
||||
MOZ_UA_OS_AGNOSTIC=1
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
es-ES
|
||||
pl
|
||||
pt-BR
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#if defined(XP_WIN)
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#elif defined(XP_UNIX)
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
@ -49,7 +51,10 @@ using namespace mozilla;
|
|||
#define kDesktopFolder "browser"
|
||||
#define kMetroFolder "metro"
|
||||
#define kMetroAppIniFilename "metroapp.ini"
|
||||
#ifdef XP_WIN
|
||||
#define kMetroTestFile "tests.ini"
|
||||
const char* kMetroConsoleIdParam = "testconsoleid=";
|
||||
#endif
|
||||
|
||||
static void Output(const char *fmt, ... )
|
||||
{
|
||||
|
@ -101,6 +106,42 @@ static bool IsArg(const char* arg, const char* s)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
/*
|
||||
* AttachToTestsConsole - Windows helper for when we are running
|
||||
* in the immersive environment. Firefox is launched by Windows in
|
||||
* response to a request by metrotestharness, which is launched by
|
||||
* runtests.py. As such stdout in fx doesn't point to the right
|
||||
* stream. This helper touches up stdout such that test output gets
|
||||
* routed to the console the tests are run in.
|
||||
*/
|
||||
static void AttachToTestsConsole(DWORD aProcessId)
|
||||
{
|
||||
if (!AttachConsole(aProcessId)) {
|
||||
OutputDebugStringW(L"Could not attach to console.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
HANDLE winOut = CreateFileA("CONOUT$",
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_WRITE, 0,
|
||||
OPEN_EXISTING, 0, 0);
|
||||
if (winOut == INVALID_HANDLE_VALUE) {
|
||||
OutputDebugStringW(L"Could not attach to console.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the c runtime handle
|
||||
int stdOut = _open_osfhandle((intptr_t)winOut, _O_APPEND);
|
||||
if (stdOut == -1) {
|
||||
OutputDebugStringW(L"Could not open c-runtime handle.\n");
|
||||
return;
|
||||
}
|
||||
FILE *fp = _fdopen(stdOut, "a");
|
||||
*stdout = *fp;
|
||||
}
|
||||
#endif
|
||||
|
||||
XRE_GetFileFromPathType XRE_GetFileFromPath;
|
||||
XRE_CreateAppDataType XRE_CreateAppData;
|
||||
XRE_FreeAppDataType XRE_FreeAppData;
|
||||
|
@ -314,6 +355,15 @@ static int do_main(int argc, char* argv[], nsIFile *xreDirectory)
|
|||
if (isspace(*ptr)) {
|
||||
*ptr = '\0';
|
||||
ptr++;
|
||||
// Check for the console id the metrotestharness passes in, we need
|
||||
// to connect up to this so test output goes to the right place.
|
||||
if (ptr && !strncmp(ptr, kMetroConsoleIdParam, strlen(kMetroConsoleIdParam))) {
|
||||
DWORD processId = strtol(ptr + strlen(kMetroConsoleIdParam), nullptr, 10);
|
||||
if (processId > 0) {
|
||||
AttachToTestsConsole(processId);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
newArgv[newArgc] = ptr;
|
||||
newArgc++;
|
||||
continue;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1232,3 +1232,6 @@ pref("plain_text.wrap_long_lines", true);
|
|||
pref("media.webaudio.enabled", true);
|
||||
#endif
|
||||
|
||||
// If this turns true, Moz*Gesture events are not called stopPropagation()
|
||||
// before content.
|
||||
pref("dom.debug.propagate_gesture_events_through_content", false);
|
||||
|
|
|
@ -65,21 +65,21 @@ XPCOMUtils.defineLazyGetter(this, "gPrefService", function() {
|
|||
return Services.prefs;
|
||||
});
|
||||
|
||||
__defineGetter__("AddonManager", function() {
|
||||
this.__defineGetter__("AddonManager", function() {
|
||||
let tmp = {};
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm", tmp);
|
||||
return this.AddonManager = tmp.AddonManager;
|
||||
});
|
||||
__defineSetter__("AddonManager", function (val) {
|
||||
this.__defineSetter__("AddonManager", function (val) {
|
||||
delete this.AddonManager;
|
||||
return this.AddonManager = val;
|
||||
});
|
||||
|
||||
__defineGetter__("PluralForm", function() {
|
||||
this.__defineGetter__("PluralForm", function() {
|
||||
Cu.import("resource://gre/modules/PluralForm.jsm");
|
||||
return this.PluralForm;
|
||||
});
|
||||
__defineSetter__("PluralForm", function (val) {
|
||||
this.__defineSetter__("PluralForm", function (val) {
|
||||
delete this.PluralForm;
|
||||
return this.PluralForm = val;
|
||||
});
|
||||
|
@ -768,7 +768,10 @@ let gGestureSupport = {
|
|||
* The gesture event to handle
|
||||
*/
|
||||
handleEvent: function GS_handleEvent(aEvent) {
|
||||
aEvent.stopPropagation();
|
||||
if (!Services.prefs.getBoolPref(
|
||||
"dom.debug.propagate_gesture_events_through_content")) {
|
||||
aEvent.stopPropagation();
|
||||
}
|
||||
|
||||
// Create a preference object with some defaults
|
||||
let def = function(aThreshold, aLatched)
|
||||
|
@ -3747,7 +3750,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
|
|||
// Hacky: update the PopupNotifications' object's reference to the iconBox,
|
||||
// if it already exists, since it may have changed if the URL bar was
|
||||
// added/removed.
|
||||
if (!__lookupGetter__("PopupNotifications"))
|
||||
if (!window.__lookupGetter__("PopupNotifications"))
|
||||
PopupNotifications.iconBox = document.getElementById("notification-popup-box");
|
||||
}
|
||||
|
||||
|
@ -4213,32 +4216,6 @@ var XULBrowserWindow = {
|
|||
}
|
||||
}
|
||||
|
||||
// This code here does not compare uris exactly when determining
|
||||
// whether or not the message should be hidden since the message
|
||||
// may be prematurely hidden when an install is invoked by a click
|
||||
// on a link that looks like this:
|
||||
//
|
||||
// <a href="#" onclick="return install();">Install Foo</a>
|
||||
//
|
||||
// - which fires a onLocationChange message to uri + '#'...
|
||||
var selectedBrowser = gBrowser.selectedBrowser;
|
||||
if (selectedBrowser.lastURI) {
|
||||
let oldSpec = selectedBrowser.lastURI.spec;
|
||||
let oldIndexOfHash = oldSpec.indexOf("#");
|
||||
if (oldIndexOfHash != -1)
|
||||
oldSpec = oldSpec.substr(0, oldIndexOfHash);
|
||||
let newSpec = location;
|
||||
let newIndexOfHash = newSpec.indexOf("#");
|
||||
if (newIndexOfHash != -1)
|
||||
newSpec = newSpec.substr(0, newIndexOfHash);
|
||||
if (newSpec != oldSpec) {
|
||||
// Remove all the notifications, except for those which want to
|
||||
// persist across the first location change.
|
||||
let nBox = gBrowser.getNotificationBox(selectedBrowser);
|
||||
nBox.removeTransientNotifications();
|
||||
}
|
||||
}
|
||||
|
||||
// Disable menu entries for images, enable otherwise
|
||||
if (content.document && mimeTypeIsTextBased(content.document.contentType))
|
||||
this.isImage.removeAttribute('disabled');
|
||||
|
@ -4691,26 +4668,26 @@ var TabsProgressListener = {
|
|||
|
||||
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
|
||||
aFlags) {
|
||||
// Filter out sub-frame loads and location changes caused by anchor
|
||||
// navigation or history.push/pop/replaceState.
|
||||
if (aBrowser.contentWindow == aWebProgress.DOMWindow &&
|
||||
!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)) {
|
||||
// Filter out location changes caused by anchor navigation
|
||||
// or history.push/pop/replaceState.
|
||||
if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)
|
||||
return;
|
||||
|
||||
// Only need to call locationChange if the PopupNotifications object
|
||||
// for this window has already been initialized (i.e. its getter no
|
||||
// longer exists)
|
||||
if (!Object.getOwnPropertyDescriptor(window, "PopupNotifications").get)
|
||||
PopupNotifications.locationChange(aBrowser);
|
||||
|
||||
gBrowser.getNotificationBox(aBrowser).removeTransientNotifications();
|
||||
|
||||
// Filter out location changes in sub documents.
|
||||
if (aBrowser.contentWindow == aWebProgress.DOMWindow) {
|
||||
// Initialize the click-to-play state.
|
||||
aBrowser._clickToPlayPluginsActivated = new Map();
|
||||
aBrowser._clickToPlayAllPluginsActivated = false;
|
||||
aBrowser._pluginScriptedState = gPluginHandler.PLUGIN_SCRIPTED_STATE_NONE;
|
||||
|
||||
// Only need to call locationChange if the PopupNotifications object
|
||||
// for this window has already been initialized (i.e. its getter no
|
||||
// longer exists)
|
||||
if (!Object.getOwnPropertyDescriptor(window, "PopupNotifications").get)
|
||||
PopupNotifications.locationChange(aBrowser);
|
||||
|
||||
// Only handle background browsers as long as the selected browser is
|
||||
// handled in XULBrowserWindow.onLocationChange (bug 839516).
|
||||
if (aBrowser != gBrowser.selectedBrowser)
|
||||
gBrowser.getNotificationBox(aBrowser).removeTransientNotifications();
|
||||
|
||||
FullZoom.onLocationChange(aLocationURI, false, aBrowser);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -9,7 +9,7 @@ let Cu = Components.utils;
|
|||
|
||||
// Bug 671101 - directly using webNavigation in this context
|
||||
// causes docshells to leak
|
||||
__defineGetter__("webNavigation", function () {
|
||||
this.__defineGetter__("webNavigation", function () {
|
||||
return docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
});
|
||||
|
||||
|
|
|
@ -2926,8 +2926,8 @@
|
|||
<xul:toolbarbutton class="tabs-newtab-button"
|
||||
command="cmd_newNavigatorTab"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
onmouseenter="document.getBindingParent(this)._enterNewTab();"
|
||||
onmouseleave="document.getBindingParent(this)._leaveNewTab();"
|
||||
onmouseover="document.getBindingParent(this)._enterNewTab();"
|
||||
onmouseout="document.getBindingParent(this)._leaveNewTab();"
|
||||
tooltiptext="&newTabButton.tooltip;"/>
|
||||
<xul:spacer class="closing-tabs-spacer" anonid="closing-tabs-spacer"
|
||||
style="width: 0;"/>
|
||||
|
@ -4268,17 +4268,11 @@
|
|||
</implementation>
|
||||
|
||||
<handlers>
|
||||
<handler event="mouseover">
|
||||
var anonid = event.originalTarget.getAttribute("anonid");
|
||||
<handler event="mouseover"><![CDATA[
|
||||
let anonid = event.originalTarget.getAttribute("anonid");
|
||||
if (anonid == "close-button")
|
||||
this.mOverCloseButton = true;
|
||||
</handler>
|
||||
<handler event="mouseout">
|
||||
var anonid = event.originalTarget.getAttribute("anonid");
|
||||
if (anonid == "close-button")
|
||||
this.mOverCloseButton = false;
|
||||
</handler>
|
||||
<handler event="mouseenter" phase="target"><![CDATA[
|
||||
|
||||
let tab = event.target;
|
||||
if (tab.selected)
|
||||
return;
|
||||
|
@ -4306,7 +4300,11 @@
|
|||
}
|
||||
}
|
||||
]]></handler>
|
||||
<handler event="mouseleave" phase="target"><![CDATA[
|
||||
<handler event="mouseout"><![CDATA[
|
||||
let anonid = event.originalTarget.getAttribute("anonid");
|
||||
if (anonid == "close-button")
|
||||
this.mOverCloseButton = false;
|
||||
|
||||
let tabContainer = this.parentNode;
|
||||
if (tabContainer._beforeHoveredTab) {
|
||||
tabContainer._beforeHoveredTab.removeAttribute("beforehovered");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var expected = ["TabOpen", "onStateChange", "onLocationChange", "onLinkIconAvailable"];
|
||||
var actual = [];
|
||||
var tabIndex = -1;
|
||||
__defineGetter__("tab", function () gBrowser.tabs[tabIndex]);
|
||||
this.__defineGetter__("tab", function () gBrowser.tabs[tabIndex]);
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
|
|
@ -725,7 +725,26 @@ var tests = [
|
|||
PopupNotifications.buttonDelay = PREF_SECURITY_DELAY_INITIAL;
|
||||
},
|
||||
},
|
||||
{ // Test #25 - location change in background tab removes notification
|
||||
{ // Test #25 - reload removes notification
|
||||
run: function () {
|
||||
loadURI("http://example.com/", function() {
|
||||
let notifyObj = new basicNotification();
|
||||
notifyObj.options.eventCallback = function (eventName) {
|
||||
if (eventName == "removed") {
|
||||
ok(true, "Notification removed in background tab after reloading");
|
||||
executeSoon(function () {
|
||||
goNext();
|
||||
});
|
||||
}
|
||||
};
|
||||
showNotification(notifyObj);
|
||||
executeSoon(function () {
|
||||
gBrowser.selectedBrowser.reload();
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{ // Test #26 - location change in background tab removes notification
|
||||
run: function () {
|
||||
let oldSelectedTab = gBrowser.selectedTab;
|
||||
let newTab = gBrowser.addTab("about:blank");
|
||||
|
@ -753,7 +772,7 @@ var tests = [
|
|||
});
|
||||
}
|
||||
},
|
||||
{ // Test #26 - Popup notification anchor shouldn't disappear when a notification with the same ID is re-added in a background tab
|
||||
{ // Test #27 - Popup notification anchor shouldn't disappear when a notification with the same ID is re-added in a background tab
|
||||
run: function () {
|
||||
loadURI("http://example.com/", function () {
|
||||
let originalTab = gBrowser.selectedTab;
|
||||
|
@ -790,6 +809,24 @@ var tests = [
|
|||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{ // Test #28 - location change in embedded frame removes notification
|
||||
run: function () {
|
||||
loadURI("data:text/html,<iframe id='iframe' src='http://example.com/'>", function () {
|
||||
let notifyObj = new basicNotification();
|
||||
notifyObj.options.eventCallback = function (eventName) {
|
||||
if (eventName == "removed") {
|
||||
ok(true, "Notification removed in background tab after reloading");
|
||||
executeSoon(goNext);
|
||||
}
|
||||
};
|
||||
showNotification(notifyObj);
|
||||
executeSoon(function () {
|
||||
content.document.getElementById("iframe")
|
||||
.setAttribute("src", "http://example.org/");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -877,7 +914,7 @@ function loadURI(uri, callback) {
|
|||
if (callback) {
|
||||
gBrowser.addEventListener("load", function() {
|
||||
// Ignore the about:blank load
|
||||
if (gBrowser.currentURI.spec != uri)
|
||||
if (gBrowser.currentURI.spec == "about:blank")
|
||||
return;
|
||||
|
||||
gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче