зеркало из https://github.com/mozilla/pjs.git
Merge from mozilla-central.
This commit is contained in:
Коммит
db5385a0a2
|
@ -197,12 +197,12 @@ ifdef MOZ_CRASHREPORTER
|
|||
$(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
|
||||
echo packing symbols
|
||||
cd $(DIST)/crashreporter-symbols && \
|
||||
zip -r9D ../"$(SYMBOL_ARCHIVE_BASENAME).zip" .
|
||||
zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
|
||||
endif # MOZ_CRASHREPORTER
|
||||
|
||||
uploadsymbols:
|
||||
ifdef MOZ_CRASHREPORTER
|
||||
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
|
||||
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip"
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
|
|
|
@ -46,7 +46,7 @@ interface nsObjectFrame;
|
|||
interface nsIContent;
|
||||
interface nsITimer;
|
||||
|
||||
[uuid(6a58f7e8-587c-40dd-b684-dc3e54f1342a)]
|
||||
[uuid(29384ba1-f9ce-425d-afb5-54e2ee949d87)]
|
||||
interface nsIAccessibilityService : nsIAccessibleRetrieval
|
||||
{
|
||||
nsIAccessible createOuterDocAccessible(in nsIDOMNode aNode);
|
||||
|
@ -114,6 +114,12 @@ interface nsIAccessibilityService : nsIAccessibleRetrieval
|
|||
*/
|
||||
void processDocLoadEvent(in nsITimer aTimer, in voidPtr aClosure, in PRUint32 aEventType);
|
||||
|
||||
/**
|
||||
* Notify accessibility that anchor jump has been accomplished to the given
|
||||
* target. Used by layout.
|
||||
*/
|
||||
void notifyOfAnchorJumpTo(in nsIContent aTarget);
|
||||
|
||||
/**
|
||||
* Fire accessible event of the given type for the given target.
|
||||
*
|
||||
|
|
|
@ -127,8 +127,7 @@ nsAccessibilityService::nsAccessibilityService()
|
|||
nsCOMPtr<nsIWebProgress> progress(do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID));
|
||||
if (progress) {
|
||||
progress->AddProgressListener(static_cast<nsIWebProgressListener*>(this),
|
||||
nsIWebProgress::NOTIFY_STATE_DOCUMENT |
|
||||
nsIWebProgress::NOTIFY_LOCATION);
|
||||
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
|
||||
}
|
||||
|
||||
// Initialize accessibility.
|
||||
|
@ -265,6 +264,35 @@ NS_IMETHODIMP nsAccessibilityService::ProcessDocLoadEvent(nsITimer *aTimer, void
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessibilityService::NotifyOfAnchorJumpTo(nsIContent *aTarget)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> targetNode(do_QueryInterface(aTarget));
|
||||
|
||||
nsCOMPtr<nsIAccessible> targetAcc;
|
||||
GetAccessibleFor(targetNode, getter_AddRefs(targetAcc));
|
||||
|
||||
// If the jump target is not accessible then fire an event for nearest
|
||||
// accessible in parent chain.
|
||||
if (!targetAcc) {
|
||||
nsIDocument *document = aTarget->GetCurrentDoc();
|
||||
nsCOMPtr<nsIDOMNode> documentNode(do_QueryInterface(document));
|
||||
if (documentNode) {
|
||||
nsCOMPtr<nsIAccessibleDocument> accessibleDoc =
|
||||
nsAccessNode::GetDocAccessibleFor(documentNode);
|
||||
if (accessibleDoc)
|
||||
accessibleDoc->GetAccessibleInParentChain(targetNode, PR_TRUE,
|
||||
getter_AddRefs(targetAcc));
|
||||
}
|
||||
}
|
||||
|
||||
if (targetAcc)
|
||||
return nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_SCROLLING_START,
|
||||
targetAcc);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent,
|
||||
nsIAccessible *aTarget)
|
||||
|
@ -309,28 +337,7 @@ NS_IMETHODIMP nsAccessibilityService::OnProgressChange(nsIWebProgress *aWebProgr
|
|||
NS_IMETHODIMP nsAccessibilityService::OnLocationChange(nsIWebProgress *aWebProgress,
|
||||
nsIRequest *aRequest, nsIURI *location)
|
||||
{
|
||||
// If the document is already loaded, this will just check to see
|
||||
// if an anchor jump event needs to be fired.
|
||||
// If there is no accessible for the document, we will ignore
|
||||
// this and the anchor jump event will be fired via OnStateChange
|
||||
// and nsIAccessibleStates::STATE_STOP
|
||||
nsCOMPtr<nsIDOMWindow> domWindow;
|
||||
aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
|
||||
NS_ASSERTION(domWindow, "DOM Window for state change is null");
|
||||
NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||
domWindow->GetDocument(getter_AddRefs(domDoc));
|
||||
nsCOMPtr<nsIDOMNode> domDocRootNode(do_QueryInterface(domDoc));
|
||||
NS_ENSURE_TRUE(domDocRootNode, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIAccessibleDocument> accessibleDoc =
|
||||
nsAccessNode::GetDocAccessibleFor(domDocRootNode);
|
||||
nsRefPtr<nsDocAccessible> docAcc =
|
||||
nsAccUtils::QueryAccessibleDocument(accessibleDoc);
|
||||
if (docAcc)
|
||||
docAcc->FireAnchorJumpEvent();
|
||||
|
||||
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -3117,7 +3117,7 @@ nsAccessible::GetNameInternal(nsAString& aName)
|
|||
// nsAccessible private methods
|
||||
|
||||
already_AddRefed<nsIAccessible>
|
||||
nsAccessible::GetFirstAvailableAccessible(nsIDOMNode *aStartNode, PRBool aRequireLeaf)
|
||||
nsAccessible::GetFirstAvailableAccessible(nsIDOMNode *aStartNode)
|
||||
{
|
||||
nsIAccessibilityService *accService = GetAccService();
|
||||
nsCOMPtr<nsIAccessible> accessible;
|
||||
|
@ -3126,11 +3126,9 @@ nsAccessible::GetFirstAvailableAccessible(nsIDOMNode *aStartNode, PRBool aRequir
|
|||
|
||||
while (currentNode) {
|
||||
accService->GetAccessibleInWeakShell(currentNode, mWeakShell, getter_AddRefs(accessible)); // AddRef'd
|
||||
if (accessible && (!aRequireLeaf || nsAccUtils::IsLeaf(accessible))) {
|
||||
nsIAccessible *retAccessible = accessible;
|
||||
NS_ADDREF(retAccessible);
|
||||
return retAccessible;
|
||||
}
|
||||
if (accessible)
|
||||
return accessible.forget();
|
||||
|
||||
if (!walker) {
|
||||
// Instantiate walker lazily since we won't need it in 90% of the cases
|
||||
// where the first DOM node we're given provides an accessible
|
||||
|
|
|
@ -326,13 +326,15 @@ protected:
|
|||
already_AddRefed<nsIAccessible> GetNextWithState(nsIAccessible *aStart, PRUint32 matchState);
|
||||
|
||||
/**
|
||||
* Return an accessible for the given DOM node, or if that node isn't accessible, return the
|
||||
* accessible for the next DOM node which has one (based on forward depth first search)
|
||||
* @param aStartNode, the DOM node to start from
|
||||
* @param aRequireLeaf, only accept leaf accessible nodes
|
||||
* @return the resulting accessible
|
||||
* Return an accessible for the given DOM node, or if that node isn't
|
||||
* accessible, return the accessible for the next DOM node which has one
|
||||
* (based on forward depth first search).
|
||||
*
|
||||
* @param aStartNode [in] the DOM node to start from
|
||||
* @return the resulting accessible
|
||||
*/
|
||||
already_AddRefed<nsIAccessible> GetFirstAvailableAccessible(nsIDOMNode *aStartNode, PRBool aRequireLeaf = PR_FALSE);
|
||||
already_AddRefed<nsIAccessible>
|
||||
GetFirstAvailableAccessible(nsIDOMNode *aStartNode);
|
||||
|
||||
// Hyperlink helpers
|
||||
virtual nsresult GetLinkOffset(PRInt32* aStartOffset, PRInt32* aEndOffset);
|
||||
|
|
|
@ -307,17 +307,17 @@ nsAccEvent::GetAccessibleByNode()
|
|||
|
||||
/* static */
|
||||
void
|
||||
nsAccEvent::ApplyEventRules(nsTArray<nsCOMPtr<nsIAccessibleEvent> > &aEventsToFire)
|
||||
nsAccEvent::ApplyEventRules(nsTArray<nsRefPtr<nsAccEvent> > &aEventsToFire)
|
||||
{
|
||||
PRUint32 numQueuedEvents = aEventsToFire.Length();
|
||||
PRInt32 tail = numQueuedEvents - 1;
|
||||
|
||||
nsRefPtr<nsAccEvent> tailEvent = GetAccEventPtr(aEventsToFire[tail]);
|
||||
nsAccEvent* tailEvent = aEventsToFire[tail];
|
||||
switch(tailEvent->mEventRule) {
|
||||
case nsAccEvent::eCoalesceFromSameSubtree:
|
||||
{
|
||||
for (PRInt32 index = 0; index < tail; index ++) {
|
||||
nsRefPtr<nsAccEvent> thisEvent = GetAccEventPtr(aEventsToFire[index]);
|
||||
nsAccEvent* thisEvent = aEventsToFire[index];
|
||||
if (thisEvent->mEventType != tailEvent->mEventType)
|
||||
continue; // Different type
|
||||
|
||||
|
@ -381,7 +381,7 @@ nsAccEvent::ApplyEventRules(nsTArray<nsCOMPtr<nsIAccessibleEvent> > &aEventsToFi
|
|||
{
|
||||
// Check for repeat events.
|
||||
for (PRInt32 index = 0; index < tail; index ++) {
|
||||
nsRefPtr<nsAccEvent> accEvent = GetAccEventPtr(aEventsToFire[index]);
|
||||
nsAccEvent* accEvent = aEventsToFire[index];
|
||||
if (accEvent->mEventType == tailEvent->mEventType &&
|
||||
accEvent->mEventRule == tailEvent->mEventRule &&
|
||||
accEvent->mDOMNode == tailEvent->mDOMNode) {
|
||||
|
@ -397,13 +397,13 @@ nsAccEvent::ApplyEventRules(nsTArray<nsCOMPtr<nsIAccessibleEvent> > &aEventsToFi
|
|||
|
||||
/* static */
|
||||
void
|
||||
nsAccEvent::ApplyToSiblings(nsTArray<nsCOMPtr<nsIAccessibleEvent> > &aEventsToFire,
|
||||
nsAccEvent::ApplyToSiblings(nsTArray<nsRefPtr<nsAccEvent> > &aEventsToFire,
|
||||
PRUint32 aStart, PRUint32 aEnd,
|
||||
PRUint32 aEventType, nsIDOMNode* aDOMNode,
|
||||
EEventRule aEventRule)
|
||||
PRUint32 aEventType, nsIDOMNode* aDOMNode,
|
||||
EEventRule aEventRule)
|
||||
{
|
||||
for (PRUint32 index = aStart; index < aEnd; index ++) {
|
||||
nsRefPtr<nsAccEvent> accEvent = GetAccEventPtr(aEventsToFire[index]);
|
||||
nsAccEvent* accEvent = aEventsToFire[index];
|
||||
if (accEvent->mEventType == aEventType &&
|
||||
accEvent->mEventRule != nsAccEvent::eDoNotEmit &&
|
||||
nsCoreUtils::AreSiblings(accEvent->mDOMNode, aDOMNode)) {
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "nsIDOMNode.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsAccUtils.h"
|
||||
|
||||
class nsIPresShell;
|
||||
|
||||
|
@ -126,11 +127,13 @@ public:
|
|||
return eventType;
|
||||
}
|
||||
static EEventRule EventRule(nsIAccessibleEvent *aAccEvent) {
|
||||
nsRefPtr<nsAccEvent> accEvent = GetAccEventPtr(aAccEvent);
|
||||
nsRefPtr<nsAccEvent> accEvent =
|
||||
nsAccUtils::QueryObject<nsAccEvent>(aAccEvent);
|
||||
return accEvent->mEventRule;
|
||||
}
|
||||
static PRBool IsAsyncEvent(nsIAccessibleEvent *aAccEvent) {
|
||||
nsRefPtr<nsAccEvent> accEvent = GetAccEventPtr(aAccEvent);
|
||||
nsRefPtr<nsAccEvent> accEvent =
|
||||
nsAccUtils::QueryObject<nsAccEvent>(aAccEvent);
|
||||
return accEvent->mIsAsync;
|
||||
}
|
||||
static PRBool IsFromUserInput(nsIAccessibleEvent *aAccEvent) {
|
||||
|
@ -169,15 +172,9 @@ public:
|
|||
* Event rule of filtered events will be set to eDoNotEmit.
|
||||
* Events with other event rule are good to emit.
|
||||
*/
|
||||
static void ApplyEventRules(nsTArray<nsCOMPtr<nsIAccessibleEvent> > &aEventsToFire);
|
||||
static void ApplyEventRules(nsTArray<nsRefPtr<nsAccEvent> > &aEventsToFire);
|
||||
|
||||
private:
|
||||
static already_AddRefed<nsAccEvent> GetAccEventPtr(nsIAccessibleEvent *aAccEvent) {
|
||||
nsAccEvent* accEvent = nsnull;
|
||||
aAccEvent->QueryInterface(NS_GET_IID(nsAccEvent), (void**)&accEvent);
|
||||
return accEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply aEventRule to same type event that from sibling nodes of aDOMNode.
|
||||
* @param aEventsToFire array of pending events
|
||||
|
@ -188,7 +185,7 @@ private:
|
|||
* @param aEventRule the event rule to be applied
|
||||
* (should be eDoNotEmit or eAllowDupes)
|
||||
*/
|
||||
static void ApplyToSiblings(nsTArray<nsCOMPtr<nsIAccessibleEvent> > &aEventsToFire,
|
||||
static void ApplyToSiblings(nsTArray<nsRefPtr<nsAccEvent> > &aEventsToFire,
|
||||
PRUint32 aStart, PRUint32 aEnd,
|
||||
PRUint32 aEventType, nsIDOMNode* aDOMNode,
|
||||
EEventRule aEventRule);
|
||||
|
|
|
@ -860,41 +860,6 @@ nsresult nsDocAccessible::RemoveEventListeners()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocAccessible::FireAnchorJumpEvent()
|
||||
{
|
||||
if (!mIsContentLoaded || !mDocument)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsISupports> container = mDocument->GetContainer();
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(container));
|
||||
nsCAutoString theURL;
|
||||
if (webNav) {
|
||||
nsCOMPtr<nsIURI> pURI;
|
||||
webNav->GetCurrentURI(getter_AddRefs(pURI));
|
||||
if (pURI) {
|
||||
pURI->GetSpec(theURL);
|
||||
}
|
||||
}
|
||||
static nsCAutoString lastAnchor;
|
||||
const char kHash = '#';
|
||||
nsCAutoString currentAnchor;
|
||||
PRInt32 hasPosition = theURL.FindChar(kHash);
|
||||
if (hasPosition > 0 && hasPosition < (PRInt32)theURL.Length() - 1) {
|
||||
mIsAnchor = PR_TRUE;
|
||||
currentAnchor.Assign(Substring(theURL,
|
||||
hasPosition+1,
|
||||
(PRInt32)theURL.Length()-hasPosition-1));
|
||||
}
|
||||
|
||||
if (currentAnchor.Equals(lastAnchor)) {
|
||||
mIsAnchorJumped = PR_FALSE;
|
||||
} else {
|
||||
mIsAnchorJumped = PR_TRUE;
|
||||
lastAnchor.Assign(currentAnchor);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsDocAccessible::FireDocLoadEvents(PRUint32 aEventType)
|
||||
{
|
||||
|
@ -948,7 +913,6 @@ nsDocAccessible::FireDocLoadEvents(PRUint32 aEventType)
|
|||
nsCOMPtr<nsIAccessibleEvent> accEvent =
|
||||
new nsAccStateChangeEvent(this, nsIAccessibleStates::STATE_BUSY, PR_FALSE, PR_FALSE);
|
||||
FireAccessibleEvent(accEvent);
|
||||
FireAnchorJumpEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1626,7 +1590,8 @@ nsDocAccessible::FireDelayedAccessibleEvent(nsIAccessibleEvent *aEvent)
|
|||
{
|
||||
NS_ENSURE_ARG(aEvent);
|
||||
|
||||
mEventsToFire.AppendElement(aEvent);
|
||||
nsRefPtr<nsAccEvent> accEvent = nsAccUtils::QueryObject<nsAccEvent>(aEvent);
|
||||
mEventsToFire.AppendElement(accEvent);
|
||||
|
||||
// Filter events.
|
||||
nsAccEvent::ApplyEventRules(mEventsToFire);
|
||||
|
|
|
@ -56,11 +56,11 @@ class nsIScrollableView;
|
|||
const PRUint32 kDefaultCacheSize = 256;
|
||||
|
||||
#define NS_DOCACCESSIBLE_IMPL_CID \
|
||||
{ /* 9735bc5f-a4b6-4668-ab73-6f8434c8e750 */ \
|
||||
0x9735bc5f, \
|
||||
0xa4b6, \
|
||||
0x4668, \
|
||||
{ 0xab, 0x73, 0x6f, 0x84, 0x34, 0xc8, 0xe7, 0x50 } \
|
||||
{ /* 9e97d7af-b20a-4a5a-a8d9-bcae0de0b7a2 */ \
|
||||
0x9e97d7af, \
|
||||
0xb20a, \
|
||||
0x4a5a, \
|
||||
{ 0xa8, 0xd9, 0xbc, 0xae, 0x0d, 0xe0, 0xb7, 0xa2 } \
|
||||
}
|
||||
|
||||
class nsDocAccessible : public nsHyperTextAccessibleWrap,
|
||||
|
@ -172,11 +172,6 @@ public:
|
|||
*/
|
||||
virtual void FireDocLoadEvents(PRUint32 aEventType);
|
||||
|
||||
/**
|
||||
* Process the case when anchor was clicked.
|
||||
*/
|
||||
virtual void FireAnchorJumpEvent();
|
||||
|
||||
/**
|
||||
* Used to flush pending events, called after timeout. See FlushPendingEvents.
|
||||
*/
|
||||
|
@ -298,12 +293,10 @@ protected:
|
|||
PRPackedBool mIsLoadCompleteFired;
|
||||
|
||||
protected:
|
||||
PRBool mIsAnchor;
|
||||
PRBool mIsAnchorJumped;
|
||||
|
||||
PRBool mInFlushPendingEvents;
|
||||
PRBool mFireEventTimerStarted;
|
||||
nsTArray<nsCOMPtr<nsIAccessibleEvent> > mEventsToFire;
|
||||
nsTArray<nsRefPtr<nsAccEvent> > mEventsToFire;
|
||||
|
||||
static PRUint32 gLastFocusedAccessiblesState;
|
||||
static nsIAtom *gLastFocusedFrameType;
|
||||
|
|
|
@ -61,14 +61,8 @@
|
|||
*
|
||||
* Comboboxes:
|
||||
* - nsHTMLComboboxAccessible
|
||||
* - nsHTMLComboboxTextFieldAccessible (#ifdef COMBO_BOX_WITH_THREE_CHILDREN)
|
||||
* - nsHTMLComboboxButtonAccessible (#ifdef COMBO_BOX_WITH_THREE_CHILDREN)
|
||||
* - nsHTMLComboboxListAccessible [ inserted in accessible tree ]
|
||||
* - nsHTMLSelectOptionAccessible(s)
|
||||
*
|
||||
* XXX COMBO_BOX_WITH_THREE_CHILDREN is not currently defined.
|
||||
* If we start using it again, we should pass the correct frame into those accessibles.
|
||||
* They share a DOM node with the parent combobox.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -982,30 +976,6 @@ void nsHTMLComboboxAccessible::CacheChildren()
|
|||
|
||||
if (mAccChildCount == eChildCountUninitialized) {
|
||||
mAccChildCount = 0;
|
||||
#ifdef COMBO_BOX_WITH_THREE_CHILDREN
|
||||
// We no longer create textfield and button accessible, in order to have
|
||||
// harmonization between IAccessible2, ATK/AT-SPI and OS X
|
||||
nsHTMLComboboxTextFieldAccessible* textFieldAccessible =
|
||||
new nsHTMLComboboxTextFieldAccessible(this, mDOMNode, mWeakShell);
|
||||
SetFirstChild(textFieldAccessible);
|
||||
if (!textFieldAccessible) {
|
||||
return;
|
||||
}
|
||||
textFieldAccessible->SetParent(this);
|
||||
textFieldAccessible->Init();
|
||||
mAccChildCount = 1; // Textfield accessible child successfully added
|
||||
|
||||
nsHTMLComboboxButtonAccessible* buttonAccessible =
|
||||
new nsHTMLComboboxButtonAccessible(mParent, mDOMNode, mWeakShell);
|
||||
textFieldAccessible->SetNextSibling(buttonAccessible);
|
||||
if (!buttonAccessible) {
|
||||
return;
|
||||
}
|
||||
|
||||
buttonAccessible->SetParent(this);
|
||||
buttonAccessible->Init();
|
||||
mAccChildCount = 2; // Button accessible child successfully added
|
||||
#endif
|
||||
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (!frame) {
|
||||
|
@ -1029,11 +999,7 @@ void nsHTMLComboboxAccessible::CacheChildren()
|
|||
mListAccessible->Init();
|
||||
}
|
||||
|
||||
#ifdef COMBO_BOX_WITH_THREE_CHILDREN
|
||||
buttonAccessible->SetNextSibling(mListAccessible);
|
||||
#else
|
||||
SetFirstChild(mListAccessible);
|
||||
#endif
|
||||
|
||||
mListAccessible->SetParent(this);
|
||||
mListAccessible->SetNextSibling(nsnull);
|
||||
|
@ -1188,222 +1154,9 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString&
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef COMBO_BOX_WITH_THREE_CHILDREN
|
||||
/** ----- nsHTMLComboboxTextFieldAccessible ----- */
|
||||
|
||||
/** Constructor */
|
||||
nsHTMLComboboxTextFieldAccessible::nsHTMLComboboxTextFieldAccessible(nsIAccessible* aParent,
|
||||
nsIDOMNode* aDOMNode,
|
||||
nsIWeakReference* aShell):
|
||||
nsHTMLTextFieldAccessible(aDOMNode, aShell)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLComboboxTextFieldAccessible::GetUniqueID(void **aUniqueID)
|
||||
{
|
||||
// Since mDOMNode is same as for our parent, use |this| pointer as the unique Id
|
||||
*aUniqueID = static_cast<void*>(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the bounds for the BlockFrame.
|
||||
* Walks the Frame tree and checks for proper frames.
|
||||
*/
|
||||
void nsHTMLComboboxTextFieldAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame)
|
||||
{
|
||||
// get our first child's frame
|
||||
nsIFrame* frame = nsAccessible::GetBoundsFrame();
|
||||
if (!frame)
|
||||
return;
|
||||
|
||||
frame = frame->GetFirstChild(nsnull);
|
||||
*aBoundingFrame = frame;
|
||||
|
||||
aBounds = frame->GetRect();
|
||||
}
|
||||
|
||||
void nsHTMLComboboxTextFieldAccessible::CacheChildren()
|
||||
{
|
||||
// Allow single text anonymous child, so that nsHyperTextAccessible can operate correctly
|
||||
// We must override this otherwise we get the dropdown button as a child of the textfield,
|
||||
// and at least for now we want to keep it as a sibling
|
||||
if (!mWeakShell) {
|
||||
// This node has been shut down
|
||||
mAccChildCount = eChildCountUninitialized;
|
||||
return;
|
||||
}
|
||||
|
||||
// Allows only 1 child
|
||||
if (mAccChildCount == eChildCountUninitialized) {
|
||||
mAccChildCount = 0; // Prevent reentry
|
||||
nsAccessibleTreeWalker walker(mWeakShell, mDOMNode, PR_TRUE);
|
||||
// Seed the frame hint early while we're still on a container node.
|
||||
// This is better than doing the GetPrimaryFrameFor() later on
|
||||
// a text node, because text nodes aren't in the frame map.
|
||||
walker.mState.frame = GetFrame();
|
||||
|
||||
walker.GetFirstChild();
|
||||
SetFirstChild(walker.mState.accessible);
|
||||
nsRefPtr<nsAccessible> child =
|
||||
nsAccUtils::QueryAccessible(walker.mState.accessible);
|
||||
child->SetParent(this);
|
||||
child->SetNextSibling(nsnull);
|
||||
mAccChildCount = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/** -----ComboboxButtonAccessible ----- */
|
||||
|
||||
/** Constructor -- cache our parent */
|
||||
nsHTMLComboboxButtonAccessible::nsHTMLComboboxButtonAccessible(nsIAccessible* aParent,
|
||||
nsIDOMNode* aDOMNode,
|
||||
nsIWeakReference* aShell):
|
||||
nsLeafAccessible(aDOMNode, aShell)
|
||||
{
|
||||
}
|
||||
|
||||
/** Just one action ( click ). */
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetNumActions(PRUint8 *aNumActions)
|
||||
{
|
||||
*aNumActions = 1;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Programmaticaly click on the button, causing either the display or
|
||||
* the hiding of the drop down box ( window ).
|
||||
* Walks the Frame tree and checks for proper frames.
|
||||
*/
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::DoAction(PRUint8 aIndex)
|
||||
{
|
||||
nsIFrame* frame = nsAccessible::GetBoundsFrame();
|
||||
nsPresContext *context = GetPresContext();
|
||||
if (!frame || !context)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
frame = frame->GetFirstChild(nsnull)->GetNextSibling();
|
||||
|
||||
// We only have one action, click. Any other index is meaningless(wrong)
|
||||
if (aIndex == eAction_Click) {
|
||||
nsCOMPtr<nsIDOMHTMLInputElement>
|
||||
element(do_QueryInterface(frame->GetContent()));
|
||||
if (element)
|
||||
{
|
||||
element->Click();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
/**
|
||||
* Our action name is the reverse of our state:
|
||||
* if we are closed -> open is our name.
|
||||
* if we are open -> closed is our name.
|
||||
* Uses the frame to get the state, updated on every click
|
||||
*/
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
nsIFrame *boundsFrame = GetBoundsFrame();
|
||||
nsIComboboxControlFrame* comboFrame;
|
||||
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
|
||||
if (!comboFrame)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (comboFrame->IsDroppedDown())
|
||||
aName.AssignLiteral("close");
|
||||
else
|
||||
aName.AssignLiteral("open");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetUniqueID(void **aUniqueID)
|
||||
{
|
||||
// Since mDOMNode is same for all tree item, use |this| pointer as the unique Id
|
||||
*aUniqueID = static_cast<void*>(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the bounds for the gfxButtonControlFrame.
|
||||
* Walks the Frame tree and checks for proper frames.
|
||||
*/
|
||||
void nsHTMLComboboxButtonAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame)
|
||||
{
|
||||
// get our second child's frame
|
||||
// bounding frame is the ComboboxControlFrame
|
||||
nsIFrame *frame = nsAccessible::GetBoundsFrame();
|
||||
*aBoundingFrame = frame;
|
||||
nsPresContext *context = GetPresContext();
|
||||
if (!frame || !context)
|
||||
return;
|
||||
|
||||
aBounds = frame->GetFirstChild(nsnull)->GetNextSibling()->GetRect();
|
||||
// sibling frame is for the button
|
||||
}
|
||||
|
||||
/** We are a button. */
|
||||
nsresult
|
||||
nsHTMLComboboxButtonAccessible::GetRoleInternal(PRUint32 *aRole)
|
||||
{
|
||||
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/** Return our cached parent */
|
||||
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetParent(nsIAccessible **aParent)
|
||||
{
|
||||
NS_IF_ADDREF(*aParent = mParent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLComboboxButtonAccessible::GetName(nsAString& aName)
|
||||
{
|
||||
// Native anonymous content, no way to use ARIA here.
|
||||
aName.Truncate();
|
||||
return GetActionName(eAction_Click, aName);
|
||||
}
|
||||
|
||||
/**
|
||||
* As a nsHTMLComboboxButtonAccessible we can have the following states:
|
||||
* STATE_PRESSED
|
||||
* STATE_FOCUSED
|
||||
* STATE_FOCUSABLE
|
||||
* STATE_INVISIBLE
|
||||
*/
|
||||
nsresult
|
||||
nsHTMLComboboxButtonAccessible::GetStateInternal(PRUint32 *aState,
|
||||
PRUint32 *aExtraState)
|
||||
{
|
||||
// Get focus status from base class
|
||||
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
|
||||
NS_ENSURE_A11Y_SUCCESS(rv, rv);
|
||||
|
||||
nsIFrame *boundsFrame = GetBoundsFrame();
|
||||
nsIComboboxControlFrame* comboFrame = nsnull;
|
||||
if (boundsFrame)
|
||||
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
|
||||
|
||||
if (!comboFrame) {
|
||||
*aState |= nsIAccessibleStates::STATE_INVISIBLE;
|
||||
}
|
||||
else {
|
||||
*aState |= nsIAccessibleStates::STATE_FOCUSABLE;
|
||||
if (comboFrame->IsDroppedDown()) {
|
||||
*aState |= nsIAccessibleStates::STATE_PRESSED;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** ----- nsHTMLComboboxListAccessible ----- */
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHTMLComboboxListAccessible
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsHTMLComboboxListAccessible::nsHTMLComboboxListAccessible(nsIAccessible *aParent,
|
||||
nsIDOMNode* aDOMNode,
|
||||
|
|
|
@ -244,59 +244,6 @@ private:
|
|||
nsRefPtr<nsHTMLComboboxListAccessible> mListAccessible;
|
||||
};
|
||||
|
||||
#ifdef COMBO_BOX_WITH_THREE_CHILDREN
|
||||
/*
|
||||
* A class the represents the text field in the Select to the left
|
||||
* of the drop down button
|
||||
*/
|
||||
class nsHTMLComboboxTextFieldAccessible : public nsHTMLTextFieldAccessible
|
||||
{
|
||||
public:
|
||||
|
||||
nsHTMLComboboxTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
|
||||
virtual ~nsHTMLComboboxTextFieldAccessible() {}
|
||||
|
||||
/* ----- nsIAccessible ----- */
|
||||
NS_IMETHOD GetUniqueID(void **aUniqueID);
|
||||
|
||||
virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
|
||||
|
||||
protected:
|
||||
void CacheChildren();
|
||||
};
|
||||
|
||||
/**
|
||||
* A class that represents the button inside the Select to the
|
||||
* right of the text field
|
||||
*/
|
||||
class nsHTMLComboboxButtonAccessible : public nsLeafAccessible
|
||||
{
|
||||
public:
|
||||
enum { eAction_Click = 0 };
|
||||
|
||||
nsHTMLComboboxButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
|
||||
virtual ~nsHTMLComboboxButtonAccessible() {}
|
||||
|
||||
// nsIAccessible
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
|
||||
NS_IMETHOD GetParent(nsIAccessible **_retval);
|
||||
NS_IMETHOD GetName(nsAString& aName);
|
||||
|
||||
// nsIAccessNode
|
||||
NS_IMETHOD GetUniqueID(void **aUniqueID);
|
||||
|
||||
// nsAccessible
|
||||
virtual nsresult GetRoleInternal(PRUint32 *aRole);
|
||||
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
|
||||
|
||||
protected:
|
||||
virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* A class that represents the window that lives to the right
|
||||
* of the drop down button inside the Select. This is the window
|
||||
|
|
|
@ -142,41 +142,6 @@ __try {
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocAccessibleWrap::FireAnchorJumpEvent()
|
||||
{
|
||||
// Staying on the same page, jumping to a named anchor
|
||||
// Fire EVENT_SCROLLING_START on first leaf accessible -- because some
|
||||
// assistive technologies only cache the child numbers for leaf accessibles
|
||||
// the can only relate events back to their internal model if it's a leaf.
|
||||
// There is usually an accessible for the focus node, but if it's an empty text node
|
||||
// we have to move forward in the document to get one
|
||||
nsDocAccessible::FireAnchorJumpEvent();
|
||||
if (!mIsAnchorJumped)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> focusNode;
|
||||
if (mIsAnchor) {
|
||||
nsCOMPtr<nsISelectionController> selCon(do_QueryReferent(mWeakShell));
|
||||
if (!selCon)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel));
|
||||
if (!domSel)
|
||||
return;
|
||||
|
||||
domSel->GetFocusNode(getter_AddRefs(focusNode));
|
||||
}
|
||||
else {
|
||||
focusNode = mDOMNode; // Moved to top, so event is for 1st leaf after root
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessible> accessible = GetFirstAvailableAccessible(focusNode, PR_TRUE);
|
||||
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_SCROLLING_START,
|
||||
accessible);
|
||||
}
|
||||
|
||||
STDMETHODIMP nsDocAccessibleWrap::get_URL(/* [out] */ BSTR __RPC_FAR *aURL)
|
||||
{
|
||||
__try {
|
||||
|
|
|
@ -92,8 +92,6 @@ public:
|
|||
/* [optional][in] */ VARIANT varChild,
|
||||
/* [retval][out] */ BSTR __RPC_FAR *pszValue);
|
||||
|
||||
virtual void FireAnchorJumpEvent();
|
||||
|
||||
// nsDocAccessibleWrap
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,6 +54,7 @@ _TEST_FILES =\
|
|||
attributes.js \
|
||||
common.js \
|
||||
events.js \
|
||||
events_scroll.html \
|
||||
grid.js \
|
||||
layout.js \
|
||||
name.css \
|
||||
|
@ -91,6 +92,7 @@ _TEST_FILES =\
|
|||
test_elm_listbox.xul \
|
||||
$(warning test_elm_media.html temporarily disabled) \
|
||||
test_elm_plugin.html \
|
||||
test_elm_select.html \
|
||||
test_elm_tree.xul \
|
||||
test_elm_txtcntnr.html \
|
||||
test_events_caretmove.html \
|
||||
|
@ -101,6 +103,7 @@ _TEST_FILES =\
|
|||
test_events_focus.html \
|
||||
test_events_focus.xul \
|
||||
test_events_mutation.html \
|
||||
test_events_scroll.xul \
|
||||
test_events_tree.xul \
|
||||
test_events_valuechange.html \
|
||||
test_groupattrs.xul \
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>nsIAccessible actions testing for anchors</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
</p>
|
||||
<a name="link1">link1</a>
|
||||
|
||||
<p style="color: blue">
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
text text text text text text text text text text text text text text <br>
|
||||
</p>
|
||||
</body>
|
||||
<html>
|
|
@ -21,7 +21,10 @@
|
|||
isBusy: false,
|
||||
setOverLink: function (link, b) {
|
||||
}
|
||||
}
|
||||
};
|
||||
var gFindBar = {
|
||||
hidden: true
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Invoker implementation.
|
||||
|
@ -74,7 +77,7 @@
|
|||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
function onload()
|
||||
function doTest()
|
||||
{
|
||||
var tabBrowser = document.getElementById("content");
|
||||
tabBrowser.loadURI("about:");
|
||||
|
@ -85,6 +88,8 @@
|
|||
gQueue.onFinish = function() { window.close(); }
|
||||
gQueue.invoke();
|
||||
}
|
||||
|
||||
gOpenerWnd.addA11yLoadEvent(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
|
|
@ -39,14 +39,6 @@
|
|||
|
||||
function doTest()
|
||||
{
|
||||
if (!WIN) {
|
||||
ok(true,
|
||||
"Nothing to test because scolling events are fired on Windows only");
|
||||
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
var actionsArray = [
|
||||
{
|
||||
ID: "anchor1",
|
||||
|
@ -63,7 +55,7 @@
|
|||
actionIndex: 0,
|
||||
events: CLICK_EVENTS,
|
||||
eventSeq: [
|
||||
new scrollingChecker(getAccessible("bottom2").firstChild)
|
||||
new scrollingChecker(getAccessible("bottom2"))
|
||||
]
|
||||
}
|
||||
];
|
||||
|
@ -82,7 +74,18 @@
|
|||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=506389"
|
||||
title="Some same page links do not fire EVENT_SYSTEM_SCROLLINGSTART">
|
||||
Mozilla Bug 506389
|
||||
</a><br>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=437607"
|
||||
title="Clicking the 'Skip to main content' link once works, second time fails to initiate a V cursor jump">
|
||||
Mozilla Bug 437607
|
||||
</a><br>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=519303"
|
||||
title="Same page links to targets with content fires scrolling start accessible event on leaf text node">
|
||||
Mozilla Bug 519303
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
|
|
@ -0,0 +1,129 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML select control tests</title>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
var accTree = {
|
||||
role: ROLE_LISTBOX,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_HEADING
|
||||
},
|
||||
{
|
||||
role: ROLE_OPTION,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
role: ROLE_OPTION,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
role: ROLE_OPTION,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
testAccessibleTree("listbox", accTree);
|
||||
|
||||
accTree = {
|
||||
role: ROLE_COMBOBOX,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_COMBOBOX_LIST,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_HEADING
|
||||
},
|
||||
{
|
||||
role: ROLE_COMBOBOX_OPTION,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
role: ROLE_COMBOBOX_OPTION,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
role: ROLE_COMBOBOX_OPTION,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
testAccessibleTree("combobox", accTree);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
title="remove all the code in #ifdef COMBO_BOX_WITH_THREE_CHILDREN"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=506616">
|
||||
Mozilla Bug 506616
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<select id="listbox" size="4">
|
||||
<optgroup label="Colors">
|
||||
<option>Red</option>
|
||||
<option>Blue</option>
|
||||
</optgroup>
|
||||
<option>Animal</option>
|
||||
</select>
|
||||
|
||||
<select id="combobox">
|
||||
<optgroup label="Colors">
|
||||
<option>Red</option>
|
||||
<option>Blue</option>
|
||||
</optgroup>
|
||||
<option>Animal</option>
|
||||
</select>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,101 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js" />
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/a11y/accessible/treeview.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/a11y/accessible/common.js" />
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/a11y/accessible/events.js" />
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Hack to make xul:tabbrowser work
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
var XULBrowserWindow = {
|
||||
isBusy: false,
|
||||
setOverLink: function (link, b) {
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Tests
|
||||
|
||||
var gScrollHandler = {
|
||||
handleEvent: function gScrollHandler_handleEvent(aEvent) {
|
||||
if (aEvent.DOMNode.getAttribute("name") == "link1") {
|
||||
unregisterA11yEventListener(EVENT_SCROLLING_START, this);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function doTest()
|
||||
{
|
||||
registerA11yEventListener(EVENT_SCROLLING_START, gScrollHandler);
|
||||
|
||||
var url =
|
||||
"chrome://mochikit/content/a11y/accessible/events_scroll.html#link1";
|
||||
|
||||
var tabBrowser = document.getElementById("tabBrowser");
|
||||
tabBrowser.loadURI(url);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<hbox flex="1" style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=437607"
|
||||
title="Clicking the 'Skip to main content' link once works, second time fails to initiate a V cursor jump">
|
||||
Mozilla Bug 437607
|
||||
</a><br/>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=519303"
|
||||
title="Same page links to targets with content fires scrolling start accessible event on leaf text node">
|
||||
Mozilla Bug 519303
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
<!-- Hack to make xul:tabbrowser work -->
|
||||
<menubar>
|
||||
<menu label="menu">
|
||||
<menupopup>
|
||||
<menuitem label="close window hook" id="menu_closeWindow"/>
|
||||
<menuitem label="close hook" id="menu_close"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<tabbrowser type="content-primary" flex="1" id="tabBrowser"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -63,6 +63,7 @@ build/pgo/blueprint/Makefile
|
|||
build/pgo/js-input/Makefile
|
||||
build/unix/Makefile
|
||||
build/win32/Makefile
|
||||
build/win32/crashinjectdll/Makefile
|
||||
config/Makefile
|
||||
config/autoconf.mk
|
||||
config/mkdepend/Makefile
|
||||
|
|
|
@ -21,6 +21,14 @@
|
|||
<emItem id="support@daemon-tools.cc">
|
||||
<versionRange minVersion=" " maxVersion="1.0.0.5"/>
|
||||
</emItem>
|
||||
<emItem id="{2224e955-00e9-4613-a844-ce69fccaae91}"/>
|
||||
<emItem id="{3f963a5b-e555-4543-90e2-c3908898db71}">
|
||||
<versionRange minVersion=" " maxVersion="8.0">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.1a1" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
|
||||
<versionRange minVersion="1.2" maxVersion="1.2">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
|
@ -49,5 +57,10 @@
|
|||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem>
|
||||
<match name="filename" exp="NPFFAddOn.dll"/>
|
||||
<versionRange>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
</pluginItems>
|
||||
</blocklist>
|
||||
|
|
|
@ -54,6 +54,8 @@
|
|||
#include "nsStringGlue.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
// we want to use the DLL blocklist if possible
|
||||
#define XRE_WANT_DLL_BLOCKLIST
|
||||
// we want a wmain entry point
|
||||
#include "nsWindowsWMain.cpp"
|
||||
#endif
|
||||
|
|
|
@ -262,8 +262,7 @@ pref("browser.download.useDownloadDir", true);
|
|||
|
||||
#ifdef WINCE
|
||||
pref("browser.download.folderList", 2);
|
||||
// Bug 499807: use Hard Disk filesystem because Desktop is short on space.
|
||||
pref("browser.download.dir", "\\Hard Disk");
|
||||
pref("browser.download.dir", "\\Storage Card");
|
||||
#else
|
||||
pref("browser.download.folderList", 1);
|
||||
#endif
|
||||
|
@ -311,7 +310,6 @@ pref("browser.microsummary.updateGenerators", true);
|
|||
// enable search suggestions by default
|
||||
pref("browser.search.suggest.enabled", true);
|
||||
|
||||
pref("browser.history.showSessions", false);
|
||||
pref("browser.sessionhistory.max_entries", 50);
|
||||
pref("browser.history_expire_days", 180);
|
||||
pref("browser.history_expire_days_min", 90);
|
||||
|
@ -363,10 +361,6 @@ pref("browser.allTabs.previews", false);
|
|||
pref("browser.ctrlTab.previews", false);
|
||||
pref("browser.ctrlTab.recentlyUsedLimit", 7);
|
||||
|
||||
// Default bookmark sorting
|
||||
pref("browser.bookmarks.sort.direction", "descending");
|
||||
pref("browser.bookmarks.sort.resource", "rdf:http://home.netscape.com/NC-rdf#Name");
|
||||
|
||||
// By default, do not export HTML at shutdown.
|
||||
// If true, at shutdown the bookmarks in your menu and toolbar will
|
||||
// be exported as HTML to the bookmarks.html file.
|
||||
|
@ -376,7 +370,7 @@ pref("browser.bookmarks.autoExportHTML", false);
|
|||
// keep in {PROFILEDIR}/bookmarkbackups. Special values:
|
||||
// -1: unlimited
|
||||
// 0: no backups created (and deletes all existing backups)
|
||||
pref("browser.bookmarks.max_backups", 5);
|
||||
pref("browser.bookmarks.max_backups", 10);
|
||||
|
||||
// Scripts & Windows prefs
|
||||
pref("dom.disable_open_during_load", true);
|
||||
|
@ -758,7 +752,11 @@ pref("browser.rights.3.shown", false);
|
|||
pref("browser.rights.override", true);
|
||||
#endif
|
||||
|
||||
#ifdef WINCE
|
||||
pref("browser.sessionstore.resume_from_crash", false);
|
||||
#else
|
||||
pref("browser.sessionstore.resume_from_crash", true);
|
||||
#endif
|
||||
pref("browser.sessionstore.resume_session_once", false);
|
||||
|
||||
// minimal interval between two save operations in milliseconds
|
||||
|
|
|
@ -55,6 +55,7 @@ endif
|
|||
|
||||
EXTRA_JS_MODULES = \
|
||||
content/openLocationLastURL.jsm \
|
||||
content/NetworkPrioritizer.jsm \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -0,0 +1,217 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Paul O’Shannessy <paul@oshannessy.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
* This module adjusts network priority for tabs in a way that gives 'important'
|
||||
* tabs a higher priority. There are 3 levels of priority. Each is listed below
|
||||
* with the priority adjustment used.
|
||||
*
|
||||
* Highest (-10): Selected tab in the focused window.
|
||||
* Medium (0): Background tabs in the focused window.
|
||||
* Selected tab in background windows.
|
||||
* Lowest (+10): Background tabs in background windows.
|
||||
*/
|
||||
|
||||
let EXPORTED_SYMBOLS = ["trackBrowserWindow"];
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
|
||||
// Lazy getters
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "_focusManager",
|
||||
"@mozilla.org/focus-manager;1",
|
||||
"nsIFocusManager");
|
||||
|
||||
|
||||
// Constants
|
||||
const TAB_EVENTS = ["TabOpen", "TabSelect"];
|
||||
const WINDOW_EVENTS = ["activate", "unload"];
|
||||
// PRIORITY DELTA is -10 because lower priority value is actually a higher priority
|
||||
const PRIORITY_DELTA = -10;
|
||||
|
||||
|
||||
// Variables
|
||||
let _lastFocusedWindow = null;
|
||||
let _windows = [];
|
||||
|
||||
|
||||
// Exported symbol
|
||||
function trackBrowserWindow(aWindow) {
|
||||
WindowHelper.addWindow(aWindow);
|
||||
}
|
||||
|
||||
|
||||
// Global methods
|
||||
function _handleEvent(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "TabOpen":
|
||||
BrowserHelper.onOpen(aEvent.target.linkedBrowser);
|
||||
break;
|
||||
case "TabSelect":
|
||||
BrowserHelper.onSelect(aEvent.target.linkedBrowser);
|
||||
break;
|
||||
case "activate":
|
||||
WindowHelper.onActivate(aEvent.target);
|
||||
break;
|
||||
case "unload":
|
||||
WindowHelper.removeWindow(aEvent.currentTarget);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Methods that impact a browser. Put into single object for organization.
|
||||
let BrowserHelper = {
|
||||
onOpen: function(aBrowser) {
|
||||
// If the tab is in the focused window, leave priority as it is
|
||||
if (aBrowser.ownerDocument.defaultView != _lastFocusedWindow)
|
||||
this.decreasePriority(aBrowser);
|
||||
},
|
||||
|
||||
onSelect: function(aBrowser) {
|
||||
let windowEntry = WindowHelper.getEntry(aBrowser.ownerDocument.defaultView);
|
||||
if (windowEntry.lastSelectedBrowser)
|
||||
this.decreasePriority(windowEntry.lastSelectedBrowser);
|
||||
this.increasePriority(aBrowser);
|
||||
|
||||
windowEntry.lastSelectedBrowser = aBrowser;
|
||||
},
|
||||
|
||||
// Auxiliary methods
|
||||
getLoadgroup: function(aBrowser) {
|
||||
return aBrowser.webNavigation.QueryInterface(Ci.nsIDocumentLoader)
|
||||
.loadGroup.QueryInterface(Ci.nsISupportsPriority);
|
||||
},
|
||||
|
||||
increasePriority: function(aBrowser) {
|
||||
this.getLoadgroup(aBrowser).adjustPriority(PRIORITY_DELTA);
|
||||
},
|
||||
|
||||
decreasePriority: function(aBrowser) {
|
||||
this.getLoadgroup(aBrowser).adjustPriority(PRIORITY_DELTA * -1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Methods that impact a window. Put into single object for organization.
|
||||
let WindowHelper = {
|
||||
addWindow: function(aWindow) {
|
||||
// Build internal data object
|
||||
_windows.push({ window: aWindow, lastSelectedBrowser: null });
|
||||
|
||||
// Add event listeners
|
||||
TAB_EVENTS.forEach(function(event) {
|
||||
aWindow.gBrowser.tabContainer.addEventListener(event, _handleEvent, false);
|
||||
});
|
||||
WINDOW_EVENTS.forEach(function(event) {
|
||||
aWindow.addEventListener(event, _handleEvent, false);
|
||||
});
|
||||
|
||||
// This gets called AFTER activate event, so if this is the focused window
|
||||
// we want to activate it. Otherwise, deprioritize it.
|
||||
if (aWindow == _focusManager.activeWindow)
|
||||
this.handleFocusedWindow(aWindow);
|
||||
else
|
||||
this.decreasePriority(aWindow);
|
||||
|
||||
// Select the selected tab
|
||||
BrowserHelper.onSelect(aWindow.gBrowser.selectedBrowser);
|
||||
},
|
||||
|
||||
removeWindow: function(aWindow) {
|
||||
if (aWindow == _lastFocusedWindow)
|
||||
_lastFocusedWindow = null;
|
||||
|
||||
// Delete this window from our tracking
|
||||
_windows.splice(this.getEntryIndex(aWindow), 1);
|
||||
|
||||
// Remove the event listeners
|
||||
TAB_EVENTS.forEach(function(event) {
|
||||
aWindow.gBrowser.tabContainer.removeEventListener(event, _handleEvent, false);
|
||||
});
|
||||
WINDOW_EVENTS.forEach(function(event) {
|
||||
aWindow.removeEventListener(event, _handleEvent, false);
|
||||
});
|
||||
},
|
||||
|
||||
onActivate: function(aWindow, aHasFocus) {
|
||||
// If this window was the last focused window, we don't need to do anything
|
||||
if (aWindow == _lastFocusedWindow)
|
||||
return;
|
||||
|
||||
// handleFocusedWindow will deprioritize the current window
|
||||
this.handleFocusedWindow(aWindow);
|
||||
|
||||
// Lastly we should increase priority for this window
|
||||
this.increasePriority(aWindow);
|
||||
},
|
||||
|
||||
handleFocusedWindow: function(aWindow) {
|
||||
// If we have a last focused window, we need to deprioritize it first
|
||||
if (_lastFocusedWindow)
|
||||
this.decreasePriority(_lastFocusedWindow);
|
||||
|
||||
// aWindow is now focused
|
||||
_lastFocusedWindow = aWindow;
|
||||
},
|
||||
|
||||
// Auxiliary methods
|
||||
increasePriority: function(aWindow) {
|
||||
aWindow.gBrowser.browsers.forEach(function(aBrowser) {
|
||||
BrowserHelper.increasePriority(aBrowser);
|
||||
});
|
||||
},
|
||||
|
||||
decreasePriority: function(aWindow) {
|
||||
aWindow.gBrowser.browsers.forEach(function(aBrowser) {
|
||||
BrowserHelper.decreasePriority(aBrowser);
|
||||
});
|
||||
},
|
||||
|
||||
getEntry: function(aWindow) {
|
||||
return _windows[this.getEntryIndex(aWindow)];
|
||||
},
|
||||
|
||||
getEntryIndex: function(aWindow) {
|
||||
// Assumes that every object has a unique window & it's in the array
|
||||
for (let i = 0; i < _windows.length; i++)
|
||||
if (_windows[i].window == aWindow)
|
||||
return i;
|
||||
}
|
||||
};
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
aboutlabel="&aboutLink;"
|
||||
aboutaccesskey="&aboutLink.accesskey;">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/aboutDialog.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/aboutDialog.js"/>
|
||||
|
||||
<deck id="modes" flex="1">
|
||||
<vbox flex="1" id="clientBox">
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
|
||||
<link rel="icon" type="image/png" id="favicon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACGFjVEwAAAASAAAAAJNtBPIAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAALuAD6AABhIDeugAAALhJREFUOI2Nk8sNxCAMRDlGohauXFOMpfTiAlxICqAELltHLqlgctg1InzMRhpFAc%2BLGWTnmoeZYamt78zXdZmaQtQMADlnU0OIAlbmJUBEcO4bRKQY2rUXIPmAGnDuG%2FBx3%2FfvOPVaDUg%2BoAPUf1PArIMCSD5glMEsUGaG%2BkyAFWIBaCsKuA%2BHGCNijLgP133XgOEtaPFMy2vUolEGJoCIzBmoRUR9%2B7rxj16DZaW%2FmgtmxnJ8V3oAnApQwNS5zpcAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAB4D6AIB52fclgAAACpmZEFUAAAAAjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9WF%2Bu8QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAHgPoAgEK8Q9%2FAAAAFmZkQVQAAAAEOI1jYBgFo2AUjAIIAAAEEAAB0xIn4wAAABpmY1RMAAAABQAAABAAAAAQAAAAAAAAAAAAHgPoAgHnO30FAAAAQGZkQVQAAAAGOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVfozYcAAAABpmY1RMAAAABwAAABAAAAAQAAAAAAAAAAAAHgPoAgEKra7sAAAAFmZkQVQAAAAIOI1jYBgFo2AUjAIIAAAEEAABM9s3hAAAABpmY1RMAAAACQAAABAAAAAQAAAAAAAAAAAAHgPoAgHn3p%2BwAAAAKmZkQVQAAAAKOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F1BhPl6AAAAGmZjVEwAAAALAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQpITFkAAAAWZmRBVAAAAAw4jWNgGAWjYBSMAggAAAQQAAHaszpmAAAAGmZjVEwAAAANAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeeCPiMAAABAZmRBVAAAAA44jWNgGJ5gpxrDf2LEcIL%2FpzAVYxPDavP%2FUwz%2FpW79%2F%2F%2F%2FFMP%2FnWoQjC5GOxcgu4QYsVEwCmAAAOE0KxUmBL0KAAAAGmZjVEwAAAAPAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQoU7coAAAAWZmRBVAAAABA4jWNgGAWjYBSMAggAAAQQAAEpOBELAAAAGmZjVEwAAAARAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeYVWtoAAAAqZmRBVAAAABI4jWNgGAVYQXNz839ixHBq3qnG8B9ZAzYx2rlgFIwCcgAA8psX%2FWvpAecAAAAaZmNUTAAAABMAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC4OJMwAAABZmZEFUAAAAFDiNY2AYBaNgFIwCCAAABBAAAcBQHOkAAAAaZmNUTAAAABUAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5kn7SQAAAEBmZEFUAAAAFjiNY2AYnmCnGsN%2FYsRwgv%2BnMBVjE8Nq8%2F9TDP%2Blbv3%2F%2F%2F8Uw%2F%2BdahCMLkY7FyC7hBixUTAKYAAA4TQrFc%2BcEoQAAAAaZmNUTAAAABcAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC98ooAAAABZmZEFUAAAAGDiNY2AYBaNgFIwCCAAABBAAASCZDI4AAAAaZmNUTAAAABkAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5qwZ%2FAAAACpmZEFUAAAAGjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9cjJWbAAAABpmY1RMAAAAGwAAABAAAAAQAAAAAAAAAAAAHgPoAgELOsoVAAAAFmZkQVQAAAAcOI1jYBgFo2AUjAIIAAAEEAAByfEBbAAAABpmY1RMAAAAHQAAABAAAAAQAAAAAAAAAAAAHgPoAgHm8LhvAAAAQGZkQVQAAAAeOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVlxR3%2FgAAABpmY1RMAAAAHwAAABAAAAAQAAAAAAAAAAAAHgPoAgELZmuGAAAAFmZkQVQAAAAgOI1jYBgFo2AUjAIIAAAEEAABHP5cFQAAABpmY1RMAAAAIQAAABAAAAAQAAAAAAAAAAAAHgPoAgHlgtAOAAAAKmZkQVQAAAAiOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F0%2FMvDdAAAAAElFTkSuQmCC"/>
|
||||
|
||||
<script type="application/x-javascript"><![CDATA[
|
||||
<script type="application/javascript"><![CDATA[
|
||||
var buttonClicked = false;
|
||||
function robotButton()
|
||||
{
|
||||
|
|
|
@ -376,7 +376,7 @@ function generateTextForTextNode(node, indent, textFragmentAccumulator) {
|
|||
|
||||
// Trim the text node's text content and add proper indentation after
|
||||
// any internal line breaks.
|
||||
let text = node.textContent.trim().replace("\n[ \t]*", "\n" + indent);
|
||||
let text = node.textContent.trim().replace("\n", "\n" + indent, "g");
|
||||
textFragmentAccumulator.push(text);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
<!-- nsMenuBarX hides these and uses them to build the Application menu.
|
||||
|
|
|
@ -22,6 +22,12 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
|
|||
background-position: top right;
|
||||
}
|
||||
|
||||
%ifdef XP_MACOSX
|
||||
#main-window[inFullscreen="true"] {
|
||||
padding-top: 0; /* override drawintitlebar="true" */
|
||||
}
|
||||
%endif
|
||||
|
||||
#browser-bottombox[lwthemefooter="true"] {
|
||||
background-repeat: no-repeat;
|
||||
background-position: bottom left;
|
||||
|
|
|
@ -682,8 +682,8 @@ let gGestureSupport = {
|
|||
let addRemove = aAddListener ? window.addEventListener :
|
||||
window.removeEventListener;
|
||||
|
||||
for each (let event in gestureEvents)
|
||||
addRemove("Moz" + event, this, true);
|
||||
gestureEvents.forEach(function (event) addRemove("Moz" + event, this, true),
|
||||
this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -871,9 +871,10 @@ let gGestureSupport = {
|
|||
*/
|
||||
onSwipe: function GS_onSwipe(aEvent) {
|
||||
// Figure out which one (and only one) direction was triggered
|
||||
for each (let dir in ["UP", "RIGHT", "DOWN", "LEFT"])
|
||||
["UP", "RIGHT", "DOWN", "LEFT"].forEach(function (dir) {
|
||||
if (aEvent.direction == aEvent["DIRECTION_" + dir])
|
||||
return this._doAction(aEvent, ["swipe", dir.toLowerCase()]);
|
||||
}, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1286,6 +1287,10 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
|||
Components.utils.reportError("Failed to init content pref service:\n" + ex);
|
||||
}
|
||||
|
||||
let NP = {};
|
||||
Cu.import("resource://gre/modules/NetworkPrioritizer.jsm", NP);
|
||||
NP.trackBrowserWindow(window);
|
||||
|
||||
// initialize the session-restore service (in case it's not already running)
|
||||
if (document.documentElement.getAttribute("windowtype") == "navigator:browser") {
|
||||
try {
|
||||
|
@ -2084,15 +2089,28 @@ function BrowserViewSourceOfDocument(aDocument)
|
|||
|
||||
// doc - document to use for source, or null for this window's document
|
||||
// initialTab - name of the initial tab to display, or null for the first tab
|
||||
// imageUrl - url of an image to load in the Media Tab of the Page Info window; can be null/omitted
|
||||
function BrowserPageInfo(doc, initialTab, imageUrl)
|
||||
{
|
||||
var args = {doc: doc, initialTab: initialTab, imageUrl: imageUrl};
|
||||
return toOpenDialogByTypeAndUrl("Browser:page-info",
|
||||
doc ? doc.location : window.content.document.location,
|
||||
"chrome://browser/content/pageinfo/pageInfo.xul",
|
||||
"chrome,toolbar,dialog=no,resizable",
|
||||
args);
|
||||
// imageElement - image to load in the Media Tab of the Page Info window; can be null/omitted
|
||||
function BrowserPageInfo(doc, initialTab, imageElement) {
|
||||
var args = {doc: doc, initialTab: initialTab, imageElement: imageElement};
|
||||
var windows = Cc['@mozilla.org/appshell/window-mediator;1']
|
||||
.getService(Ci.nsIWindowMediator)
|
||||
.getEnumerator("Browser:page-info");
|
||||
|
||||
var documentURL = doc ? doc.location : window.content.document.location;
|
||||
|
||||
// Check for windows matching the url
|
||||
while (windows.hasMoreElements()) {
|
||||
var currentWindow = windows.getNext();
|
||||
if (currentWindow.document.documentElement.getAttribute("relatedUrl") == documentURL) {
|
||||
currentWindow.focus();
|
||||
currentWindow.resetPageInfo(args);
|
||||
return currentWindow;
|
||||
}
|
||||
}
|
||||
|
||||
// We didn't find a matching window, so open a new one.
|
||||
return openDialog("chrome://browser/content/pageinfo/pageInfo.xul", "",
|
||||
"chrome,toolbar,dialog=no,resizable", args);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -2630,7 +2648,7 @@ function FillInHTMLTooltip(tipElement)
|
|||
var tipNode = document.getElementById("aHTMLTooltip");
|
||||
tipNode.style.direction = direction;
|
||||
|
||||
for each (var t in [titleText, XLinkTitleText]) {
|
||||
[titleText, XLinkTitleText].forEach(function (t) {
|
||||
if (t && /\S/.test(t)) {
|
||||
|
||||
// Per HTML 4.01 6.2 (CDATA section), literal CRs and tabs should be
|
||||
|
@ -2644,7 +2662,7 @@ function FillInHTMLTooltip(tipElement)
|
|||
tipNode.setAttribute("label", t);
|
||||
retVal = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
@ -3249,28 +3267,6 @@ function toOpenWindowByType(inType, uri, features)
|
|||
window.open(uri, "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar");
|
||||
}
|
||||
|
||||
function toOpenDialogByTypeAndUrl(inType, relatedUrl, windowUri, features, extraArgument)
|
||||
{
|
||||
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
|
||||
var windowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator);
|
||||
var windows = windowManagerInterface.getEnumerator(inType);
|
||||
|
||||
// Check for windows matching the url
|
||||
while (windows.hasMoreElements()) {
|
||||
var currentWindow = windows.getNext();
|
||||
if (currentWindow.document.documentElement.getAttribute("relatedUrl") == relatedUrl) {
|
||||
currentWindow.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// We didn't find a matching window, so open a new one.
|
||||
if (features)
|
||||
return window.openDialog(windowUri, "_blank", features, extraArgument);
|
||||
|
||||
return window.openDialog(windowUri, "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar", extraArgument);
|
||||
}
|
||||
|
||||
function OpenBrowserWindow()
|
||||
{
|
||||
var charsetArg = new String();
|
||||
|
@ -3770,10 +3766,13 @@ var FullScreen =
|
|||
}
|
||||
}
|
||||
|
||||
if (aShow)
|
||||
if (aShow) {
|
||||
gNavToolbox.removeAttribute("inFullscreen");
|
||||
else
|
||||
document.documentElement.removeAttribute("inFullscreen");
|
||||
} else {
|
||||
gNavToolbox.setAttribute("inFullscreen", true);
|
||||
document.documentElement.setAttribute("inFullscreen", true);
|
||||
}
|
||||
|
||||
var controls = document.getElementsByAttribute("fullscreencontrol", "true");
|
||||
for (var i = 0; i < controls.length; ++i)
|
||||
|
@ -5461,9 +5460,9 @@ var OfflineApps = {
|
|||
{
|
||||
var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
|
||||
getService(Components.interfaces.nsIApplicationCacheService);
|
||||
if (!groups) {
|
||||
groups = cacheService.getGroups({});
|
||||
}
|
||||
if (!groups)
|
||||
groups = cacheService.getGroups();
|
||||
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"].
|
||||
getService(Components.interfaces.nsIIOService);
|
||||
|
||||
|
@ -5938,6 +5937,7 @@ var gMissingPluginInstaller = {
|
|||
}
|
||||
|
||||
function showOutdatedPluginsInfo() {
|
||||
gPrefService.setBoolPref("plugins.update.notifyUser", false);
|
||||
var url = formatURL("plugins.update.url", true);
|
||||
gBrowser.loadOneTab(url, {inBackground: false});
|
||||
return true;
|
||||
|
|
|
@ -92,12 +92,12 @@
|
|||
# wishes to include *must* go into the global-scripts.inc file
|
||||
# so that they can be shared by macBrowserOverlay.xul.
|
||||
#include global-scripts.inc
|
||||
<script type="application/x-javascript" src="chrome://browser/content/nsContextMenu.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/nsContextMenu.js"/>
|
||||
|
||||
#ifdef MOZ_SAFE_BROWSING
|
||||
<script type="application/x-javascript" src="chrome://browser/content/safebrowsing/sb-loader.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/safebrowsing/sb-loader.js"/>
|
||||
#endif
|
||||
<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
|
||||
|
||||
<script type="application/javascript" src="chrome://browser/content/places/editBookmarkOverlay.js"/>
|
||||
|
||||
|
|
|
@ -164,8 +164,8 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"></script>
|
||||
<script type="application/x-javascript">
|
||||
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"></script>
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
var gCreditsInterval = -1;
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/printUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/viewZoomOverlay.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/browser.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/viewSourceUtils.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/printUtils.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/viewZoomOverlay.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/browser.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/viewSourceUtils.js"/>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
# so that they can be shared by this overlay.
|
||||
#include global-scripts.inc
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<script type="application/javascript">
|
||||
addEventListener("load", nonBrowserWindowStartup, false);
|
||||
addEventListener("unload", nonBrowserWindowShutdown, false);
|
||||
</script>
|
||||
|
|
|
@ -144,18 +144,64 @@ nsContextMenu.prototype = {
|
|||
(mailtoHandler.preferredApplicationHandler instanceof Ci.nsIWebHandlerApp));
|
||||
}
|
||||
|
||||
// time to do some bad things and see if we've highlighted a URL that isn't actually linked
|
||||
// Time to do some bad things and see if we've highlighted a URL that
|
||||
// isn't actually linked.
|
||||
var onPlainTextLink = false;
|
||||
if (this.isTextSelected) {
|
||||
// ok, we have some text, let's figure out if it looks like a URL
|
||||
var someText = document.commandDispatcher.focusedWindow
|
||||
.getSelection().toString();
|
||||
try {
|
||||
var uri = makeURI(someText);
|
||||
// Ok, we have some text, let's figure out if it looks like a URL.
|
||||
let selection = document.commandDispatcher.focusedWindow
|
||||
.getSelection();
|
||||
let linkText = selection.toString().trim();
|
||||
let uri;
|
||||
if (/^(?:https?|ftp):/i.test(linkText)) {
|
||||
try {
|
||||
uri = makeURI(linkText);
|
||||
} catch (ex) {}
|
||||
}
|
||||
catch (ex) { }
|
||||
|
||||
var onPlainTextLink = false;
|
||||
if (uri && /^(https?|ftp)$/i.test(uri.scheme) && uri.host) {
|
||||
// Check if this could be a valid url, just missing the protocol.
|
||||
else if (/^(?:\w+\.)+\D\S*$/.test(linkText)) {
|
||||
// Now let's see if this is an intentional link selection. Our guess is
|
||||
// based on whether the selection begins/ends with whitespace or is
|
||||
// preceded/followed by a non-word character.
|
||||
|
||||
// selection.toString() trims trailing whitespace, so we look for
|
||||
// that explicitly in the first and last ranges.
|
||||
let beginRange = selection.getRangeAt(0);
|
||||
let delimitedAtStart = /^\s/.test(beginRange);
|
||||
if (!delimitedAtStart) {
|
||||
let container = beginRange.startContainer;
|
||||
let offset = beginRange.startOffset;
|
||||
if (container.nodeType == Node.TEXT_NODE && offset > 0)
|
||||
delimitedAtStart = /\W/.test(container.textContent[offset - 1]);
|
||||
else
|
||||
delimitedAtStart = true;
|
||||
}
|
||||
|
||||
let delimitedAtEnd = false;
|
||||
if (delimitedAtStart) {
|
||||
let endRange = selection.getRangeAt(selection.rangeCount - 1);
|
||||
delimitedAtEnd = /\s$/.test(endRange);
|
||||
if (!delimitedAtEnd) {
|
||||
let container = endRange.endContainer;
|
||||
let offset = endRange.endOffset;
|
||||
if (container.nodeType == Node.TEXT_NODE &&
|
||||
offset < container.textContent.length)
|
||||
delimitedAtEnd = /\W/.test(container.textContent[offset]);
|
||||
else
|
||||
delimitedAtEnd = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (delimitedAtStart && delimitedAtEnd) {
|
||||
let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"]
|
||||
.getService(Ci.nsIURIFixup);
|
||||
try {
|
||||
uri = uriFixup.createFixupURI(linkText, uriFixup.FIXUP_FLAG_NONE);
|
||||
} catch (ex) {}
|
||||
}
|
||||
}
|
||||
|
||||
if (uri && uri.host) {
|
||||
this.linkURI = uri;
|
||||
this.linkURL = this.linkURI.spec;
|
||||
onPlainTextLink = true;
|
||||
|
@ -258,7 +304,7 @@ nsContextMenu.prototype = {
|
|||
document.getElementById("context-viewbgimage")
|
||||
.disabled = !this.hasBGImage;
|
||||
|
||||
this.showItem("context-viewimageinfo", (this.onImage));
|
||||
this.showItem("context-viewimageinfo", this.onImage);
|
||||
},
|
||||
|
||||
initMiscItems: function CM_initMiscItems() {
|
||||
|
@ -779,7 +825,8 @@ nsContextMenu.prototype = {
|
|||
},
|
||||
|
||||
viewImageInfo: function() {
|
||||
BrowserPageInfo(this.target.ownerDocument.defaultView.top.document,"mediaTab",this.mediaURL);
|
||||
BrowserPageInfo(this.target.ownerDocument.defaultView.top.document,
|
||||
"mediaTab", this.target);
|
||||
},
|
||||
|
||||
viewFrameInfo: function() {
|
||||
|
|
|
@ -54,9 +54,9 @@
|
|||
persist="screenX screenY"
|
||||
screenX="24" screenY="24">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/openLocation.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/openLocation.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
|
||||
|
||||
<stringbundle id="openLocationBundle" src="chrome://browser/locale/openLocation.properties"/>
|
||||
|
||||
|
|
|
@ -88,7 +88,8 @@ let gOpenLocationLastURL = {
|
|||
}
|
||||
},
|
||||
reset: function() {
|
||||
prefSvc.clearUserPref(LAST_URL_PREF);
|
||||
if (prefSvc.prefHasUserValue(LAST_URL_PREF))
|
||||
prefSvc.clearUserPref(LAST_URL_PREF);
|
||||
gOpenLocationLastURLData = "";
|
||||
}
|
||||
};
|
||||
|
|
|
@ -148,7 +148,7 @@ pageInfoTreeView.prototype = {
|
|||
// mmm, yummy. global variables.
|
||||
var gWindow = null;
|
||||
var gDocument = null;
|
||||
var gImageUrl = null;
|
||||
var gImageElement = null;
|
||||
|
||||
// column number to help using the data array
|
||||
const COL_IMAGE_ADDRESS = 0;
|
||||
|
@ -279,41 +279,16 @@ function onLoadPageInfo()
|
|||
gStrings.mediaLink = gBundle.getString("mediaLink");
|
||||
gStrings.mediaInput = gBundle.getString("mediaInput");
|
||||
|
||||
if ("arguments" in window && window.arguments.length >= 1 &&
|
||||
window.arguments[0] && window.arguments[0].doc) {
|
||||
gDocument = window.arguments[0].doc;
|
||||
gWindow = gDocument.defaultView;
|
||||
}
|
||||
else {
|
||||
if ("gBrowser" in window.opener)
|
||||
gWindow = window.opener.gBrowser.contentWindow;
|
||||
else
|
||||
gWindow = window.opener.frames[0];
|
||||
gDocument = gWindow.document;
|
||||
}
|
||||
var args = "arguments" in window &&
|
||||
window.arguments.length >= 1 &&
|
||||
window.arguments[0];
|
||||
|
||||
// init media view
|
||||
var imageTree = document.getElementById("imagetree");
|
||||
imageTree.view = gImageView;
|
||||
|
||||
// set gImageUrl if present
|
||||
if ("arguments" in window && window.arguments.length >= 1 &&
|
||||
window.arguments[0] && window.arguments[0].imageUrl)
|
||||
gImageUrl = window.arguments[0].imageUrl;
|
||||
|
||||
// build the content
|
||||
loadPageInfo();
|
||||
|
||||
/* Select the requested tab, if the name is specified */
|
||||
var initialTab = "generalTab";
|
||||
if ("arguments" in window && window.arguments.length >= 1 &&
|
||||
window.arguments[0] && window.arguments[0].initialTab)
|
||||
initialTab = window.arguments[0].initialTab;
|
||||
var radioGroup = document.getElementById("viewGroup");
|
||||
initialTab = document.getElementById(initialTab) || document.getElementById("generalTab");
|
||||
radioGroup.selectedItem = initialTab;
|
||||
radioGroup.selectedItem.doCommand();
|
||||
radioGroup.focus();
|
||||
loadTab(args);
|
||||
Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService)
|
||||
.notifyObservers(window, "page-info-dialog-loaded", null);
|
||||
|
@ -340,7 +315,7 @@ function loadPageInfo()
|
|||
onLoadRegistry.forEach(function(func) { func(); });
|
||||
}
|
||||
|
||||
function resetPageInfo()
|
||||
function resetPageInfo(args)
|
||||
{
|
||||
/* Reset Meta tags part */
|
||||
gMetaView.clear();
|
||||
|
@ -364,8 +339,7 @@ function resetPageInfo()
|
|||
/* Call registered overlay reset functions */
|
||||
onResetRegistry.forEach(function(func) { func(); });
|
||||
|
||||
/* And let's rebuild the data */
|
||||
loadPageInfo();
|
||||
loadTab(args);
|
||||
}
|
||||
|
||||
function onUnloadPageInfo()
|
||||
|
@ -403,6 +377,37 @@ function showTab(id)
|
|||
deck.selectedPanel = pagel;
|
||||
}
|
||||
|
||||
function loadTab(args)
|
||||
{
|
||||
if (args && args.doc) {
|
||||
gDocument = args.doc;
|
||||
gWindow = gDocument.defaultView;
|
||||
}
|
||||
else {
|
||||
if ("gBrowser" in window.opener)
|
||||
gWindow = window.opener.gBrowser.contentWindow;
|
||||
else
|
||||
gWindow = window.opener.frames[0];
|
||||
gDocument = gWindow.document;
|
||||
}
|
||||
|
||||
if (args && args.imageElement)
|
||||
gImageElement = args.imageElement;
|
||||
|
||||
/* Rebuild the data */
|
||||
gImageElement = args && args.imageElement;
|
||||
|
||||
/* Load the page info */
|
||||
loadPageInfo();
|
||||
|
||||
var initialTab = (args && args.initialTab) || "generalTab";
|
||||
var radioGroup = document.getElementById("viewGroup");
|
||||
initialTab = document.getElementById(initialTab) || document.getElementById("generalTab");
|
||||
radioGroup.selectedItem = initialTab;
|
||||
radioGroup.selectedItem.doCommand();
|
||||
radioGroup.focus();
|
||||
}
|
||||
|
||||
function onClickMore()
|
||||
{
|
||||
var radioGrp = document.getElementById("viewGroup");
|
||||
|
@ -531,7 +536,7 @@ function processFrames()
|
|||
var iterator = doc.createTreeWalker(doc, NodeFilter.SHOW_ELEMENT, grabAll, true);
|
||||
gFrameList.shift();
|
||||
setTimeout(doGrab, 16, iterator);
|
||||
onFinished.push(selectImgUrl);
|
||||
onFinished.push(selectImage);
|
||||
}
|
||||
else
|
||||
onFinished.forEach(function(func) { func(); });
|
||||
|
@ -1171,16 +1176,15 @@ function doSelectAll()
|
|||
elem.view.selection.selectAll();
|
||||
}
|
||||
|
||||
function selectImgUrl ()
|
||||
{
|
||||
if (gImageUrl) {
|
||||
var tree = document.getElementById("imagetree");
|
||||
for (var c = 0; c < tree.view.rowCount; c++)
|
||||
{
|
||||
if (gImageUrl == gImageView.data[c][COL_IMAGE_ADDRESS]) {
|
||||
tree.view.selection.select(c);
|
||||
return;
|
||||
}
|
||||
function selectImage() {
|
||||
if (!gImageElement)
|
||||
return;
|
||||
|
||||
var tree = document.getElementById("imagetree");
|
||||
for (var i = 0; i < tree.view.rowCount; i++) {
|
||||
if (gImageElement == gImageView.data[i][COL_IMAGE_NODE]) {
|
||||
tree.view.selection.select(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,13 +64,13 @@
|
|||
width="&pageInfoWindow.width;" height="&pageInfoWindow.height;"
|
||||
persist="screenX screenY width height sizemode">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/pageInfo.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/feeds.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/permissions.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/security.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/pageinfo/pageInfo.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/pageinfo/feeds.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/pageinfo/permissions.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/pageinfo/security.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
|
||||
|
||||
<stringbundleset id="pageinfobundleset">
|
||||
<stringbundle id="pageinfobundle" src="chrome://browser/locale/pageInfo.properties"/>
|
||||
|
|
|
@ -90,7 +90,8 @@ function disableAddons() {
|
|||
// Select the default theme
|
||||
var prefB = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
prefB.clearUserPref("general.skins.selectedSkin");
|
||||
if (prefB.prefHasUserValue("general.skins.selectedSkin"))
|
||||
prefB.clearUserPref("general.skins.selectedSkin");
|
||||
|
||||
// Disable plugins
|
||||
var phs = Components.classes["@mozilla.org/plugin/host;1"]
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
onload="onLoad();"
|
||||
buttondisabledaccept="true">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/safeMode.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/safeMode.js"/>
|
||||
|
||||
<stringbundle id="preferencesBundle" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
|
||||
|
|
|
@ -872,10 +872,6 @@
|
|||
|
||||
this._lastRelatedTab = null;
|
||||
|
||||
var fm = Components.classes["@mozilla.org/focus-manager;1"].
|
||||
getService(Components.interfaces.nsIFocusManager);
|
||||
var focusedChromeElement = fm.getFocusedElementForWindow(window, false, {});
|
||||
|
||||
var oldBrowser = this.mCurrentBrowser;
|
||||
if (oldBrowser)
|
||||
oldBrowser.setAttribute("type", "content-targetable");
|
||||
|
@ -970,13 +966,10 @@
|
|||
event.initEvent("TabSelect", true, false);
|
||||
this.mCurrentTab.dispatchEvent(event);
|
||||
|
||||
// change focus to the new tab if nothing is focused, the old tab
|
||||
// is focused or there is something in the new tab to focus. One
|
||||
// specific case where focus is not changed is when the new tab
|
||||
// has no focused element and a chrome element is focused.
|
||||
if ((!focusedChromeElement || focusedChromeElement == oldBrowser ||
|
||||
fm.getFocusedElementForWindow(window.content, true, {})))
|
||||
fm.setFocus(newBrowser, fm.FLAG_NOSCROLL);
|
||||
// Change focus to the new browser unless the findbar is focused.
|
||||
if (gFindBar.hidden ||
|
||||
gFindBar.getElement("findbar-textbox").getAttribute("focused") != "true")
|
||||
newBrowser.focus();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
|
@ -2930,7 +2923,7 @@
|
|||
</xul:hbox>
|
||||
</xul:stack>
|
||||
</content>
|
||||
<implementation implements="nsITimerCallback, nsIDOMEventListener">
|
||||
<implementation implements="nsIDOMEventListener">
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
var pb2 =
|
||||
|
@ -2971,12 +2964,6 @@
|
|||
Components.classes['@mozilla.org/preferences-service;1'].
|
||||
getService(Components.interfaces.nsIPrefBranch2);
|
||||
pb2.removeObserver("browser.tabs.closeButtons", this._prefObserver);
|
||||
|
||||
// Release timer to avoid reference cycles.
|
||||
if (this._animateTimer) {
|
||||
this._animateTimer.cancel();
|
||||
this._animateTimer = null;
|
||||
}
|
||||
]]>
|
||||
</destructor>
|
||||
|
||||
|
@ -3106,33 +3093,6 @@
|
|||
<field name="_animateElement">
|
||||
this.mTabstrip._scrollButtonDown;
|
||||
</field>
|
||||
|
||||
<field name="_animateTimer">null</field>
|
||||
<field name="_animateBaseOpacity">null</field>
|
||||
<field name="_animateBaseColor">null</field>
|
||||
<field name="_animateStep">-1</field>
|
||||
<field name="_animateDelay">25</field>
|
||||
<field name="_animatePercents">
|
||||
[1.00, 0.85, 0.80, 0.75, 0.71, 0.68, 0.65, 0.62, 0.59, 0.57,
|
||||
0.54, 0.52, 0.50, 0.47, 0.45, 0.44, 0.42, 0.40, 0.38, 0.37,
|
||||
0.35, 0.34, 0.32, 0.31, 0.30, 0.29, 0.28, 0.27, 0.26, 0.25,
|
||||
0.24, 0.23, 0.23, 0.22, 0.22, 0.21, 0.21, 0.21, 0.20, 0.20,
|
||||
0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.19, 0.19, 0.19, 0.18,
|
||||
0.18, 0.17, 0.17, 0.16, 0.15, 0.14, 0.13, 0.11, 0.09, 0.06]
|
||||
</field>
|
||||
|
||||
<method name="_stopAnimation">
|
||||
<body><![CDATA[
|
||||
if (this._animateStep != -1) {
|
||||
if (this._animateTimer)
|
||||
this._animateTimer.cancel();
|
||||
|
||||
this._animateStep = -1;
|
||||
this._animateElement.style.outlineColor = "";
|
||||
this._animateElement.style.outlineStyle = "";
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="_notifyBackgroundTab">
|
||||
<parameter name="aTab"/>
|
||||
|
@ -3159,54 +3119,12 @@
|
|||
selected.left - scrollRect.left);
|
||||
}
|
||||
|
||||
this._stopAnimation();
|
||||
|
||||
const DEFAULT_OPACITY = .7;
|
||||
var self = this;
|
||||
this._animateBaseColor =
|
||||
window.getComputedStyle(this._animateElement, null)
|
||||
.outlineColor
|
||||
.replace(/^rgb\((.*)\)$/, "rgba($1, " + DEFAULT_OPACITY + ")")
|
||||
.replace(/([^, ]*)\)/, function (m0, m1) {
|
||||
self._animateBaseOpacity = parseFloat(m1);
|
||||
return "$opacity)";
|
||||
});
|
||||
|
||||
// start the flash timer
|
||||
this._animateStep = 0;
|
||||
|
||||
var outlineWidth =
|
||||
Math.ceil(Math.min(this._animateElement.clientHeight,
|
||||
this._animateElement.clientWidth) * .6) + "px";
|
||||
this._animateElement.style.outlineWidth = outlineWidth;
|
||||
this._animateElement.style.outlineOffset = "-" + outlineWidth;
|
||||
this._animateElement.style.outlineColor = "rgba(0,0,0,0)";
|
||||
this._animateElement.style.outlineStyle = "solid";
|
||||
|
||||
if (!this._animateTimer)
|
||||
this._animateTimer =
|
||||
Components.classes["@mozilla.org/timer;1"]
|
||||
.createInstance(Components.interfaces.nsITimer);
|
||||
|
||||
this._animateTimer.initWithCallback(this, this._animateDelay,
|
||||
this._animateTimer.TYPE_REPEATING_SLACK);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="notify">
|
||||
<parameter name="aTimer"/>
|
||||
<body><![CDATA[
|
||||
if (!document)
|
||||
aTimer.cancel();
|
||||
|
||||
var opacity = this._animateBaseOpacity * this._animatePercents[this._animateStep];
|
||||
this._animateElement.style.outlineColor =
|
||||
this._animateBaseColor.replace("$opacity", opacity);
|
||||
|
||||
if (this._animateStep < (this._animatePercents.length - 1))
|
||||
this._animateStep++;
|
||||
else
|
||||
this._stopAnimation();
|
||||
if (!this._animateElement.hasAttribute("notifybgtab")) {
|
||||
this._animateElement.setAttribute("notifybgtab", "true");
|
||||
setTimeout(function (ele) {
|
||||
ele.removeAttribute("notifybgtab");
|
||||
}, 150, this._animateElement);
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
|
|
@ -99,6 +99,7 @@ _BROWSER_FILES = \
|
|||
browser_bug481560.js \
|
||||
browser_bug477014.js \
|
||||
browser_bug495058.js \
|
||||
browser_bug517902.js \
|
||||
browser_bug521216.js \
|
||||
browser_discovery.js \
|
||||
browser_tabfocus.js \
|
||||
|
@ -139,7 +140,9 @@ _BROWSER_FILES = \
|
|||
browser_bug304198.js \
|
||||
browser_drag.js \
|
||||
browser_relatedTabs.js \
|
||||
browser_plainTextLinks.js \
|
||||
browser_contextSearchTabPosition.js \
|
||||
browser_NetworkPrioritizer.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
|
|
|
@ -0,0 +1,187 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Paul O’Shannessy <paul@oshannessy.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
function test() {
|
||||
/** Tests for NetworkPrioritizer.jsm (Bug 514490) **/
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
const PRIORITY_DELTA = -10; // same as in NetworkPrioritizer
|
||||
|
||||
// Test helper functions.
|
||||
// getPriority and setPriority can take a Tab or a Browser
|
||||
function getPriority(aBrowser) {
|
||||
// Assume we were passed a tab if it's not a browser
|
||||
if (!aBrowser.webNavigation)
|
||||
aBrowser = aBrowser.linkedBrowser;
|
||||
return aBrowser.webNavigation.QueryInterface(Ci.nsIDocumentLoader)
|
||||
.loadGroup.QueryInterface(Ci.nsISupportsPriority).priority;
|
||||
}
|
||||
function setPriority(aBrowser, aPriority) {
|
||||
if (!aBrowser.webNavigation)
|
||||
aBrowser = aBrowser.linkedBrowser;
|
||||
aBrowser.webNavigation.QueryInterface(Ci.nsIDocumentLoader)
|
||||
.loadGroup.QueryInterface(Ci.nsISupportsPriority).priority = aPriority;
|
||||
}
|
||||
|
||||
function isWindowState(aWindow, aTabPriorities) {
|
||||
let browsers = aWindow.gBrowser.browsers;
|
||||
// Make sure we have the right number of tabs & priorities
|
||||
is(browsers.length, aTabPriorities.length,
|
||||
"Window has expected number of tabs");
|
||||
// aState should be in format [ priority, priority, priority ]
|
||||
for (let i = 0; i < browsers.length; i++) {
|
||||
is(getPriority(browsers[i]), aTabPriorities[i],
|
||||
"Tab had expected priority");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This is the real test. It creates multiple tabs & windows, changes focus,
|
||||
// closes windows/tabs to make sure we behave correctly.
|
||||
// This test assumes that no priorities have been adjusted and the loadgroup
|
||||
// priority starts at 0.
|
||||
function test_behavior() {
|
||||
|
||||
// Call window "window_A" to make the test easier to follow
|
||||
let window_A = window;
|
||||
|
||||
// Test 1 window, 1 tab case.
|
||||
isWindowState(window_A, [-10]);
|
||||
|
||||
// Exising tab is tab_A1
|
||||
let tab_A2 = window_A.gBrowser.addTab("http://example.com");
|
||||
let tab_A3 = window_A.gBrowser.addTab("about:config");
|
||||
tab_A3.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||
tab_A3.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
// tab_A2 isn't focused yet
|
||||
isWindowState(window_A, [-10, 0, 0]);
|
||||
|
||||
// focus tab_A2 & make sure priority got updated
|
||||
window_A.gBrowser.selectedTab = tab_A2;
|
||||
isWindowState(window_A, [0, -10, 0]);
|
||||
|
||||
window_A.gBrowser.removeTab(tab_A2);
|
||||
// Next tab is auto selected
|
||||
isWindowState(window_A, [0, -10]);
|
||||
|
||||
// Open another window then play with focus
|
||||
let window_B = openDialog(location, "_blank", "chrome,all,dialog=no", "http://example.com");
|
||||
window_B.addEventListener("load", function(aEvent) {
|
||||
window_B.removeEventListener("load", arguments.callee, false);
|
||||
window_B.gBrowser.addEventListener("load", function(aEvent) {
|
||||
window_B.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
// On Linux, waitForFocus doesn't work if the window is already focused,
|
||||
// so focus window_A first.
|
||||
waitForFocus(function() {
|
||||
waitForFocus(function() {
|
||||
isWindowState(window_A, [10, 0]);
|
||||
isWindowState(window_B, [-10]);
|
||||
|
||||
waitForFocus(function() {
|
||||
isWindowState(window_A, [0, -10]);
|
||||
isWindowState(window_B, [0]);
|
||||
|
||||
waitForFocus(function() {
|
||||
isWindowState(window_A, [10, 0]);
|
||||
isWindowState(window_B, [-10]);
|
||||
|
||||
// And we're done. Cleanup & run the next test
|
||||
window_B.close();
|
||||
window_A.gBrowser.removeTab(tab_A3);
|
||||
executeSoon(runNextTest);
|
||||
}, window_B);
|
||||
}, window_A);
|
||||
}, window_B);
|
||||
}, window_A);
|
||||
|
||||
}, true);
|
||||
}, false);
|
||||
}, true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// This is more a test of nsLoadGroup and how it handles priorities. But since
|
||||
// we depend on its behavior, it's good to test it. This is testing that there
|
||||
// are no errors if we adjust beyond nsISupportsPriority's bounds.
|
||||
function test_extremePriorities() {
|
||||
let tab_A1 = gBrowser.tabContainer.getItemAtIndex(0);
|
||||
let oldPriority = getPriority(tab_A1);
|
||||
|
||||
// Set the priority of tab_A1 to the lowest possible. Selecting the other tab
|
||||
// will try to lower it
|
||||
setPriority(tab_A1, Ci.nsISupportsPriority.PRIORITY_LOWEST);
|
||||
|
||||
let tab_A2 = gBrowser.addTab("http://example.com");
|
||||
tab_A2.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||
tab_A2.removeEventListener("load", arguments.callee, true);
|
||||
gBrowser.selectedTab = tab_A2;
|
||||
is(getPriority(tab_A1), Ci.nsISupportsPriority.PRIORITY_LOWEST - PRIORITY_DELTA,
|
||||
"Can adjust priority beyond 'lowest'");
|
||||
|
||||
// Now set priority to "highest" and make sure that no errors occur.
|
||||
setPriority(tab_A1, Ci.nsISupportsPriority.PRIORITY_HIGHEST);
|
||||
gBrowser.selectedTab = tab_A1;
|
||||
|
||||
is(getPriority(tab_A1), Ci.nsISupportsPriority.PRIORITY_HIGHEST + PRIORITY_DELTA,
|
||||
"Can adjust priority beyond 'highest'");
|
||||
|
||||
// Cleanup, run next test
|
||||
gBrowser.removeTab(tab_A2);
|
||||
executeSoon(function() {
|
||||
setPriority(tab_A1, oldPriority);
|
||||
runNextTest();
|
||||
});
|
||||
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
||||
let tests = [test_behavior, test_extremePriorities];
|
||||
function runNextTest() {
|
||||
if (tests.length) {
|
||||
// Linux has problems if window isn't focused. Should help prevent [orange].
|
||||
waitForFocus(tests.shift());
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
runNextTest();
|
||||
}
|
|
@ -38,13 +38,10 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
if (Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager).activeWindow !=
|
||||
window) {
|
||||
setTimeout(test, 0);
|
||||
window.focus();
|
||||
return;
|
||||
}
|
||||
waitForFocus(continue_test);
|
||||
}
|
||||
|
||||
function continue_test() {
|
||||
let charsToDelete, deletedURLTab, fullURLTab, partialURLTab, testPartialURL, testURL;
|
||||
|
||||
charsToDelete = 5;
|
||||
|
@ -108,7 +105,8 @@ function test() {
|
|||
|
||||
urlbarBackspace(function () {
|
||||
is(gURLBar.value, "", 'gURLBar.value should be "" (just set)');
|
||||
gPrefService.clearUserPref("browser.urlbar.clickSelectsAll");
|
||||
if (gPrefService.prefHasUserValue("browser.urlbar.clickSelectsAll"))
|
||||
gPrefService.clearUserPref("browser.urlbar.clickSelectsAll");
|
||||
cb();
|
||||
});
|
||||
}
|
||||
|
@ -133,7 +131,8 @@ function test() {
|
|||
urlbarBackspace(arguments.callee);
|
||||
} else {
|
||||
is(gURLBar.value, testPartialURL, "gURLBar.value should be testPartialURL (just set)");
|
||||
gPrefService.clearUserPref("browser.urlbar.clickSelectsAll");
|
||||
if (gPrefService.prefHasUserValue("browser.urlbar.clickSelectsAll"))
|
||||
gPrefService.clearUserPref("browser.urlbar.clickSelectsAll");
|
||||
cb();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -85,7 +85,8 @@ function runPrintPreviewTests() {
|
|||
testPrintPreview(gTab1, function() {
|
||||
// test print preview of HTML document with siteSpecific set to false
|
||||
testPrintPreview(gTab2, function() {
|
||||
gPrefService.clearUserPref("browser.zoom.siteSpecific");
|
||||
if (gPrefService.prefHasUserValue("browser.zoom.siteSpecific"))
|
||||
gPrefService.clearUserPref("browser.zoom.siteSpecific");
|
||||
finishTest();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -23,7 +23,8 @@ function test() {
|
|||
tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
|
||||
isnot(tab1Zoom, tab2Zoom, "Zoom should not affect background tabs");
|
||||
|
||||
gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
|
||||
if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
|
||||
gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
|
||||
gBrowser.removeTab(tab1);
|
||||
gBrowser.removeTab(tab2);
|
||||
finish();
|
||||
|
|
|
@ -11,5 +11,6 @@ function test() {
|
|||
is(gBrowser.mTabs.length, 1, "a new tab has been opened");
|
||||
is(document.activeElement, gURLBar.inputField, "location bar is focused for the new tab");
|
||||
|
||||
gPrefService.clearUserPref("browser.tabs.closeWindowWithLastTab");
|
||||
if (gPrefService.prefHasUserValue("browser.tabs.closeWindowWithLastTab"))
|
||||
gPrefService.clearUserPref("browser.tabs.closeWindowWithLastTab");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
/* Make sure that "View Image Info" loads the correct image data */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
var doc = gBrowser.contentDocument;
|
||||
var testImg = doc.getElementById("test-image");
|
||||
var pageInfo = BrowserPageInfo(doc, "mediaTab", testImg);
|
||||
|
||||
pageInfo.addEventListener("load", function () {
|
||||
pageInfo.onFinished.push(function () {
|
||||
executeSoon(function () {
|
||||
var pageInfoImg = pageInfo.document.getElementById("thepreviewimage");
|
||||
|
||||
is(pageInfoImg.src, testImg.src, "selected image has the correct source");
|
||||
is(pageInfoImg.width, testImg.width, "selected image has the correct width");
|
||||
is(pageInfoImg.height, testImg.height, "selected image has the correct height");
|
||||
|
||||
pageInfo.close();
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}, true);
|
||||
}, true);
|
||||
|
||||
content.location =
|
||||
"data:text/html," +
|
||||
"<img src='about:logo?a' height=200 width=250>" +
|
||||
"<img src='about:logo?b' height=200 width=250 alt=1>" +
|
||||
"<img src='about:logo?b' height=100 width=150 alt=2 id='test-image'>";
|
||||
}
|
|
@ -84,7 +84,8 @@ function test() {
|
|||
}
|
||||
|
||||
// cleanup
|
||||
gPrefService.clearUserPref("browser.ctrlTab.previews");
|
||||
if (gPrefService.prefHasUserValue("browser.ctrlTab.previews"))
|
||||
gPrefService.clearUserPref("browser.ctrlTab.previews");
|
||||
|
||||
finish();
|
||||
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
let doc, range, selection;
|
||||
function setSelection(el1, el2, index1, index2) {
|
||||
selection.removeAllRanges();
|
||||
range.setStart(el1, index1);
|
||||
range.setEnd(el2, index2);
|
||||
selection.addRange(range);
|
||||
}
|
||||
|
||||
function initContextMenu() {
|
||||
document.popupNode = doc.getElementsByTagName("DIV")[0];
|
||||
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
||||
let contextMenu = new nsContextMenu(contentAreaContextMenu, gBrowser);
|
||||
return contextMenu;
|
||||
}
|
||||
|
||||
function testExpected(expected, msg) {
|
||||
initContextMenu();
|
||||
let linkMenuItem = document.getElementById("context-openlinkincurrent");
|
||||
is(linkMenuItem.hidden, expected, msg);
|
||||
}
|
||||
|
||||
function testLinkExpected(expected, msg) {
|
||||
let contextMenu = initContextMenu();
|
||||
is(contextMenu.linkURL, expected, msg);
|
||||
}
|
||||
|
||||
function runSelectionTests() {
|
||||
let mainDiv = doc.createElement("div");
|
||||
let div = doc.createElement("div");
|
||||
let div2 = doc.createElement("div");
|
||||
let span1 = doc.createElement("span");
|
||||
let span2 = doc.createElement("span");
|
||||
let span3 = doc.createElement("span");
|
||||
let p1 = doc.createElement("p");
|
||||
let p2 = doc.createElement("p");
|
||||
span1.textContent = "http://index.";
|
||||
span2.textContent = "example.com example.com";
|
||||
span3.textContent = " - Test";
|
||||
p1.textContent = "mailto:test.com ftp.example.com";
|
||||
p2.textContent = "example.com -";
|
||||
div.appendChild(span1);
|
||||
div.appendChild(span2);
|
||||
div.appendChild(span3);
|
||||
div.appendChild(p1);
|
||||
div.appendChild(p2);
|
||||
let p3 = doc.createElement("p");
|
||||
p3.textContent = "main.example.com";
|
||||
div2.appendChild(p3);
|
||||
mainDiv.appendChild(div);
|
||||
mainDiv.appendChild(div2);
|
||||
doc.body.appendChild(mainDiv);
|
||||
setSelection(span1.firstChild, span2.firstChild, 0, 11);
|
||||
testExpected(false, "The link context menu should show for http://www.example.com");
|
||||
setSelection(span1.firstChild, span2.firstChild, 7, 11);
|
||||
testExpected(false, "The link context menu should show for www.example.com");
|
||||
setSelection(span1.firstChild, span2.firstChild, 8, 11);
|
||||
testExpected(true, "The link context menu should not show for ww.example.com");
|
||||
setSelection(span2.firstChild, span2.firstChild, 0, 11);
|
||||
testExpected(false, "The link context menu should show for example.com");
|
||||
testLinkExpected("http://example.com/", "url for example.com selection should not prepend www");
|
||||
setSelection(span2.firstChild, span2.firstChild, 11, 23);
|
||||
testExpected(false, "The link context menu should show for example.com");
|
||||
setSelection(span2.firstChild, span2.firstChild, 0, 10);
|
||||
testExpected(true, "Link options should not show for selection that's not at a word boundary");
|
||||
setSelection(span2.firstChild, span3.firstChild, 12, 7);
|
||||
testExpected(true, "Link options should not show for selection that has whitespace");
|
||||
setSelection(span2.firstChild, span2.firstChild, 12, 19);
|
||||
testExpected(true, "Link options should not show unless a url is selected");
|
||||
setSelection(p1.firstChild, p1.firstChild, 0, 15);
|
||||
testExpected(true, "Link options should not show for mailto: links");
|
||||
setSelection(p1.firstChild, p1.firstChild, 16, 31);
|
||||
testExpected(false, "Link options should show for ftp.example.com");
|
||||
testLinkExpected("ftp://ftp.example.com/", "ftp.example.com should be preceeded with ftp://");
|
||||
setSelection(p2.firstChild, p2.firstChild, 0, 14);
|
||||
testExpected(false, "Link options should show for www.example.com ");
|
||||
selection.selectAllChildren(div2);
|
||||
testExpected(false, "Link options should show for triple-click selections");
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
doc = content.document;
|
||||
range = doc.createRange();
|
||||
selection = content.getSelection();
|
||||
waitForFocus(runSelectionTests, content);
|
||||
}, true);
|
||||
|
||||
content.location =
|
||||
"data:text/html,Test For Non-Hyperlinked url selection";
|
||||
}
|
|
@ -6,13 +6,11 @@ let testPage1 = "data:text/html,<html id='tab1'><body><button id='button1'>Tab 1
|
|||
let testPage2 = "data:text/html,<html id='tab2'><body><button id='button2'>Tab 2</button></body></html>";
|
||||
let testPage3 = "data:text/html,<html id='tab3'><body><button id='button3'>Tab 3</button></body></html>";
|
||||
|
||||
var browser1;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
var tab1 = gBrowser.addTab();
|
||||
browser1 = gBrowser.getBrowserForTab(tab1);
|
||||
var browser1 = gBrowser.getBrowserForTab(tab1);
|
||||
|
||||
var tab2 = gBrowser.addTab();
|
||||
var browser2 = gBrowser.getBrowserForTab(tab2);
|
||||
|
@ -34,25 +32,26 @@ function test() {
|
|||
window.addEventListener("focus", _browser_tabfocus_test_eventOccured, true);
|
||||
window.addEventListener("blur", _browser_tabfocus_test_eventOccured, true);
|
||||
|
||||
gBrowser.selectedTab = tab2;
|
||||
|
||||
var fm = Components.classes["@mozilla.org/focus-manager;1"].
|
||||
getService(Components.interfaces.nsIFocusManager);
|
||||
is(fm.focusedWindow, window, "focusedWindow after tab load");
|
||||
is(fm.focusedElement, gURLBar.inputField, "focusedElement after tab load");
|
||||
|
||||
// make sure that the focus initially starts out blank
|
||||
var fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||
var focusedWindow = {};
|
||||
is(fm.getFocusedElementForWindow(browser1.contentWindow, false, focusedWindow), null, "initial focus in tab 1");
|
||||
is(focusedWindow.value, browser1.contentWindow, "initial frame focus in tab 1");
|
||||
is(fm.getFocusedElementForWindow(browser2.contentWindow, false, focusedWindow), null, "initial focus in tab 2");
|
||||
is(focusedWindow.value, browser2.contentWindow, "initial frame focus in tab 2");
|
||||
|
||||
expectFocusShift(function () gBrowser.selectedTab = tab2,
|
||||
browser2.contentWindow, null, true,
|
||||
"focusedElement after tab change, focus in new tab");
|
||||
|
||||
// switching tabs when the urlbar is focused and nothing in the new tab is focused
|
||||
// should keep focus in the urlbar
|
||||
// should focus the browser
|
||||
expectFocusShift(function () gURLBar.focus(),
|
||||
window, gURLBar.inputField, true,
|
||||
"url field focused");
|
||||
expectFocusShift(function () gBrowser.selectedTab = tab1,
|
||||
window, gURLBar.inputField, false,
|
||||
"focusedElement after tab change, focus in url field, no focus in new tab");
|
||||
browser1.contentWindow, null, true,
|
||||
"focusedElement after tab change, focus in new tab");
|
||||
|
||||
// focusing a button in the current tab should focus it
|
||||
var button1 = browser1.contentDocument.getElementById("button1");
|
||||
|
@ -223,8 +222,7 @@ function expectFocusShift(callback, expectedWindow, expectedElement, focusChange
|
|||
is(_browser_tabfocus_test_events, expectedEvents, testid + " events");
|
||||
_browser_tabfocus_test_events = "";
|
||||
|
||||
var fm = Components.classes["@mozilla.org/focus-manager;1"].
|
||||
getService(Components.interfaces.nsIFocusManager);
|
||||
var fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||
|
||||
var focusedElement = fm.focusedElement;
|
||||
is(focusedElement ? getId(focusedElement) : "none",
|
||||
|
|
|
@ -53,11 +53,11 @@
|
|||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="load()" onunload="unload()">
|
||||
<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/browser.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/nsContextMenu.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/web-panels.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/browser.js"/>
|
||||
<script type="application/javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/nsContextMenu.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/web-panels.js"/>
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="bundle_browser" src="chrome://browser/locale/browser.properties"/>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
should be updated to ignore this one as well. -->
|
||||
<link rel="icon" type="image/png" id="favicon" href="chrome://global/skin/icons/warning-16.png"/>
|
||||
|
||||
<script type="application/x-javascript"><![CDATA[
|
||||
<script type="application/javascript"><![CDATA[
|
||||
// Error url MUST be formatted like this:
|
||||
// about:certerror?e=error&u=url&d=desc
|
||||
|
||||
|
@ -273,7 +273,7 @@
|
|||
- an onload handler. This is because error pages are loaded as
|
||||
- LOAD_BACKGROUND, which means that onload handlers will not be executed.
|
||||
-->
|
||||
<script type="application/x-javascript">initPage();</script>
|
||||
<script type="application/javascript">initPage();</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -35,6 +35,7 @@ function testExpertPref() {
|
|||
|
||||
// Clean up
|
||||
gBrowser.removeCurrentTab();
|
||||
gPrefService.clearUserPref("browser.xul.error_pages.expert_bad_cert");
|
||||
if (gPrefService.prefHasUserValue("browser.xul.error_pages.expert_bad_cert"))
|
||||
gPrefService.clearUserPref("browser.xul.error_pages.expert_bad_cert");
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ DistributionCustomizer.prototype = {
|
|||
},
|
||||
|
||||
_bookmarksApplied: false,
|
||||
applyBookmarks: function DIST_applyBookarks() {
|
||||
applyBookmarks: function DIST_applyBookmarks() {
|
||||
this._bookmarksApplied = true;
|
||||
if (!this._iniFile)
|
||||
return this._checkCustomizationComplete();
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
href="chrome://browser/skin/feeds/subscribe.css"
|
||||
type="text/css"
|
||||
media="all"/>
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/feeds/subscribe.js"/>
|
||||
</head>
|
||||
<body onload="SubscribeHandler.writeContent();" onunload="SubscribeHandler.uninit();">
|
||||
|
@ -60,7 +60,7 @@
|
|||
></div>
|
||||
</div>
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<script type="application/javascript">
|
||||
SubscribeHandler.init();
|
||||
</script>
|
||||
|
||||
|
|
|
@ -552,7 +552,7 @@ MicrosummaryService.prototype = {
|
|||
*
|
||||
*/
|
||||
get _bookmarks() {
|
||||
var bookmarks = this._ans.getItemsWithAnnotation(ANNO_MICSUM_GEN_URI, {});
|
||||
var bookmarks = this._ans.getItemsWithAnnotation(ANNO_MICSUM_GEN_URI);
|
||||
this.__defineGetter__("_bookmarks", function() bookmarks);
|
||||
return this._bookmarks;
|
||||
},
|
||||
|
|
|
@ -453,7 +453,10 @@ var MigrationWizard = {
|
|||
var prefBranch = prefSvc.getBranch(null);
|
||||
|
||||
if (this._newHomePage == "DEFAULT") {
|
||||
prefBranch.clearUserPref("browser.startup.homepage");
|
||||
try {
|
||||
prefBranch.clearUserPref("browser.startup.homepage");
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
else {
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"]
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
buttons="accept,cancel"
|
||||
branded="true">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/migration/migration.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/migration/migration.js"/>
|
||||
|
||||
<stringbundle id="bundle" src="chrome://browser/locale/migration/migration.properties"/>
|
||||
<stringbundle id="brandBundle" src="chrome://branding/locale/brand.properties"/>
|
||||
|
|
|
@ -1002,7 +1002,7 @@ BrowserGlue.prototype = {
|
|||
newInVersion: 1 };
|
||||
smartBookmarks.push(smart);
|
||||
|
||||
var smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO, {});
|
||||
var smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
|
||||
// Set current itemId, parent and position if Smart Bookmark exists,
|
||||
// we will use these informations to create the new version at the same
|
||||
// position.
|
||||
|
|
|
@ -52,9 +52,9 @@
|
|||
onload="init();"
|
||||
onunload="SidebarUtils.clearURLFromStatusBar();">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/bookmarks/bookmarksPanel.js"/>
|
||||
|
||||
<commandset id="placesCommands"/>
|
||||
|
|
|
@ -248,7 +248,7 @@ PlacesController.prototype = {
|
|||
case "placesCmd_deleteDataHost":
|
||||
var host;
|
||||
if (PlacesUtils.nodeIsHost(this._view.selectedNode)) {
|
||||
var queries = this._view.selectedNode.getQueries({});
|
||||
var queries = this._view.selectedNode.getQueries();
|
||||
host = queries[0].domain;
|
||||
}
|
||||
else
|
||||
|
@ -509,7 +509,7 @@ PlacesController.prototype = {
|
|||
|
||||
// annotations
|
||||
if (uri) {
|
||||
var names = PlacesUtils.annotations.getPageAnnotationNames(uri, {});
|
||||
var names = PlacesUtils.annotations.getPageAnnotationNames(uri);
|
||||
for (var j = 0; j < names.length; ++j)
|
||||
nodeData[names[j]] = true;
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ PlacesController.prototype = {
|
|||
// For items also include the item-specific annotations
|
||||
if (node.itemId != -1) {
|
||||
names = PlacesUtils.annotations
|
||||
.getItemAnnotationNames(node.itemId, {});
|
||||
.getItemAnnotationNames(node.itemId);
|
||||
for (j = 0; j < names.length; ++j)
|
||||
nodeData[names[j]] = true;
|
||||
}
|
||||
|
@ -1058,7 +1058,7 @@ PlacesController.prototype = {
|
|||
}
|
||||
else if (PlacesUtils.nodeIsDay(aContainerNode)) {
|
||||
// Day container.
|
||||
var query = aContainerNode.getQueries({})[0];
|
||||
var query = aContainerNode.getQueries()[0];
|
||||
var beginTime = query.beginTime;
|
||||
var endTime = query.endTime;
|
||||
NS_ASSERT(query && beginTime && endTime,
|
||||
|
|
|
@ -204,7 +204,7 @@ var gEditItemOverlay = {
|
|||
|
||||
this._initTextField("locationField", this._uri.spec);
|
||||
if (!aItemIdList) {
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(this._uri, {}).join(", ");
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(this._uri).join(", ");
|
||||
this._initTextField("tagsField", tags, false);
|
||||
}
|
||||
else {
|
||||
|
@ -218,8 +218,8 @@ var gEditItemOverlay = {
|
|||
this._itemIds[i] = -1;
|
||||
}
|
||||
else
|
||||
this._uris[i] = PlacesUtils.bookmarks.getBookmarkURI(this._itemIds[i], {});
|
||||
this._tags[i] = PlacesUtils.tagging.getTagsForURI(this._uris[i], {});
|
||||
this._uris[i] = PlacesUtils.bookmarks.getBookmarkURI(this._itemIds[i]);
|
||||
this._tags[i] = PlacesUtils.tagging.getTagsForURI(this._uris[i]);
|
||||
if (this._tags[i].length < this._tags[nodeToCheck].length)
|
||||
nodeToCheck = i;
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ var gEditItemOverlay = {
|
|||
}
|
||||
|
||||
// List of recently used folders:
|
||||
var folderIds = annos.getItemsWithAnnotation(LAST_USED_ANNO, { });
|
||||
var folderIds = annos.getItemsWithAnnotation(LAST_USED_ANNO);
|
||||
|
||||
/**
|
||||
* The value of the LAST_USED_ANNO annotation is the time (in the form of
|
||||
|
@ -573,7 +573,7 @@ var gEditItemOverlay = {
|
|||
},
|
||||
|
||||
_updateSingleTagForItem: function EIO__updateSingleTagForItem() {
|
||||
var currentTags = PlacesUtils.tagging.getTagsForURI(this._uri, { });
|
||||
var currentTags = PlacesUtils.tagging.getTagsForURI(this._uri);
|
||||
var tags = this._getTagsArrayFromTagField();
|
||||
if (tags.length > 0 || currentTags.length > 0) {
|
||||
var tagsToRemove = [];
|
||||
|
@ -599,7 +599,7 @@ var gEditItemOverlay = {
|
|||
PlacesUIUtils.ptm.doTransaction(aggregate);
|
||||
|
||||
// Ensure the tagsField is in sync, clean it up from empty tags
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(this._uri, {}).join(", ");
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(this._uri).join(", ");
|
||||
this._initTextField("tagsField", tags, false);
|
||||
return true;
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ var gEditItemOverlay = {
|
|||
this._allTags = tags;
|
||||
this._tags = [];
|
||||
for (i = 0; i < this._uris.length; i++)
|
||||
this._tags[i] = PlacesUtils.tagging.getTagsForURI(this._uris[i], {});
|
||||
this._tags[i] = PlacesUtils.tagging.getTagsForURI(this._uris[i]);
|
||||
|
||||
// Ensure the tagsField is in sync, clean it up from empty tags
|
||||
this._initTextField("tagsField", tags, false);
|
||||
|
@ -1112,7 +1112,7 @@ var gEditItemOverlay = {
|
|||
this._initNamePicker(); // for microsummaries
|
||||
this._initTextField("tagsField",
|
||||
PlacesUtils.tagging
|
||||
.getTagsForURI(this._uri, { }).join(", "),
|
||||
.getTagsForURI(this._uri).join(", "),
|
||||
false);
|
||||
this._rebuildTagsSelectorList();
|
||||
}
|
||||
|
|
|
@ -60,9 +60,9 @@
|
|||
onload="HistorySidebarInit();"
|
||||
onunload="SidebarUtils.clearURLFromStatusBar();">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/places/history-panel.js"/>
|
||||
|
||||
<commandset id="editMenuCommands"/>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
screenY="24"
|
||||
persist="screenX screenY width height">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/places/moveBookmarks.js"/>
|
||||
|
||||
<hbox flex="1">
|
||||
|
|
|
@ -216,7 +216,7 @@ var PlacesOrganizer = {
|
|||
return;
|
||||
|
||||
var node = this._places.selectedNode;
|
||||
var queries = asQuery(node).getQueries({});
|
||||
var queries = asQuery(node).getQueries();
|
||||
|
||||
// Items are only excluded on the left pane.
|
||||
var options = node.queryOptions.clone();
|
||||
|
@ -359,7 +359,7 @@ var PlacesOrganizer = {
|
|||
* main places pane.
|
||||
*/
|
||||
getCurrentQueries: function PO_getCurrentQueries() {
|
||||
return asQuery(this._content.getResult().root).getQueries({});
|
||||
return asQuery(this._content.getResult().root).getQueries();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
toggletoolbar="true"
|
||||
persist="width height screenX screenY sizemode">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/places/places.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/utilityOverlay.js"/>
|
||||
|
|
|
@ -47,17 +47,17 @@
|
|||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/utilityOverlay.js"/>
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/places/utils.js"/>
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/places/controller.js"/>
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/places/treeView.js"/>
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
|
||||
<!-- Bookmarks and history tooltip -->
|
||||
|
|
|
@ -231,7 +231,7 @@ var PlacesUIUtils = {
|
|||
var tags = aData.tags.split(", ");
|
||||
// filter out tags already present, so that undo doesn't remove them
|
||||
// from pre-existing bookmarks
|
||||
var storedTags = PlacesUtils.tagging.getTagsForURI(itemURL, {});
|
||||
var storedTags = PlacesUtils.tagging.getTagsForURI(itemURL);
|
||||
tags = tags.filter(function (aTag) {
|
||||
return (storedTags.indexOf(aTag) == -1);
|
||||
}, this);
|
||||
|
@ -1147,7 +1147,7 @@ var PlacesUIUtils = {
|
|||
|
||||
// Get all items marked as being the left pane folder. We should only have
|
||||
// one of them.
|
||||
var items = as.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO, {});
|
||||
var items = as.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO);
|
||||
if (items.length > 1) {
|
||||
// Something went wrong, we cannot have more than one left pane folder,
|
||||
// remove all left pane folders and continue. We will create a new one.
|
||||
|
@ -1182,7 +1182,7 @@ var PlacesUIUtils = {
|
|||
// associating a mnemonic name to the real item ids.
|
||||
delete this.leftPaneQueries;
|
||||
this.leftPaneQueries = {};
|
||||
var items = as.getItemsWithAnnotation(ORGANIZER_QUERY_ANNO, {});
|
||||
var items = as.getItemsWithAnnotation(ORGANIZER_QUERY_ANNO);
|
||||
// While looping through queries we will also check for titles validity.
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
var queryName = as.getItemAnnotation(items[i], ORGANIZER_QUERY_ANNO);
|
||||
|
|
|
@ -691,7 +691,7 @@ placesRemoveItemTransaction.prototype = {
|
|||
// children, see getMostRecentBookmarkForURI) for the bookmark's url,
|
||||
// remove the url from tag containers as well.
|
||||
if (PlacesUtils.getMostRecentBookmarkForURI(this._uri) == -1) {
|
||||
this._tags = PlacesUtils.tagging.getTagsForURI(this._uri, {});
|
||||
this._tags = PlacesUtils.tagging.getTagsForURI(this._uri);
|
||||
PlacesUtils.tagging.untagURI(this._uri, this._tags);
|
||||
}
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ placesEditBookmarkURITransactions.prototype = {
|
|||
this._oldURI = PlacesUtils.bookmarks.getBookmarkURI(this._id);
|
||||
PlacesUtils.bookmarks.changeBookmarkURI(this._id, this._newURI);
|
||||
// move tags from old URI to new URI
|
||||
this._tags = PlacesUtils.tagging.getTagsForURI(this._oldURI, {});
|
||||
this._tags = PlacesUtils.tagging.getTagsForURI(this._oldURI);
|
||||
if (this._tags.length != 0) {
|
||||
// only untag the old URI if this is the only bookmark
|
||||
if (PlacesUtils.getBookmarksForURI(this._oldURI, {}).length == 0)
|
||||
|
@ -1157,7 +1157,7 @@ function placesUntagURITransaction(aURI, aTags) {
|
|||
}
|
||||
}
|
||||
else
|
||||
this._tags = PlacesUtils.tagging.getTagsForURI(this._uri, {});
|
||||
this._tags = PlacesUtils.tagging.getTagsForURI(this._uri);
|
||||
|
||||
this.redoTransaction = this.doTransaction;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ var windowObserver = {
|
|||
"Left pane folder correctly created");
|
||||
var leftPaneItems =
|
||||
PlacesUtils.annotations
|
||||
.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO, {});
|
||||
.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO);
|
||||
is(leftPaneItems.length, 1,
|
||||
"We correctly have only 1 left pane folder");
|
||||
var leftPaneRoot = leftPaneItems[0];
|
||||
|
@ -99,7 +99,7 @@ function test() {
|
|||
|
||||
// Check if we have any left pane folder already set, remove it eventually.
|
||||
var leftPaneItems = PlacesUtils.annotations
|
||||
.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO, {});
|
||||
.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO);
|
||||
if (leftPaneItems.length > 0) {
|
||||
// The left pane has already been created, touching it now would cause
|
||||
// next tests to rely on wrong values (and possibly crash)
|
||||
|
@ -125,7 +125,7 @@ function test() {
|
|||
|
||||
// Check fake left pane root has been correctly created.
|
||||
var leftPaneItems =
|
||||
PlacesUtils.annotations.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO, {});
|
||||
PlacesUtils.annotations.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO);
|
||||
is(leftPaneItems.length, 1, "We correctly have only 1 left pane folder");
|
||||
is(leftPaneItems[0], fakeLeftPaneRoot, "left pane root itemId is correct");
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ function test() {
|
|||
var bmId = add_bookmark(PlacesUtils._uri(TEST_URL));
|
||||
ok(bmId > 0, "A bookmark was added");
|
||||
ts.tagURI(PlacesUtils._uri(TEST_URL), ["foo"]);
|
||||
var tags = ts.getTagsForURI(PU._uri(TEST_URL), {});
|
||||
var tags = ts.getTagsForURI(PU._uri(TEST_URL));
|
||||
is(tags[0], 'foo', "tag is foo");
|
||||
},
|
||||
|
||||
|
@ -168,13 +168,13 @@ function test() {
|
|||
var histNode = PO._content.view.nodeForTreeIndex(0);
|
||||
ok(histNode, "histNode exists: " + histNode.title);
|
||||
// check to see if the history node is tagged!
|
||||
var tags = PU.tagging.getTagsForURI(PU._uri(MOZURISPEC), {});
|
||||
var tags = PU.tagging.getTagsForURI(PU._uri(MOZURISPEC));
|
||||
ok(tags.length == 1, "history node is tagged: " + tags.length);
|
||||
// check if a bookmark was created
|
||||
var isBookmarked = PU.bookmarks.isBookmarked(PU._uri(MOZURISPEC));
|
||||
is(isBookmarked, true, MOZURISPEC + " is bookmarked");
|
||||
var bookmarkIds = PU.bookmarks.getBookmarkIdsForURI(
|
||||
PU._uri(histNode.uri), {});
|
||||
PU._uri(histNode.uri));
|
||||
ok(bookmarkIds.length > 0, "bookmark exists for the tagged history item: " + bookmarkIds);
|
||||
},
|
||||
|
||||
|
@ -194,7 +194,7 @@ function test() {
|
|||
ts.untagURI(PU._uri(MOZURISPEC), ["foo"]);
|
||||
ts.untagURI(PU._uri(TEST_URL), ["foo"]);
|
||||
hs.removeAllPages();
|
||||
var tags = ts.getTagsForURI(PU._uri(TEST_URL), {});
|
||||
var tags = ts.getTagsForURI(PU._uri(TEST_URL));
|
||||
is(tags.length, 0, "tags are gone");
|
||||
bs.removeFolderChildren(bs.unfiledBookmarksFolder);
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ function test() {
|
|||
}
|
||||
}
|
||||
node.containerOpen = false;
|
||||
throw("Unable to find child node");
|
||||
ok(false, "Unable to find child node");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ gTests.push({
|
|||
// Add a tag to this bookmark.
|
||||
PlacesUtils.tagging.tagURI(PlacesUtils._uri(TEST_URL),
|
||||
["testTag"]);
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(TEST_URL), {});
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(TEST_URL));
|
||||
is(tags[0], "testTag", "Correctly added a tag");
|
||||
},
|
||||
|
||||
|
@ -282,7 +282,7 @@ gTests.push({
|
|||
|
||||
cleanup: function() {
|
||||
// Check tags have not changed.
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(TEST_URL), {});
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(TEST_URL));
|
||||
is(tags[0], "testTag", "Tag on node has not changed");
|
||||
|
||||
// Cleanup.
|
||||
|
@ -366,7 +366,7 @@ gTests.push({
|
|||
// Add a tag to this bookmark.
|
||||
PlacesUtils.tagging.tagURI(PlacesUtils._uri(TEST_URL),
|
||||
["testTag"]);
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(TEST_URL), {});
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(TEST_URL));
|
||||
is(tags[0], "testTag", "Correctly added a tag");
|
||||
},
|
||||
|
||||
|
@ -440,7 +440,7 @@ gTests.push({
|
|||
|
||||
cleanup: function() {
|
||||
// Check tags have not changed.
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(TEST_URL), {});
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(TEST_URL));
|
||||
is(tags[0], "testTag", "Tag on node has not changed");
|
||||
|
||||
// Cleanup.
|
||||
|
|
|
@ -87,7 +87,7 @@ function test() {
|
|||
|
||||
// Get the left pane folder.
|
||||
var leftPaneItems = PlacesUtils.annotations
|
||||
.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO, {});
|
||||
.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO);
|
||||
|
||||
is(leftPaneItems.length, 1, "We correctly have only 1 left pane folder");
|
||||
// Check version.
|
||||
|
@ -98,7 +98,7 @@ function test() {
|
|||
|
||||
// Get all left pane queries.
|
||||
var items = PlacesUtils.annotations
|
||||
.getItemsWithAnnotation(ORGANIZER_QUERY_ANNO, {});
|
||||
.getItemsWithAnnotation(ORGANIZER_QUERY_ANNO);
|
||||
// Get current queries names.
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
var itemId = items[i];
|
||||
|
|
|
@ -318,7 +318,8 @@ function runNextTest() {
|
|||
gBrowser.removeTabsProgressListener(gTabsListener);
|
||||
|
||||
// Restore history.
|
||||
gPrefService.clearUserPref(DISABLE_HISTORY_PREF);
|
||||
if (gPrefService.prefHasUserValue(DISABLE_HISTORY_PREF))
|
||||
gPrefService.clearUserPref(DISABLE_HISTORY_PREF);
|
||||
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ function search(aFolderId, aSearchStr, aExpectedScopeButtonId) {
|
|||
// contentTree.place should be equal to contentTree.getResult().root.uri,
|
||||
// but it's not until bug 476952 is fixed.
|
||||
var query = queryStringToQuery(contentTree.getResult().root.uri);
|
||||
is(query.getFolders({}, {})[0], aFolderId,
|
||||
is(query.getFolders()[0], aFolderId,
|
||||
"Content tree's folder should be what was selected in the left pane");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,14 +104,14 @@
|
|||
gEditItemOverlay.onTagsFieldBlur();
|
||||
|
||||
// test that the tag has been added in the backend
|
||||
is(ts.getTagsForURI(testURI, {})[0], testTag, "tags match");
|
||||
is(ts.getTagsForURI(testURI)[0], testTag, "tags match");
|
||||
|
||||
// change the tag
|
||||
document.getElementById("editBMPanel_tagsField").value = testTagUpper;
|
||||
gEditItemOverlay.onTagsFieldBlur();
|
||||
|
||||
// test that the tag has been added in the backend
|
||||
is(ts.getTagsForURI(testURI, {})[0], testTagUpper, "tags match");
|
||||
is(ts.getTagsForURI(testURI)[0], testTagUpper, "tags match");
|
||||
|
||||
// Cleanup.
|
||||
ts.untagURI(testURI, [testTag]);
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
// We need 2 left pane folders to simulate a corrupt profile.
|
||||
do {
|
||||
let leftPaneItems = as.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO, {});
|
||||
let leftPaneItems = as.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO);
|
||||
// Create a fake left pane folder.
|
||||
let fakeLeftPaneRoot = bs.createFolder(PlacesUtils.placesRootId, "",
|
||||
bs.DEFAULT_INDEX);
|
||||
|
@ -97,7 +97,7 @@
|
|||
// Check left pane.
|
||||
ok(PlacesUIUtils.leftPaneFolderId > 0,
|
||||
"Left pane folder correctly created");
|
||||
var leftPaneItems = as.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO, {});
|
||||
var leftPaneItems = as.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO);
|
||||
is(leftPaneItems.length, 1,
|
||||
"We correctly have only 1 left pane folder");
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ function testTags() {
|
|||
for each(let {uri: u, tags: t} in tagData) {
|
||||
var i = 0;
|
||||
dump("test tags for " + u.spec + ": " + t + "\n");
|
||||
var tt = PlacesUtils.tagging.getTagsForURI(u, {});
|
||||
var tt = PlacesUtils.tagging.getTagsForURI(u);
|
||||
dump("true tags for " + u.spec + ": " + tt + "\n");
|
||||
do_check_true(t.every(function(el) {
|
||||
i++;
|
||||
|
|
|
@ -170,7 +170,7 @@ function run_test() {
|
|||
do_check_eq(bm1lm, bm2lm);
|
||||
|
||||
|
||||
var ids = bmsvc.getBookmarkIdsForURI(testURI, {});
|
||||
var ids = bmsvc.getBookmarkIdsForURI(testURI);
|
||||
do_check_eq(ids[0], bm2);
|
||||
do_check_eq(ids[1], bm1);
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ function run_test() {
|
|||
// TEST 1: smart bookmarks disabled
|
||||
pref.setIntPref("browser.places.smartBookmarksVersion", -1);
|
||||
gluesvc.ensurePlacesDefaultQueriesInitialized();
|
||||
var smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO, {});
|
||||
var smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
|
||||
do_check_eq(smartBookmarkItemIds.length, 0);
|
||||
// check that pref has not been bumped up
|
||||
do_check_eq(pref.getIntPref("browser.places.smartBookmarksVersion"), -1);
|
||||
|
@ -84,7 +84,7 @@ function run_test() {
|
|||
// TEST 2: create smart bookmarks
|
||||
pref.setIntPref("browser.places.smartBookmarksVersion", 0);
|
||||
gluesvc.ensurePlacesDefaultQueriesInitialized();
|
||||
smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO, {});
|
||||
smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
|
||||
do_check_neq(smartBookmarkItemIds.length, 0);
|
||||
// check that pref has been bumped up
|
||||
do_check_true(pref.getIntPref("browser.places.smartBookmarksVersion") > 0);
|
||||
|
@ -96,7 +96,7 @@ function run_test() {
|
|||
bmsvc.removeItem(smartBookmarkItemIds[0]);
|
||||
pref.setIntPref("browser.places.smartBookmarksVersion", 0);
|
||||
gluesvc.ensurePlacesDefaultQueriesInitialized();
|
||||
smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO, {});
|
||||
smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
|
||||
do_check_eq(smartBookmarkItemIds.length, smartBookmarksCount);
|
||||
// check that pref has been bumped up
|
||||
do_check_true(pref.getIntPref("browser.places.smartBookmarksVersion") > 0);
|
||||
|
@ -113,7 +113,7 @@ function run_test() {
|
|||
// restore
|
||||
pref.setIntPref("browser.places.smartBookmarksVersion", 0);
|
||||
gluesvc.ensurePlacesDefaultQueriesInitialized();
|
||||
smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO, {});
|
||||
smartBookmarkItemIds = annosvc.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
|
||||
do_check_eq(smartBookmarkItemIds.length, smartBookmarksCount);
|
||||
do_check_eq(bmsvc.getFolderIdForItem(smartBookmarkItemIds[0]), newParent);
|
||||
do_check_eq(bmsvc.getItemTitle(smartBookmarkItemIds[0]), oldTitle);
|
||||
|
|
|
@ -47,7 +47,6 @@ const PREF_BMPROCESSED = "distribution.516444.bookmarksProcessed";
|
|||
const PREF_DISTRIBUTION_ID = "distribution.id";
|
||||
|
||||
const TOPIC_FINAL_UI_STARTUP = "final-ui-startup";
|
||||
const TOPIC_PLACES_INIT_COMPLETE = "places-init-complete";
|
||||
const TOPIC_CUSTOMIZATION_COMPLETE = "distribution-customization-complete";
|
||||
|
||||
let os = Cc["@mozilla.org/observer-service;1"].
|
||||
|
@ -95,10 +94,9 @@ function run_test() {
|
|||
// Initialize nsBrowserGlue.
|
||||
Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
|
||||
|
||||
// Places initialization has already happened, so we need to simulate a new
|
||||
// one. This will force browserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_FINAL_UI_STARTUP, null);
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
// places-init-complete is an enqueued notification so it will be notified
|
||||
// when exiting from this scope.
|
||||
|
||||
do_test_pending();
|
||||
// Test will continue on customization complete notification.
|
||||
|
|
|
@ -184,7 +184,7 @@ function run_test() {
|
|||
// Create to Root
|
||||
var txn2 = ptSvc.createItem(uri("http://www.example.com"), root, bmStartIndex, "Testing1");
|
||||
ptSvc.doTransaction(txn2); // Also testing doTransaction
|
||||
var b = (bmsvc.getBookmarkIdsForURI(uri("http://www.example.com"), {}))[0];
|
||||
var b = (bmsvc.getBookmarkIdsForURI(uri("http://www.example.com")))[0];
|
||||
do_check_eq(observer._itemAddedId, b);
|
||||
do_check_eq(observer._itemAddedIndex, bmStartIndex);
|
||||
do_check_true(bmsvc.isBookmarked(uri("http://www.example.com")));
|
||||
|
@ -194,7 +194,7 @@ function run_test() {
|
|||
do_check_false(bmsvc.isBookmarked(uri("http://www.example.com")));
|
||||
txn2.redoTransaction();
|
||||
do_check_true(bmsvc.isBookmarked(uri("http://www.example.com")));
|
||||
var newId = (bmsvc.getBookmarkIdsForURI(uri("http://www.example.com"), {}))[0];
|
||||
var newId = (bmsvc.getBookmarkIdsForURI(uri("http://www.example.com")))[0];
|
||||
do_check_eq(observer._itemAddedIndex, bmStartIndex);
|
||||
do_check_eq(observer._itemAddedParent, root);
|
||||
do_check_eq(observer._itemAddedId, newId);
|
||||
|
@ -211,7 +211,7 @@ function run_test() {
|
|||
|
||||
var txn2b = ptSvc.createItem(uri("http://www.example2.com"), fldrId, bmStartIndex, "Testing1b");
|
||||
ptSvc.doTransaction(txn2b);
|
||||
var b2 = (bmsvc.getBookmarkIdsForURI(uri("http://www.example2.com"), {}))[0];
|
||||
var b2 = (bmsvc.getBookmarkIdsForURI(uri("http://www.example2.com")))[0];
|
||||
do_check_eq(observer._itemAddedId, b2);
|
||||
do_check_eq(observer._itemAddedIndex, bmStartIndex);
|
||||
do_check_true(bmsvc.isBookmarked(uri("http://www.example2.com")));
|
||||
|
@ -219,7 +219,7 @@ function run_test() {
|
|||
do_check_eq(observer._itemRemovedId, b2);
|
||||
do_check_eq(observer._itemRemovedIndex, bmStartIndex);
|
||||
txn2b.redoTransaction();
|
||||
newId = (bmsvc.getBookmarkIdsForURI(uri("http://www.example2.com"), {}))[0];
|
||||
newId = (bmsvc.getBookmarkIdsForURI(uri("http://www.example2.com")))[0];
|
||||
do_check_eq(observer._itemAddedIndex, bmStartIndex);
|
||||
do_check_eq(observer._itemAddedParent, fldrId);
|
||||
do_check_eq(observer._itemAddedId, newId);
|
||||
|
@ -232,7 +232,7 @@ function run_test() {
|
|||
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.example3.com"), root, -1, "Testing2"));
|
||||
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.example3.com"), root, -1, "Testing3"));
|
||||
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.example3.com"), fldrId, -1, "Testing4"));
|
||||
var bkmkIds = bmsvc.getBookmarkIdsForURI(uri("http://www.example3.com"), {});
|
||||
var bkmkIds = bmsvc.getBookmarkIdsForURI(uri("http://www.example3.com"));
|
||||
bkmkIds.sort();
|
||||
var bkmk1Id = bkmkIds[0];
|
||||
var bkmk2Id = bkmkIds[1];
|
||||
|
@ -563,7 +563,7 @@ function run_test() {
|
|||
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.sortingtest.com"), srtFldId, -1, "c"));
|
||||
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.sortingtest.com"), srtFldId, -1, "b"));
|
||||
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.sortingtest.com"), srtFldId, -1, "a"));
|
||||
var b = bmsvc.getBookmarkIdsForURI(uri("http://www.sortingtest.com"), {});
|
||||
var b = bmsvc.getBookmarkIdsForURI(uri("http://www.sortingtest.com"));
|
||||
b.sort();
|
||||
var b1 = b[0];
|
||||
var b2 = b[1];
|
||||
|
@ -595,7 +595,7 @@ function run_test() {
|
|||
ptSvc.doTransaction(
|
||||
ptSvc.createItem(uri("http://dietrich.ganx4.com/mozilla/test-microsummary-content.php"),
|
||||
root, -1, "micro test", null, null, null));
|
||||
var bId = (bmsvc.getBookmarkIdsForURI(uri("http://dietrich.ganx4.com/mozilla/test-microsummary-content.php"),{}))[0];
|
||||
var bId = (bmsvc.getBookmarkIdsForURI(uri("http://dietrich.ganx4.com/mozilla/test-microsummary-content.php")))[0];
|
||||
do_check_true(!mss.hasMicrosummary(bId));
|
||||
var txn18 = ptSvc.editBookmarkMicrosummary(bId, tmpMs);
|
||||
txn18.doTransaction();
|
||||
|
@ -611,7 +611,7 @@ function run_test() {
|
|||
var postDataURI = uri("http://foo.com");
|
||||
ptSvc.doTransaction(
|
||||
ptSvc.createItem(postDataURI, root, -1, "postdata test", null, null, null));
|
||||
var postDataId = (bmsvc.getBookmarkIdsForURI(postDataURI,{}))[0];
|
||||
var postDataId = (bmsvc.getBookmarkIdsForURI(postDataURI))[0];
|
||||
var postDataTxn = ptSvc.editBookmarkPostData(postDataId, postData);
|
||||
postDataTxn.doTransaction();
|
||||
do_check_true(annosvc.itemHasAnnotation(postDataId, POST_DATA_ANNO))
|
||||
|
@ -641,18 +641,18 @@ function run_test() {
|
|||
var tagURI = uri("http://foo.tld");
|
||||
var tagTxn = ptSvc.tagURI(tagURI, ["foo", "bar"]);
|
||||
tagTxn.doTransaction();
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI, { })), uneval(["bar","foo"]));
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI)), uneval(["bar","foo"]));
|
||||
tagTxn.undoTransaction();
|
||||
do_check_true(tagssvc.getTagsForURI(tagURI, { }).length == 0);
|
||||
do_check_eq(tagssvc.getTagsForURI(tagURI).length, 0);
|
||||
tagTxn.redoTransaction();
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI, { })), uneval(["bar","foo"]));
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI)), uneval(["bar","foo"]));
|
||||
var untagTxn = ptSvc.untagURI(tagURI, ["bar"]);
|
||||
untagTxn.doTransaction();
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI, { })), uneval(["foo"]));
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI)), uneval(["foo"]));
|
||||
untagTxn.undoTransaction();
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI, { })), uneval(["bar","foo"]));
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI)), uneval(["bar","foo"]));
|
||||
untagTxn.redoTransaction();
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI, { })), uneval(["foo"]));
|
||||
do_check_eq(uneval(tagssvc.getTagsForURI(tagURI)), uneval(["foo"]));
|
||||
|
||||
// Test aggregate removeItem transaction
|
||||
var bkmk1Id = bmsvc.insertBookmark(root, uri("http://www.mozilla.org/"), 0, "Mozilla");
|
||||
|
@ -751,7 +751,7 @@ function run_test() {
|
|||
childTxns);
|
||||
try {
|
||||
ptSvc.doTransaction(itemWChildTxn); // Also testing doTransaction
|
||||
var itemId = (bmsvc.getBookmarkIdsForURI(uri("http://www.example.com"), {}))[0];
|
||||
var itemId = (bmsvc.getBookmarkIdsForURI(uri("http://www.example.com")))[0];
|
||||
do_check_eq(observer._itemAddedId, itemId);
|
||||
do_check_eq(newDateAdded, bmsvc.getItemDateAdded(itemId));
|
||||
do_check_eq(observer._itemChangedProperty, "testAnno/testInt");
|
||||
|
@ -763,7 +763,7 @@ function run_test() {
|
|||
do_check_eq(observer._itemRemovedId, itemId);
|
||||
itemWChildTxn.redoTransaction();
|
||||
do_check_true(bmsvc.isBookmarked(uri("http://www.example.com")));
|
||||
var newId = (bmsvc.getBookmarkIdsForURI(uri("http://www.example.com"), {}))[0];
|
||||
var newId = (bmsvc.getBookmarkIdsForURI(uri("http://www.example.com")))[0];
|
||||
do_check_eq(newDateAdded, bmsvc.getItemDateAdded(newId));
|
||||
do_check_eq(observer._itemAddedId, newId);
|
||||
do_check_eq(observer._itemChangedProperty, "testAnno/testInt");
|
||||
|
@ -782,14 +782,14 @@ function run_test() {
|
|||
var folderWChildItemTxn = ptSvc.createFolder("Folder", root, bmStartIndex, null, [childItemTxn]);
|
||||
try {
|
||||
ptSvc.doTransaction(folderWChildItemTxn);
|
||||
var childItemId = (bmsvc.getBookmarkIdsForURI(uri("http://www.childItem.com"), {}))[0];
|
||||
var childItemId = (bmsvc.getBookmarkIdsForURI(uri("http://www.childItem.com")))[0];
|
||||
do_check_eq(observer._itemAddedId, childItemId);
|
||||
do_check_eq(observer._itemAddedIndex, 0);
|
||||
do_check_true(bmsvc.isBookmarked(uri("http://www.childItem.com")));
|
||||
folderWChildItemTxn.undoTransaction();
|
||||
do_check_false(bmsvc.isBookmarked(uri("http://www.childItem.com")));
|
||||
folderWChildItemTxn.redoTransaction();
|
||||
var newchildItemId = (bmsvc.getBookmarkIdsForURI(uri("http://www.childItem.com"), {}))[0];
|
||||
var newchildItemId = (bmsvc.getBookmarkIdsForURI(uri("http://www.childItem.com")))[0];
|
||||
do_check_eq(observer._itemAddedIndex, 0);
|
||||
do_check_eq(observer._itemAddedId, newchildItemId);
|
||||
do_check_true(bmsvc.isBookmarked(uri("http://www.childItem.com")));
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
name="dom.disable_window_status_change" type="bool"/>
|
||||
</preferences>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/advanced-scripts.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/advanced-scripts.js"/>
|
||||
|
||||
<stringbundle id="preferencesBundle" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
|
||||
|
|
|
@ -219,9 +219,9 @@ var gAdvancedPane = {
|
|||
{
|
||||
var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
|
||||
getService(Components.interfaces.nsIApplicationCacheService);
|
||||
if (!groups) {
|
||||
groups = cacheService.getGroups({});
|
||||
}
|
||||
if (!groups)
|
||||
groups = cacheService.getGroups();
|
||||
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"].
|
||||
getService(Components.interfaces.nsIIOService);
|
||||
|
||||
|
@ -256,7 +256,7 @@ var gAdvancedPane = {
|
|||
|
||||
var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
|
||||
getService(Components.interfaces.nsIApplicationCacheService);
|
||||
var groups = cacheService.getGroups({});
|
||||
var groups = cacheService.getGroups();
|
||||
|
||||
var bundle = document.getElementById("bundlePreferences");
|
||||
|
||||
|
@ -316,7 +316,7 @@ var gAdvancedPane = {
|
|||
getService(Components.interfaces.nsIApplicationCacheService);
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"].
|
||||
getService(Components.interfaces.nsIIOService);
|
||||
var groups = cacheService.getGroups({});
|
||||
var groups = cacheService.getGroups();
|
||||
for (var i = 0; i < groups.length; i++) {
|
||||
var uri = ios.newURI(groups[i], null, null);
|
||||
if (uri.asciiHost == host) {
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
|
||||
#endif
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/advanced.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/advanced.js"/>
|
||||
|
||||
<tabbox id="advancedPrefs" flex="1"
|
||||
onselect="gAdvancedPane.tabSelectionChanged();">
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
type="bool"/>
|
||||
</preferences>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/applications.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/applications.js"/>
|
||||
|
||||
<keyset>
|
||||
<key key="&focusSearch1.key;" modifiers="accel" oncommand="gApplicationsPane.focusFilterBox();"/>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
<preference id="network.proxy.backup.gopher_port" name="network.proxy.backup.gopher_port" type="int"/>
|
||||
</preferences>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/connection.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/connection.js"/>
|
||||
|
||||
<stringbundle id="preferencesBundle" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
|
||||
|
|
|
@ -75,8 +75,8 @@
|
|||
onchange="gContentPane._rebuildFonts();"/>
|
||||
</preferences>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/content.js"/>
|
||||
<script type="application/javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/content.js"/>
|
||||
|
||||
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@
|
|||
</preferences>
|
||||
|
||||
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/fonts.js"/>
|
||||
<script type="application/javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/fonts.js"/>
|
||||
|
||||
<!-- Fonts for: [ Language ] -->
|
||||
<groupbox>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
type="bool"/>
|
||||
</preferences>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/languages.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/languages.js"/>
|
||||
|
||||
<stringbundleset id="languageSet">
|
||||
<stringbundle id="bundleRegions" src="chrome://global/locale/regionNames.properties"/>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
onpaneload="gMainPane.init();"
|
||||
helpTopic="prefs-main">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/main.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/main.js"/>
|
||||
|
||||
<preferences id="mainPreferences">
|
||||
<!-- XXX Button preferences -->
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
|
||||
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/privacy.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/privacy.js"/>
|
||||
|
||||
<!-- History -->
|
||||
<groupbox id="historyGroup">
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
</preferences>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/security.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/security.js"/>
|
||||
|
||||
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
onload="SelectBookmarkDialog.init();"
|
||||
ondialogaccept="SelectBookmarkDialog.accept();">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/preferences/selectBookmark.js"/>
|
||||
|
||||
<description>&selectBookmark.label;</description>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<preference id="browser.tabs.warnOnOpen" name="browser.tabs.warnOnOpen" type="bool"/>
|
||||
</preferences>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/tabs.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/tabs.js"/>
|
||||
|
||||
<!-- XXX flex below is a hack because wrapping checkboxes don't reflow
|
||||
properly; see bug 349098 -->
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<head>
|
||||
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all"/>
|
||||
<link rel="stylesheet" href="chrome://browser/skin/aboutPrivateBrowsing.css" type="text/css" media="all"/>
|
||||
<script type="application/x-javascript;version=1.7"><![CDATA[
|
||||
<script type="application/javascript;version=1.7"><![CDATA[
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче