зеркало из https://github.com/mozilla/pjs.git
Merge mozilla-central to tracemonkey.
This commit is contained in:
Коммит
67a84d1621
|
@ -40,7 +40,7 @@
|
|||
#include "nsIAccessible.h"
|
||||
#include "nsAccessibilityAtoms.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsIAccessibilityService.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsIAccessibleDocument.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
|
@ -82,27 +82,19 @@ nsIStringBundle *nsAccessNode::gStringBundle = 0;
|
|||
nsIStringBundle *nsAccessNode::gKeyStringBundle = 0;
|
||||
nsITimer *nsAccessNode::gDoCommandTimer = 0;
|
||||
nsIDOMNode *nsAccessNode::gLastFocusedNode = 0;
|
||||
#ifdef DEBUG
|
||||
PRBool nsAccessNode::gIsAccessibilityActive = PR_FALSE;
|
||||
PRBool nsAccessNode::gIsShuttingDownApp = PR_FALSE;
|
||||
#endif
|
||||
PRBool nsAccessNode::gIsCacheDisabled = PR_FALSE;
|
||||
PRBool nsAccessNode::gIsFormFillEnabled = PR_FALSE;
|
||||
nsAccessNodeHashtable nsAccessNode::gGlobalDocAccessibleCache;
|
||||
|
||||
nsApplicationAccessibleWrap *nsAccessNode::gApplicationAccessible = nsnull;
|
||||
|
||||
nsIAccessibilityService *nsAccessNode::sAccService = nsnull;
|
||||
nsIAccessibilityService *nsAccessNode::GetAccService()
|
||||
nsIAccessibilityService*
|
||||
nsAccessNode::GetAccService()
|
||||
{
|
||||
if (!gIsAccessibilityActive)
|
||||
return nsnull;
|
||||
|
||||
if (!sAccService) {
|
||||
nsresult rv = CallGetService("@mozilla.org/accessibilityService;1",
|
||||
&sAccService);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "No accessibility service");
|
||||
}
|
||||
|
||||
return sAccService;
|
||||
return nsAccessibilityService::GetAccessibilityService();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -245,9 +237,7 @@ NS_IMETHODIMP nsAccessNode::GetOwnerWindow(void **aWindow)
|
|||
already_AddRefed<nsApplicationAccessibleWrap>
|
||||
nsAccessNode::GetApplicationAccessible()
|
||||
{
|
||||
if (!gIsAccessibilityActive) {
|
||||
return nsnull;
|
||||
}
|
||||
NS_ASSERTION(gIsAccessibilityActive, "Accessibility wasn't initialized!");
|
||||
|
||||
if (!gApplicationAccessible) {
|
||||
nsApplicationAccessibleWrap::PreCreate();
|
||||
|
@ -273,9 +263,8 @@ nsAccessNode::GetApplicationAccessible()
|
|||
|
||||
void nsAccessNode::InitXPAccessibility()
|
||||
{
|
||||
if (gIsAccessibilityActive) {
|
||||
return;
|
||||
}
|
||||
NS_ASSERTION(!gIsAccessibilityActive,
|
||||
"Accessibility was initialized already!");
|
||||
|
||||
nsCOMPtr<nsIStringBundleService> stringBundleService =
|
||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID);
|
||||
|
@ -297,11 +286,13 @@ void nsAccessNode::InitXPAccessibility()
|
|||
prefBranch->GetBoolPref("browser.formfill.enable", &gIsFormFillEnabled);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
gIsAccessibilityActive = PR_TRUE;
|
||||
NotifyA11yInitOrShutdown();
|
||||
#endif
|
||||
NotifyA11yInitOrShutdown(PR_TRUE);
|
||||
}
|
||||
|
||||
void nsAccessNode::NotifyA11yInitOrShutdown()
|
||||
void nsAccessNode::NotifyA11yInitOrShutdown(PRBool aIsInit)
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> obsService =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
|
@ -310,7 +301,7 @@ void nsAccessNode::NotifyA11yInitOrShutdown()
|
|||
static const PRUnichar kInitIndicator[] = { '1', 0 };
|
||||
static const PRUnichar kShutdownIndicator[] = { '0', 0 };
|
||||
obsService->NotifyObservers(nsnull, "a11y-init-or-shutdown",
|
||||
gIsAccessibilityActive ? kInitIndicator : kShutdownIndicator);
|
||||
aIsInit ? kInitIndicator : kShutdownIndicator);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,16 +311,12 @@ void nsAccessNode::ShutdownXPAccessibility()
|
|||
// which happens when xpcom is shutting down
|
||||
// at exit of program
|
||||
|
||||
if (!gIsAccessibilityActive) {
|
||||
return;
|
||||
}
|
||||
gIsShuttingDownApp = PR_TRUE;
|
||||
NS_ASSERTION(gIsAccessibilityActive, "Accessibility was shutdown already!");
|
||||
|
||||
NS_IF_RELEASE(gStringBundle);
|
||||
NS_IF_RELEASE(gKeyStringBundle);
|
||||
NS_IF_RELEASE(gDoCommandTimer);
|
||||
NS_IF_RELEASE(gLastFocusedNode);
|
||||
NS_IF_RELEASE(sAccService);
|
||||
|
||||
nsApplicationAccessibleWrap::Unload();
|
||||
ClearCache(gGlobalDocAccessibleCache);
|
||||
|
@ -339,8 +326,10 @@ void nsAccessNode::ShutdownXPAccessibility()
|
|||
NS_IF_RELEASE(gApplicationAccessible);
|
||||
gApplicationAccessible = nsnull;
|
||||
|
||||
#ifdef DEBUG
|
||||
gIsAccessibilityActive = PR_FALSE;
|
||||
NotifyA11yInitOrShutdown();
|
||||
#endif
|
||||
NotifyA11yInitOrShutdown(PR_FALSE);
|
||||
}
|
||||
|
||||
PRBool
|
||||
|
|
|
@ -174,21 +174,21 @@ protected:
|
|||
/**
|
||||
* Notify global nsIObserver's that a11y is getting init'd or shutdown
|
||||
*/
|
||||
static void NotifyA11yInitOrShutdown();
|
||||
static void NotifyA11yInitOrShutdown(PRBool aIsInit);
|
||||
|
||||
// Static data, we do our own refcounting for our static data
|
||||
static nsIStringBundle *gStringBundle;
|
||||
static nsIStringBundle *gKeyStringBundle;
|
||||
static nsITimer *gDoCommandTimer;
|
||||
#ifdef DEBUG
|
||||
static PRBool gIsAccessibilityActive;
|
||||
static PRBool gIsShuttingDownApp;
|
||||
#endif
|
||||
static PRBool gIsCacheDisabled;
|
||||
static PRBool gIsFormFillEnabled;
|
||||
|
||||
static nsAccessNodeHashtable gGlobalDocAccessibleCache;
|
||||
|
||||
private:
|
||||
static nsIAccessibilityService *sAccService;
|
||||
static nsApplicationAccessibleWrap *gApplicationAccessible;
|
||||
};
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
#endif
|
||||
|
||||
nsAccessibilityService *nsAccessibilityService::gAccessibilityService = nsnull;
|
||||
PRBool nsAccessibilityService::gIsShutdown = PR_TRUE;
|
||||
|
||||
/**
|
||||
* nsAccessibilityService
|
||||
|
@ -120,6 +121,7 @@ nsAccessibilityService *nsAccessibilityService::gAccessibilityService = nsnull;
|
|||
|
||||
nsAccessibilityService::nsAccessibilityService()
|
||||
{
|
||||
// Add observers.
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
if (!observerService)
|
||||
|
@ -132,13 +134,15 @@ nsAccessibilityService::nsAccessibilityService()
|
|||
nsIWebProgress::NOTIFY_STATE_DOCUMENT |
|
||||
nsIWebProgress::NOTIFY_LOCATION);
|
||||
}
|
||||
|
||||
// Initialize accessibility.
|
||||
nsAccessNodeWrap::InitAccessibility();
|
||||
}
|
||||
|
||||
nsAccessibilityService::~nsAccessibilityService()
|
||||
{
|
||||
nsAccessibilityService::gAccessibilityService = nsnull;
|
||||
nsAccessNodeWrap::ShutdownAccessibility();
|
||||
NS_ASSERTION(gIsShutdown, "Accessibility wasn't shutdown!");
|
||||
gAccessibilityService = nsnull;
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS5(nsAccessibilityService, nsIAccessibilityService, nsIAccessibleRetrieval,
|
||||
|
@ -151,6 +155,8 @@ nsAccessibilityService::Observe(nsISupports *aSubject, const char *aTopic,
|
|||
const PRUnichar *aData)
|
||||
{
|
||||
if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
|
||||
|
||||
// Remove observers.
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
if (observerService) {
|
||||
|
@ -159,8 +165,8 @@ nsAccessibilityService::Observe(nsISupports *aSubject, const char *aTopic,
|
|||
nsCOMPtr<nsIWebProgress> progress(do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID));
|
||||
if (progress)
|
||||
progress->RemoveProgressListener(static_cast<nsIWebProgressListener*>(this));
|
||||
nsAccessNodeWrap::ShutdownAccessibility();
|
||||
// Cancel and release load timers
|
||||
|
||||
// Cancel and release load timers.
|
||||
while (mLoadTimers.Count() > 0 ) {
|
||||
nsCOMPtr<nsITimer> timer = mLoadTimers.ObjectAt(0);
|
||||
void *closure = nsnull;
|
||||
|
@ -172,7 +178,18 @@ nsAccessibilityService::Observe(nsISupports *aSubject, const char *aTopic,
|
|||
timer->Cancel();
|
||||
mLoadTimers.RemoveObjectAt(0);
|
||||
}
|
||||
|
||||
// Application is going to be closed, shutdown accessibility and mark
|
||||
// accessibility service as shutdown to prevent calls of its methods.
|
||||
// Don't null accessibility service static member at this point to be safe
|
||||
// if someone will try to operate with it.
|
||||
|
||||
NS_ASSERTION(!gIsShutdown, "Accessibility was shutdown already");
|
||||
|
||||
gIsShutdown = PR_TRUE;
|
||||
nsAccessNodeWrap::ShutdownAccessibility();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -182,7 +199,8 @@ NS_IMETHODIMP nsAccessibilityService::OnStateChange(nsIWebProgress *aWebProgress
|
|||
{
|
||||
NS_ASSERTION(aStateFlags & STATE_IS_DOCUMENT, "Other notifications excluded");
|
||||
|
||||
if (!aWebProgress || 0 == (aStateFlags & (STATE_START | STATE_STOP))) {
|
||||
if (gIsShutdown || !aWebProgress ||
|
||||
(aStateFlags & (STATE_START | STATE_STOP)) == 0) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -260,23 +278,26 @@ nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent,
|
|||
|
||||
void nsAccessibilityService::StartLoadCallback(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
nsIAccessibilityService *accService = nsAccessNode::GetAccService();
|
||||
if (accService)
|
||||
accService->ProcessDocLoadEvent(aTimer, aClosure, nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_START);
|
||||
if (gAccessibilityService)
|
||||
gAccessibilityService->
|
||||
ProcessDocLoadEvent(aTimer, aClosure,
|
||||
nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_START);
|
||||
}
|
||||
|
||||
void nsAccessibilityService::EndLoadCallback(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
nsIAccessibilityService *accService = nsAccessNode::GetAccService();
|
||||
if (accService)
|
||||
accService->ProcessDocLoadEvent(aTimer, aClosure, nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE);
|
||||
if (gAccessibilityService)
|
||||
gAccessibilityService->
|
||||
ProcessDocLoadEvent(aTimer, aClosure,
|
||||
nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE);
|
||||
}
|
||||
|
||||
void nsAccessibilityService::FailedLoadCallback(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
nsIAccessibilityService *accService = nsAccessNode::GetAccService();
|
||||
if (accService)
|
||||
accService->ProcessDocLoadEvent(aTimer, aClosure, nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED);
|
||||
if (gAccessibilityService)
|
||||
gAccessibilityService->
|
||||
ProcessDocLoadEvent(aTimer, aClosure,
|
||||
nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED);
|
||||
}
|
||||
|
||||
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
|
||||
|
@ -1315,7 +1336,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
|||
NS_ENSURE_ARG_POINTER(aAccessible);
|
||||
NS_ENSURE_ARG_POINTER(aFrameHint);
|
||||
*aAccessible = nsnull;
|
||||
if (!aPresShell || !aWeakShell) {
|
||||
if (!aPresShell || !aWeakShell || gIsShutdown) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -2056,22 +2077,28 @@ NS_IMETHODIMP nsAccessibilityService::InvalidateSubtreeFor(nsIPresShell *aShell,
|
|||
nsresult
|
||||
nsAccessibilityService::GetAccessibilityService(nsIAccessibilityService** aResult)
|
||||
{
|
||||
NS_PRECONDITION(aResult != nsnull, "null ptr");
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
NS_ENSURE_TRUE(aResult, NS_ERROR_NULL_POINTER);
|
||||
*aResult = nsnull;
|
||||
if (!nsAccessibilityService::gAccessibilityService) {
|
||||
|
||||
if (!gAccessibilityService) {
|
||||
gAccessibilityService = new nsAccessibilityService();
|
||||
if (!gAccessibilityService ) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
NS_ENSURE_TRUE(gAccessibilityService, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
gIsShutdown = PR_FALSE;
|
||||
}
|
||||
*aResult = nsAccessibilityService::gAccessibilityService;
|
||||
NS_ADDREF(*aResult);
|
||||
|
||||
NS_ADDREF(*aResult = gAccessibilityService);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAccessibilityService*
|
||||
nsAccessibilityService::GetAccessibilityService()
|
||||
{
|
||||
NS_ASSERTION(!gIsShutdown,
|
||||
"Going to deal with shutdown accessibility service!");
|
||||
return gAccessibilityService;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_GetAccessibilityService(nsIAccessibilityService** aResult)
|
||||
{
|
||||
|
|
|
@ -84,6 +84,16 @@ public:
|
|||
*/
|
||||
static nsresult GetAccessibilityService(nsIAccessibilityService** aResult);
|
||||
|
||||
/**
|
||||
* Return cached accessibility service.
|
||||
*/
|
||||
static nsIAccessibilityService* GetAccessibilityService();
|
||||
|
||||
/**
|
||||
* Indicates whether accessibility service was shutdown.
|
||||
*/
|
||||
static PRBool gIsShutdown;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Return presentation shell, DOM node for the given frame.
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "nsRootAccessible.h"
|
||||
#include "nsAccessibilityAtoms.h"
|
||||
#include "nsAccessibleEventData.h"
|
||||
#include "nsIAccessibilityService.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsICommandManager.h"
|
||||
#include "nsIDocShell.h"
|
||||
|
@ -670,7 +670,7 @@ nsDocAccessible::Shutdown()
|
|||
// Remove from the cache after other parts of Shutdown(), so that Shutdown() procedures
|
||||
// can find the doc or root accessible in the cache if they need it.
|
||||
// We don't do this during ShutdownAccessibility() because that is already clearing the cache
|
||||
if (!gIsShuttingDownApp)
|
||||
if (!nsAccessibilityService::gIsShutdown)
|
||||
gGlobalDocAccessibleCache.Remove(static_cast<void*>(kungFuDeathGripDoc));
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -336,21 +336,33 @@ nsTextEquivUtils::AppendFromValue(nsIAccessible *aAccessible,
|
|||
NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessible> nextSibling;
|
||||
aAccessible->GetNextSibling(getter_AddRefs(nextSibling));
|
||||
if (nextSibling) {
|
||||
nsCOMPtr<nsIAccessible> parent;
|
||||
aAccessible->GetParent(getter_AddRefs(parent));
|
||||
if (parent) {
|
||||
nsCOMPtr<nsIAccessible> firstChild;
|
||||
parent->GetFirstChild(getter_AddRefs(firstChild));
|
||||
if (firstChild && firstChild != aAccessible) {
|
||||
nsresult rv = aAccessible->GetValue(text);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsRefPtr<nsAccessible> acc = nsAccUtils::QueryAccessible(aAccessible);
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
acc->GetDOMNode(getter_AddRefs(node));
|
||||
NS_ENSURE_STATE(node);
|
||||
|
||||
return AppendString(aString, text) ?
|
||||
NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(node));
|
||||
NS_ENSURE_STATE(content);
|
||||
|
||||
nsCOMPtr<nsIContent> parent = content->GetParent();
|
||||
PRInt32 indexOf = parent->IndexOf(content);
|
||||
|
||||
for (PRInt32 i = indexOf - 1; i >= 0; i--) {
|
||||
// check for preceding text...
|
||||
if (!parent->GetChildAt(i)->TextIsOnlyWhitespace()) {
|
||||
PRUint32 childCount = parent->GetChildCount();
|
||||
for (PRUint32 j = indexOf + 1; j < childCount; j++) {
|
||||
// .. and subsequent text
|
||||
if (!parent->GetChildAt(j)->TextIsOnlyWhitespace()) {
|
||||
nsresult rv = aAccessible->GetValue(text);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return AppendString(aString, text) ?
|
||||
NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -593,9 +593,8 @@ __try {
|
|||
|
||||
void nsAccessNodeWrap::InitAccessibility()
|
||||
{
|
||||
if (gIsAccessibilityActive) {
|
||||
return;
|
||||
}
|
||||
NS_ASSERTION(!gIsAccessibilityActive,
|
||||
"Accessibility was initialized already!");
|
||||
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
if (prefBranch) {
|
||||
|
@ -623,9 +622,7 @@ void nsAccessNodeWrap::ShutdownAccessibility()
|
|||
NS_IF_RELEASE(gTextEvent);
|
||||
::DestroyCaret();
|
||||
|
||||
if (!gIsAccessibilityActive) {
|
||||
return;
|
||||
}
|
||||
NS_ASSERTION(gIsAccessibilityActive, "Accessibility was shutdown already!");
|
||||
|
||||
nsAccessNode::ShutdownXPAccessibility();
|
||||
}
|
||||
|
|
|
@ -139,13 +139,13 @@
|
|||
|
||||
// textarea's name should have the value, which initially is specified by
|
||||
// a text child.
|
||||
testName("textareawithchild", "Story: Foo");
|
||||
testName("textareawithchild", "Story Foo is ended.");
|
||||
|
||||
// new textarea name should reflect the value change.
|
||||
var elem = document.getElementById("textareawithchild");
|
||||
elem.value = "Bar";
|
||||
|
||||
testName("textareawithchild", "Story: Bar");
|
||||
testName("textareawithchild", "Story Bar is ended.");
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// label with nested combobox (test for 'f' item of name computation guide)
|
||||
|
@ -153,6 +153,9 @@
|
|||
testName("comboinstart", "One day(s).");
|
||||
testName("combo3", "day(s).");
|
||||
|
||||
testName("textboxinstart", "Two days.");
|
||||
testName("textbox1", "days.");
|
||||
|
||||
testName("comboinmiddle", "Subscribe to ATOM feed.");
|
||||
testName("combo4", "Subscribe to ATOM feed.");
|
||||
|
||||
|
@ -163,6 +166,9 @@
|
|||
testName("comboinend", "This day was sunny");
|
||||
testName("combo6", "This day was");
|
||||
|
||||
testName("textboxinend", "This day was sunny");
|
||||
testName("textbox2", "This day was");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -345,13 +351,15 @@
|
|||
|
||||
<!-- A textarea nested in a label with a text child (bug #453371). -->
|
||||
<form>
|
||||
<label>Story:
|
||||
<label>Story
|
||||
<textarea id="textareawithchild" name="name">Foo</textarea>
|
||||
is ended.
|
||||
</label>
|
||||
</form>
|
||||
|
||||
<!-- a label with a nested control in the start, middle and end -->
|
||||
<form>
|
||||
<!-- at the start (without and with whitespaces) -->
|
||||
<label id="comboinstart"><select id="combo3">
|
||||
<option>One</option>
|
||||
<option>Two</option>
|
||||
|
@ -359,6 +367,12 @@
|
|||
day(s).
|
||||
</label>
|
||||
|
||||
<label id="textboxinstart">
|
||||
<input id="textbox1" value="Two">
|
||||
days.
|
||||
</label>
|
||||
|
||||
<!-- in the middle -->
|
||||
<label id="comboinmiddle">
|
||||
Subscribe to
|
||||
<select id="combo4" name="occupation">
|
||||
|
@ -377,12 +391,18 @@
|
|||
</label>
|
||||
<input id="checkbox" type="checkbox" />
|
||||
|
||||
<!-- at the end (without and with whitespaces) -->
|
||||
<label id="comboinend">
|
||||
This day was
|
||||
<select id="combo6" name="occupation">
|
||||
<option>sunny</option>
|
||||
<option>rainy</option>
|
||||
</select></label>
|
||||
|
||||
<label id="textboxinend">
|
||||
This day was
|
||||
<input id="textbox2" value="sunny">
|
||||
</label>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -885,6 +885,9 @@ pref("content.sink.interactive_time", 750000); /* default 750000 */
|
|||
pref("content.sink.initial_perf_time", 500000); /* default 2000000 */
|
||||
pref("content.sink.enable_perf_mode", 0); /* default 0; 0 == switch, 1 == stay interactive, 2 == stay perf */
|
||||
|
||||
// Write sessionstore.js less often
|
||||
pref("browser.sessionstore.interval", 60000);
|
||||
|
||||
#endif /* WINCE */
|
||||
|
||||
// Whether to use a panel that looks like an OS X sheet for customization
|
||||
|
|
|
@ -167,13 +167,11 @@
|
|||
<menuitem id="context-back"
|
||||
label="&backCmd.label;"
|
||||
accesskey="&backCmd.accesskey;"
|
||||
chromedir="&locale.dir;"
|
||||
command="Browser:BackOrBackDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="context-forward"
|
||||
label="&forwardCmd.label;"
|
||||
accesskey="&forwardCmd.accesskey;"
|
||||
chromedir="&locale.dir;"
|
||||
command="Browser:ForwardOrForwardDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="context-reload"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
%brandDTD;
|
||||
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
|
||||
%browserDTD;
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
<!ENTITY % globalRegionDTD SYSTEM "chrome://global-region/locale/region.dtd">
|
||||
%globalRegionDTD;
|
||||
<!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetOverlay.dtd" >
|
||||
|
|
|
@ -439,7 +439,7 @@
|
|||
label="&fullScreenCmd.label;"
|
||||
key="key_fullScreen"
|
||||
type="checkbox"
|
||||
command="View:FullScreen"/>
|
||||
observes="View:FullScreen"/>
|
||||
#endif
|
||||
<menuitem id="menu_showAllTabs"
|
||||
hidden="true"
|
||||
|
@ -474,7 +474,6 @@
|
|||
#else
|
||||
key="goBackKb"
|
||||
#endif
|
||||
chromedir="&locale.dir;"
|
||||
command="Browser:BackOrBackDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="historyMenuForward"
|
||||
|
@ -484,7 +483,6 @@
|
|||
#else
|
||||
key="goForwardKb"
|
||||
#endif
|
||||
chromedir="&locale.dir;"
|
||||
command="Browser:ForwardOrForwardDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="historyMenuHome"
|
||||
|
|
|
@ -432,9 +432,7 @@ var PlacesCommandHook = {
|
|||
if (starIcon && isElementVisible(starIcon)) {
|
||||
// Make sure the bookmark properties dialog hangs toward the middle of
|
||||
// the location bar in RTL builds
|
||||
var position = "after_end";
|
||||
if (gURLBar.getAttribute("chromedir") == "rtl")
|
||||
position = "after_start";
|
||||
var position = (getComputedStyle(gNavToolbox, "").direction == "rtl") ? 'after_start' : 'after_end';
|
||||
if (aShowEditUI)
|
||||
StarUI.showEditBookmarkPopup(itemId, starIcon, position);
|
||||
#ifdef ADVANCED_STARRING_UI
|
||||
|
@ -524,10 +522,7 @@ var PlacesCommandHook = {
|
|||
* A short description of the feed. Optional.
|
||||
*/
|
||||
addLiveBookmark: function PCH_addLiveBookmark(url, feedTitle, feedSubtitle) {
|
||||
var ios =
|
||||
Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var feedURI = ios.newURI(url, null, null);
|
||||
var feedURI = makeURI(url);
|
||||
|
||||
var doc = gBrowser.contentDocument;
|
||||
var title = (arguments.length > 1) ? feedTitle : doc.title;
|
||||
|
|
|
@ -266,8 +266,19 @@ var FullZoom = {
|
|||
|
||||
// location change observer
|
||||
|
||||
onLocationChange: function FullZoom_onLocationChange(aURI, aBrowser) {
|
||||
if (!aURI)
|
||||
/**
|
||||
* Called when the location of a tab changes.
|
||||
* When that happens, we need to update the current zoom level if appropriate.
|
||||
*
|
||||
* @param aURI
|
||||
* A URI object representing the new location.
|
||||
* @param aIsTabSwitch
|
||||
* Whether this location change has happened because of a tab switch.
|
||||
* @param aBrowser
|
||||
* (optional) browser object displaying the document
|
||||
*/
|
||||
onLocationChange: function FullZoom_onLocationChange(aURI, aIsTabSwitch, aBrowser) {
|
||||
if (!aURI || (aIsTabSwitch && !this.siteSpecific))
|
||||
return;
|
||||
this._applyPrefToSetting(this._cps.getPref(aURI, this.name), aBrowser);
|
||||
},
|
||||
|
@ -302,11 +313,6 @@ var FullZoom = {
|
|||
this._removePref();
|
||||
},
|
||||
|
||||
setSettingValue: function FullZoom_setSettingValue() {
|
||||
var value = this._cps.getPref(gBrowser.currentURI, this.name);
|
||||
this._applyPrefToSetting(value);
|
||||
},
|
||||
|
||||
/**
|
||||
* Set the zoom level for the current tab.
|
||||
*
|
||||
|
@ -329,12 +335,13 @@ var FullZoom = {
|
|||
_applyPrefToSetting: function FullZoom__applyPrefToSetting(aValue, aBrowser) {
|
||||
var browser = aBrowser || gBrowser.selectedBrowser;
|
||||
|
||||
if (!this.siteSpecific || gInPrintPreviewMode ||
|
||||
browser.contentDocument instanceof Ci.nsIImageDocument)
|
||||
return;
|
||||
var resetZoom = (!this.siteSpecific || gInPrintPreviewMode ||
|
||||
browser.contentDocument instanceof Ci.nsIImageDocument);
|
||||
|
||||
try {
|
||||
if (typeof aValue != "undefined")
|
||||
if (resetZoom)
|
||||
ZoomManager.setZoomForBrowser(browser, 1);
|
||||
else if (typeof aValue != "undefined")
|
||||
ZoomManager.setZoomForBrowser(browser, this._ensureValid(aValue));
|
||||
else if (typeof this.globalValue != "undefined")
|
||||
ZoomManager.setZoomForBrowser(browser, this.globalValue);
|
||||
|
|
|
@ -45,7 +45,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
|
|||
display: none;
|
||||
}
|
||||
|
||||
#feed-menu[chromedir="rtl"] > menuitem {
|
||||
#feed-menu:-moz-locale-dir(rtl) > menuitem {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
# Thomas K. Dyas <tdyas@zecador.org>
|
||||
# Edward Lee <edward.lee@engineering.uiuc.edu>
|
||||
# Paul O’Shannessy <paul@oshannessy.com>
|
||||
# Nils Maier <maierman@web.de>
|
||||
#
|
||||
# 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
|
||||
|
@ -1839,6 +1840,35 @@ function delayedOpenTab(aUrl, aReferrer, aCharset, aPostData, aAllowThirdPartyFi
|
|||
gBrowser.loadOneTab(aUrl, aReferrer, aCharset, aPostData, false, aAllowThirdPartyFixup);
|
||||
}
|
||||
|
||||
var gLastOpenDirectory = {
|
||||
_lastDir: null,
|
||||
get path() {
|
||||
if (!this._lastDir || !this._lastDir.exists()) {
|
||||
try {
|
||||
this._lastDir = gPrefService.getComplexValue("browser.open.lastDir",
|
||||
Ci.nsILocalFile);
|
||||
if (!this._lastDir.exists())
|
||||
this._lastDir = null;
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
return this._lastDir;
|
||||
},
|
||||
set path(val) {
|
||||
if (!val || !val.exists() || !val.isDirectory())
|
||||
return;
|
||||
this._lastDir = val.clone();
|
||||
|
||||
// Don't save the last open directory pref inside the Private Browsing mode
|
||||
if (!gPrivateBrowsingUI.privateBrowsingEnabled)
|
||||
gPrefService.setComplexValue("browser.open.lastDir", Ci.nsILocalFile,
|
||||
this._lastDir);
|
||||
},
|
||||
reset: function() {
|
||||
this._lastDir = null;
|
||||
}
|
||||
};
|
||||
|
||||
function BrowserOpenFileWindow()
|
||||
{
|
||||
// Get filepicker component.
|
||||
|
@ -1848,9 +1878,13 @@ function BrowserOpenFileWindow()
|
|||
fp.init(window, gNavigatorBundle.getString("openFile"), nsIFilePicker.modeOpen);
|
||||
fp.appendFilters(nsIFilePicker.filterAll | nsIFilePicker.filterText | nsIFilePicker.filterImages |
|
||||
nsIFilePicker.filterXML | nsIFilePicker.filterHTML);
|
||||
fp.displayDirectory = gLastOpenDirectory.path;
|
||||
|
||||
if (fp.show() == nsIFilePicker.returnOK)
|
||||
if (fp.show() == nsIFilePicker.returnOK) {
|
||||
if (fp.file && fp.file.exists())
|
||||
gLastOpenDirectory.path = fp.file.parent.QueryInterface(Ci.nsILocalFile);
|
||||
openTopWin(fp.fileURL.spec);
|
||||
}
|
||||
} catch (ex) {
|
||||
}
|
||||
}
|
||||
|
@ -2557,7 +2591,6 @@ function onExitPrintPreview()
|
|||
{
|
||||
// restore chrome to original state
|
||||
gInPrintPreviewMode = false;
|
||||
FullZoom.setSettingValue();
|
||||
toggleAffectedChrome(false);
|
||||
}
|
||||
|
||||
|
@ -2660,10 +2693,9 @@ var browserDragAndDrop = {
|
|||
var file = dt.mozGetDataAt("application/x-moz-file", 0);
|
||||
if (file) {
|
||||
var name = file instanceof Ci.nsIFile ? file.leafName : "";
|
||||
var ioService = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
var fileHandler = ioService.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
var fileHandler = ContentAreaUtils.ioService
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
return [fileHandler.getURLSpecFromFile(file), name];
|
||||
}
|
||||
|
||||
|
@ -2889,9 +2921,7 @@ const DOMLinkHandler = {
|
|||
break;
|
||||
|
||||
var targetDoc = link.ownerDocument;
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var uri = ios.newURI(link.href, targetDoc.characterSet, null);
|
||||
var uri = makeURI(link.href, targetDoc.characterSet);
|
||||
|
||||
if (gBrowser.isFailedIcon(uri))
|
||||
break;
|
||||
|
@ -3474,7 +3504,7 @@ var FullScreen =
|
|||
// show/hide all menubars, toolbars, and statusbars (except the full screen toolbar)
|
||||
this.showXULChrome("toolbar", window.fullScreen);
|
||||
this.showXULChrome("statusbar", window.fullScreen);
|
||||
document.getElementById("fullScreenItem").setAttribute("checked", !window.fullScreen);
|
||||
document.getElementById("View:FullScreen").setAttribute("checked", !window.fullScreen);
|
||||
|
||||
var fullScrToggler = document.getElementById("fullscr-toggler");
|
||||
if (!window.fullScreen) {
|
||||
|
@ -4231,7 +4261,7 @@ var XULBrowserWindow = {
|
|||
// simulate all change notifications after switching tabs
|
||||
onUpdateCurrentBrowser: function (aStateFlags, aStatus, aMessage, aTotalProgress) {
|
||||
if (FullZoom.updateBackgroundTabs)
|
||||
FullZoom.onLocationChange(gBrowser.currentURI);
|
||||
FullZoom.onLocationChange(gBrowser.currentURI, true);
|
||||
var nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
|
||||
var loadingDone = aStateFlags & nsIWebProgressListener.STATE_STOP;
|
||||
// use a pseudo-object instead of a (potentially non-existing) channel for getting
|
||||
|
@ -4298,7 +4328,7 @@ var TabsProgressListener = {
|
|||
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI) {
|
||||
// Filter out any sub-frame loads
|
||||
if (aBrowser.contentWindow == aWebProgress.DOMWindow)
|
||||
FullZoom.onLocationChange(aLocationURI, aBrowser);
|
||||
FullZoom.onLocationChange(aLocationURI, false, aBrowser);
|
||||
},
|
||||
|
||||
onStatusChange: function (aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
|
||||
|
@ -4422,10 +4452,7 @@ nsBrowserAccess.prototype =
|
|||
if (aURI) {
|
||||
if (aOpener) {
|
||||
location = aOpener.location;
|
||||
referrer =
|
||||
Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService)
|
||||
.newURI(location, null, null);
|
||||
referrer = makeURI(location);
|
||||
}
|
||||
newWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
|
@ -4442,10 +4469,7 @@ nsBrowserAccess.prototype =
|
|||
newWindow = aOpener.top;
|
||||
if (aURI) {
|
||||
location = aOpener.location;
|
||||
referrer =
|
||||
Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService)
|
||||
.newURI(location, null, null);
|
||||
referrer = makeURI(location);
|
||||
|
||||
newWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(nsIWebNavigation)
|
||||
|
@ -5418,11 +5442,8 @@ var OfflineApps = {
|
|||
if (!attr) return null;
|
||||
|
||||
try {
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
|
||||
var contentURI = ios.newURI(aWindow.location.href, null, null);
|
||||
return ios.newURI(attr, aWindow.document.characterSet, contentURI);
|
||||
var contentURI = makeURI(aWindow.location.href, null, null);
|
||||
return makeURI(attr, aWindow.document.characterSet, contentURI);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
|
@ -5623,11 +5644,8 @@ var OfflineApps = {
|
|||
if (!manifest)
|
||||
return;
|
||||
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
|
||||
var manifestURI = ios.newURI(manifest, aDocument.characterSet,
|
||||
aDocument.documentURIObject);
|
||||
var manifestURI = makeURI(manifest, aDocument.characterSet,
|
||||
aDocument.documentURIObject);
|
||||
|
||||
var updateService = Cc["@mozilla.org/offlinecacheupdate-service;1"].
|
||||
getService(Ci.nsIOfflineCacheUpdateService);
|
||||
|
@ -5640,9 +5658,7 @@ var OfflineApps = {
|
|||
{
|
||||
if (aTopic == "dom-storage-warn-quota-exceeded") {
|
||||
if (aSubject) {
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService).
|
||||
newURI(aSubject.location.href, null, null);
|
||||
var uri = makeURI(aSubject.location.href);
|
||||
|
||||
if (OfflineApps._checkUsage(uri)) {
|
||||
var browserWindow =
|
||||
|
@ -5668,19 +5684,13 @@ var OfflineApps = {
|
|||
|
||||
function WindowIsClosing()
|
||||
{
|
||||
var cn = gBrowser.tabContainer.childNodes;
|
||||
var numtabs = cn.length;
|
||||
var reallyClose =
|
||||
closeWindow(false,
|
||||
function () {
|
||||
return gBrowser.warnAboutClosingTabs(true);
|
||||
});
|
||||
|
||||
var reallyClose = closeWindow(false, warnAboutClosingWindow);
|
||||
if (!reallyClose)
|
||||
return false;
|
||||
|
||||
for (var i = 0; reallyClose && i < numtabs; ++i) {
|
||||
var ds = gBrowser.getBrowserForTab(cn[i]).docShell;
|
||||
var numBrowsers = gBrowser.browsers.length;
|
||||
for (let i = 0; reallyClose && i < numBrowsers; ++i) {
|
||||
let ds = gBrowser.browsers[i].docShell;
|
||||
|
||||
if (ds.contentViewer && !ds.contentViewer.permitUnload())
|
||||
reallyClose = false;
|
||||
|
@ -5689,6 +5699,49 @@ function WindowIsClosing()
|
|||
return reallyClose;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this is the last full *browser* window around. If it is, this will
|
||||
* be communicated like quitting. Otherwise, we warn about closing multiple tabs.
|
||||
* @returns true if closing can proceed, false if it got cancelled.
|
||||
*/
|
||||
function warnAboutClosingWindow() {
|
||||
// Popups aren't considered full browser windows.
|
||||
if (!toolbar.visible)
|
||||
return gBrowser.warnAboutClosingTabs(true);
|
||||
|
||||
// Figure out if there's at least one other browser window around.
|
||||
let foundOtherBrowserWindow = false;
|
||||
let wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
|
||||
let e = wm.getEnumerator("navigator:browser");
|
||||
while (e.hasMoreElements() && !foundOtherBrowserWindow) {
|
||||
let win = e.getNext();
|
||||
if (win != window && win.toolbar.visible)
|
||||
foundOtherBrowserWindow = true;
|
||||
}
|
||||
if (foundOtherBrowserWindow)
|
||||
return gBrowser.warnAboutClosingTabs(true);
|
||||
|
||||
let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
||||
|
||||
let closingCanceled = Cc["@mozilla.org/supports-PRBool;1"].
|
||||
createInstance(Ci.nsISupportsPRBool);
|
||||
os.notifyObservers(closingCanceled,
|
||||
"browser-lastwindow-close-requested", null);
|
||||
if (closingCanceled.data)
|
||||
return false;
|
||||
|
||||
os.notifyObservers(null, "browser-lastwindow-close-granted", null);
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// OS X doesn't quit the application when the last window is closed, but keeps
|
||||
// the session alive. Hence don't prompt users to save tabs, but warn about
|
||||
// closing multiple tabs.
|
||||
return gBrowser.warnAboutClosingTabs(true);
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
var MailIntegration = {
|
||||
sendLinkForWindow: function (aWindow) {
|
||||
this.sendMessage(aWindow.location.href,
|
||||
|
@ -5703,9 +5756,7 @@ var MailIntegration = {
|
|||
mailtoUrl += "&subject=" + encodeURIComponent(aSubject);
|
||||
}
|
||||
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var uri = ioService.newURI(mailtoUrl, null, null);
|
||||
var uri = makeURI(mailtoUrl);
|
||||
|
||||
// now pass this uri to the operating system
|
||||
this._launchExternalUrl(uri);
|
||||
|
@ -6647,9 +6698,7 @@ var gIdentityHandler = {
|
|||
|
||||
// Make sure the identity popup hangs toward the middle of the location bar
|
||||
// in RTL builds
|
||||
var position = 'after_start';
|
||||
if (gURLBar.getAttribute("chromedir") == "rtl")
|
||||
position = 'after_end';
|
||||
var position = (getComputedStyle(gNavToolbox, "").direction == "rtl") ? 'after_end' : 'after_start';
|
||||
|
||||
// Add the "open" attribute to the identity box for styling
|
||||
this._identityBox.setAttribute("open", "true");
|
||||
|
@ -6674,6 +6723,12 @@ let DownloadMonitorPanel = {
|
|||
_lastTime: Infinity,
|
||||
_listening: false,
|
||||
|
||||
get DownloadUtils() {
|
||||
delete this.DownloadUtils;
|
||||
Cu.import("resource://gre/modules/DownloadUtils.jsm", this);
|
||||
return this.DownloadUtils;
|
||||
},
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//// DownloadMonitorPanel Public Methods
|
||||
|
||||
|
@ -6681,9 +6736,6 @@ let DownloadMonitorPanel = {
|
|||
* Initialize the status panel and member variables
|
||||
*/
|
||||
init: function DMP_init() {
|
||||
// Load the modules to help display strings
|
||||
Cu.import("resource://gre/modules/DownloadUtils.jsm");
|
||||
|
||||
// Initialize "private" member variables
|
||||
this._panel = document.getElementById("download-monitor");
|
||||
|
||||
|
@ -6702,10 +6754,17 @@ let DownloadMonitorPanel = {
|
|||
gDownloadMgr.removeListener(this);
|
||||
},
|
||||
|
||||
inited: function DMP_inited() {
|
||||
return this._panel != null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Update status based on the number of active and paused downloads
|
||||
*/
|
||||
updateStatus: function DMP_updateStatus() {
|
||||
if (!this.inited())
|
||||
return;
|
||||
|
||||
let numActive = gDownloadMgr.activeDownloadCount;
|
||||
|
||||
// Hide the panel and reset the "last time" if there's no downloads
|
||||
|
@ -6735,7 +6794,8 @@ let DownloadMonitorPanel = {
|
|||
|
||||
// Get the remaining time string and last sec for time estimation
|
||||
let timeLeft;
|
||||
[timeLeft, this._lastTime] = DownloadUtils.getTimeLeft(maxTime, this._lastTime);
|
||||
[timeLeft, this._lastTime] =
|
||||
this.DownloadUtils.getTimeLeft(maxTime, this._lastTime);
|
||||
|
||||
// Figure out how many downloads are currently downloading
|
||||
let numDls = numActive - numPaused;
|
||||
|
@ -6912,6 +6972,10 @@ let gPrivateBrowsingUI = {
|
|||
docElement.getAttribute("titlemodifier_privatebrowsing"));
|
||||
docElement.setAttribute("browsingmode", "private");
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
DownloadMonitorPanel.updateStatus();
|
||||
}, 0);
|
||||
},
|
||||
|
||||
onExitPrivateBrowsing: function PBUI_onExitPrivateBrowsing() {
|
||||
|
@ -6946,6 +7010,12 @@ let gPrivateBrowsingUI = {
|
|||
.removeAttribute("disabled");
|
||||
|
||||
this._privateBrowsingAutoStarted = false;
|
||||
|
||||
gLastOpenDirectory.reset();
|
||||
|
||||
setTimeout(function () {
|
||||
DownloadMonitorPanel.updateStatus();
|
||||
}, 0);
|
||||
},
|
||||
|
||||
_setPBMenuTitle: function PBUI__setPBMenuTitle(aMode) {
|
||||
|
|
|
@ -104,17 +104,16 @@
|
|||
|
||||
<popupset id="mainPopupSet">
|
||||
<menupopup id="backForwardMenu"
|
||||
chromedir="&locale.dir;"
|
||||
onpopupshowing="return FillHistoryMenu(event.target);"
|
||||
oncommand="gotoHistoryIndex(event);"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
|
||||
|
||||
<!-- for search and content formfill/pw manager -->
|
||||
<panel type="autocomplete" chromedir="&locale.dir;" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
|
||||
<panel type="autocomplete" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
|
||||
|
||||
<!-- for url bar autocomplete -->
|
||||
<panel type="autocomplete-richlistbox" chromedir="&locale.dir;" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
|
||||
<panel type="autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
|
||||
|
||||
<panel id="editBookmarkPanel"
|
||||
orient="vertical"
|
||||
|
@ -205,8 +204,7 @@
|
|||
<!-- Popup for site identity information -->
|
||||
<panel id="identity-popup" position="after_start" hidden="true" noautofocus="true"
|
||||
onpopupshown="document.getElementById('identity-popup-more-info-button').focus();"
|
||||
level="top"
|
||||
chromedir="&locale.dir;">
|
||||
level="top">
|
||||
<hbox id="identity-popup-container" align="top">
|
||||
<image id="identity-popup-icon"/>
|
||||
<vbox id="identity-popup-content-box">
|
||||
|
@ -318,18 +316,16 @@
|
|||
<toolbaritem id="unified-back-forward-button" class="chromeclass-toolbar-additional"
|
||||
context="backForwardMenu">
|
||||
<toolbarbutton id="back-button" class="toolbarbutton-1"
|
||||
chromedir="&locale.dir;"
|
||||
label="&backCmd.label;"
|
||||
command="Browser:BackOrBackDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltiptext="&backButton.tooltip;"/>
|
||||
<toolbarbutton id="forward-button" class="toolbarbutton-1"
|
||||
chromedir="&locale.dir;"
|
||||
label="&forwardCmd.label;"
|
||||
command="Browser:ForwardOrForwardDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltiptext="&forwardButton.tooltip;"/>
|
||||
<toolbarbutton id="back-forward-dropmarker" type="menu" chromedir="&locale.dir;"
|
||||
<toolbarbutton id="back-forward-dropmarker" type="menu"
|
||||
disabled="true" tooltiptext="&backForwardMenu.tooltip;"
|
||||
onbroadcast="if (this.disabled) this.disabled =
|
||||
document.getElementById('Browser:Back').hasAttribute('disabled') &&
|
||||
|
@ -337,7 +333,6 @@
|
|||
<!-- bug 415444: event.stopPropagation is here for the cloned version of
|
||||
this menupopup -->
|
||||
<menupopup context=""
|
||||
chromedir="&locale.dir;"
|
||||
position="after_start"
|
||||
onpopupshowing="return FillHistoryMenu(event.target);"
|
||||
oncommand="gotoHistoryIndex(event); event.stopPropagation();"
|
||||
|
@ -374,7 +369,6 @@
|
|||
bookmarkemptytext="&urlbar.bookmark.emptyText;"
|
||||
historyemptytext="&urlbar.history.emptyText;"
|
||||
noneemptytext="&urlbar.none.emptyText;"
|
||||
chromedir="&locale.dir;"
|
||||
type="autocomplete"
|
||||
autocompletesearch="history"
|
||||
autocompletepopup="PopupAutoCompleteRichResult"
|
||||
|
@ -384,6 +378,7 @@
|
|||
showimagecolumn="true"
|
||||
enablehistory="true"
|
||||
maxrows="6"
|
||||
timeout="75"
|
||||
newlines="stripsurroundingwhitespace"
|
||||
oninput="gBrowser.userTypedValue = this.value;"
|
||||
ontextentered="this.handleCommand(param);"
|
||||
|
@ -398,7 +393,6 @@
|
|||
We only add the identity-box button to the tab order when the location bar
|
||||
has focus, otherwise pressing F6 focuses it instead of the location bar -->
|
||||
<box id="identity-box" role="button"
|
||||
chromedir="&locale.dir;"
|
||||
onclick="gIdentityHandler.handleIdentityButtonEvent(event);"
|
||||
onkeypress="gIdentityHandler.handleIdentityButtonEvent(event);">
|
||||
<hbox align="center">
|
||||
|
@ -418,13 +412,11 @@
|
|||
style="-moz-user-focus: none"
|
||||
class="plain urlbar-icon"
|
||||
id="feed-button"
|
||||
chromedir="&locale.dir;"
|
||||
collapsed="true"
|
||||
tooltiptext="&feedButton.tooltip;"
|
||||
onclick="return FeedHandler.onFeedButtonClick(event);">
|
||||
<menupopup position="after_end"
|
||||
id="feed-menu"
|
||||
chromedir="&locale.dir;"
|
||||
onpopupshowing="return FeedHandler.buildFeedList(this);"
|
||||
oncommand="return FeedHandler.subscribeToFeed(null, event);"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
|
@ -433,7 +425,6 @@
|
|||
class="urlbar-icon"
|
||||
onclick="PlacesStarButton.onClick(event);"/>
|
||||
<image id="go-button"
|
||||
chromedir="&locale.dir;"
|
||||
class="urlbar-icon"
|
||||
tooltiptext="&goEndCap.tooltip;"
|
||||
onclick="gURLBar.handleCommand(event);"/>
|
||||
|
@ -444,7 +435,7 @@
|
|||
<toolbaritem id="search-container" title="&searchItem.title;"
|
||||
align="center" class="chromeclass-toolbar-additional"
|
||||
flex="100" persist="width">
|
||||
<searchbar id="searchbar" flex="1" chromedir="&locale.dir;"/>
|
||||
<searchbar id="searchbar" flex="1"/>
|
||||
</toolbaritem>
|
||||
|
||||
<toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
|
@ -520,7 +511,13 @@
|
|||
label="&pasteCmd.label;"
|
||||
command="cmd_paste"
|
||||
tooltiptext="&pasteButton.tooltip;"/>
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
<toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
observes="View:FullScreen"
|
||||
type="checkbox"
|
||||
label="&fullScreenCmd.label;"
|
||||
tooltiptext="&fullScreenButton.tooltip;"/>
|
||||
#endif
|
||||
</toolbarpalette>
|
||||
|
||||
<toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
|
||||
|
|
|
@ -1182,10 +1182,8 @@ nsContextMenu.prototype = {
|
|||
},
|
||||
|
||||
getLinkURI: function() {
|
||||
var ioService = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
try {
|
||||
return ioService.newURI(this.linkURL, null, null);
|
||||
return makeURI(this.linkURL);
|
||||
}
|
||||
catch (ex) {
|
||||
// e.g. empty URL string
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
<label value="&openWhere.label;"/>
|
||||
<menulist id="openWhereList">
|
||||
<menupopup>
|
||||
<menuitem value="0" id="currentWindow" label="&topWindow.label;"/>
|
||||
<menuitem value="0" id="currentWindow" label="&topTab.label;"/>
|
||||
<menuitem value="1" label="&newWindow.label;"/>
|
||||
<menuitem value="3" label="&newTab.label;"/>
|
||||
</menupopup>
|
||||
|
|
|
@ -48,8 +48,6 @@
|
|||
<!DOCTYPE window [
|
||||
<!ENTITY % pageInfoDTD SYSTEM "chrome://browser/locale/pageInfo.dtd">
|
||||
%pageInfoDTD;
|
||||
<!ENTITY % global SYSTEM "chrome://global/locale/global.dtd">
|
||||
%global;
|
||||
]>
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
|
@ -117,8 +115,7 @@
|
|||
</menupopup>
|
||||
|
||||
<windowdragbox id="topBar" class="viewGroupWrapper">
|
||||
<radiogroup id="viewGroup" class="chromeclass-toolbar" orient="horizontal"
|
||||
chromedir="&locale.dir;">
|
||||
<radiogroup id="viewGroup" class="chromeclass-toolbar" orient="horizontal">
|
||||
<radio id="generalTab" label="&generalTab;" accesskey="&generalTab.accesskey;"
|
||||
oncommand="showTab('general');"/>
|
||||
<radio id="mediaTab" label="&mediaTab;" accesskey="&mediaTab.accesskey;"
|
||||
|
|
|
@ -111,7 +111,7 @@ function onOK() {
|
|||
try {
|
||||
if (document.getElementById("resetUserPrefs").checked)
|
||||
clearAllPrefs();
|
||||
if (document.getElementById("resetBookmarks").checked)
|
||||
if (document.getElementById("deleteBookmarks").checked)
|
||||
restoreDefaultBookmarks();
|
||||
if (document.getElementById("resetToolbars").checked)
|
||||
deleteLocalstore();
|
||||
|
@ -139,7 +139,7 @@ function onLoad() {
|
|||
function UpdateOKButtonState() {
|
||||
document.documentElement.getButton("accept").disabled =
|
||||
!document.getElementById("resetUserPrefs").checked &&
|
||||
!document.getElementById("resetBookmarks").checked &&
|
||||
!document.getElementById("deleteBookmarks").checked &&
|
||||
!document.getElementById("resetToolbars").checked &&
|
||||
!document.getElementById("disableAddons").checked &&
|
||||
!document.getElementById("restoreSearch").checked;
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
<vbox id="tasks">
|
||||
<checkbox id="disableAddons" label="&disableAddons.label;" accesskey="&disableAddons.accesskey;"/>
|
||||
<checkbox id="resetToolbars" label="&resetToolbars.label;" accesskey="&resetToolbars.accesskey;"/>
|
||||
<checkbox id="resetBookmarks" label="&resetBookmarks.label;" accesskey="&resetBookmarks.accesskey;"/>
|
||||
<checkbox id="deleteBookmarks" label="&deleteBookmarks.label;" accesskey="&deleteBookmarks.accesskey;"/>
|
||||
<checkbox id="resetUserPrefs" label="&resetUserPrefs.label;" accesskey="&resetUserPrefs.accesskey;"/>
|
||||
<checkbox id="restoreSearch" label="&restoreSearch.label;" accesskey="&restoreSearch.accesskey;"/>
|
||||
</vbox>
|
||||
|
|
|
@ -50,8 +50,6 @@
|
|||
<!DOCTYPE bindings [
|
||||
<!ENTITY % tabBrowserDTD SYSTEM "chrome://browser/locale/tabbrowser.dtd" >
|
||||
%tabBrowserDTD;
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
]>
|
||||
|
||||
<bindings id="tabBrowserBindings"
|
||||
|
@ -68,7 +66,7 @@
|
|||
<xul:stringbundle anonid="tbstringbundle" src="chrome://browser/locale/tabbrowser.properties"/>
|
||||
<xul:tabbox anonid="tabbox" flex="1" eventnode="document" xbl:inherits="handleCtrlPageUpDown"
|
||||
onselect="if (!('updateCurrentBrowser' in this.parentNode) || event.target.localName != 'tabpanels') return; this.parentNode.updateCurrentBrowser();">
|
||||
<xul:hbox class="tab-drop-indicator-bar" collapsed="true" chromedir="&locale.dir;"
|
||||
<xul:hbox class="tab-drop-indicator-bar" collapsed="true"
|
||||
ondragover="this.parentNode.parentNode._onDragOver(event);"
|
||||
ondragleave="this.parentNode.parentNode._onDragLeave(event);"
|
||||
ondrop="this.parentNode.parentNode._onDrop(event);">
|
||||
|
@ -622,17 +620,13 @@
|
|||
<body>
|
||||
<![CDATA[
|
||||
var browser = this.getBrowserForTab(aTab);
|
||||
browser.mIconURL = aURI;
|
||||
browser.mIconURL = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
|
||||
|
||||
if (aURI) {
|
||||
if (!(aURI instanceof Components.interfaces.nsIURI)) {
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
aURI = ios.newURI(aURI, null, null);
|
||||
}
|
||||
if (this.mFaviconService)
|
||||
this.mFaviconService.setAndLoadFaviconForPage(browser.currentURI,
|
||||
aURI, false);
|
||||
if (aURI && this.mFaviconService) {
|
||||
if (!(aURI instanceof Ci.nsIURI))
|
||||
aURI = makeURI(aURI);
|
||||
this.mFaviconService.setAndLoadFaviconForPage(browser.currentURI,
|
||||
aURI, false);
|
||||
}
|
||||
|
||||
this.updateIcon(aTab);
|
||||
|
@ -706,7 +700,7 @@
|
|||
req.image.height > sz)
|
||||
return;
|
||||
|
||||
this.setIcon(aTab, browser.currentURI.spec);
|
||||
this.setIcon(aTab, browser.currentURI);
|
||||
} catch (e) { }
|
||||
}
|
||||
}
|
||||
|
@ -725,14 +719,11 @@
|
|||
<parameter name="aURI"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!(aURI instanceof Components.interfaces.nsIURI)) {
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
aURI = ios.newURI(aURI, null, null);
|
||||
}
|
||||
|
||||
if (this.mFaviconService)
|
||||
if (this.mFaviconService) {
|
||||
if (!(aURI instanceof Ci.nsIURI))
|
||||
aURI = makeURI(aURI);
|
||||
return this.mFaviconService.isFailedFavicon(aURI);
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
|
@ -2819,8 +2810,7 @@
|
|||
onmousedown="_startScroll(-1);"
|
||||
onmouseover="_continueScroll(-1);"
|
||||
onmouseup="_stopScroll();"
|
||||
onmouseout="_pauseScroll();"
|
||||
chromedir="&locale.dir;"/>
|
||||
onmouseout="_pauseScroll();"/>
|
||||
<xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1" anonid="scrollbox">
|
||||
<children/>
|
||||
</xul:scrollbox>
|
||||
|
@ -2836,8 +2826,7 @@
|
|||
onmousedown="_startScroll(1);"
|
||||
onmouseover="_continueScroll(1);"
|
||||
onmouseup="_stopScroll();"
|
||||
onmouseout="_pauseScroll();"
|
||||
chromedir="&locale.dir;"/>
|
||||
onmouseout="_pauseScroll();"/>
|
||||
</xul:stack>
|
||||
</content>
|
||||
#endif
|
||||
|
@ -2858,7 +2847,7 @@
|
|||
</xul:stack>
|
||||
#endif
|
||||
<xul:arrowscrollbox anonid="arrowscrollbox" orient="horizontal" flex="1"
|
||||
style="min-width: 1px;" chromedir="&locale.dir;"
|
||||
style="min-width: 1px;"
|
||||
#ifndef XP_MACOSX
|
||||
clicktoscroll="true"
|
||||
#endif
|
||||
|
@ -2870,13 +2859,13 @@
|
|||
# button, necessary due to the previous hack.
|
||||
<children/>
|
||||
<xul:toolbarbutton class="tabs-newtab-button"
|
||||
command="cmd_newNavigatorTab" chromedir="&locale.dir;"
|
||||
command="cmd_newNavigatorTab"
|
||||
tooltiptext="&newTabButton.tooltip;"/>
|
||||
</xul:arrowscrollbox>
|
||||
<xul:toolbarbutton class="tabs-newtab-button" anonid="newtab-button"
|
||||
command="cmd_newNavigatorTab" chromedir="&locale.dir;"
|
||||
command="cmd_newNavigatorTab"
|
||||
tooltiptext="&newTabButton.tooltip;"/>
|
||||
<xul:stack align="center" pack="end" chromedir="&locale.dir;">
|
||||
<xul:stack align="center" pack="end">
|
||||
<xul:hbox flex="1" class="tabs-alltabs-box-animate" anonid="alltabs-box-animate"/>
|
||||
<xul:toolbarbutton class="tabs-alltabs-button" anonid="alltabs-button"
|
||||
type="menu"
|
||||
|
@ -2886,7 +2875,7 @@
|
|||
</xul:toolbarbutton>
|
||||
</xul:stack>
|
||||
<xul:toolbarbutton anonid="tabs-closebutton"
|
||||
class="close-button tabs-closebutton" chromedir="&locale.dir;"/>
|
||||
class="close-button tabs-closebutton"/>
|
||||
</xul:hbox>
|
||||
</xul:stack>
|
||||
</content>
|
||||
|
@ -3242,8 +3231,7 @@
|
|||
|
||||
<binding id="tabbrowser-tab" display="xul:hbox"
|
||||
extends="chrome://global/content/bindings/tabbox.xml#tab">
|
||||
<content chromedir="&locale.dir;"
|
||||
closetabtext="&closeTab.label;">
|
||||
<content closetabtext="&closeTab.label;">
|
||||
<xul:image xbl:inherits="validate,src=image" class="tab-icon-image"/>
|
||||
<xul:label flex="1" xbl:inherits="value=label,crop,accesskey" class="tab-text"/>
|
||||
<xul:toolbarbutton anonid="close-button" tabindex="-1" class="tab-close-button"/>
|
||||
|
|
|
@ -2,6 +2,8 @@ var gTestPage = "http://example.org/browser/browser/base/content/test/dummy_page
|
|||
var gTestImage = "http://example.org/browser/browser/base/content/test/moz.png";
|
||||
var gTab1, gTab2, gTab3;
|
||||
var gLevel;
|
||||
const kBack = 0;
|
||||
const kForward = 1;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
@ -53,10 +55,74 @@ function imageLoaded() {
|
|||
gBrowser.selectedTab = gTab1;
|
||||
zoomTest(gTab1, 1, "Zoom should still be 1 when tab with image is selected");
|
||||
|
||||
finishTest();
|
||||
executeSoon(imageZoomSwitch);
|
||||
}
|
||||
|
||||
function imageZoomSwitch() {
|
||||
navigate(kBack, function() {
|
||||
navigate(kForward, function() {
|
||||
zoomTest(gTab1, 1, "Tab 1 should not be zoomed when an image loads");
|
||||
gBrowser.selectedTab = gTab2;
|
||||
zoomTest(gTab1, 1, "Tab 1 should still not be zoomed when deselected");
|
||||
|
||||
// Mac OS X does not support print preview, so skip those tests
|
||||
let isOSX = ("nsILocalFileMac" in Components.interfaces);
|
||||
if (isOSX)
|
||||
finishTest();
|
||||
else
|
||||
runPrintPreviewTests();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function runPrintPreviewTests() {
|
||||
// test print preview on image document
|
||||
testPrintPreview(gTab1, function() {
|
||||
// test print preview on HTML document
|
||||
testPrintPreview(gTab2, function() {
|
||||
// test print preview on image document with siteSpecific set to false
|
||||
gPrefService.setBoolPref("browser.zoom.siteSpecific", false);
|
||||
testPrintPreview(gTab1, function() {
|
||||
// test print preview of HTML document with siteSpecific set to false
|
||||
testPrintPreview(gTab2, function() {
|
||||
gPrefService.clearUserPref("browser.zoom.siteSpecific");
|
||||
finishTest();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function testPrintPreview(aTab, aCallback) {
|
||||
gBrowser.selectedTab = aTab;
|
||||
FullZoom.enlarge();
|
||||
let level = ZoomManager.zoom;
|
||||
|
||||
function onEnterPP() {
|
||||
toggleAffectedChromeOrig.apply(null, arguments);
|
||||
|
||||
function onExitPP() {
|
||||
toggleAffectedChromeOrig.apply(null, arguments);
|
||||
toggleAffectedChrome = toggleAffectedChromeOrig;
|
||||
|
||||
zoomTest(aTab, level, "Toggling print preview mode should not affect zoom level");
|
||||
|
||||
FullZoom.reset();
|
||||
aCallback();
|
||||
}
|
||||
toggleAffectedChrome = onExitPP;
|
||||
PrintUtils.exitPrintPreview();
|
||||
}
|
||||
let toggleAffectedChromeOrig = toggleAffectedChrome;
|
||||
toggleAffectedChrome = onEnterPP;
|
||||
|
||||
let printPreview = new Function(document.getElementById("cmd_printPreview")
|
||||
.getAttribute("oncommand"));
|
||||
executeSoon(printPreview);
|
||||
}
|
||||
|
||||
function finishTest() {
|
||||
gBrowser.selectedTab = gTab1;
|
||||
FullZoom.reset();
|
||||
gBrowser.removeTab(gTab1);
|
||||
FullZoom.reset();
|
||||
|
@ -77,3 +143,14 @@ function load(tab, url, cb) {
|
|||
}, true);
|
||||
tab.linkedBrowser.loadURI(url);
|
||||
}
|
||||
|
||||
function navigate(direction, cb) {
|
||||
gBrowser.addEventListener("pageshow", function(event) {
|
||||
gBrowser.removeEventListener("pageshow", arguments.callee, true);
|
||||
setTimeout(cb, 0);
|
||||
}, true);
|
||||
if (direction == kBack)
|
||||
gBrowser.goBack();
|
||||
else if (direction == kForward)
|
||||
gBrowser.goForward();
|
||||
}
|
||||
|
|
|
@ -283,10 +283,8 @@
|
|||
if (val == this.value &&
|
||||
this.getAttribute("pageproxystate") == "valid") {
|
||||
let uri;
|
||||
let ioService = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
try {
|
||||
uri = ioService.newURI(val, null, null);
|
||||
uri = makeURI(val);
|
||||
} catch (e) {}
|
||||
|
||||
if (uri && !uri.schemeIs("javascript") && !uri.schemeIs("data")) {
|
||||
|
@ -387,10 +385,7 @@
|
|||
<setter>
|
||||
<![CDATA[
|
||||
try {
|
||||
let uri = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService).
|
||||
newURI(val, null, null);
|
||||
val = losslessDecodeURI(uri);
|
||||
val = losslessDecodeURI(makeURI(val));
|
||||
} catch (ex) { }
|
||||
this.value = val;
|
||||
|
||||
|
|
|
@ -47,8 +47,6 @@
|
|||
%browserDTD;
|
||||
<!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd">
|
||||
%textcontextDTD;
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
]>
|
||||
|
||||
<page id="webpanels-window"
|
||||
|
|
|
@ -2055,7 +2055,7 @@ MicrosummaryResource.prototype = {
|
|||
getService(Ci.nsICharsetResolver);
|
||||
if (resolver) {
|
||||
var charset = resolver.requestCharset(null, request.channel, {}, {});
|
||||
if (charset != "");
|
||||
if (charset != "")
|
||||
request.channel.contentCharset = charset;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -909,7 +909,6 @@ var Module = {
|
|||
registerType("image/bmp");
|
||||
registerType("image/x-icon");
|
||||
registerType("image/vnd.microsoft.icon");
|
||||
registerType("image/x-xbitmap");
|
||||
registerType("application/http-index-format");
|
||||
|
||||
var catMan = Components.classes["@mozilla.org/categorymanager;1"]
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
# Marco Bonardo <mak77@bonardo.net>
|
||||
# Dietrich Ayala <dietrich@mozilla.com>
|
||||
# Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||
# Nils Maier <maierman@web.de>
|
||||
#
|
||||
# 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
|
||||
|
@ -102,6 +103,12 @@ function BrowserGlue() {
|
|||
this._init();
|
||||
}
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
# OS X has the concept of zero-window sessions and therefore ignores the
|
||||
# browser-lastwindow-close-* topics.
|
||||
#define OBSERVE_LASTWINDOW_CLOSE_TOPICS 1
|
||||
#endif
|
||||
|
||||
BrowserGlue.prototype = {
|
||||
|
||||
_saveSession: false,
|
||||
|
@ -151,6 +158,17 @@ BrowserGlue.prototype = {
|
|||
// and history synchronization could fail.
|
||||
this._onProfileShutdown();
|
||||
break;
|
||||
#ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
|
||||
case "browser-lastwindow-close-requested":
|
||||
// The application is not actually quitting, but the last full browser
|
||||
// window is about to be closed.
|
||||
this._onQuitRequest(subject, "lastwindow");
|
||||
break;
|
||||
case "browser-lastwindow-close-granted":
|
||||
if (this._saveSession)
|
||||
this._setPrefToSaveSession();
|
||||
break;
|
||||
#endif
|
||||
case "session-save":
|
||||
this._setPrefToSaveSession();
|
||||
subject.QueryInterface(Ci.nsISupportsPRBool);
|
||||
|
@ -189,6 +207,10 @@ BrowserGlue.prototype = {
|
|||
osvr.addObserver(this, "browser:purge-session-history", false);
|
||||
osvr.addObserver(this, "quit-application-requested", false);
|
||||
osvr.addObserver(this, "quit-application-granted", false);
|
||||
#ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
|
||||
osvr.addObserver(this, "browser-lastwindow-close-requested", false);
|
||||
osvr.addObserver(this, "browser-lastwindow-close-granted", false);
|
||||
#endif
|
||||
osvr.addObserver(this, "session-save", false);
|
||||
osvr.addObserver(this, "places-init-complete", false);
|
||||
osvr.addObserver(this, "places-database-locked", false);
|
||||
|
@ -205,6 +227,10 @@ BrowserGlue.prototype = {
|
|||
osvr.removeObserver(this, "sessionstore-windows-restored");
|
||||
osvr.removeObserver(this, "browser:purge-session-history");
|
||||
osvr.removeObserver(this, "quit-application-requested");
|
||||
#ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
|
||||
osvr.removeObserver(this, "browser-lastwindow-close-requested");
|
||||
osvr.removeObserver(this, "browser-lastwindow-close-granted");
|
||||
#endif
|
||||
osvr.removeObserver(this, "quit-application-granted");
|
||||
osvr.removeObserver(this, "session-save");
|
||||
},
|
||||
|
@ -338,7 +364,6 @@ BrowserGlue.prototype = {
|
|||
if (!showPrompt || inPrivateBrowsing)
|
||||
return false;
|
||||
|
||||
var buttonChoice = 0;
|
||||
var quitBundle = this._bundleService.createBundle("chrome://browser/locale/quitDialog.properties");
|
||||
var brandBundle = this._bundleService.createBundle("chrome://branding/locale/brand.properties");
|
||||
|
||||
|
@ -377,9 +402,11 @@ BrowserGlue.prototype = {
|
|||
button2Title = quitBundle.GetStringFromName("quitTitle");
|
||||
}
|
||||
|
||||
buttonChoice = promptService.confirmEx(null, quitDialogTitle, message,
|
||||
flags, button0Title, button1Title, button2Title,
|
||||
neverAskText, neverAsk);
|
||||
var mostRecentBrowserWindow = wm.getMostRecentWindow("navigator:browser");
|
||||
var buttonChoice =
|
||||
promptService.confirmEx(mostRecentBrowserWindow, quitDialogTitle, message,
|
||||
flags, button0Title, button1Title, button2Title,
|
||||
neverAskText, neverAsk);
|
||||
|
||||
switch (buttonChoice) {
|
||||
case 2: // Quit
|
||||
|
@ -1090,8 +1117,9 @@ GeolocationPrompt.prototype = {
|
|||
var buttons = [{
|
||||
label: browserBundle.GetStringFromName("geolocation.shareLocation"),
|
||||
accessKey: browserBundle.GetStringFromName("geolocation.shareLocation.accesskey"),
|
||||
callback: function(notification) {
|
||||
if (notification.getElementsByClassName("rememberChoice")[0].checked)
|
||||
callback: function(notification) {
|
||||
var elements = notification.getElementsByClassName("rememberChoice");
|
||||
if (elements.length && elements[0].checked)
|
||||
setPagePermission(request.requestingURI, true);
|
||||
request.allow();
|
||||
},
|
||||
|
@ -1100,7 +1128,8 @@ GeolocationPrompt.prototype = {
|
|||
label: browserBundle.GetStringFromName("geolocation.dontShareLocation"),
|
||||
accessKey: browserBundle.GetStringFromName("geolocation.dontShareLocation.accesskey"),
|
||||
callback: function(notification) {
|
||||
if (notification.getElementsByClassName("rememberChoice")[0].checked)
|
||||
var elements = notification.getElementsByClassName("rememberChoice");
|
||||
if (elements.length && elements[0].checked)
|
||||
setPagePermission(request.requestingURI, false);
|
||||
request.cancel();
|
||||
},
|
||||
|
@ -1121,11 +1150,17 @@ GeolocationPrompt.prototype = {
|
|||
// bar.
|
||||
function geolocation_hacks_to_notification () {
|
||||
|
||||
var checkbox = newBar.ownerDocument.createElementNS(XULNS, "checkbox");
|
||||
checkbox.className = "rememberChoice";
|
||||
checkbox.setAttribute("label", browserBundle.GetStringFromName("geolocation.remember"));
|
||||
checkbox.setAttribute("accesskey", browserBundle.GetStringFromName("geolocation.remember.accesskey"));
|
||||
newBar.appendChild(checkbox);
|
||||
// Never show a remember checkbox inside the private browsing mode
|
||||
var inPrivateBrowsing = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService).
|
||||
privateBrowsingEnabled;
|
||||
if (!inPrivateBrowsing) {
|
||||
var checkbox = newBar.ownerDocument.createElementNS(XULNS, "checkbox");
|
||||
checkbox.className = "rememberChoice";
|
||||
checkbox.setAttribute("label", browserBundle.GetStringFromName("geolocation.remember"));
|
||||
checkbox.setAttribute("accesskey", browserBundle.GetStringFromName("geolocation.remember.accesskey"));
|
||||
newBar.appendChild(checkbox);
|
||||
}
|
||||
|
||||
var link = newBar.ownerDocument.createElementNS(XULNS, "label");
|
||||
link.className = "text-link";
|
||||
|
|
|
@ -154,7 +154,7 @@ PlacesController.prototype = {
|
|||
var result = this._view.getResult();
|
||||
if (result) {
|
||||
var container = asContainer(result.root);
|
||||
if (container.containerOpen && container.childCount > 0);
|
||||
if (container.containerOpen && container.childCount > 0)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE bindings [
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
]>
|
||||
|
||||
<bindings id="placesBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
|
|
|
@ -62,8 +62,6 @@
|
|||
%placesDTD;
|
||||
<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
|
||||
%editMenuOverlayDTD;
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
|
||||
%browserDTD;
|
||||
]>
|
||||
|
@ -187,24 +185,22 @@
|
|||
</popupset>
|
||||
|
||||
<toolbox id="placesToolbox">
|
||||
<toolbar class="chromeclass-toolbar" id="placesToolbar" align="center" chromedir="&locale.dir;">
|
||||
<toolbar class="chromeclass-toolbar" id="placesToolbar" align="center">
|
||||
<toolbarbutton id="back-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
command="OrganizerCommand:Back"
|
||||
tooltiptext="&backButton.tooltip;"
|
||||
chromedir="&locale.dir;"
|
||||
disabled="true"/>
|
||||
|
||||
<toolbarbutton id="forward-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
command="OrganizerCommand:Forward"
|
||||
tooltiptext="&forwardButton.tooltip;"
|
||||
chromedir="&locale.dir;"
|
||||
disabled="true"/>
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
<toolbarbutton type="menu" class="tabbable"
|
||||
onpopupshowing="document.getElementById('placeContent').focus()"
|
||||
#else
|
||||
<menubar id="placesMenu" chromedir="&locale.dir;">
|
||||
<menubar id="placesMenu">
|
||||
<menu accesskey="&organize.accesskey;" class="menu-iconic"
|
||||
#endif
|
||||
id="organizeButton" label="&organize.label;">
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
|
||||
|
||||
<!DOCTYPE bindings [
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd" >
|
||||
%globalDTD;
|
||||
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
|
||||
%browserDTD;
|
||||
]>
|
||||
|
@ -80,7 +78,6 @@
|
|||
mousethrough="never"
|
||||
collapsed="true"
|
||||
tooltiptext="&bookmarksToolbarChevron.tooltip;"
|
||||
chromedir="&locale.dir;"
|
||||
onpopupshowing="chevronPopupShowing(event);">
|
||||
<xul:menupopup anonid="chevronPopup"
|
||||
xbl:inherits="tooltip"
|
||||
|
|
|
@ -62,6 +62,7 @@ _BROWSER_TEST_FILES = \
|
|||
browser_library_middleclick.js \
|
||||
browser_library_views_liveupdate.js \
|
||||
browser_views_liveupdate.js \
|
||||
browser_sidebarpanels_click.js \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,206 @@
|
|||
/* ***** 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 Places test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ehsan Akhgari.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 test makes sure that the items in the bookmarks and history sidebar
|
||||
// panels are clickable in both LTR and RTL modes.
|
||||
|
||||
function test() {
|
||||
const BOOKMARKS_SIDEBAR_ID = "viewBookmarksSidebar";
|
||||
const BOOKMARKS_SIDEBAR_TREE_ID = "bookmarks-view";
|
||||
const HISTORY_SIDEBAR_ID = "viewHistorySidebar";
|
||||
const HISTORY_SIDEBAR_TREE_ID = "historyTree";
|
||||
|
||||
// Initialization.
|
||||
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
|
||||
getService(Ci.nsIWindowWatcher);
|
||||
let bs = PlacesUtils.bookmarks;
|
||||
let hs = PlacesUtils.history;
|
||||
let sidebarBox = document.getElementById("sidebar-box");
|
||||
let sidebar = document.getElementById("sidebar");
|
||||
waitForExplicitFinish();
|
||||
|
||||
// If a sidebar is already open, close it.
|
||||
if (!sidebarBox.hidden) {
|
||||
info("Unexpected sidebar found - a previous test failed to cleanup correctly");
|
||||
toggleSidebar();
|
||||
}
|
||||
|
||||
const TEST_URL = "javascript:alert(\"test\");";
|
||||
|
||||
let tests = [];
|
||||
tests.push({
|
||||
_itemID: null,
|
||||
init: function() {
|
||||
// Add a bookmark to the Unfiled Bookmarks folder.
|
||||
this._itemID = bs.insertBookmark(bs.unfiledBookmarksFolder,
|
||||
PlacesUtils._uri(TEST_URL),
|
||||
bs.DEFAULT_INDEX, "test");
|
||||
},
|
||||
prepare: function() {
|
||||
},
|
||||
selectNode: function(tree) {
|
||||
tree.selectItems([this._itemID]);
|
||||
},
|
||||
cleanup: function() {
|
||||
bs.removeFolderChildren(bs.unfiledBookmarksFolder);
|
||||
},
|
||||
sidebarName: BOOKMARKS_SIDEBAR_ID,
|
||||
treeName: BOOKMARKS_SIDEBAR_TREE_ID,
|
||||
desc: "Bookmarks sidebar test"
|
||||
});
|
||||
|
||||
tests.push({
|
||||
init: function() {
|
||||
// Add a history entry.
|
||||
this.cleanup();
|
||||
hs.addVisit(PlacesUtils._uri(TEST_URL), Date.now() * 1000,
|
||||
null, hs.TRANSITION_TYPED, false, 0);
|
||||
},
|
||||
prepare: function() {
|
||||
sidebar.contentDocument.getElementById("byvisited").doCommand();
|
||||
},
|
||||
selectNode: function(tree) {
|
||||
tree.selectNode(tree.view.nodeForTreeIndex(0));
|
||||
is(tree.selectedNode.uri, TEST_URL, "The correct visit has been selected");
|
||||
is(tree.selectedNode.itemId, -1, "The selected node is not bookmarked");
|
||||
},
|
||||
cleanup: function() {
|
||||
hs.QueryInterface(Ci.nsIBrowserHistory)
|
||||
.removeAllPages();
|
||||
},
|
||||
sidebarName: HISTORY_SIDEBAR_ID,
|
||||
treeName: HISTORY_SIDEBAR_TREE_ID,
|
||||
desc: "History sidebar test"
|
||||
});
|
||||
|
||||
let currentTest;
|
||||
|
||||
function testPlacesPanel(preFunc, postFunc) {
|
||||
currentTest.init();
|
||||
|
||||
sidebar.addEventListener("load", function() {
|
||||
sidebar.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
let doc = sidebar.contentDocument;
|
||||
let tree = doc.getElementById(currentTest.treeName);
|
||||
let tbo = tree.treeBoxObject;
|
||||
|
||||
executeSoon(function() {
|
||||
currentTest.prepare();
|
||||
if (preFunc)
|
||||
preFunc();
|
||||
|
||||
let observer = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic === "domwindowopened") {
|
||||
ww.unregisterNotification(this);
|
||||
let alertDialog = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
alertDialog.addEventListener("load", function() {
|
||||
alertDialog.removeEventListener("load", arguments.callee, false);
|
||||
info("alert dialog observed as expected");
|
||||
executeSoon(function() {
|
||||
alertDialog.close();
|
||||
toggleSidebar(currentTest.sidebarName);
|
||||
currentTest.cleanup();
|
||||
postFunc();
|
||||
});
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
ww.registerNotification(observer);
|
||||
|
||||
// Select the inserted places item.
|
||||
currentTest.selectNode(tree);
|
||||
is(tbo.view.selection.count, 1,
|
||||
"The test node should be successfully selected");
|
||||
// Get its row ID.
|
||||
let min = {}, max = {};
|
||||
tbo.view.selection.getRangeAt(0, min, max);
|
||||
let rowID = min.value;
|
||||
tbo.ensureRowIsVisible(rowID);
|
||||
|
||||
// Calculate the click coordinates.
|
||||
let x = {}, y = {}, width = {}, height = {};
|
||||
tbo.getCoordsForCellItem(rowID, tree.columns[0], "text",
|
||||
x, y, width, height);
|
||||
x = x.value + width.value / 2;
|
||||
y = y.value + height.value / 2;
|
||||
// Simulate the click.
|
||||
EventUtils.synthesizeMouse(tree.body, x, y, {}, doc.defaultView);
|
||||
// Now, wait for the domwindowopened observer to catch the alert dialog.
|
||||
// If something goes wrong, the test will time out at this stage.
|
||||
// Note that for the history sidebar, the URL itself is not opened,
|
||||
// and Places will show the load-js-data-url-error prompt as an alert
|
||||
// box, which means that the click actually worked, so it's good enough
|
||||
// for the purpose of this test.
|
||||
});
|
||||
}, true);
|
||||
toggleSidebar(currentTest.sidebarName);
|
||||
}
|
||||
|
||||
function changeSidebarDirection(aDirection) {
|
||||
document.getElementById("sidebar")
|
||||
.contentDocument
|
||||
.documentElement
|
||||
.style.direction = aDirection;
|
||||
}
|
||||
|
||||
function runNextTest() {
|
||||
if (tests.length == 0)
|
||||
finish();
|
||||
else {
|
||||
currentTest = tests.shift();
|
||||
testPlacesPanel(function() {
|
||||
changeSidebarDirection("ltr");
|
||||
info("Running " + currentTest.desc + " in LTR mode");
|
||||
}, function() {
|
||||
executeSoon(function() {
|
||||
testPlacesPanel(function() {
|
||||
// Run the test in RTL mode.
|
||||
changeSidebarDirection("rtl");
|
||||
info("Running " + currentTest.desc + " in RTL mode");
|
||||
}, function() {
|
||||
executeSoon(runNextTest);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
runNextTest();
|
||||
}
|
|
@ -45,17 +45,18 @@ include $(DEPTH)/config/autoconf.mk
|
|||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_CHROME_FILES = \
|
||||
perf_large_delete.xul \
|
||||
$(NULL)
|
||||
perf_large_delete.xul \
|
||||
$(NULL)
|
||||
|
||||
_BROWSER_TEST_FILES = \
|
||||
browser_ui_000_data.js\
|
||||
browser_ui_bookmarks_sidebar.js\
|
||||
browser_ui_history_sidebar.js\
|
||||
$(NULL)
|
||||
# XXX disabled tests, not working properly yet
|
||||
# browser_ui_history_menu.js\
|
||||
# browser_ui_locationbar.js\
|
||||
# browser_ui_history_menu.js
|
||||
# browser_ui_locationbar.js
|
||||
# XXX disabled tests, random failures
|
||||
# browser_ui_bookmarks_sidebar.js
|
||||
_BROWSER_TEST_FILES = \
|
||||
browser_ui_000_data.js \
|
||||
browser_ui_history_sidebar.js \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_CHROME_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
|
||||
|
|
|
@ -67,9 +67,14 @@ var observer = {
|
|||
}
|
||||
}
|
||||
};
|
||||
os.addObserver(observer, NS_PLACES_INIT_COMPLETE_TOPIC, false);
|
||||
|
||||
function run_test() {
|
||||
// XXX bug 507199
|
||||
// This test is temporarily disabled!
|
||||
return;
|
||||
|
||||
os.addObserver(observer, NS_PLACES_INIT_COMPLETE_TOPIC, false);
|
||||
|
||||
// Create bookmarks.html in the profile.
|
||||
create_bookmarks_html("bookmarks.glue.html");
|
||||
// Remove JSON backup from profile.
|
||||
|
|
|
@ -67,9 +67,14 @@ var observer = {
|
|||
}
|
||||
}
|
||||
};
|
||||
os.addObserver(observer, NS_PLACES_INIT_COMPLETE_TOPIC, false);
|
||||
|
||||
function run_test() {
|
||||
// XXX bug 507199
|
||||
// This test is temporarily disabled!
|
||||
return;
|
||||
|
||||
os.addObserver(observer, NS_PLACES_INIT_COMPLETE_TOPIC, false);
|
||||
|
||||
// Remove bookmarks.html from profile.
|
||||
remove_bookmarks_html();
|
||||
// Remove JSON backup from profile.
|
||||
|
|
|
@ -56,9 +56,8 @@ var gAdvancedPane = {
|
|||
advancedPrefs.selectedTab = document.getElementById(extraArgs["advancedTab"]);
|
||||
} else {
|
||||
var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex");
|
||||
if (preference.value === null)
|
||||
return;
|
||||
advancedPrefs.selectedIndex = preference.value;
|
||||
if (preference.value !== null)
|
||||
advancedPrefs.selectedIndex = preference.value;
|
||||
}
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
|
|
|
@ -123,6 +123,9 @@ PrivateBrowsingService.prototype = {
|
|||
// Whether the private browsing mode has been started automatically
|
||||
_autoStarted: false,
|
||||
|
||||
// List of view source window URIs for restoring later
|
||||
_viewSrcURLs: [],
|
||||
|
||||
// XPCOM registration
|
||||
classDescription: "PrivateBrowsing Service",
|
||||
contractID: "@mozilla.org/privatebrowsing;1",
|
||||
|
@ -177,6 +180,22 @@ PrivateBrowsingService.prototype = {
|
|||
|
||||
this._closePageInfoWindows();
|
||||
|
||||
// save view-source windows URIs and close them
|
||||
let viewSrcWindowsEnum = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator).
|
||||
getEnumerator("navigator:view-source");
|
||||
while (viewSrcWindowsEnum.hasMoreElements()) {
|
||||
let win = viewSrcWindowsEnum.getNext();
|
||||
if (this._inPrivateBrowsing) {
|
||||
let plainURL = win.getBrowser().currentURI.spec;
|
||||
if (plainURL.indexOf("view-source:") == 0) {
|
||||
plainURL = plainURL.substr(12);
|
||||
this._viewSrcURLs.push(plainURL);
|
||||
}
|
||||
}
|
||||
win.close();
|
||||
}
|
||||
|
||||
if (!this._quitting && this._saveSession) {
|
||||
let browserWindow = this._getBrowserWindow();
|
||||
|
||||
|
@ -215,6 +234,28 @@ PrivateBrowsingService.prototype = {
|
|||
this._savedBrowserState = null;
|
||||
|
||||
this._closePageInfoWindows();
|
||||
|
||||
// re-open all view-source windows
|
||||
let windowWatcher = Cc["@mozilla.org/embedcomp/window-watcher;1"].
|
||||
getService(Ci.nsIWindowWatcher);
|
||||
this._viewSrcURLs.forEach(function(uri) {
|
||||
let args = Cc["@mozilla.org/supports-array;1"].
|
||||
createInstance(Ci.nsISupportsArray);
|
||||
let str = Cc["@mozilla.org/supports-string;1"].
|
||||
createInstance(Ci.nsISupportsString);
|
||||
str.data = uri;
|
||||
args.AppendElement(str);
|
||||
args.AppendElement(null); // charset
|
||||
args.AppendElement(null); // page descriptor
|
||||
args.AppendElement(null); // line number
|
||||
let forcedCharset = Cc["@mozilla.org/supports-PRBool;1"].
|
||||
createInstance(Ci.nsISupportsPRBool);
|
||||
forcedCharset.data = false;
|
||||
args.AppendElement(forcedCharset);
|
||||
windowWatcher.openWindow(null, "chrome://global/content/viewSource.xul",
|
||||
"_blank", "all,dialog=no", args);
|
||||
});
|
||||
this._viewSrcURLs = [];
|
||||
}
|
||||
else {
|
||||
// otherwise, if we have transitioned into private browsing mode, load
|
||||
|
|
|
@ -45,22 +45,30 @@ include $(DEPTH)/config/autoconf.mk
|
|||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_BROWSER_TEST_FILES = \
|
||||
browser_privatebrowsing_ui.js \
|
||||
browser_console_clear.js \
|
||||
browser_privatebrowsing_theming.js \
|
||||
browser_privatebrowsing_searchbar.js \
|
||||
browser_privatebrowsing_findbar.js \
|
||||
browser_privatebrowsing_zoom.js \
|
||||
browser_privatebrowsing_transition.js \
|
||||
browser_privatebrowsing_import.js \
|
||||
browser_privatebrowsing_certexceptionsui.js \
|
||||
browser_privatebrowsing_crh.js \
|
||||
browser_privatebrowsing_downloadmonitor.js \
|
||||
browser_privatebrowsing_findbar.js \
|
||||
browser_privatebrowsing_forgetthissite.js \
|
||||
browser_privatebrowsing_geoprompt.js \
|
||||
browser_privatebrowsing_geoprompt_page.html \
|
||||
browser_privatebrowsing_import.js \
|
||||
browser_privatebrowsing_opendir.js \
|
||||
browser_privatebrowsing_pageinfo.js \
|
||||
browser_privatebrowsing_popupmode.js \
|
||||
browser_privatebrowsing_searchbar.js \
|
||||
browser_privatebrowsing_sslsite_transition.js \
|
||||
browser_privatebrowsing_theming.js \
|
||||
browser_privatebrowsing_transition.js \
|
||||
browser_privatebrowsing_ui.js \
|
||||
browser_privatebrowsing_urlbarfocus.js \
|
||||
browser_privatebrowsing_viewsource.js \
|
||||
browser_privatebrowsing_windowtitle.js \
|
||||
browser_privatebrowsing_windowtitle_page.html \
|
||||
browser_privatebrowsing_urlbarfocus.js \
|
||||
browser_privatebrowsing_forgetthissite.js \
|
||||
browser_privatebrowsing_pageinfo.js \
|
||||
browser_privatebrowsing_sslsite_transition.js \
|
||||
browser_privatebrowsing_popupmode.js \
|
||||
browser_privatebrowsing_zoom.js \
|
||||
browser_privatebrowsing_zoomrestore.js \
|
||||
staller.sjs \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
/* ***** 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 Private Browsing Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ehsan Akhgari.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 test makes sure that certificate exceptions UI behaves correctly
|
||||
// inside the private browsing mode, based on whether it's opened from the prefs
|
||||
// window or from the SSL error page (see bug 461627).
|
||||
|
||||
function test() {
|
||||
// initialization
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
|
||||
getService(Ci.nsIWindowWatcher);
|
||||
|
||||
const EXCEPTIONS_DLG_URL = 'chrome://pippki/content/exceptionDialog.xul';
|
||||
const EXCEPTIONS_DLG_FEATURES = 'chrome,centerscreen,modal';
|
||||
const INVALID_CERT_LOCATION = 'https://nocert.example.com/';
|
||||
waitForExplicitFinish();
|
||||
|
||||
// enter private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
|
||||
let testCheckbox;
|
||||
let obs = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
// unregister ourself
|
||||
ww.unregisterNotification(this);
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
|
||||
win.addEventListener("load", function() {
|
||||
win.removeEventListener("load", arguments.callee, false);
|
||||
testCheckbox(win.document.defaultView);
|
||||
}, false);
|
||||
}
|
||||
};
|
||||
|
||||
step1();
|
||||
|
||||
// Test the certificate exceptions dialog as it is invoked from about:certerror
|
||||
function step1() {
|
||||
ww.registerNotification(obs);
|
||||
let params = {
|
||||
exceptionAdded : false,
|
||||
location: INVALID_CERT_LOCATION,
|
||||
handlePrivateBrowsing : true,
|
||||
prefetchCert: true,
|
||||
};
|
||||
testCheckbox = function(win) {
|
||||
let obsSvc = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
obsSvc.addObserver({
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
obsSvc.removeObserver(this, "cert-exception-ui-ready", false);
|
||||
ok(win.gCert, "The certificate information should be available now");
|
||||
|
||||
let checkbox = win.document.getElementById("permanent");
|
||||
ok(checkbox.hasAttribute("disabled"),
|
||||
"the permanent checkbox should be disabled when handling the private browsing mode");
|
||||
ok(!checkbox.hasAttribute("checked"),
|
||||
"the permanent checkbox should not be checked when handling the private browsing mode");
|
||||
win.close();
|
||||
step2();
|
||||
}
|
||||
}, "cert-exception-ui-ready", false);
|
||||
};
|
||||
window.openDialog(EXCEPTIONS_DLG_URL, '', EXCEPTIONS_DLG_FEATURES, params);
|
||||
}
|
||||
|
||||
// Test the certificate excetions dialog as it is invoked from the Preferences dialog
|
||||
function step2() {
|
||||
ww.registerNotification(obs);
|
||||
let params = {
|
||||
exceptionAdded : false,
|
||||
location: INVALID_CERT_LOCATION,
|
||||
prefetchCert: true,
|
||||
};
|
||||
testCheckbox = function(win) {
|
||||
let obsSvc = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
obsSvc.addObserver({
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
obsSvc.removeObserver(this, "cert-exception-ui-ready", false);
|
||||
ok(win.gCert, "The certificate information should be available now");
|
||||
|
||||
let checkbox = win.document.getElementById("permanent");
|
||||
ok(!checkbox.hasAttribute("disabled"),
|
||||
"the permanent checkbox should not be disabled when not handling the private browsing mode");
|
||||
ok(checkbox.hasAttribute("checked"),
|
||||
"the permanent checkbox should be checked when not handling the private browsing mode");
|
||||
win.close();
|
||||
cleanup();
|
||||
}
|
||||
}, "cert-exception-ui-ready", false);
|
||||
};
|
||||
window.openDialog(EXCEPTIONS_DLG_URL, '', EXCEPTIONS_DLG_FEATURES, params);
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
// leave the private browsing mode
|
||||
pb.privateBrowsingEnabled = false;
|
||||
finish();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,168 @@
|
|||
/* ***** 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 Private Browsing Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ehsan Akhgari.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 test makes sure that the download monitor status bar panel is correctly
|
||||
// cleared when switching the private browsing mode on or off.
|
||||
|
||||
function test() {
|
||||
// initialization
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
let dm = Cc["@mozilla.org/download-manager;1"].
|
||||
getService(Ci.nsIDownloadManager);
|
||||
if (!gDownloadMgr)
|
||||
gDownloadMgr = dm;
|
||||
let iosvc = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
let panel = document.getElementById("download-monitor");
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Add a new download
|
||||
addDownload(dm, {
|
||||
resultFileName: "pbtest-1",
|
||||
downloadName: "PB Test 1"
|
||||
});
|
||||
|
||||
// Make sure that the download is being displayed in the monitor panel
|
||||
if (!DownloadMonitorPanel.inited())
|
||||
DownloadMonitorPanel.init();
|
||||
else
|
||||
DownloadMonitorPanel.updateStatus();
|
||||
ok(!panel.hidden, "The download panel should be successfully added initially");
|
||||
|
||||
// Enter the private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
|
||||
setTimeout(function () {
|
||||
ok(panel.hidden, "The download panel should be hidden when entering the private browsing mode");
|
||||
|
||||
// Add a new download
|
||||
let file = addDownload(dm, {
|
||||
resultFileName: "pbtest-2",
|
||||
downloadName: "PB Test 2"
|
||||
}).targetFile;
|
||||
|
||||
// Update the panel
|
||||
DownloadMonitorPanel.updateStatus();
|
||||
|
||||
// Make sure that the panel is visible
|
||||
ok(!panel.hidden, "The download panel should show up when a new download is added");
|
||||
|
||||
// Exit the private browsing mode
|
||||
pb.privateBrowsingEnabled = false;
|
||||
|
||||
setTimeout(function () {
|
||||
ok(panel.hidden, "The download panel should be hidden when leaving the private browsing mode");
|
||||
|
||||
// cleanup
|
||||
let dls = dm.activeDownloads;
|
||||
while (dls.hasMoreElements()) {
|
||||
let dl = dls.getNext().QueryInterface(Ci.nsIDownload);
|
||||
dm.removeDownload(dl.id);
|
||||
let file = dl.targetFile;
|
||||
if (file.exists())
|
||||
file.remove(false);
|
||||
}
|
||||
if (file.exists())
|
||||
file.remove(false);
|
||||
|
||||
finish();
|
||||
}, 0);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a download to the DM, and starts it.
|
||||
* (Copied from toolkit/componentns/downloads/test/unit/head_download_manager.js)
|
||||
* @param aParams (optional): an optional object which contains the function
|
||||
* parameters:
|
||||
* resultFileName: leaf node for the target file
|
||||
* targetFile: nsIFile for the target (overrides resultFileName)
|
||||
* sourceURI: the download source URI
|
||||
* downloadName: the display name of the download
|
||||
* runBeforeStart: a function to run before starting the download
|
||||
*/
|
||||
function addDownload(dm, aParams)
|
||||
{
|
||||
if (!aParams)
|
||||
aParams = {};
|
||||
if (!("resultFileName" in aParams))
|
||||
aParams.resultFileName = "download.result";
|
||||
if (!("targetFile" in aParams)) {
|
||||
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Ci.nsIProperties);
|
||||
aParams.targetFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
aParams.targetFile.append(aParams.resultFileName);
|
||||
}
|
||||
if (!("sourceURI" in aParams))
|
||||
aParams.sourceURI = "http://localhost:8888/browser/browser/components/privatebrowsing/test/browser/staller.sjs";
|
||||
if (!("downloadName" in aParams))
|
||||
aParams.downloadName = null;
|
||||
if (!("runBeforeStart" in aParams))
|
||||
aParams.runBeforeStart = function () {};
|
||||
|
||||
const nsIWBP = Ci.nsIWebBrowserPersist;
|
||||
let persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
|
||||
.createInstance(Ci.nsIWebBrowserPersist);
|
||||
persist.persistFlags = nsIWBP.PERSIST_FLAGS_REPLACE_EXISTING_FILES |
|
||||
nsIWBP.PERSIST_FLAGS_BYPASS_CACHE |
|
||||
nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
|
||||
|
||||
let dl = dm.addDownload(Ci.nsIDownloadManager.DOWNLOAD_TYPE_DOWNLOAD,
|
||||
createURI(aParams.sourceURI),
|
||||
createURI(aParams.targetFile), aParams.downloadName, null,
|
||||
Math.round(Date.now() * 1000), null, persist);
|
||||
|
||||
// This will throw if it isn't found, and that would mean test failure, so no
|
||||
// try catch block
|
||||
let test = dm.getDownload(dl.id);
|
||||
|
||||
aParams.runBeforeStart.call(undefined, dl);
|
||||
|
||||
persist.progressListener = dl.QueryInterface(Ci.nsIWebProgressListener);
|
||||
persist.saveURI(dl.source, null, null, null, null, dl.targetFile);
|
||||
|
||||
return dl;
|
||||
}
|
||||
|
||||
function createURI(aObj)
|
||||
{
|
||||
let ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
return (aObj instanceof Ci.nsIFile) ? ios.newFileURI(aObj) :
|
||||
ios.newURI(aObj, null, null);
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
/* ***** 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 Private Browsing Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ehsan Akhgari.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 test makes sure that the geolocation prompt does not show a remember
|
||||
// control inside the private browsing mode.
|
||||
|
||||
function test() {
|
||||
// initialization
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
const testPageURL = "http://localhost:8888/browser/" +
|
||||
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt_page.html";
|
||||
waitForExplicitFinish();
|
||||
|
||||
let pageTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = pageTab;
|
||||
let pageBrowser = gBrowser.getBrowserForTab(pageTab);
|
||||
pageBrowser.addEventListener("load", function () {
|
||||
pageBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
setTimeout(function() {
|
||||
// Make sure the notification is correctly displayed with a remember control
|
||||
let notificationBox = gBrowser.getNotificationBox(pageBrowser);
|
||||
let notification = notificationBox.getNotificationWithValue("geolocation");
|
||||
ok(notification, "Notification box should be displaying outside of private browsing mode");
|
||||
is(notification.getElementsByClassName("rememberChoice").length, 1,
|
||||
"The remember control must be displayed outside of private browsing mode");
|
||||
notificationBox.currentNotification.close();
|
||||
|
||||
gBrowser.removeTab(pageTab);
|
||||
|
||||
// enter the private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
|
||||
pageTab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = pageTab;
|
||||
pageBrowser = gBrowser.getBrowserForTab(pageTab);
|
||||
pageBrowser.addEventListener("load", function () {
|
||||
pageBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
setTimeout(function() {
|
||||
// Make sure the notification is correctly displayed without a remember control
|
||||
let notificationBox = gBrowser.getNotificationBox(pageBrowser);
|
||||
let notification = notificationBox.getNotificationWithValue("geolocation");
|
||||
ok(notification, "Notification box should be displaying outside of private browsing mode");
|
||||
is(notification.getElementsByClassName("rememberChoice").length, 0,
|
||||
"The remember control must not be displayed inside of private browsing mode");
|
||||
notificationBox.currentNotification.close();
|
||||
|
||||
gBrowser.removeTab(pageTab);
|
||||
|
||||
// cleanup
|
||||
pb.privateBrowsingEnabled = false;
|
||||
finish();
|
||||
}, 100); // remember control is added in a setTimeout(0) call
|
||||
}, true);
|
||||
pageBrowser.contentWindow.location = testPageURL;
|
||||
}, 100); // remember control is added in a setTimeout(0) call
|
||||
}, true);
|
||||
pageBrowser.contentWindow.location = testPageURL;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Geolocation invoker</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
navigator.geolocation.getCurrentPosition(function (pos) {
|
||||
// ignore
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,142 @@
|
|||
/* ***** 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 Private Browsing Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ehsan Akhgari.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 test makes sure that the last open directory used inside the private
|
||||
// browsing mode is not remembered after leaving that mode.
|
||||
|
||||
function test() {
|
||||
// initialization
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
let ds = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Ci.nsIProperties);
|
||||
let dir1 = ds.get("ProfD", Ci.nsIFile);
|
||||
let dir2 = ds.get("TmpD", Ci.nsIFile);
|
||||
let file = dir2.clone();
|
||||
file.append("pbtest.file");
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600);
|
||||
|
||||
const kPrefName = "browser.open.lastDir";
|
||||
|
||||
function setupCleanSlate() {
|
||||
gLastOpenDirectory.reset();
|
||||
gPrefService.clearUserPref(kPrefName);
|
||||
}
|
||||
|
||||
setupCleanSlate();
|
||||
|
||||
// Test 1: general workflow test
|
||||
|
||||
// initial checks
|
||||
ok(!gLastOpenDirectory.path,
|
||||
"Last open directory path should be initially empty");
|
||||
gLastOpenDirectory.path = dir2;
|
||||
is(gLastOpenDirectory.path.path, dir2.path,
|
||||
"The path should be successfully set");
|
||||
gLastOpenDirectory.path = null;
|
||||
is(gLastOpenDirectory.path.path, dir2.path,
|
||||
"The path should be not change when assigning it to null");
|
||||
gLastOpenDirectory.path = dir1;
|
||||
is(gLastOpenDirectory.path.path, dir1.path,
|
||||
"The path should be successfully outside of the private browsing mode");
|
||||
|
||||
// enter private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
|
||||
is(gLastOpenDirectory.path.path, dir1.path,
|
||||
"The path should not change when entering the private browsing mode");
|
||||
gLastOpenDirectory.path = dir2;
|
||||
is(gLastOpenDirectory.path.path, dir2.path,
|
||||
"The path should successfully change inside the private browsing mode");
|
||||
|
||||
// leave private browsing mode
|
||||
pb.privateBrowsingEnabled = false;
|
||||
|
||||
is(gLastOpenDirectory.path.path, dir1.path,
|
||||
"The path should be reset to the same path as before entering the private browsing mode");
|
||||
|
||||
setupCleanSlate();
|
||||
|
||||
// Test 2: the user first tries to open a file inside the private browsing mode
|
||||
|
||||
pb.privateBrowsingEnabled = true;
|
||||
ok(!gLastOpenDirectory.path,
|
||||
"No original path should exist inside the private browsing mode");
|
||||
gLastOpenDirectory.path = dir1;
|
||||
is(gLastOpenDirectory.path.path, dir1.path,
|
||||
"The path should be successfully set inside the private browsing mode");
|
||||
pb.privateBrowsingEnabled = false;
|
||||
ok(!gLastOpenDirectory.path,
|
||||
"The path set inside the private browsing mode should not leak when leaving that mode");
|
||||
|
||||
setupCleanSlate();
|
||||
|
||||
// Test 3: the last open directory is set from a previous session, it should be used
|
||||
// in normal mode
|
||||
|
||||
gPrefService.setComplexValue(kPrefName, Ci.nsILocalFile, dir1);
|
||||
is(gLastOpenDirectory.path.path, dir1.path,
|
||||
"The pref set from last session should take effect outside the private browsing mode");
|
||||
|
||||
setupCleanSlate();
|
||||
|
||||
// Test 4: the last open directory is set from a previous session, it should be used
|
||||
// in private browsing mode mode
|
||||
|
||||
gPrefService.setComplexValue(kPrefName, Ci.nsILocalFile, dir1);
|
||||
pb.privateBrowsingEnabled = true;
|
||||
is(gLastOpenDirectory.path.path, dir1.path,
|
||||
"The pref set from last session should take effect inside the private browsing mode");
|
||||
pb.privateBrowsingEnabled = false;
|
||||
is(gLastOpenDirectory.path.path, dir1.path,
|
||||
"The pref set from last session should remain in effect after leaving the private browsing mode");
|
||||
|
||||
setupCleanSlate();
|
||||
|
||||
// Test 5: setting the path to a file shouldn't work
|
||||
|
||||
gLastOpenDirectory.path = file;
|
||||
ok(!gLastOpenDirectory.path,
|
||||
"Setting the path to a file shouldn't work when it's originally null");
|
||||
gLastOpenDirectory.path = dir1;
|
||||
gLastOpenDirectory.path = file;
|
||||
is(gLastOpenDirectory.path.path, dir1.path,
|
||||
"Setting the path to a file shouldn't work when it's not originally null");
|
||||
|
||||
// cleanup
|
||||
file.remove(false);
|
||||
}
|
|
@ -0,0 +1,197 @@
|
|||
/* ***** 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 Private Browsing Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ehsan Akhgari.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 test makes sure that entering the private browsing mode closes
|
||||
// all view source windows, and leaving it restores them
|
||||
|
||||
function test() {
|
||||
// initialization
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tabAbout = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tabAbout;
|
||||
let aboutBrowser = gBrowser.getBrowserForTab(tabAbout);
|
||||
aboutBrowser.addEventListener("load", function () {
|
||||
aboutBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
|
||||
getService(Ci.nsIWindowWatcher);
|
||||
let observer = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "domwindowopened") {
|
||||
ww.unregisterNotification(this);
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
|
||||
win.addEventListener("load", function() {
|
||||
win.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
let browser = win.document.defaultView.getBrowser();
|
||||
browser.addEventListener("load", function() {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
// view source window is loaded, proceed with the rest of the test
|
||||
step1();
|
||||
}, true);
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
ww.registerNotification(observer);
|
||||
|
||||
openViewSource();
|
||||
|
||||
function openViewSource() {
|
||||
// invoke the View Source command
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("command", true, true);
|
||||
document.getElementById("View:PageSource").dispatchEvent(event);
|
||||
}
|
||||
|
||||
function step1() {
|
||||
observer = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "domwindowclosed") {
|
||||
ok(true, "Entering the private browsing mode should close the view source window");
|
||||
ww.unregisterNotification(observer);
|
||||
|
||||
step2();
|
||||
}
|
||||
else if (aTopic == "domwindowopened")
|
||||
ok(false, "Entering the private browsing mode should not open any view source window");
|
||||
}
|
||||
};
|
||||
ww.registerNotification(observer);
|
||||
|
||||
gBrowser.addTabsProgressListener({
|
||||
onLocationChange: function() {},
|
||||
onProgressChange: function() {},
|
||||
onSecurityChange: function() {},
|
||||
onStatusChange: function() {},
|
||||
onRefreshAttempted: function() {},
|
||||
onLinkIconAvailable: function() {},
|
||||
onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
if (aStateFlags & (Ci.nsIWebProgressListener.STATE_STOP |
|
||||
Ci.nsIWebProgressListener.STATE_IS_WINDOW)) {
|
||||
gBrowser.removeTabsProgressListener(this);
|
||||
|
||||
step3();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// enter private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
}
|
||||
|
||||
let events = 0, step2, step3;
|
||||
step2 = step3 = function() {
|
||||
if (++events == 2)
|
||||
step4();
|
||||
}
|
||||
|
||||
function step4() {
|
||||
observer = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "domwindowopened") {
|
||||
ww.unregisterNotification(this);
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
|
||||
win.addEventListener("load", function() {
|
||||
win.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
let browser = win.document.defaultView.getBrowser();
|
||||
browser.addEventListener("load", function() {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
// view source window inside private browsing mode opened
|
||||
step5();
|
||||
}, true);
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
ww.registerNotification(observer);
|
||||
|
||||
openViewSource();
|
||||
}
|
||||
|
||||
function step5() {
|
||||
let events = 0;
|
||||
|
||||
observer = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "domwindowclosed") {
|
||||
ok(true, "Leaving the private browsing mode should close the existing view source window");
|
||||
if (++events == 2)
|
||||
ww.unregisterNotification(observer);
|
||||
}
|
||||
else if (aTopic == "domwindowopened") {
|
||||
ok(true, "Leaving the private browsing mode should restore the previous view source window");
|
||||
if (++events == 2)
|
||||
ww.unregisterNotification(observer);
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
|
||||
win.addEventListener("load", function() {
|
||||
win.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
let browser = win.document.defaultView.getBrowser();
|
||||
browser.addEventListener("load", function() {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
is(browser.currentURI.spec, "view-source:about:",
|
||||
"The correct view source window should be restored");
|
||||
|
||||
// cleanup
|
||||
win.close();
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
finish();
|
||||
}, true);
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
ww.registerNotification(observer);
|
||||
|
||||
// exit private browsing mode
|
||||
pb.privateBrowsingEnabled = false;
|
||||
}
|
||||
}, true);
|
||||
aboutBrowser.loadURI("about:");
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
/* ***** 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 Private Browsing Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ehsan Akhgari.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of 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 test makes sure that about:privatebrowsing does not appear zoomed in
|
||||
// if there is already a zoom site pref for about:blank (bug 487656).
|
||||
|
||||
function test() {
|
||||
// initialization
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
let cps = Cc["@mozilla.org/content-pref/service;1"].
|
||||
getService(Ci.nsIContentPrefService);
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tabBlank = gBrowser.selectedTab;
|
||||
gBrowser.removeAllTabsBut(tabBlank);
|
||||
|
||||
let blankBrowser = gBrowser.getBrowserForTab(tabBlank);
|
||||
blankBrowser.addEventListener("load", function() {
|
||||
blankBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
// change the zoom on the blank page
|
||||
FullZoom.enlarge();
|
||||
isnot(ZoomManager.zoom, 1, "Zoom level for about:blank should be changed");
|
||||
|
||||
// enter private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
let tabAboutPB = gBrowser.selectedTab;
|
||||
let browserAboutPB = gBrowser.getBrowserForTab(tabAboutPB);
|
||||
browserAboutPB.addEventListener("load", function() {
|
||||
browserAboutPB.removeEventListener("load", arguments.callee, true);
|
||||
setTimeout(function() {
|
||||
// make sure the zoom level is set to 1
|
||||
is(ZoomManager.zoom, 1, "Zoom level for about:privatebrowsing should be reset");
|
||||
|
||||
// Mac OS X does not support print preview, so skip those tests
|
||||
let isOSX = ("nsILocalFileMac" in Components.interfaces);
|
||||
if (isOSX) {
|
||||
finishTest();
|
||||
return;
|
||||
}
|
||||
|
||||
// test print preview on HTML document
|
||||
testPrintPreview(browserAboutPB, function() {
|
||||
browserAboutPB.addEventListener("load", function() {
|
||||
browserAboutPB.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
// test print preview on image document
|
||||
testPrintPreview(browserAboutPB, finishTest);
|
||||
}, true);
|
||||
browserAboutPB.loadURI("about:logo");
|
||||
});
|
||||
}, 0);
|
||||
}, true);
|
||||
}, true);
|
||||
blankBrowser.loadURI("about:blank");
|
||||
}
|
||||
|
||||
function finishTest() {
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
// leave private browsing mode
|
||||
pb.privateBrowsingEnabled = false;
|
||||
let tabBlank = gBrowser.selectedTab;
|
||||
let blankBrowser = gBrowser.getBrowserForTab(tabBlank);
|
||||
blankBrowser.addEventListener("load", function() {
|
||||
blankBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
executeSoon(function() {
|
||||
// cleanup
|
||||
FullZoom.reset();
|
||||
finish();
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
|
||||
function testPrintPreview(aBrowser, aCallback) {
|
||||
FullZoom.enlarge();
|
||||
let level = ZoomManager.getZoomForBrowser(aBrowser);
|
||||
|
||||
function onEnterPP(aHide) {
|
||||
toggleAffectedChromeOrig(aHide);
|
||||
|
||||
function onExitPP(aHide) {
|
||||
toggleAffectedChromeOrig(aHide);
|
||||
toggleAffectedChrome = toggleAffectedChromeOrig;
|
||||
|
||||
is(ZoomManager.getZoomForBrowser(aBrowser), level,
|
||||
"Toggling print preview mode should not affect zoom level");
|
||||
|
||||
FullZoom.reset();
|
||||
aCallback();
|
||||
}
|
||||
toggleAffectedChrome = onExitPP;
|
||||
PrintUtils.exitPrintPreview();
|
||||
}
|
||||
let toggleAffectedChromeOrig = toggleAffectedChrome;
|
||||
toggleAffectedChrome = onEnterPP;
|
||||
|
||||
let printPreview = new Function(document.getElementById("cmd_printPreview")
|
||||
.getAttribute("oncommand"));
|
||||
executeSoon(printPreview);
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
|
@ -12,18 +11,19 @@
|
|||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org Code.
|
||||
* The Original Code is Private Browsing Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* Ehsan Akhgari.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Ehsan Akhgari <ehsan.akhgari@gmail.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"),
|
||||
* either of 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
|
||||
|
@ -35,12 +35,21 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "prtypes.h"
|
||||
// This provides the tests with a download URL which never finishes.
|
||||
|
||||
class nsIWebBrowserChrome;
|
||||
function handleRequest(request, response) {
|
||||
response.setStatusLine(request.httpVersion, 200, "OK");
|
||||
response.processAsync();
|
||||
|
||||
namespace AppCallbacks {
|
||||
void EnableChromeWindow(nsIWebBrowserChrome *aWindow, PRBool aEnabled);
|
||||
function stall() {
|
||||
response.write("stalling...\n");
|
||||
}
|
||||
|
||||
PRUint32 RunEventLoop(PRBool &aRunCondition);
|
||||
response.setHeader("Content-Type", "text/plain", false);
|
||||
stall();
|
||||
|
||||
const nsITimer = Components.interfaces.nsITimer;
|
||||
var timer = Components.classes["@mozilla.org/timer;1"]
|
||||
.createInstance(nsITimer);
|
||||
timer.initWithCallback(stall, 500, nsITimer.TYPE_REPEATING_SLACK);
|
||||
}
|
|
@ -45,8 +45,6 @@
|
|||
<!DOCTYPE bindings [
|
||||
<!ENTITY % searchBarDTD SYSTEM "chrome://browser/locale/searchbar.dtd" >
|
||||
%searchBarDTD;
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
|
||||
%browserDTD;
|
||||
]>
|
||||
|
@ -80,8 +78,7 @@
|
|||
xbl:inherits="disabled,disableautocomplete,searchengine,src,newlines">
|
||||
<xul:button class="searchbar-engine-button"
|
||||
type="menu"
|
||||
anonid="searchbar-engine-button"
|
||||
chromedir="&locale.dir;">
|
||||
anonid="searchbar-engine-button">
|
||||
<xul:image class="searchbar-engine-image" xbl:inherits="src"/>
|
||||
<xul:image class="searchbar-dropmarker-image"/>
|
||||
<xul:menupopup class="searchbar-popup"
|
||||
|
@ -93,10 +90,9 @@
|
|||
oncommand="openManager(event);"/>
|
||||
</xul:menupopup>
|
||||
</xul:button>
|
||||
<xul:hbox class="search-go-container" chromedir="&locale.dir;">
|
||||
<xul:hbox class="search-go-container">
|
||||
<xul:image class="search-go-button"
|
||||
anonid="search-go-button"
|
||||
chromedir="&locale.dir;"
|
||||
onclick="handleSearchCommand(event);"
|
||||
tooltiptext="&searchEndCap.label;" />
|
||||
</xul:hbox>
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
* Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||
* Michael Kraft <morac99-firefox@yahoo.com>
|
||||
* Paul O’Shannessy <paul@oshannessy.com>
|
||||
* Nils Maier <maierman@web.de>
|
||||
*
|
||||
* 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
|
||||
|
@ -74,6 +75,7 @@ const NOTIFY_WINDOWS_RESTORED = "sessionstore-windows-restored";
|
|||
const OBSERVING = [
|
||||
"domwindowopened", "domwindowclosed",
|
||||
"quit-application-requested", "quit-application-granted",
|
||||
"browser-lastwindow-close-granted",
|
||||
"quit-application", "browser:purge-session-history",
|
||||
"private-browsing", "browser:purge-domain-data",
|
||||
"private-browsing-change-granted"
|
||||
|
@ -169,6 +171,11 @@ SessionStoreService.prototype = {
|
|||
// whether we clearing history on shutdown
|
||||
_clearingOnShutdown: false,
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
// whether the last window was closed and should be restored
|
||||
_restoreLastWindow: false,
|
||||
#endif
|
||||
|
||||
/* ........ Global Event Handlers .............. */
|
||||
|
||||
/**
|
||||
|
@ -329,6 +336,15 @@ SessionStoreService.prototype = {
|
|||
// freeze the data at what we've got (ignoring closing windows)
|
||||
this._loadState = STATE_QUITTING;
|
||||
break;
|
||||
#ifndef XP_MACOSX
|
||||
case "browser-lastwindow-close-granted":
|
||||
// last browser window is quitting.
|
||||
// remember to restore the last window when another browser window is openend
|
||||
// do not account for pref(resume_session_once) at this point, as it might be
|
||||
// set by another observer getting this notice after us
|
||||
this._restoreLastWindow = true;
|
||||
break;
|
||||
#endif
|
||||
case "quit-application":
|
||||
if (aData == "restart") {
|
||||
this._prefBranch.setBoolPref("sessionstore.resume_session_once", true);
|
||||
|
@ -568,7 +584,8 @@ SessionStoreService.prototype = {
|
|||
this.restoreWindow(aWindow, this._initialState, this._isCmdLineEmpty(aWindow));
|
||||
delete this._initialState;
|
||||
|
||||
// mark ourselves as running
|
||||
// _loadState changed from "stopped" to "running"
|
||||
// force a save operation so that crashes happening during startup are correctly counted
|
||||
this.saveState(true);
|
||||
}
|
||||
else {
|
||||
|
@ -586,7 +603,38 @@ SessionStoreService.prototype = {
|
|||
let followUp = this._statesToRestore[aWindow.__SS_restoreID].windows.length == 1;
|
||||
this.restoreWindow(aWindow, this._statesToRestore[aWindow.__SS_restoreID], true, followUp);
|
||||
}
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
else if (this._restoreLastWindow && aWindow.toolbar.visible &&
|
||||
this._closedWindows.length && this._doResumeSession() &&
|
||||
!this._inPrivateBrowsing) {
|
||||
|
||||
// default to the most-recently closed window
|
||||
// don't use popup windows
|
||||
let state = null;
|
||||
this._closedWindows = this._closedWindows.filter(function(aWinState) {
|
||||
if (!state && !aWinState.isPopup) {
|
||||
state = aWinState;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (state) {
|
||||
delete state.hidden;
|
||||
state = { windows: [state] };
|
||||
this._restoreCount = 1;
|
||||
this.restoreWindow(aWindow, state, this._isCmdLineEmpty(aWindow));
|
||||
}
|
||||
// we actually restored the session just now.
|
||||
this._prefBranch.setBoolPref("sessionstore.resume_session_once", false);
|
||||
}
|
||||
if (this._restoreLastWindow && aWindow.toolbar.visible) {
|
||||
// always reset (if not a popup window)
|
||||
// we don't want to restore a window directly after, for example,
|
||||
// undoCloseWindow was executed.
|
||||
this._restoreLastWindow = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
var tabbrowser = aWindow.getBrowser();
|
||||
var tabpanels = tabbrowser.mPanelContainer;
|
||||
|
||||
|
@ -1546,9 +1594,6 @@ SessionStoreService.prototype = {
|
|||
aHash[aHost] = {};
|
||||
if (!aHash[aHost][aPath])
|
||||
aHash[aHost][aPath] = {};
|
||||
if (!aHash[aHost][aPath][aName])
|
||||
aHash[aHost][aPath][aName] = {};
|
||||
|
||||
aHash[aHost][aPath][aName] = aCookie;
|
||||
}
|
||||
|
||||
|
@ -1569,14 +1614,9 @@ SessionStoreService.prototype = {
|
|||
if (cookie.isSession && _this._checkPrivacyLevel(cookie.isSecure)) {
|
||||
// use the cookie's host, path, and name as keys into a hash,
|
||||
// to make sure we serialize each cookie only once
|
||||
var isInHash = false;
|
||||
try {
|
||||
if (jscookies[cookie.host][cookie.path][cookie.name])
|
||||
isInHash = true;
|
||||
} catch (e) {
|
||||
// not in hash yet
|
||||
}
|
||||
if (!isInHash) {
|
||||
if (!(cookie.host in jscookies &&
|
||||
cookie.path in jscookies[cookie.host] &&
|
||||
cookie.name in jscookies[cookie.host][cookie.path])) {
|
||||
var jscookie = { "host": cookie.host, "value": cookie.value };
|
||||
// only add attributes with non-default values (saving a few bits)
|
||||
if (cookie.path) jscookie.path = cookie.path;
|
||||
|
|
|
@ -58,6 +58,7 @@ _BROWSER_TEST_FILES = \
|
|||
browser_346337.js \
|
||||
browser_346337_sample.html \
|
||||
browser_350525.js \
|
||||
browser_354894.js \
|
||||
browser_367052.js \
|
||||
browser_393716.js \
|
||||
browser_394759.js \
|
||||
|
|
|
@ -0,0 +1,516 @@
|
|||
/* ***** 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 sessionstore test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Nils Maier <maierman@web.de>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Simon Bünzli <zeniko@gmail.com>
|
||||
* Paul O’Shannessy <paul@oshannessy.com>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
/**
|
||||
* Checks that restoring the last browser window in session is actually
|
||||
* working:
|
||||
* 1.1) Open a new browser window
|
||||
* 1.2) Add some tabs
|
||||
* 1.3) Close that window
|
||||
* 1.4) Opening another window
|
||||
* --> State is restored
|
||||
*
|
||||
* 2.1) Open a new browser window
|
||||
* 2.2) Add some tabs
|
||||
* 2.3) Enter private browsing mode
|
||||
* 2.4) Close the window while still in private browsing mode
|
||||
* 2.5) Opening a new window
|
||||
* --> State is not restored, because private browsing mode is still active
|
||||
* 2.6) Leaving private browsing mode
|
||||
* 2.7) Open another window
|
||||
* --> State (that was before entering PBM) is restored
|
||||
*
|
||||
* 3.1) Open a new browser window
|
||||
* 3.2) Add some tabs
|
||||
* 3.4) Open some popups
|
||||
* 3.5) Add another tab to one popup (so that it gets stored) and close it again
|
||||
* 3.5) Close the browser window
|
||||
* 3.6) Open another browser window
|
||||
* --> State of the closed browser window, but not of the popup, is restored
|
||||
*
|
||||
* 4.1) Open a popup
|
||||
* 4.2) Add another tab to the popup (so that it gets stored) and close it again
|
||||
* 4.3) Open a window
|
||||
* --> Nothing at all should be restored
|
||||
*
|
||||
* 5.1) Open two browser windows and close them again
|
||||
* 5.2) undoCloseWindow() one
|
||||
* 5.3) Open another browser window
|
||||
* --> Nothing at all should be restored
|
||||
*
|
||||
* Checks the new notifications are correctly posted and processed, that is
|
||||
* for each successful -requested a -granted is received, but omitted if
|
||||
* -requested was cnceled
|
||||
* Said notifications are:
|
||||
* - browser-lastwindow-close-requested
|
||||
* - browser-lastwindow-close-granted
|
||||
* Tests are:
|
||||
* 6) Cancel closing when first observe a -requested
|
||||
* --> Window is kept open
|
||||
* 7) Count the number of notifications
|
||||
* --> count(-requested) == count(-granted) + 1
|
||||
* --> (The first -requested was canceled, so off-by-one)
|
||||
* 8) (Mac only) Mac version of Test 5 additionally preparing Test 6
|
||||
*
|
||||
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=354894
|
||||
* @note It is implicitly tested that restoring the last window works when
|
||||
* non-browser windows are around. The "Run Tests" window as well as the main
|
||||
* browser window (wherein the test code gets executed) won't be considered
|
||||
* browser windows. To achiveve this said main browser window has it's windowtype
|
||||
* attribute modified so that it's not considered a browser window any longer.
|
||||
* This is crucial, because otherwise there would be two browser windows around,
|
||||
* said main test window and the one opened by the tests, and hence the new
|
||||
* logic wouldn't be executed at all.
|
||||
* @note Mac only tests the new notifications, as restoring the last window is
|
||||
* not enabled on that platform (platform shim; the application is kept running
|
||||
* although there are no windows left)
|
||||
* @note There is a difference when closing a browser window with
|
||||
* BrowserTryToCloseWindow() as opposed to close(). The former will make
|
||||
* nsSessionStore restore a window next time it gets a chance and will post
|
||||
* notifications. The latter won't.
|
||||
*/
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Some urls that might be opened in tabs and/or popups
|
||||
// Do not use about:blank:
|
||||
// That one is reserved for special purposes in the tests
|
||||
const TEST_URLS = ["about:mozilla", "about:buildconfig"];
|
||||
|
||||
// Number of -request notifications to except
|
||||
// remember to adjust when adding new tests
|
||||
const NOTIFICATIONS_EXPECTED = 6;
|
||||
|
||||
// Window features of popup windows
|
||||
const POPUP_FEATURES = "toolbar=no,resizable=no,status=no";
|
||||
|
||||
// Window features of browser windows
|
||||
const CHROME_FEATURES = "chrome,all,dialog=no";
|
||||
|
||||
// Store the old window type for cleanup
|
||||
let oldWinType = "";
|
||||
// Store the old tabs.warnOnClose pref so that we may reset it during
|
||||
// cleanup
|
||||
let oldWarnTabsOnClose = gPrefService.getBoolPref("browser.tabs.warnOnClose");
|
||||
|
||||
// Observe these, and also use to count the number of hits
|
||||
let observing = {
|
||||
"browser-lastwindow-close-requested": 0,
|
||||
"browser-lastwindow-close-granted": 0
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper: Will observe and handle the notifications for us
|
||||
*/
|
||||
let observer = {
|
||||
hitCount: 0,
|
||||
|
||||
observe: function(aCancel, aTopic, aData) {
|
||||
// count so that we later may compare
|
||||
observing[aTopic]++;
|
||||
|
||||
// handle some tests
|
||||
if (++this.hitCount == 1) {
|
||||
// Test 6
|
||||
aCancel.QueryInterface(Ci.nsISupportsPRBool).data = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
let observerService = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
|
||||
/**
|
||||
* Helper: Sets prefs as the testsuite requires
|
||||
* @note Will be reset in cleanTestSuite just before finishing the tests
|
||||
*/
|
||||
function setPrefs() {
|
||||
gPrefService.setIntPref("browser.startup.page", 3);
|
||||
gPrefService.setBoolPref(
|
||||
"browser.privatebrowsing.keep_current_session",
|
||||
true
|
||||
);
|
||||
gPrefService.setBoolPref("browser.tabs.warnOnClose", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper: Sets up this testsuite
|
||||
*/
|
||||
function setupTestsuite(testFn) {
|
||||
// Register our observers
|
||||
for (let o in observing) {
|
||||
observerService.addObserver(observer, o, false);
|
||||
}
|
||||
|
||||
// Make the main test window not count as a browser window any longer
|
||||
oldWinType = document.documentElement.getAttribute("windowtype");
|
||||
document.documentElement.setAttribute("windowtype", "navigator:testrunner");
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper: Cleans up behind the testsuite
|
||||
*/
|
||||
function cleanupTestsuite(callback) {
|
||||
// Finally remove observers again
|
||||
for (let o in observing) {
|
||||
observerService.removeObserver(observer, o, false);
|
||||
}
|
||||
// Reset the prefs we touched
|
||||
for each (let pref in [
|
||||
"browser.startup.page",
|
||||
"browser.privatebrowsing.keep_current_session"
|
||||
]) {
|
||||
if (gPrefService.prefHasUserValue(pref)) {
|
||||
gPrefService.clearUserPref(pref);
|
||||
}
|
||||
}
|
||||
gPrefService.setBoolPref("browser.tabs.warnOnClose", oldWarnTabsOnClose);
|
||||
|
||||
// Reset the window type
|
||||
document.documentElement.setAttribute("windowtype", oldWinType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper: sets the prefs and a new window with our test tabs
|
||||
*/
|
||||
function setupTestAndRun(testFn) {
|
||||
// Prepare the prefs
|
||||
setPrefs();
|
||||
|
||||
// Prepare a window; open it and add more tabs
|
||||
let newWin = openDialog(location, "_blank", CHROME_FEATURES, "about:config");
|
||||
newWin.addEventListener("load", function(aEvent) {
|
||||
newWin.removeEventListener("load", arguments.callee, false);
|
||||
newWin.gBrowser.addEventListener("load", function(aEvent) {
|
||||
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
for each (let url in TEST_URLS) {
|
||||
newWin.gBrowser.addTab(url);
|
||||
}
|
||||
|
||||
executeSoon(function() testFn(newWin));
|
||||
}, true);
|
||||
}, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test 1: Normal in-session restore
|
||||
* @note: Non-Mac only
|
||||
*/
|
||||
function testOpenCloseNormal(nextFn) {
|
||||
setupTestAndRun(function(newWin) {
|
||||
// Close the window
|
||||
// window.close doesn't push any close events,
|
||||
// so use BrowserTryToCloseWindow
|
||||
newWin.BrowserTryToCloseWindow();
|
||||
|
||||
// The first request to close is denied by our observer (Test 6)
|
||||
ok(!newWin.closed, "First close request was denied");
|
||||
if (!newWin.closed) {
|
||||
newWin.BrowserTryToCloseWindow();
|
||||
ok(newWin.closed, "Second close request was granted");
|
||||
}
|
||||
|
||||
// Open a new window
|
||||
// The previously closed window should be restored
|
||||
newWin = openDialog(location, "_blank", CHROME_FEATURES);
|
||||
newWin.addEventListener("load", function() {
|
||||
executeSoon(function() {
|
||||
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 1,
|
||||
"Restored window in-session with otherpopup windows around");
|
||||
|
||||
// Cleanup
|
||||
newWin.close();
|
||||
|
||||
// Next please
|
||||
executeSoon(nextFn);
|
||||
});
|
||||
}, true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Test 2: PrivateBrowsing in-session restore
|
||||
* @note: Non-Mac only
|
||||
*/
|
||||
function testOpenClosePrivateBrowsing(nextFn) {
|
||||
setupTestAndRun(function(newWin) {
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
// Close the window
|
||||
newWin.BrowserTryToCloseWindow();
|
||||
|
||||
// Enter private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
|
||||
// Open a new window.
|
||||
// The previously closed window should NOT be restored
|
||||
newWin = openDialog(location, "_blank", CHROME_FEATURES);
|
||||
newWin.addEventListener("load", function() {
|
||||
executeSoon(function() {
|
||||
is(newWin.gBrowser.browsers.length, 1,
|
||||
"Did not restore in private browing mode");
|
||||
|
||||
// Cleanup
|
||||
newWin.BrowserTryToCloseWindow();
|
||||
|
||||
// Exit private browsing mode again
|
||||
pb.privateBrowsingEnabled = false;
|
||||
|
||||
newWin = openDialog(location, "_blank", CHROME_FEATURES);
|
||||
newWin.addEventListener("load", function() {
|
||||
executeSoon(function() {
|
||||
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 1,
|
||||
"Restored after leaving private browsing again");
|
||||
|
||||
newWin.close();
|
||||
|
||||
// Next please
|
||||
executeSoon(nextFn);
|
||||
});
|
||||
}, true);
|
||||
});
|
||||
}, true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Test 3: Open some popup windows to check those aren't restored, but
|
||||
* the browser window is
|
||||
* @note: Non-Mac only
|
||||
*/
|
||||
function testOpenCloseWindowAndPopup(nextFn) {
|
||||
setupTestAndRun(function(newWin) {
|
||||
// open some popups
|
||||
let popup = openDialog(location, "popup", POPUP_FEATURES, TEST_URLS[0]);
|
||||
let popup2 = openDialog(location, "popup2", POPUP_FEATURES, TEST_URLS[1]);
|
||||
popup2.addEventListener("load", function() {
|
||||
popup2.removeEventListener("load", arguments.callee, false);
|
||||
popup2.gBrowser.addEventListener("load", function() {
|
||||
popup2.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
popup2.gBrowser.addTab(TEST_URLS[0]);
|
||||
// close the window
|
||||
newWin.BrowserTryToCloseWindow();
|
||||
|
||||
// Close the popup window
|
||||
// The test is successful when not this popup window is restored
|
||||
// but instead newWin
|
||||
popup2.close();
|
||||
|
||||
// open a new window the previously closed window should be restored to
|
||||
newWin = openDialog(location, "_blank", CHROME_FEATURES);
|
||||
newWin.addEventListener("load", function() {
|
||||
executeSoon(function() {
|
||||
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 1,
|
||||
"Restored window and associated tabs in session");
|
||||
|
||||
// Cleanup
|
||||
newWin.close();
|
||||
popup.close();
|
||||
|
||||
// Next please
|
||||
executeSoon(nextFn);
|
||||
});
|
||||
}, true);
|
||||
}, true);
|
||||
}, false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Test 4: Open some popup window to check it isn't restored.
|
||||
* Instead nothing at all should be restored
|
||||
* @note: Non-Mac only
|
||||
*/
|
||||
function testOpenCloseOnlyPopup(nextFn) {
|
||||
// prepare the prefs
|
||||
setPrefs();
|
||||
|
||||
// This will cause nsSessionStore to restore a window the next time it
|
||||
// gets a chance.
|
||||
let popup = openDialog(location, "popup", POPUP_FEATURES, TEST_URLS[1]);
|
||||
popup.addEventListener("load", function() {
|
||||
is(popup.gBrowser.browsers.length, 1,
|
||||
"Did not restore the popup window (1)");
|
||||
popup.BrowserTryToCloseWindow();
|
||||
|
||||
// Real tests
|
||||
popup = openDialog(location, "popup", POPUP_FEATURES, TEST_URLS[1]);
|
||||
popup.addEventListener("load", function() {
|
||||
popup.removeEventListener("load", arguments.callee, false);
|
||||
popup.gBrowser.addEventListener("load", function() {
|
||||
popup.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
popup.gBrowser.addTab(TEST_URLS[0]);
|
||||
|
||||
is(popup.gBrowser.browsers.length, 2,
|
||||
"Did not restore to the popup window (2)");
|
||||
|
||||
// Close the popup window
|
||||
// The test is successful when not this popup window is restored
|
||||
// but instead a new window is opened without restoring anything
|
||||
popup.close();
|
||||
|
||||
let newWin = openDialog(location, "_blank", CHROME_FEATURES, "about:blank");
|
||||
newWin.addEventListener("load", function() {
|
||||
newWin.removeEventListener("load", arguments.callee, true);
|
||||
executeSoon(function() {
|
||||
isnot(newWin.gBrowser.browsers.length, 2,
|
||||
"Did not restore the popup window");
|
||||
is(TEST_URLS.indexOf(newWin.gBrowser.browsers[0].currentURI.spec), -1,
|
||||
"Did not restore the popup window (2)");
|
||||
|
||||
// Cleanup
|
||||
newWin.close();
|
||||
|
||||
// Next please
|
||||
executeSoon(nextFn);
|
||||
});
|
||||
}, true);
|
||||
}, true);
|
||||
}, false);
|
||||
}, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test 5: Open some windows and do undoCloseWindow. This should prevent any
|
||||
* restoring later in the test
|
||||
* @note: Non-Mac only
|
||||
*/
|
||||
function testOpenCloseRestoreFromPopup(nextFn) {
|
||||
setupTestAndRun(function(newWin) {
|
||||
setupTestAndRun(function(newWin2) {
|
||||
newWin.BrowserTryToCloseWindow();
|
||||
newWin2.BrowserTryToCloseWindow();
|
||||
|
||||
newWin = undoCloseWindow(0);
|
||||
|
||||
newWin2 = openDialog(location, "_blank", CHROME_FEATURES);
|
||||
newWin2.addEventListener("load", function() {
|
||||
newWin2.removeEventListener("load", arguments.callee, true);
|
||||
executeSoon(function() {
|
||||
is(newWin2.gBrowser.browsers.length, 1,
|
||||
"Did not restore, as undoCloseWindow() was last called");
|
||||
is(TEST_URLS.indexOf(newWin2.gBrowser.browsers[0].currentURI.spec), -1,
|
||||
"Did not restore, as undoCloseWindow() was last called (2)");
|
||||
|
||||
// Cleanup
|
||||
newWin.close();
|
||||
newWin2.close();
|
||||
|
||||
// Next please
|
||||
executeSoon(nextFn);
|
||||
});
|
||||
}, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Test 7: Check whether the right number of notifications was received during
|
||||
* the tests
|
||||
*/
|
||||
function testNotificationCount(nextFn) {
|
||||
is(observing["browser-lastwindow-close-requested"], NOTIFICATIONS_EXPECTED,
|
||||
"browser-lastwindow-close-requested notifications observed");
|
||||
|
||||
// -request must be one more as we cancel the first one we hit,
|
||||
// and hence won't produce a corresponding -grant
|
||||
// @see observer.observe
|
||||
is(observing["browser-lastwindow-close-requested"],
|
||||
observing["browser-lastwindow-close-granted"] + 1,
|
||||
"Notification count for -request and -grant matches");
|
||||
|
||||
executeSoon(nextFn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test 8: Test if closing can be denied on Mac
|
||||
* Futhermore prepares the testNotificationCount test (Test 6)
|
||||
* @note: Mac only
|
||||
*/
|
||||
function testMacNotifications(nextFn, iteration) {
|
||||
iteration = iteration || 1;
|
||||
setupTestAndRun(function(newWin) {
|
||||
// close the window
|
||||
// window.close doesn't push any close events,
|
||||
// so use BrowserTryToCloseWindow
|
||||
newWin.BrowserTryToCloseWindow();
|
||||
if (iteration == 1) {
|
||||
ok(!newWin.closed, "First close attempt denied");
|
||||
if (!newWin.closed) {
|
||||
newWin.BrowserTryToCloseWindow();
|
||||
ok(newWin.closed, "Second close attempt granted");
|
||||
}
|
||||
}
|
||||
|
||||
if (iteration < NOTIFICATIONS_EXPECTED - 1) {
|
||||
executeSoon(function() testMacNotifications(nextFn, ++iteration));
|
||||
}
|
||||
else {
|
||||
executeSoon(nextFn);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Execution starts here
|
||||
|
||||
setupTestsuite();
|
||||
if (navigator.platform.match(/Mac/)) {
|
||||
// Mac tests
|
||||
testMacNotifications(
|
||||
function() testNotificationCount(
|
||||
function() cleanupTestsuite() + finish()
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
// Non-Mac Tests
|
||||
testOpenCloseNormal(
|
||||
function() testOpenClosePrivateBrowsing(
|
||||
function() testOpenCloseWindowAndPopup(
|
||||
function() testOpenCloseOnlyPopup(
|
||||
function() testOpenCloseRestoreFromPopup (
|
||||
function() testNotificationCount(
|
||||
function() cleanupTestsuite() + finish()
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -38,51 +38,69 @@
|
|||
function test() {
|
||||
/** Test for Bug 490040 **/
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||
getService(Ci.nsISessionStore);
|
||||
let os = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
|
||||
getService(Ci.nsIWindowWatcher);
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
function testWithState(aState, aCallback) {
|
||||
// ensure we can store the window if need be
|
||||
function testWithState(aState) {
|
||||
// Ensure we can store the window if needed.
|
||||
let curClosedWindowCount = ss.getClosedWindowCount();
|
||||
gPrefService.setIntPref("browser.sessionstore.max_windows_undo", curClosedWindowCount + 1);
|
||||
gPrefService.setIntPref("browser.sessionstore.max_windows_undo",
|
||||
curClosedWindowCount + 1);
|
||||
|
||||
let theWin = openDialog(location, "_blank", "chrome,all,dialog=no");
|
||||
theWin.addEventListener("load", function(aEvent) {
|
||||
theWin.removeEventListener("load", arguments.callee, true);
|
||||
let windowObserver = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
let theWin = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
|
||||
ss.setWindowState(theWin, JSON.stringify(aState.windowState), true);
|
||||
switch(aTopic) {
|
||||
case "domwindowopened":
|
||||
theWin.addEventListener("load", function () {
|
||||
theWin.removeEventListener("load", arguments.callee, false);
|
||||
executeSoon(function() {
|
||||
// Close the window as soon as the first tab loads, or
|
||||
// immediately if there are no tabs.
|
||||
if (aState.windowState.windows[0].tabs[0].entries.length) {
|
||||
theWin.gBrowser.addEventListener("load", function() {
|
||||
theWin.gBrowser.removeEventListener("load",
|
||||
arguments.callee, true);
|
||||
theWin.close();
|
||||
}, true);
|
||||
} else {
|
||||
executeSoon(function() {
|
||||
theWin.close();
|
||||
});
|
||||
}
|
||||
ss.setWindowState(theWin, JSON.stringify(aState.windowState),
|
||||
true);
|
||||
});
|
||||
}, false);
|
||||
break;
|
||||
|
||||
let observer = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
let _this = this;
|
||||
// use executeSoon to ensure this happens after SS observer
|
||||
executeSoon(function() {
|
||||
is(ss.getClosedWindowCount(), curClosedWindowCount + (aState.shouldBeAdded ? 1 : 0),
|
||||
"That window should " + (aState.shouldBeAdded ? "" : "not ") + "be restorable");
|
||||
os.removeObserver(_this, "domwindowclosed");
|
||||
executeSoon(aCallback);
|
||||
});
|
||||
case "domwindowclosed":
|
||||
ww.unregisterNotification(this);
|
||||
// Use executeSoon to ensure this happens after SS observer.
|
||||
executeSoon(function() {
|
||||
is(ss.getClosedWindowCount(),
|
||||
curClosedWindowCount + (aState.shouldBeAdded ? 1 : 0),
|
||||
"That window should " + (aState.shouldBeAdded ? "" : "not ") +
|
||||
"be restorable");
|
||||
executeSoon(runNextTest);
|
||||
});
|
||||
break;
|
||||
}
|
||||
};
|
||||
os.addObserver(observer, "domwindowclosed", true);
|
||||
|
||||
// Close the window as soon as the first tab loads, or immediately if
|
||||
// there are no tabs.
|
||||
if (aState.windowState.windows[0].tabs[0].entries.length) {
|
||||
theWin.gBrowser.addEventListener("load", function() {
|
||||
theWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
theWin.close();
|
||||
}, true);
|
||||
} else {
|
||||
executeSoon(function() {
|
||||
theWin.close();
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
ww.registerNotification(windowObserver);
|
||||
ww.openWindow(null,
|
||||
location,
|
||||
"_blank",
|
||||
"chrome,all,dialog=no",
|
||||
null);
|
||||
}
|
||||
|
||||
// Only windows with open tabs are restorable. Windows where a lone tab is
|
||||
|
@ -128,15 +146,16 @@ function test() {
|
|||
}
|
||||
];
|
||||
|
||||
testWithState(states[0], function() {
|
||||
testWithState(states[1], function() {
|
||||
testWithState(states[2], function() {
|
||||
testWithState(states[3], function() {
|
||||
gPrefService.clearUserPref("browser.sessionstore.max_windows_undo");
|
||||
finish();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
function runNextTest() {
|
||||
if (states.length) {
|
||||
let state = states.shift();
|
||||
testWithState(state);
|
||||
}
|
||||
else {
|
||||
gPrefService.clearUserPref("browser.sessionstore.max_windows_undo");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
runNextTest();
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,9 @@
|
|||
<menupopup>
|
||||
<menuitem label="¢er.label;" value="CENTER"/>
|
||||
<menuitem label="&tile.label;" value="TILE"/>
|
||||
#ifndef WINCE
|
||||
<menuitem label="&stretch.label;" value="STRETCH"/>
|
||||
#endif
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<spacer flex="1"/>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* Robert Strong <robert.bugzilla@gmail.com>
|
||||
* Asaf Romano <mano@mozilla.com>
|
||||
* Ryan Jones <sciguyryan@gmail.com>
|
||||
* Paul O'Shannessy <paul@oshannessy.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -215,9 +216,11 @@ typedef struct {
|
|||
#define APP_REG_NAME L"Firefox"
|
||||
#define CLS_HTML "FirefoxHTML"
|
||||
#define CLS_URL "FirefoxURL"
|
||||
#define CPL_DESKTOP L"\\Control Panel\\Desktop"
|
||||
#define VAL_OPEN "\"%APPPATH%\" -requestPending -osint -url \"%1\""
|
||||
#define VAL_FILE_ICON "%APPPATH%,1"
|
||||
#else
|
||||
#define CPL_DESKTOP L"\\ControlPanel\\Desktop"
|
||||
#define VAL_OPEN "\"%APPPATH%\" -osint -url \"%1\""
|
||||
#define VAL_FILE_ICON "%APPPATH%,-2"
|
||||
#endif
|
||||
|
@ -656,12 +659,12 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
|||
PRBool result = PR_FALSE;
|
||||
DWORD dwDisp = 0;
|
||||
HKEY key;
|
||||
// Try to create/open a subkey under HKLM.
|
||||
DWORD res = ::RegCreateKeyExW(HKEY_CURRENT_USER,
|
||||
L"Control Panel\\Desktop",
|
||||
// Try to create/open a subkey under HKCU.
|
||||
DWORD res = ::RegCreateKeyExW(HKEY_CURRENT_USER, CPL_DESKTOP,
|
||||
0, NULL, REG_OPTION_NON_VOLATILE,
|
||||
KEY_WRITE, NULL, &key, &dwDisp);
|
||||
if (REG_SUCCEEDED(res)) {
|
||||
#ifndef WINCE
|
||||
PRUnichar tile[2], style[2];
|
||||
switch (aPosition) {
|
||||
case BACKGROUND_TILE:
|
||||
|
@ -688,8 +691,25 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
|||
0, REG_SZ, (const BYTE *)style, size);
|
||||
::SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, (PVOID)path.get(),
|
||||
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
|
||||
#else
|
||||
DWORD tile = (aPosition == BACKGROUND_TILE);
|
||||
::RegSetValueExW(key, L"Tile",
|
||||
0, REG_DWORD, (const BYTE *)&tile, sizeof(DWORD));
|
||||
// On WinCE SPI_SETDESKWALLPAPER isn't available, so set the registry
|
||||
// entry ourselves and then broadcast UI change
|
||||
PRInt32 size = (path.Length() + 1) * sizeof(PRUnichar);
|
||||
::RegSetValueExW(key, L"Wallpaper",
|
||||
0, REG_SZ, (const BYTE *)path.get(), size);
|
||||
::SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, NULL, 0);
|
||||
#endif
|
||||
|
||||
// Close the key we opened.
|
||||
::RegCloseKey(key);
|
||||
|
||||
#ifdef WINCE
|
||||
// Ensure that the writes are flushed in case of hard reboot
|
||||
::RegFlushKey(HKEY_CURRENT_USER);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
|
@ -815,10 +835,13 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
|
|||
|
||||
::SetSysColors(sizeof(aParameters) / sizeof(int), aParameters, colors);
|
||||
|
||||
// SetSysColors is persisting across sessions on Windows CE, so no need to
|
||||
// write to registry
|
||||
#ifndef WINCE
|
||||
PRBool result = PR_FALSE;
|
||||
DWORD dwDisp = 0;
|
||||
HKEY key;
|
||||
// Try to create/open a subkey under HKLM.
|
||||
// Try to create/open a subkey under HKCU.
|
||||
DWORD rv = ::RegCreateKeyExW(HKEY_CURRENT_USER,
|
||||
L"Control Panel\\Colors", 0, NULL,
|
||||
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
|
||||
|
@ -836,6 +859,7 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
|
|||
|
||||
// Close the key we opened.
|
||||
::RegCloseKey(key);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -237,6 +237,7 @@ bin/components/txEXSLTRegExFunctions.js
|
|||
bin/components/nsLivemarkService.js
|
||||
bin/components/nsTaggingService.js
|
||||
bin/components/nsPlacesDBFlush.js
|
||||
bin/components/nsPlacesAutoComplete.js
|
||||
bin/components/nsDefaultCLH.js
|
||||
bin/components/nsContentPrefService.js
|
||||
bin/components/nsContentDispatchChooser.js
|
||||
|
|
|
@ -244,6 +244,7 @@ bin\components\txEXSLTRegExFunctions.js
|
|||
bin\components\nsLivemarkService.js
|
||||
bin\components\nsTaggingService.js
|
||||
bin\components\nsPlacesDBFlush.js
|
||||
bin\components\nsPlacesAutoComplete.js
|
||||
bin\components\nsDefaultCLH.js
|
||||
bin\components\nsContentPrefService.js
|
||||
bin\components\nsContentDispatchChooser.js
|
||||
|
|
|
@ -370,6 +370,7 @@ you can use these alternative items. Otherwise, their values should be empty. -
|
|||
<!ENTITY cutButton.tooltip "Cut">
|
||||
<!ENTITY copyButton.tooltip "Copy">
|
||||
<!ENTITY pasteButton.tooltip "Paste">
|
||||
<!ENTITY fullScreenButton.tooltip "Display the window in full screen">
|
||||
|
||||
<!ENTITY quitApplicationCmdWin.label "Exit">
|
||||
<!ENTITY quitApplicationCmdWin.accesskey "x">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<!ENTITY chooseFile.label "Choose File…">
|
||||
<!ENTITY newWindow.label "New Window">
|
||||
<!ENTITY newTab.label "New Tab">
|
||||
<!ENTITY topWindow.label "Current Window">
|
||||
<!ENTITY topTab.label "Current Tab">
|
||||
<!ENTITY caption.label "Open Web Location">
|
||||
<!ENTITY openWhere.label "Open in:">
|
||||
<!ENTITY openBtn.label "Open">
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
<!ENTITY resetToolbars.label "Reset toolbars and controls">
|
||||
<!ENTITY resetToolbars.accesskey "R">
|
||||
|
||||
<!ENTITY resetBookmarks.label "Reset bookmarks to &brandShortName; defaults">
|
||||
<!ENTITY resetBookmarks.accesskey "b">
|
||||
<!ENTITY deleteBookmarks.label "Delete all bookmarks except for backups">
|
||||
<!ENTITY deleteBookmarks.accesskey "b">
|
||||
|
||||
<!ENTITY resetUserPrefs.label "Reset all user preferences to &brandShortName; defaults">
|
||||
<!ENTITY resetUserPrefs.accesskey "p">
|
||||
|
|
|
@ -401,13 +401,13 @@ menuitem:not([type]) {
|
|||
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
#historyMenuBack[chromedir="rtl"],
|
||||
#context-back[chromedir="rtl"] {
|
||||
#historyMenuBack:-moz-locale-dir(rtl),
|
||||
#context-back:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu");
|
||||
}
|
||||
|
||||
#historyMenuBack[disabled][chromedir="rtl"],
|
||||
#context-back[disabled][chromedir="rtl"] {
|
||||
#historyMenuBack[disabled]:-moz-locale-dir(rtl),
|
||||
#context-back[disabled]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
|
@ -421,13 +421,13 @@ menuitem:not([type]) {
|
|||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
#historyMenuForward[chromedir="rtl"],
|
||||
#context-forward[chromedir="rtl"] {
|
||||
#historyMenuForward:-moz-locale-dir(rtl),
|
||||
#context-forward:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu");
|
||||
}
|
||||
|
||||
#historyMenuForward[disabled][chromedir="rtl"],
|
||||
#context-forward[disabled][chromedir="rtl"] {
|
||||
#historyMenuForward[disabled]:-moz-locale-dir(rtl),
|
||||
#context-forward[disabled]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
|
@ -522,10 +522,10 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
|
|||
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
#back-button[chromedir="rtl"] {
|
||||
#back-button:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar");
|
||||
}
|
||||
#back-button[disabled="true"][chromedir="rtl"] {
|
||||
#back-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
|
@ -536,10 +536,10 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
|
|||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
#forward-button[chromedir="rtl"] {
|
||||
#forward-button:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
|
||||
}
|
||||
#forward-button[disabled="true"][chromedir="rtl"] {
|
||||
#forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
|
@ -627,6 +627,10 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
|
|||
list-style-image: url("moz-icon://stock/gtk-paste?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
#fullscreen-button {
|
||||
list-style-image: url("moz-icon://stock/gtk-fullscreen?size=toolbar");
|
||||
}
|
||||
|
||||
/* 16px primary toolbar buttons */
|
||||
toolbar[iconsize="small"] .toolbarbutton-1 {
|
||||
-moz-box-orient: vertical;
|
||||
|
@ -648,13 +652,13 @@ toolbar[iconsize="small"] #back-button[disabled="true"] {
|
|||
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #back-button[chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu");
|
||||
}
|
||||
menupopup[chromedir="rtl"] > .unified-nav-back[_moz-menuactive] {
|
||||
menupopup:-moz-locale-dir(rtl) > .unified-nav-back[_moz-menuactive] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu") !important;
|
||||
}
|
||||
toolbar[iconsize="small"] #back-button[disabled="true"][chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #back-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
|
@ -668,13 +672,13 @@ toolbar[iconsize="small"] #forward-button[disabled="true"] {
|
|||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #forward-button[chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu");
|
||||
}
|
||||
menupopup[chromedir="rtl"] > .unified-nav-forward[_moz-menuactive] {
|
||||
menupopup:-moz-locale-dir(rtl) > .unified-nav-forward[_moz-menuactive] {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu") !important;
|
||||
}
|
||||
toolbar[iconsize="small"] #forward-button[disabled="true"][chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
|
@ -764,6 +768,10 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
|
|||
list-style-image: url("moz-icon://stock/gtk-paste?size=menu&state=disabled");
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #fullscreen-button {
|
||||
list-style-image: url("moz-icon://stock/gtk-fullscreen?size=menu");
|
||||
}
|
||||
|
||||
/* Fullscreen window controls */
|
||||
#window-controls {
|
||||
-moz-box-align: start;
|
||||
|
@ -833,7 +841,7 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
|
|||
direction: ltr !important;
|
||||
}
|
||||
|
||||
#PopupAutoComplete[chromedir="rtl"] > tree > treerows {
|
||||
#PopupAutoComplete:-moz-locale-dir(rtl) > tree > treerows {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
|
@ -875,7 +883,7 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
|
|||
-moz-border-end: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
||||
#identity-box[chromedir="rtl"] {
|
||||
#identity-box:-moz-locale-dir(rtl) {
|
||||
-moz-border-start: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
||||
|
@ -1338,7 +1346,7 @@ toolbarbutton.chevron {
|
|||
list-style-image: url("chrome://global/skin/toolbar/chevron.gif") !important;
|
||||
}
|
||||
|
||||
toolbarbutton.chevron[chromedir="rtl"] {
|
||||
toolbarbutton.chevron:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("chrome://global/skin/toolbar/chevron-rtl.gif") !important;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
#back-button[chromedir="rtl"] {
|
||||
#back-button:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar");
|
||||
}
|
||||
#back-button[disabled="true"][chromedir="rtl"] {
|
||||
#back-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
|
@ -29,10 +29,10 @@
|
|||
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
#forward-button[chromedir="rtl"] {
|
||||
#forward-button:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
|
||||
}
|
||||
#forward-button[disabled="true"][chromedir="rtl"] {
|
||||
#forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search-go-button[chromedir="rtl"] {
|
||||
.search-go-button:-moz-locale-dir(rtl) {
|
||||
-moz-transform: scaleX(-1);
|
||||
}
|
||||
|
||||
|
|
|
@ -124,12 +124,12 @@ toolbarbutton.bookmark-item[type=menu] > .toolbarbutton-menu-dropmarker {
|
|||
-moz-padding-end: 7px;
|
||||
}
|
||||
|
||||
toolbarbutton.bookmark-item[type=menu][chromedir="rtl"] > .toolbarbutton-menu-dropmarker {
|
||||
toolbarbutton.bookmark-item[type=menu]:-moz-locale-dir(rtl) > .toolbarbutton-menu-dropmarker {
|
||||
-moz-padding-start: 4px;
|
||||
-moz-padding-end: 2px;
|
||||
}
|
||||
|
||||
toolbarbutton.bookmark-item[chromedir="rtl"] {
|
||||
toolbarbutton.bookmark-item:-moz-locale-dir(rtl) {
|
||||
-moz-padding-start: 0px;
|
||||
-moz-padding-end: 7px;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ toolbarbutton.bookmark-item:not([container]) > .toolbarbutton-text {
|
|||
-moz-padding-end: 7px;
|
||||
}
|
||||
|
||||
toolbarbutton.bookmark-item[chromedir="rtl"] > .toolbarbutton-text {
|
||||
toolbarbutton.bookmark-item:-moz-locale-dir(rtl) > .toolbarbutton-text {
|
||||
-moz-padding-end: 0;
|
||||
-moz-padding-start: 7px;
|
||||
}
|
||||
|
@ -170,14 +170,14 @@ toolbarbutton.bookmark-item[container]:not([open]):hover > .toolbarbutton-menu-d
|
|||
}
|
||||
|
||||
toolbarbutton.bookmark-item[container]:hover > .toolbarbutton-text,
|
||||
toolbarbutton.bookmark-item[container][chromedir="rtl"]:not([open]):hover > .toolbarbutton-menu-dropmarker,
|
||||
toolbarbutton.bookmark-item[container]:-moz-locale-dir(rtl):not([open]):hover > .toolbarbutton-menu-dropmarker,
|
||||
#home-button.bookmark-item:hover > .toolbarbutton-icon,
|
||||
#home-button.bookmark-item[chromedir="rtl"]:hover > .toolbarbutton-text {
|
||||
#home-button.bookmark-item:-moz-locale-dir(rtl):hover > .toolbarbutton-text {
|
||||
background: url("chrome://global/skin/toolbar/toolbarbutton-customhover-mid.png") repeat-x;
|
||||
}
|
||||
|
||||
#home-button.bookmark-item:hover[chromedir="rtl"] > .toolbarbutton-icon,
|
||||
toolbarbutton.bookmark-item[chromedir="rtl"]:hover > .toolbarbutton-text {
|
||||
#home-button.bookmark-item:hover:-moz-locale-dir(rtl) > .toolbarbutton-icon,
|
||||
toolbarbutton.bookmark-item:-moz-locale-dir(rtl):hover > .toolbarbutton-text {
|
||||
background: url("chrome://global/skin/toolbar/toolbarbutton-customhover-right.png") no-repeat right top;
|
||||
}
|
||||
|
||||
|
@ -190,15 +190,15 @@ toolbarbutton.bookmark-item[container]:hover:active > .toolbarbutton-menu-dropma
|
|||
toolbarbutton.bookmark-item[container]:hover:active > .toolbarbutton-text,
|
||||
toolbarbutton.bookmark-item[container][open="true"] > .toolbarbutton-text,
|
||||
#home-button.bookmark-item:hover:active > .toolbarbutton-icon,
|
||||
toolbarbutton.bookmark-item[container][chromedir="rtl"]:hover:active > .toolbarbutton-menu-dropmarker,
|
||||
toolbarbutton.bookmark-item[container][chromedir="rtl"][open="true"] > .toolbarbutton-menu-dropmarker,
|
||||
#home-button.bookmark-item:hover:active[chromedir="rtl"] > .toolbarbutton-text {
|
||||
toolbarbutton.bookmark-item[container]:-moz-locale-dir(rtl):hover:active > .toolbarbutton-menu-dropmarker,
|
||||
toolbarbutton.bookmark-item[container]:-moz-locale-dir(rtl)[open="true"] > .toolbarbutton-menu-dropmarker,
|
||||
#home-button.bookmark-item:hover:active:-moz-locale-dir(rtl) > .toolbarbutton-text {
|
||||
background: url("chrome://browser/skin/bookmark-open-mid.png") repeat-x !important;
|
||||
}
|
||||
|
||||
toolbarbutton.bookmark-item[chromedir="rtl"][container]:hover:active > .toolbarbutton-text,
|
||||
toolbarbutton.bookmark-item[chromedir="rtl"][container][open] > .toolbarbutton-text,
|
||||
#home-button.bookmark-item[chromedir="rtl"]:hover:active > .toolbarbutton-icon {
|
||||
toolbarbutton.bookmark-item:-moz-locale-dir(rtl)[container]:hover:active > .toolbarbutton-text,
|
||||
toolbarbutton.bookmark-item:-moz-locale-dir(rtl)[container][open] > .toolbarbutton-text,
|
||||
#home-button.bookmark-item:-moz-locale-dir(rtl):hover:active > .toolbarbutton-icon {
|
||||
background: url("chrome://browser/skin/bookmark-open-right.png") no-repeat right top !important;
|
||||
}
|
||||
|
||||
|
@ -290,8 +290,8 @@ toolbarbutton.bookmark-item-microsummarized {
|
|||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
.toolbarbutton-1[chromedir="rtl"],
|
||||
#back-forward-dropmarker[chromedir="rtl"] {
|
||||
.toolbarbutton-1:-moz-locale-dir(rtl),
|
||||
#back-forward-dropmarker:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-rtl.png");
|
||||
}
|
||||
|
||||
|
@ -375,7 +375,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #back-button {
|
|||
border-right: none;
|
||||
}
|
||||
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #back-button[chromedir="rtl"] {
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #back-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 571px, 33px, 540px);
|
||||
}
|
||||
|
||||
|
@ -383,7 +383,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #back-button[disabled="true
|
|||
-moz-image-region: rect(33px, 535px, 66px, 504px);
|
||||
}
|
||||
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #back-button[disabled="true"][chromedir="rtl"] {
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #back-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(33px, 571px, 66px, 540px);
|
||||
}
|
||||
|
||||
|
@ -392,8 +392,8 @@ toolbar[mode="icons"] #unified-back-forward-button > #back-button[open="true"] {
|
|||
-moz-image-region: rect(66px, 535px, 99px, 504px);
|
||||
}
|
||||
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #back-button:hover:active[chromedir="rtl"]:not([disabled]),
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #back-button[open="true"][chromedir="rtl"] {
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #back-button:hover:active:-moz-locale-dir(rtl):not([disabled]),
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #back-button[open="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(66px, 571px, 99px, 540px);
|
||||
}
|
||||
|
||||
|
@ -407,7 +407,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #forward-button {
|
|||
border-right: none;
|
||||
}
|
||||
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[chromedir="rtl"] {
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #forward-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 540px, 33px, 514px);
|
||||
}
|
||||
|
||||
|
@ -415,7 +415,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #forward-button[disabled="t
|
|||
-moz-image-region: rect(33px, 560px, 66px, 535px);
|
||||
}
|
||||
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[disabled="true"][chromedir="rtl"] {
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(33px, 540px, 66px, 514px);
|
||||
}
|
||||
|
||||
|
@ -425,8 +425,8 @@ toolbar[mode="icons"] #unified-back-forward-button > #forward-button[open="true"
|
|||
-moz-margin-start: -5px;
|
||||
}
|
||||
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[chromedir="rtl"]:hover:active:not([disabled]),
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[open="true"][chromedir="rtl"] {
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #forward-button:-moz-locale-dir(rtl):hover:active:not([disabled]),
|
||||
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[open="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(99px, 545px, 132px, 514px);
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #forward-button[open="true"
|
|||
border-right: none;
|
||||
}
|
||||
|
||||
#back-forward-dropmarker[chromedir="rtl"] {
|
||||
#back-forward-dropmarker:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 514px, 33px, 504px);
|
||||
}
|
||||
|
||||
|
@ -458,7 +458,7 @@ toolbar[mode="icons"] #back-forward-dropmarker > dropmarker {
|
|||
-moz-image-region: rect(33px, 571px, 66px, 560px);
|
||||
}
|
||||
|
||||
#back-forward-dropmarker[disabled="true"][chromedir="rtl"] {
|
||||
#back-forward-dropmarker[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(33px, 514px, 66px, 504px);
|
||||
}
|
||||
|
||||
|
@ -467,18 +467,18 @@ toolbar[mode="icons"] #back-forward-dropmarker > dropmarker {
|
|||
-moz-image-region: rect(66px, 571px, 99px, 560px);
|
||||
}
|
||||
|
||||
#back-forward-dropmarker[chromedir="rtl"]:hover:active:not([disabled]),
|
||||
#back-forward-dropmarker[open="true"][chromedir="rtl"] {
|
||||
#back-forward-dropmarker:-moz-locale-dir(rtl):hover:active:not([disabled]),
|
||||
#back-forward-dropmarker[open="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(66px, 514px, 99px, 504px);
|
||||
}
|
||||
|
||||
.unified-nav-back[_moz-menuactive],
|
||||
menupopup[chromedir="rtl"] > .unified-nav-forward[_moz-menuactive] {
|
||||
menupopup:-moz-locale-dir(rtl) > .unified-nav-forward[_moz-menuactive] {
|
||||
list-style-image: url("chrome://browser/skin/menu-back.png") !important;
|
||||
}
|
||||
|
||||
.unified-nav-forward[_moz-menuactive],
|
||||
menupopup[chromedir="rtl"] > .unified-nav-back[_moz-menuactive] {
|
||||
menupopup:-moz-locale-dir(rtl) > .unified-nav-back[_moz-menuactive] {
|
||||
list-style-image: url("chrome://browser/skin/menu-forward.png") !important;
|
||||
}
|
||||
|
||||
|
@ -493,7 +493,7 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-but
|
|||
border-right: none;
|
||||
}
|
||||
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[chromedir="rtl"] {
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 648px, 23px, 614px);
|
||||
}
|
||||
|
||||
|
@ -501,7 +501,7 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-but
|
|||
-moz-image-region: rect(23px, 605px, 46px, 571px);
|
||||
}
|
||||
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[disabled="true"][chromedir="rtl"] {
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(23px, 648px, 46px, 614px);
|
||||
}
|
||||
|
||||
|
@ -510,8 +510,8 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-but
|
|||
-moz-image-region: rect(46px, 605px, 69px, 571px);
|
||||
}
|
||||
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[chromedir="rtl"]:hover:active:not([disabled]),
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[open="true"][chromedir="rtl"] {
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button:-moz-locale-dir(rtl):hover:active:not([disabled]),
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[open="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(46px, 648px, 69px, 614px);
|
||||
}
|
||||
|
||||
|
@ -525,7 +525,7 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-
|
|||
border-right: none;
|
||||
}
|
||||
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[chromedir="rtl"] {
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 614px, 23px, 580px);
|
||||
}
|
||||
|
||||
|
@ -533,7 +533,7 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-
|
|||
-moz-image-region: rect(23px, 638px, 46px, 605px);
|
||||
}
|
||||
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[disabled="true"][chromedir="rtl"] {
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(23px, 614px, 46px, 580px);
|
||||
}
|
||||
|
||||
|
@ -543,8 +543,8 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-
|
|||
-moz-margin-start: 0;
|
||||
}
|
||||
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[chromedir="rtl"]:hover:active:not([disabled]),
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[open="true"][chromedir="rtl"] {
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button:-moz-locale-dir(rtl):hover:active:not([disabled]),
|
||||
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[open="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(46px, 614px, 69px, 580px);
|
||||
}
|
||||
|
||||
|
@ -554,7 +554,7 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
|||
-moz-image-region: rect(0px, 648px, 23px, 638px);
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 580px, 23px, 571px);
|
||||
}
|
||||
|
||||
|
@ -562,7 +562,7 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
|||
-moz-image-region: rect(23px, 648px, 46px, 638px);
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[disabled="true"][chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(23px, 580px, 46px, 571px);
|
||||
}
|
||||
|
||||
|
@ -571,8 +571,8 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
|
|||
-moz-image-region: rect(46px, 648px, 69px, 638px);
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[chromedir="rtl"]:hover:active:not([disabled]),
|
||||
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[open="true"][chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker:-moz-locale-dir(rtl):hover:active:not([disabled]),
|
||||
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[open="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(46px, 580px, 69px, 571px);
|
||||
}
|
||||
|
||||
|
@ -1461,7 +1461,7 @@ toolbarbutton.chevron {
|
|||
list-style-image: url("chrome://global/skin/icons/chevron.png") !important;
|
||||
}
|
||||
|
||||
toolbarbutton.chevron[chromedir="rtl"] {
|
||||
toolbarbutton.chevron:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("chrome://global/skin/icons/chevron-rtl.png") !important;
|
||||
}
|
||||
|
||||
|
@ -1663,15 +1663,15 @@ tabbrowser > tabbox > tabpanels {
|
|||
border: none;
|
||||
}
|
||||
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-up[chromedir="ltr"],
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down[chromedir="rtl"] {
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(ltr),
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down:-moz-locale-dir(rtl) {
|
||||
border-right: 2px solid;
|
||||
-moz-border-right-colors: rgba(0,0,0,0.25) rgba(255,255,255,0.15);
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-left.png");
|
||||
}
|
||||
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down[chromedir="ltr"],
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-up[chromedir="rtl"] {
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down:-moz-locale-dir(ltr),
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(rtl) {
|
||||
border-left: 2px solid;
|
||||
-moz-border-left-colors: rgba(0,0,0,0.25) rgba(255,255,255,0.15);
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-right.png");
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
border-right: none;
|
||||
}
|
||||
|
||||
#back-button[chromedir="rtl"] {
|
||||
#back-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 67px, 23px, 34px);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@
|
|||
-moz-image-region: rect(23px, 34px, 46px, 0px) !important;
|
||||
}
|
||||
|
||||
#back-button[disabled="true"][chromedir="rtl"] {
|
||||
#back-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(23px, 67px, 46px, 34px) !important;
|
||||
}
|
||||
|
||||
|
@ -114,9 +114,9 @@
|
|||
-moz-image-region: rect(46px, 34px, 69px, 0px);
|
||||
}
|
||||
|
||||
#back-button:hover:active[chromedir="rtl"],
|
||||
#back-button[buttondown="true"][chromedir="rtl"],
|
||||
#back-button[open="true"][chromedir="rtl"] {
|
||||
#back-button:hover:active:-moz-locale-dir(rtl),
|
||||
#back-button[buttondown="true"]:-moz-locale-dir(rtl),
|
||||
#back-button[open="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(46px, 67px, 69px, 34px);
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@
|
|||
border-right: none;
|
||||
}
|
||||
|
||||
#forward-button[chromedir="rtl"] {
|
||||
#forward-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 34px, 23px, 0px);
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@
|
|||
-moz-image-region: rect(23px, 67px, 46px, 34px) !important;
|
||||
}
|
||||
|
||||
#forward-button[disabled="true"][chromedir="rtl"] {
|
||||
#forward-button[disabled="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(23px, 34px, 46px, 0px) !important;
|
||||
}
|
||||
|
||||
|
@ -154,9 +154,9 @@
|
|||
-moz-image-region: rect(46px, 67px, 69px, 34px);
|
||||
}
|
||||
|
||||
#forward-button:hover:active[chromedir="rtl"],
|
||||
#forward-button[buttondown="true"][chromedir="rtl"],
|
||||
#forward-button[open="true"][chromedir="rtl"] {
|
||||
#forward-button:hover:active:-moz-locale-dir(rtl),
|
||||
#forward-button[buttondown="true"]:-moz-locale-dir(rtl),
|
||||
#forward-button[open="true"]:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(46px, 34px, 69px, 0px);
|
||||
}
|
||||
|
||||
|
@ -169,10 +169,10 @@
|
|||
background: url("chrome://browser/skin/places/menubutton-end-pressed.png") right center no-repeat;
|
||||
}
|
||||
|
||||
#placesToolbar[chromedir="rtl"] > toolbarbutton[type="menu"] {
|
||||
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"] {
|
||||
background: url("chrome://browser/skin/places/menubutton-end-rtl.png") left center no-repeat;
|
||||
}
|
||||
#placesToolbar[chromedir="rtl"] > toolbarbutton[type="menu"][open="true"] {
|
||||
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"][open="true"] {
|
||||
background: url("chrome://browser/skin/places/menubutton-end-pressed-rtl.png") left center no-repeat;
|
||||
}
|
||||
|
||||
|
@ -192,10 +192,10 @@
|
|||
background: url("chrome://browser/skin/places/menubutton-start-pressed.png") left center no-repeat;
|
||||
}
|
||||
|
||||
#placesToolbar[chromedir="rtl"] > toolbarbutton[type="menu"] > .toolbarbutton-icon {
|
||||
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"] > .toolbarbutton-icon {
|
||||
background: url("chrome://browser/skin/places/menubutton-start-rtl.png") right center no-repeat;
|
||||
}
|
||||
#placesToolbar[chromedir="rtl"] > toolbarbutton[type="menu"][open="true"] > .toolbarbutton-icon {
|
||||
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"][open="true"] > .toolbarbutton-icon {
|
||||
background: url("chrome://browser/skin/places/menubutton-start-pressed-rtl.png") right center no-repeat;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
.searchbar-engine-button[chromedir="rtl"] {
|
||||
.searchbar-engine-button:-moz-locale-dir(rtl) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-rtl.png");
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
|||
background-image: url("chrome://browser/skin/urlbar/startcap-focused.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"] {
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-locale-dir(rtl) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-focused-rtl.png");
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
|||
background-image: url("chrome://browser/skin/urlbar/startcap-focused-graphite.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-locale-dir(rtl):-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-focused-graphite-rtl.png");
|
||||
}
|
||||
|
||||
|
@ -70,8 +70,8 @@
|
|||
background-image: url("chrome://browser/skin/urlbar/startcap-active.png") !important;
|
||||
}
|
||||
|
||||
.searchbar-engine-button:hover:active[chromedir="rtl"],
|
||||
.searchbar-engine-button[open="true"][chromedir="rtl"] {
|
||||
.searchbar-engine-button:hover:active:-moz-locale-dir(rtl),
|
||||
.searchbar-engine-button[open="true"]:-moz-locale-dir(rtl) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active-rtl.png") !important;
|
||||
}
|
||||
|
||||
|
@ -80,8 +80,8 @@
|
|||
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused.png") !important;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:active,
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"][chromedir="rtl"] {
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-locale-dir(rtl):active,
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"]:-moz-locale-dir(rtl) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-rtl.png") !important;
|
||||
}
|
||||
|
||||
|
@ -90,8 +90,8 @@
|
|||
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-graphite.png") !important;
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:active:-moz-system-metric(mac-graphite-theme),
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"][chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-locale-dir(rtl):active:-moz-system-metric(mac-graphite-theme),
|
||||
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"]:-moz-locale-dir(rtl):-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-graphite-rtl.png") !important;
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@
|
|||
-moz-padding-end: 5px;
|
||||
}
|
||||
|
||||
.search-go-container[chromedir="rtl"] {
|
||||
.search-go-container:-moz-locale-dir(rtl) {
|
||||
background-image: url("chrome://browser/skin/urlbar/endcap-rtl.png");
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@
|
|||
background-image: url("chrome://browser/skin/urlbar/endcap-focused.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .search-go-container[chromedir="rtl"] {
|
||||
.searchbar-textbox[focused="true"] > .search-go-container:-moz-locale-dir(rtl) {
|
||||
background: url("chrome://browser/skin/urlbar/endcap-focused-rtl.png") no-repeat left top;
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@
|
|||
background-image: url("chrome://browser/skin/urlbar/endcap-focused-graphite.png");
|
||||
}
|
||||
|
||||
.searchbar-textbox[focused="true"] > .search-go-container[chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
|
||||
.searchbar-textbox[focused="true"] > .search-go-container:-moz-locale-dir(rtl):-moz-system-metric(mac-graphite-theme) {
|
||||
background-image: url("chrome://browser/skin/urlbar/endcap-focused-graphite-rtl.png");
|
||||
}
|
||||
|
||||
|
|
|
@ -18,20 +18,20 @@
|
|||
|
||||
/* ::::: Identity Indicator Styling ::::: */
|
||||
|
||||
#urlbar[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
|
||||
#urlbar:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
|
||||
-moz-margin-start: 9px;
|
||||
}
|
||||
|
||||
#identity-box[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
|
||||
#identity-box:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
|
||||
-moz-margin-start: -7px;
|
||||
}
|
||||
|
||||
#identity-box[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
|
||||
#identity-box:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
|
||||
-moz-border-radius: 11px 0 2px 11px / 15px 0 2px 15px;
|
||||
}
|
||||
|
||||
/* Match #identity-box[chromedir="ltr"]'s -moz-margin-start */
|
||||
#identity-popup[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
|
||||
/* Match #identity-box:-moz-locale-dir(ltr)'s -moz-margin-start */
|
||||
#identity-popup:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
|
||||
-moz-margin-start: 7px;
|
||||
}
|
||||
|
||||
|
|
|
@ -248,16 +248,16 @@ toolbar[iconsize="large"][mode="icons"] #back-button:not([disabled="true"]):hove
|
|||
|
||||
/* unified back button with keyhole icons, RTL version */
|
||||
|
||||
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"] {
|
||||
toolbar[iconsize="large"][mode="icons"] #back-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px 516px 34px 480px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover {
|
||||
toolbar[iconsize="large"][mode="icons"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover {
|
||||
-moz-image-region: rect(34px 516px 68px 480px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"][disabled="true"] {
|
||||
toolbar[iconsize="large"][mode="icons"] #back-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(68px 516px 102px 480px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
toolbar[iconsize="large"][mode="icons"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(102px 516px 136px 480px);
|
||||
}
|
||||
|
||||
|
@ -284,16 +284,16 @@ toolbar[iconsize="large"][mode="icons"] #forward-button:not([disabled="true"]):h
|
|||
|
||||
/* unified forward button with keyhole icons, RTL version */
|
||||
|
||||
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"] {
|
||||
toolbar[iconsize="large"][mode="icons"] #forward-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(3px 480px 31px 454px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover {
|
||||
toolbar[iconsize="large"][mode="icons"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover {
|
||||
-moz-image-region: rect(37px 480px 65px 454px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"][disabled="true"] {
|
||||
toolbar[iconsize="large"][mode="icons"] #forward-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(71px 480px 99px 454px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
toolbar[iconsize="large"][mode="icons"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(105px 480px 133px 454px);
|
||||
}
|
||||
|
||||
|
@ -331,16 +331,16 @@ toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:not([disabled="
|
|||
|
||||
/* unified dropmarker with keyhole icons, RTL version */
|
||||
|
||||
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"] {
|
||||
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(3px 454px 31px 438px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover {
|
||||
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl):not([disabled="true"]):hover {
|
||||
-moz-image-region: rect(37px 454px 65px 438px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"][disabled="true"] {
|
||||
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(71px 454px 99px 438px);
|
||||
}
|
||||
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(105px 454px 133px 438px);
|
||||
}
|
||||
|
||||
|
@ -368,16 +368,16 @@ toolbar[iconsize="small"][mode="icons"] #back-button:not([disabled="true"]):hove
|
|||
|
||||
/* unified back button with keyhole icons, small icons mode, RTL version */
|
||||
|
||||
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"] {
|
||||
toolbar[iconsize="small"][mode="icons"] #back-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px 362px 24px 338px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover {
|
||||
toolbar[iconsize="small"][mode="icons"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover {
|
||||
-moz-image-region: rect(24px 362px 48px 338px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"][disabled="true"] {
|
||||
toolbar[iconsize="small"][mode="icons"] #back-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(48px 362px 72px 338px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
toolbar[iconsize="small"][mode="icons"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(72px 362px 96px 338px);
|
||||
}
|
||||
|
||||
|
@ -398,16 +398,16 @@ toolbar[iconsize="small"][mode="icons"] #forward-button:not([disabled="true"]):h
|
|||
|
||||
/* unified forward button with keyhole icons, small icons mode, RTL version */
|
||||
|
||||
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"] {
|
||||
toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px 338px 24px 314px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover {
|
||||
toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover {
|
||||
-moz-image-region: rect(24px 338px 48px 314px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"][disabled="true"] {
|
||||
toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(48px 338px 72px 314px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(72px 338px 96px 314px);
|
||||
}
|
||||
|
||||
|
@ -429,16 +429,16 @@ toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:not([disabled="
|
|||
|
||||
/* unified dropmarker with keyhole icons, small icons mode, RTL version */
|
||||
|
||||
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"] {
|
||||
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px 314px 24px 301px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover {
|
||||
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl):not([disabled="true"]):hover {
|
||||
-moz-image-region: rect(24px 314px 48px 301px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"][disabled="true"] {
|
||||
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(48px 314px 72px 301px);
|
||||
}
|
||||
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(72px 314px 96px 301px);
|
||||
}
|
||||
|
||||
|
@ -460,17 +460,17 @@ toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"
|
|||
-moz-image-region: rect(96px 24px 120px 0px);
|
||||
}
|
||||
|
||||
#back-button[chromedir="rtl"] {
|
||||
#back-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px 48px 24px 24px);
|
||||
}
|
||||
#back-button[chromedir="rtl"]:not([disabled="true"]):hover,
|
||||
#back-button[chromedir="rtl"][buttonover="true"] {
|
||||
#back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover,
|
||||
#back-button:-moz-locale-dir(rtl)[buttonover="true"] {
|
||||
-moz-image-region: rect(24px 48px 48px 24px);
|
||||
}
|
||||
#back-button[chromedir="rtl"][disabled="true"] {
|
||||
#back-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(48px 48px 72px 24px);
|
||||
}
|
||||
#back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
#back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(96px 48px 120px 24px);
|
||||
}
|
||||
|
||||
|
@ -490,17 +490,17 @@ toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"
|
|||
-moz-image-region: rect(96px 48px 120px 24px);
|
||||
}
|
||||
|
||||
#forward-button[chromedir="rtl"] {
|
||||
#forward-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px 24px 24px 0px);
|
||||
}
|
||||
#forward-button[chromedir="rtl"]:not([disabled="true"]):hover,
|
||||
#forward-button[chromedir="rtl"][buttonover="true"] {
|
||||
#forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover,
|
||||
#forward-button:-moz-locale-dir(rtl)[buttonover="true"] {
|
||||
-moz-image-region: rect(24px 24px 48px 0px);
|
||||
}
|
||||
#forward-button[chromedir="rtl"][disabled="true"] {
|
||||
#forward-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(48px 24px 72px 0px);
|
||||
}
|
||||
#forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
#forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(96px 24px 120px 0px);
|
||||
}
|
||||
|
||||
|
@ -696,6 +696,18 @@ toolbar:not([iconsize="small"]) #new-window-button > .toolbarbutton-icon {
|
|||
-moz-image-region: rect(96px 336px 120px 312px);
|
||||
}
|
||||
|
||||
/* fullscreen button */
|
||||
|
||||
#fullscreen-button {
|
||||
-moz-image-region: rect(0px 360px 24px 336px);
|
||||
}
|
||||
#fullscreen-button:hover {
|
||||
-moz-image-region: rect(24px 360px 48px 336px);
|
||||
}
|
||||
#fullscreen-button:hover:active {
|
||||
-moz-image-region: rect(96px 360px 120px 336px);
|
||||
}
|
||||
|
||||
/* ::::: 16px primary toolbar buttons ::::: */
|
||||
|
||||
toolbar[iconsize="small"] .toolbarbutton-1 {
|
||||
|
@ -727,21 +739,21 @@ toolbar[iconsize="small"] #back-button:not([disabled="true"]):hover:active {
|
|||
-moz-image-region: rect(64px 16px 80px 0px);
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #back-button[chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px 32px 16px 16px);
|
||||
}
|
||||
toolbar[iconsize="small"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover,
|
||||
toolbar[iconsize="small"] #back-button[chromedir="rtl"][buttonover="true"] {
|
||||
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover,
|
||||
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl)[buttonover="true"] {
|
||||
-moz-image-region: rect(16px 32px 32px 16px);
|
||||
}
|
||||
toolbar[iconsize="small"] #back-button[chromedir="rtl"][disabled="true"] {
|
||||
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(32px 32px 48px 16px);
|
||||
}
|
||||
toolbar[iconsize="small"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(64px 32px 80px 16px);
|
||||
}
|
||||
.unified-nav-back[_moz-menuactive],
|
||||
menupopup[chromedir="rtl"] > .unified-nav-forward[_moz-menuactive] {
|
||||
menupopup:-moz-locale-dir(rtl) > .unified-nav-forward[_moz-menuactive] {
|
||||
list-style-image: url("chrome://browser/skin/menu-back.png") !important;
|
||||
}
|
||||
|
||||
|
@ -764,21 +776,21 @@ toolbar[iconsize="small"] #forward-button:not([disabled="true"]):hover:active {
|
|||
-moz-image-region: rect(64px 32px 80px 16px);
|
||||
}
|
||||
|
||||
toolbar[iconsize="small"] #forward-button[chromedir="rtl"] {
|
||||
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px 16px 16px 0px);
|
||||
}
|
||||
toolbar[iconsize="small"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover,
|
||||
toolbar[iconsize="small"] #forward-button[chromedir="rtl"][buttonover="true"] {
|
||||
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover,
|
||||
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl)[buttonover="true"] {
|
||||
-moz-image-region: rect(16px 16px 32px 0px);
|
||||
}
|
||||
toolbar[iconsize="small"] #forward-button[chromedir="rtl"][disabled="true"] {
|
||||
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(32px 16px 48px 0px);
|
||||
}
|
||||
toolbar[iconsize="small"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
|
||||
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
|
||||
-moz-image-region: rect(64px 16px 80px 0px);
|
||||
}
|
||||
.unified-nav-forward[_moz-menuactive],
|
||||
menupopup[chromedir="rtl"] > .unified-nav-back[_moz-menuactive] {
|
||||
menupopup:-moz-locale-dir(rtl) > .unified-nav-back[_moz-menuactive] {
|
||||
list-style-image: url("chrome://browser/skin/menu-forward.png") !important;
|
||||
}
|
||||
|
||||
|
@ -1008,6 +1020,21 @@ toolbar[iconsize="small"] #paste-button:not([disabled="true"]):hover:active {
|
|||
-moz-image-region: rect(64px 224px 80px 208px);
|
||||
}
|
||||
|
||||
/* fullscreen button */
|
||||
|
||||
toolbar[iconsize="small"] #fullscreen-button > .toolbarbutton-icon {
|
||||
padding-left: 1px;
|
||||
}
|
||||
toolbar[iconsize="small"] #fullscreen-button {
|
||||
-moz-image-region: rect(0px 240px 16px 224px);
|
||||
}
|
||||
toolbar[iconsize="small"] #fullscreen-button:hover {
|
||||
-moz-image-region: rect(16px 240px 32px 224px);
|
||||
}
|
||||
toolbar[iconsize="small"] #fullscreen-button:hover:active {
|
||||
-moz-image-region: rect(64px 240px 80px 224px);
|
||||
}
|
||||
|
||||
/* ::::: fullscreen window controls ::::: */
|
||||
|
||||
#minimize-button,
|
||||
|
@ -1101,7 +1128,7 @@ toolbar[iconsize="small"] #paste-button:not([disabled="true"]):hover:active {
|
|||
direction: ltr !important;
|
||||
}
|
||||
|
||||
#PopupAutoComplete[chromedir="rtl"] > tree > treerows {
|
||||
#PopupAutoComplete:-moz-locale-dir(rtl) > tree > treerows {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
|
@ -1508,7 +1535,7 @@ tabpanels {
|
|||
-moz-border-radius-topright: 2px;
|
||||
}
|
||||
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-up[chromedir="rtl"] {
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(rtl) {
|
||||
border-left-style: solid;
|
||||
border-right-style: none;
|
||||
-moz-border-radius-topleft: 2px;
|
||||
|
@ -1527,16 +1554,16 @@ tabpanels {
|
|||
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-right.png");
|
||||
}
|
||||
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-down[chromedir="rtl"],
|
||||
.tabs-container > .tabs-newtab-button[chromedir="rtl"],
|
||||
.tabs-container > stack[chromedir="rtl"] > .tabs-alltabs-button {
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-locale-dir(rtl),
|
||||
.tabs-container > .tabs-newtab-button:-moz-locale-dir(rtl),
|
||||
.tabs-container > stack:-moz-locale-dir(rtl) > .tabs-alltabs-button {
|
||||
border-left-style: none;
|
||||
border-right-style: solid;
|
||||
-moz-border-radius-topleft: 0px;
|
||||
-moz-border-radius-topright: 2px;
|
||||
}
|
||||
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-down[chromedir="rtl"] {
|
||||
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-left.png");
|
||||
}
|
||||
|
||||
|
@ -1592,7 +1619,7 @@ tabpanels {
|
|||
opacity: 0.0;
|
||||
}
|
||||
|
||||
stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
|
||||
stack:-moz-locale-dir(rtl) > hbox > .tabs-alltabs-box-animate {
|
||||
background-image: url("chrome://browser/skin/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png");
|
||||
}
|
||||
|
||||
|
@ -1643,7 +1670,7 @@ stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
|
|||
-moz-border-radius-topleft: 2px;
|
||||
}
|
||||
|
||||
.tabs-container > .tabs-closebutton[chromedir="rtl"] {
|
||||
.tabs-container > .tabs-closebutton:-moz-locale-dir(rtl) {
|
||||
border-left: none;
|
||||
border-right: 1px solid threedshadow;
|
||||
-moz-border-radius-topleft: 0px;
|
||||
|
@ -1660,7 +1687,7 @@ toolbarbutton.chevron {
|
|||
list-style-image: url("chrome://global/skin/toolbar/chevron.gif") !important;
|
||||
}
|
||||
|
||||
toolbarbutton.chevron[chromedir="rtl"] {
|
||||
toolbarbutton.chevron:-moz-locale-dir(rtl) {
|
||||
list-style-image: url("chrome://global/skin/toolbar/chevron-rtl.gif") !important;
|
||||
}
|
||||
|
||||
|
@ -1712,13 +1739,13 @@ toolbar[mode="text"] > #window-controls > toolbarbutton > .toolbarbutton-text {
|
|||
-moz-image-region: rect(0, 26px, 11px, 13px);
|
||||
}
|
||||
|
||||
#urlbar[chromedir="ltr"] > .autocomplete-history-dropmarker {
|
||||
#urlbar:-moz-locale-dir(ltr) > .autocomplete-history-dropmarker {
|
||||
border-left: 1px solid;
|
||||
-moz-border-left-colors: transparent;
|
||||
}
|
||||
|
||||
#urlbar[chromedir="ltr"] > .autocomplete-history-dropmarker:hover ,
|
||||
#urlbar[chromedir="ltr"] > .autocomplete-history-dropmarker[open="true"] {
|
||||
#urlbar:-moz-locale-dir(ltr) > .autocomplete-history-dropmarker:hover ,
|
||||
#urlbar:-moz-locale-dir(ltr) > .autocomplete-history-dropmarker[open="true"] {
|
||||
-moz-border-left-colors: ButtonShadow;
|
||||
}
|
||||
|
||||
|
@ -1802,7 +1829,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
|||
/* ::::: Identity Indicator Styling ::::: */
|
||||
/* Location bar visuals*/
|
||||
|
||||
#urlbar[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
|
||||
#urlbar:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
|
||||
-moz-margin-start: 6px;
|
||||
}
|
||||
|
||||
|
@ -1818,10 +1845,10 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
|||
-moz-box-shadow: 1px 1px 0 rgba(255,255,255,.3) inset,
|
||||
0 -1px 0 rgba(255,255,255,.2) inset;
|
||||
}
|
||||
#identity-box[chromedir="rtl"] {
|
||||
#identity-box:-moz-locale-dir(ltr) {
|
||||
-moz-border-start-style: solid;
|
||||
}
|
||||
#identity-box[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
|
||||
#identity-box:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
|
||||
-moz-border-radius: 6px 0 2px 6px / 15px 0 2px 15px;
|
||||
margin: -1px 0;
|
||||
-moz-margin-start: -4px;
|
||||
|
@ -1980,7 +2007,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
|||
}
|
||||
|
||||
/* Bug 413060, comment 14: Match #identity-box's -moz-margin-start, less 1px */
|
||||
#identity-popup[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
|
||||
#identity-popup:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
|
||||
-moz-margin-start: 3px;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,36 +20,36 @@
|
|||
}
|
||||
|
||||
#back-button,
|
||||
#forward-button[chromedir="rtl"] {
|
||||
#forward-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 24px, 24px, 0px);
|
||||
}
|
||||
#back-button:not([disabled="true"]):hover,
|
||||
#forward-button:not([disabled="true"]):hover[chromedir="rtl"] {
|
||||
#forward-button:not([disabled="true"]):hover:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(24px, 24px, 48px, 0px);
|
||||
}
|
||||
#back-button[disabled="true"],
|
||||
#forward-button[chromedir="rtl"][disabled="true"] {
|
||||
#forward-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(48px, 24px, 72px, 0px) !important;
|
||||
}
|
||||
#back-button:not([disabled="true"]):hover:active,
|
||||
#forward-button:not([disabled="true"]):hover:active[chromedir="rtl"] {
|
||||
#forward-button:not([disabled="true"]):hover:active:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(72px, 24px, 96px, 0px);
|
||||
}
|
||||
|
||||
#forward-button,
|
||||
#back-button[chromedir="rtl"] {
|
||||
#back-button:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(0px, 48px, 24px, 24px);
|
||||
}
|
||||
#forward-button:not([disabled="true"]):hover,
|
||||
#back-button:not([disabled="true"]):hover[chromedir="rtl"] {
|
||||
#back-button:not([disabled="true"]):hover:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(24px, 48px, 48px, 24px);
|
||||
}
|
||||
#forward-button[disabled="true"],
|
||||
#back-button[chromedir="rtl"][disabled="true"] {
|
||||
#back-button:-moz-locale-dir(rtl)[disabled="true"] {
|
||||
-moz-image-region: rect(48px, 48px, 72px, 24px) !important;
|
||||
}
|
||||
#forward-button:not([disabled="true"]):hover:active,
|
||||
#back-button:not([disabled="true"]):hover:active[chromedir="rtl"] {
|
||||
#back-button:not([disabled="true"]):hover:active:-moz-locale-dir(rtl) {
|
||||
-moz-image-region: rect(72px, 48px, 96px, 24px);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@
|
|||
background: url(chrome://global/skin/arrow/arrow-dn.gif) right center no-repeat;
|
||||
}
|
||||
|
||||
#placesMenu[chromedir="rtl"] > menu > label {
|
||||
#placesMenu:-moz-locale-dir(rtl) > menu > label {
|
||||
background-position: left center;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
0 -1px 0 rgba(255,255,255,.4) inset;
|
||||
}
|
||||
|
||||
.searchbar-engine-button:-moz-system-metric(windows-default-theme)[chromedir="ltr"] {
|
||||
.searchbar-engine-button:-moz-system-metric(windows-default-theme):-moz-locale-dir(ltr) {
|
||||
-moz-border-right-colors: rgba(0,0,0,.05);
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@
|
|||
background: transparent url(chrome://browser/skin/Search-addengines.png) no-repeat right center;
|
||||
}
|
||||
|
||||
.searchbar-engine-button[addengines="true"][chromedir="rtl"] > .button-box {
|
||||
.searchbar-engine-button[addengines="true"]:-moz-locale-dir(rtl) > .button-box {
|
||||
background-position: left center;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@
|
|||
-moz-image-region: rect(0px 16px 16px 0px);
|
||||
}
|
||||
|
||||
.search-go-button[chromedir="rtl"] {
|
||||
.search-go-button:-moz-locale-dir(rtl) {
|
||||
-moz-transform: scaleX(-1);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,18 @@
|
|||
|
||||
dnl AM_PATH_NSPR([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for NSPR, and define NSPR_CFLAGS and NSPR_LIBS
|
||||
dnl
|
||||
dnl If the nspr-config script is available, use it to find the
|
||||
dnl appropriate CFLAGS and LIBS, and to check for the required
|
||||
dnl version, and run ACTION-IF-FOUND.
|
||||
dnl
|
||||
dnl Otherwise, if NO_NSPR_CONFIG_SYSTEM_VERSION is set, we use it,
|
||||
dnl NO_NSPR_CONFIG_SYSTEM_CFLAGS, and NO_NSPR_CONFIG_SYSTEM_LIBS to
|
||||
dnl provide default values, and run ACTION-IF-FOUND. (Some systems
|
||||
dnl ship NSPR without nspr-config, but can glean the appropriate flags
|
||||
dnl and version.)
|
||||
dnl
|
||||
dnl Otherwise, run ACTION-IF-NOT-FOUND.
|
||||
AC_DEFUN([AM_PATH_NSPR],
|
||||
[dnl
|
||||
|
||||
|
@ -38,17 +50,24 @@ AC_ARG_WITH(nspr-exec-prefix,
|
|||
AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version)
|
||||
|
||||
no_nspr=""
|
||||
if test "$NSPR_CONFIG" = "no"; then
|
||||
no_nspr="yes"
|
||||
else
|
||||
if test "$NSPR_CONFIG" != "no"; then
|
||||
NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags`
|
||||
NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs`
|
||||
NSPR_VERSION_STRING=`$NSPR_CONFIG $nspr_config_args --version`
|
||||
elif test -n "${NO_NSPR_CONFIG_SYSTEM_VERSION}"; then
|
||||
NSPR_CFLAGS="${NO_NSPR_CONFIG_SYSTEM_CFLAGS}"
|
||||
NSPR_LIBS="${NO_NSPR_CONFIG_SYSTEM_LDFLAGS}"
|
||||
NSPR_VERSION_STRING="$NO_NSPR_CONFIG_SYSTEM_VERSION"
|
||||
else
|
||||
no_nspr="yes"
|
||||
fi
|
||||
|
||||
nspr_config_major_version=`$NSPR_CONFIG $nspr_config_args --version | \
|
||||
if test -z "$no_nspr"; then
|
||||
nspr_config_major_version=`echo $NSPR_VERSION_STRING | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
nspr_config_minor_version=`$NSPR_CONFIG $nspr_config_args --version | \
|
||||
nspr_config_minor_version=`echo $NSPR_VERSION_STRING | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
nspr_config_micro_version=`$NSPR_CONFIG $nspr_config_args --version | \
|
||||
nspr_config_micro_version=`echo $NSPR_VERSION_STRING | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
min_nspr_major_version=`echo $min_nspr_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIICKDCCAZGgAwIBAgIFAIyjFPowDQYJKoZIhvcNAQEFBQAwKDEXMBUGA1UEAwwO
|
||||
KgB3d3cubXlDQS5vcmcxDTALBgNVBAMTBG15Q0EwHhcNMDkwMzE0MTg0NzU2WhcN
|
||||
MTkwMzE0MTg0NzU2WjBhMRMwEQYDVQQKEwpCYWRndXkgSW5jMRcwFQYDVQQDEw53
|
||||
d3cuYmFkZ3V5LmNvbTEZMBcGA1UECxMQSGFja2luZyBEaXZpc2lvbjEWMBQGBFUE
|
||||
gAMTDHd3dy5iYW5rLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2YvL
|
||||
GgmF0OTLBKz0nYTvR+DlnZai7b2MqAIM9IUEpMfqzJPNYCsXziYXgHtr/do9ppJP
|
||||
BhDjeyIGEOSpgBqdkWItxlLopUHnf8VKwnDPPj4KkNyXuTLm60X/ph+/zrjTw+kU
|
||||
m+/kVYstgGMuTIoTuu7loxCqqeVlAgc5lzTpUhkCAwEAAaMlMCMwDAYDVR0TAQH/
|
||||
BAIwADATBgNVHSUEDDAKBggrBgEFBQcDATANBgkqhkiG9w0BAQUFAAOBgQAKHl1G
|
||||
vaXftj5QPK3eIT6Q3fWuGKR39grlg5GL/WocPanYycOlm9zvT1Hx95cY6msIXSKp
|
||||
xycndJ02ODX35DDgolV6VHUsM9yoagk+eqs5kCqW2qiv3moIshL0yWVhuCobMA+E
|
||||
D3wHFCPqVU+igRdCrEQDxZHoFOR4J/DKHfGANg==
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,16 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIICljCCAf+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBkDERMA8GBPMlBAMTB2F0
|
||||
dGFjazcxEDAOBgOABAMTB2F0dGFjazYxEzARBgZVBP///38TB2F0dGFjazUxEjAQ
|
||||
BgVVBAOBgRMHYXR0YWNrNDEUMBIGB1UEgICAgIATB2F0dGFjazMxFDASBgdVBJCA
|
||||
gIABEwdhdHRhY2syMRQwEgYHVQSIgICAARMHYXR0YWNrMTAeFw0wOTA0MTMxNDAw
|
||||
MzdaFw0yOTA0MTMxNDAwMzdaMIGQMREwDwYE8yUEAxMHYXR0YWNrNzEQMA4GA4AE
|
||||
AxMHYXR0YWNrNjETMBEGBlUE////fxMHYXR0YWNrNTESMBAGBVUEA4GBEwdhdHRh
|
||||
Y2s0MRQwEgYHVQSAgICAgBMHYXR0YWNrMzEUMBIGB1UEkICAgAETB2F0dGFjazIx
|
||||
FDASBgdVBIiAgIABEwdhdHRhY2sxMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
|
||||
gQC77fQ1wrywBnVmr8XO0/78/qFOz+sjnMlpBvLx5UImittgMNSgEqNulRDbO0qG
|
||||
K4tlFF2sNsS7aOun6Cq7yl2+a8mIljmjzs+iwCLOEAkQTOM4RsdCosJVy/fjwmH1
|
||||
xI0uXt5cPkA0FM7B/IZSzWSC+2gY1+u1AhRJ35bXDhu92wIDAQABMA0GCSqGSIb3
|
||||
DQEBBQUAA4GBAFZitQjsQJ1+XsxKchBefilaHsi4oncc05P29IXcRbHI8wK2vNk8
|
||||
kkG2c6M4a4Rx1R4C3n99NwXH4vyNUbA9FuMSAdjaS3TW3zm8lKNCuIWGuI2Vvefy
|
||||
+wNcCfb8B4AuP8pZOqqKsspgiBAE1EPPErnb7nMVLCnf+ts9ARXLBZTi
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,14 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIICMTCCAZqgAwIBAgIFAIyjFTAwDQYJKoZIhvcNAQEFBQAwKDEXMBUGA1UEAwwO
|
||||
KgB3d3cubXlDQS5vcmcxDTALBgNVBAMTBG15Q0EwHhcNMDkwMzE0MTg0ODI0WhcN
|
||||
MTkwMzE0MTg0ODI0WjBqMRMwEQYDVQQKEwpCYWRndXkgSW5jMRcwFQYDVQQDEw53
|
||||
d3cuYmFkZ3V5LmNvbTEZMBcGA1UECxMQSGFja2luZyBEaXZpc2lvbjEfMB0GDVUE
|
||||
goCAgICAgICAgAMTDHd3dy5iYW5rLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
|
||||
gYkCgYEA2YvLGgmF0OTLBKz0nYTvR+DlnZai7b2MqAIM9IUEpMfqzJPNYCsXziYX
|
||||
gHtr/do9ppJPBhDjeyIGEOSpgBqdkWItxlLopUHnf8VKwnDPPj4KkNyXuTLm60X/
|
||||
ph+/zrjTw+kUm+/kVYstgGMuTIoTuu7loxCqqeVlAgc5lzTpUhkCAwEAAaMlMCMw
|
||||
DAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcDATANBgkqhkiG9w0BAQUF
|
||||
AAOBgQBr+ekYoADBm6kbHBR1oc/6O9ZciRsTbxIAl3xjA3kNEeiUXXSoe+1dlt3Z
|
||||
7D6EaQztqR8usCW728J3vi8p/XxociK3r4aq0Sxu29gp21N1V/Um8y3ssI+Yt9Im
|
||||
oHlo5ikUXra5PtGAwi4FymrU5dWlHxYk1PlNP5nsvxdElPZnZA==
|
||||
-----END CERTIFICATE-----
|
Двоичные данные
build/pgo/certs/cert8.db
Двоичные данные
build/pgo/certs/cert8.db
Двоичный файл не отображается.
Двоичные данные
build/pgo/certs/key3.db
Двоичные данные
build/pgo/certs/key3.db
Двоичный файл не отображается.
|
@ -156,3 +156,7 @@ https://sub.sectest1.example.org:443
|
|||
# Used while testing the url-classifier
|
||||
#
|
||||
http://malware.example.com:80
|
||||
|
||||
# Bug 483437, 484111
|
||||
https://www.bank1.com:443 privileged,cert=escapeattack1
|
||||
https://www.bank2.com:443 privileged,cert=escapeattack2
|
||||
|
|
|
@ -198,43 +198,53 @@ SetEnvironmentVariableW(const unsigned short* name,
|
|||
|
||||
|
||||
unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
||||
unsigned short* lpDst,
|
||||
unsigned int nSize)
|
||||
unsigned short* lpDst,
|
||||
unsigned int nSize)
|
||||
{
|
||||
if ( NULL == lpDst )
|
||||
return 0;
|
||||
|
||||
|
||||
unsigned int size = 0;
|
||||
unsigned int index = 0;
|
||||
unsigned int origLen = wcslen(lpSrc);
|
||||
|
||||
const unsigned short *pIn = lpSrc;
|
||||
unsigned short *pOut = lpDst;
|
||||
|
||||
|
||||
while ( index < origLen ) {
|
||||
|
||||
|
||||
if (*pIn != L'%') { // Regular char, copy over
|
||||
if ( size < nSize ) *pOut = *pIn, pOut++;
|
||||
index++, size++, pIn++;
|
||||
if ( size++ < nSize ) *pOut = *pIn, pOut++;
|
||||
index++, pIn++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Have a starting '%' - look for matching '%'
|
||||
int envlen = 0;
|
||||
const unsigned short *pTmp = ++pIn; // Move past original '%'
|
||||
while ( L'%' != *pTmp ) {
|
||||
const unsigned short *pTmp = pIn + 1;
|
||||
while ( *pTmp != L'%' && *pTmp != L' ' ) {
|
||||
envlen++, pTmp++;
|
||||
if ( origLen < index + envlen ) { // Ran past end of original
|
||||
SetLastError(ERROR_INVALID_PARAMETER); // buffer without matching '%'
|
||||
return -1;
|
||||
while ( envlen-- ) {
|
||||
if ( size++ < nSize ) *pOut = *pIn, pOut++;
|
||||
index++, pIn++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( *pTmp == L' ' ) { // Need to append through space
|
||||
while ( envlen-- ) {
|
||||
if ( size++ < nSize ) *pOut = *pIn, pOut++;
|
||||
index++, pIn++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
pIn++; // Move past original %
|
||||
if ( 0 == envlen ) { // Encountered a "%%" - mapping to "%"
|
||||
size++;
|
||||
if ( size < nSize ) *pOut = *pIn, pOut++;
|
||||
pIn++;
|
||||
index += 2;
|
||||
if ( size++ < nSize ) *pOut = *pIn, pOut++;
|
||||
index += 2, pIn++;
|
||||
} else {
|
||||
// Encountered a "%something%" - mapping "something"
|
||||
char key[256];
|
||||
|
@ -252,7 +262,7 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
|||
pIn = ++pTmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( size < nSize ) lpDst[size] = 0;
|
||||
return size;
|
||||
}
|
||||
|
|
|
@ -139,8 +139,7 @@ PRUint32 nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin;
|
|||
|
||||
static
|
||||
nsresult
|
||||
GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
|
||||
nsACString& aOrigin)
|
||||
GetOriginFromURI(nsIURI* aURI, nsACString& aOrigin)
|
||||
{
|
||||
if (nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin > 1) {
|
||||
// Allow a single recursive call to GetPrincipalDomainOrigin, since that
|
||||
|
@ -151,16 +150,8 @@ GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
|
|||
}
|
||||
|
||||
nsAutoInPrincipalDomainOriginSetter autoSetter;
|
||||
aOrigin.Truncate();
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
aPrincipal->GetDomain(getter_AddRefs(uri));
|
||||
if (!uri) {
|
||||
aPrincipal->GetURI(getter_AddRefs(uri));
|
||||
}
|
||||
NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED);
|
||||
|
||||
uri = NS_GetInnermostURI(uri);
|
||||
nsCOMPtr<nsIURI> uri = NS_GetInnermostURI(aURI);
|
||||
NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsCAutoString hostPort;
|
||||
|
@ -182,6 +173,22 @@ GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static
|
||||
nsresult
|
||||
GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
|
||||
nsACString& aOrigin)
|
||||
{
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
aPrincipal->GetDomain(getter_AddRefs(uri));
|
||||
if (!uri) {
|
||||
aPrincipal->GetURI(getter_AddRefs(uri));
|
||||
}
|
||||
NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED);
|
||||
|
||||
return GetOriginFromURI(uri, aOrigin);
|
||||
}
|
||||
|
||||
// Inline copy of JS_GetPrivate() for better inlining and optimization
|
||||
// possibilities. Also doesn't take a cx argument as it's not
|
||||
// needed. We access the private data only on objects whose private
|
||||
|
@ -831,35 +838,81 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
|
|||
|
||||
NS_ConvertUTF8toUTF16 className(classInfoData.GetName());
|
||||
nsCAutoString subjectOrigin;
|
||||
nsCAutoString subjectDomain;
|
||||
if (!nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin) {
|
||||
GetPrincipalDomainOrigin(subjectPrincipal, subjectOrigin);
|
||||
nsCOMPtr<nsIURI> uri, domain;
|
||||
subjectPrincipal->GetURI(getter_AddRefs(uri));
|
||||
// Subject can't be system if we failed the security
|
||||
// check, so |uri| is non-null.
|
||||
NS_ASSERTION(uri, "How did that happen?");
|
||||
GetOriginFromURI(uri, subjectOrigin);
|
||||
subjectPrincipal->GetDomain(getter_AddRefs(domain));
|
||||
if (domain) {
|
||||
GetOriginFromURI(domain, subjectDomain);
|
||||
}
|
||||
} else {
|
||||
subjectOrigin.AssignLiteral("the security manager");
|
||||
}
|
||||
NS_ConvertUTF8toUTF16 subjectOriginUnicode(subjectOrigin);
|
||||
NS_ConvertUTF8toUTF16 subjectDomainUnicode(subjectDomain);
|
||||
|
||||
nsCAutoString objectOrigin;
|
||||
nsCAutoString objectDomain;
|
||||
if (!nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin &&
|
||||
objectPrincipal) {
|
||||
GetPrincipalDomainOrigin(objectPrincipal, objectOrigin);
|
||||
nsCOMPtr<nsIURI> uri, domain;
|
||||
objectPrincipal->GetURI(getter_AddRefs(uri));
|
||||
if (uri) { // Object principal might be system
|
||||
GetOriginFromURI(uri, objectOrigin);
|
||||
}
|
||||
objectPrincipal->GetDomain(getter_AddRefs(domain));
|
||||
if (domain) {
|
||||
GetOriginFromURI(domain, objectDomain);
|
||||
}
|
||||
}
|
||||
NS_ConvertUTF8toUTF16 objectOriginUnicode(objectOrigin);
|
||||
|
||||
NS_ConvertUTF8toUTF16 objectDomainUnicode(objectDomain);
|
||||
|
||||
nsXPIDLString errorMsg;
|
||||
const PRUnichar *formatStrings[] =
|
||||
{
|
||||
subjectOriginUnicode.get(),
|
||||
className.get(),
|
||||
JSValIDToString(cx, aProperty),
|
||||
objectOriginUnicode.get()
|
||||
objectOriginUnicode.get(),
|
||||
subjectDomainUnicode.get(),
|
||||
objectDomainUnicode.get()
|
||||
};
|
||||
|
||||
PRUint32 length = NS_ARRAY_LENGTH(formatStrings);
|
||||
|
||||
// XXXbz Our localization system is stupid and can't handle not showing
|
||||
// some strings that get passed in. Which means that we have to get
|
||||
// our length precisely right: it has to be exactly the number of
|
||||
// strings our format string wants. This means we'll have to move
|
||||
// strings in the array as needed, sadly...
|
||||
if (nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin ||
|
||||
!objectPrincipal) {
|
||||
stringName.AppendLiteral("OnlySubject");
|
||||
--length;
|
||||
length -= 3;
|
||||
} else {
|
||||
// default to a length that doesn't include the domains, then
|
||||
// increase it as needed.
|
||||
length -= 2;
|
||||
if (!subjectDomainUnicode.IsEmpty()) {
|
||||
stringName.AppendLiteral("SubjectDomain");
|
||||
length += 1;
|
||||
}
|
||||
if (!objectDomainUnicode.IsEmpty()) {
|
||||
stringName.AppendLiteral("ObjectDomain");
|
||||
length += 1;
|
||||
if (length != NS_ARRAY_LENGTH(formatStrings)) {
|
||||
// We have an object domain but not a subject domain.
|
||||
// Scoot our string over one slot. See the XXX comment
|
||||
// above for why we need to do this.
|
||||
formatStrings[length-1] = formatStrings[length];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We need to keep our existing failure rv and not override it
|
||||
|
@ -2863,7 +2916,7 @@ nsScriptSecurityManager::CanCreateWrapper(JSContext *cx,
|
|||
#ifdef DEBUG_CAPS_CanCreateWrapper
|
||||
char* iidStr = aIID.ToString();
|
||||
printf("### CanCreateWrapper(%s) ", iidStr);
|
||||
nsCRT::free(iidStr);
|
||||
NS_Free(iidStr);
|
||||
#endif
|
||||
// XXX Special case for nsIXPCException ?
|
||||
ClassInfoData objClassInfo = ClassInfoData(aClassInfo, nsnull);
|
||||
|
@ -2992,7 +3045,7 @@ nsScriptSecurityManager::CanCreateInstance(JSContext *cx,
|
|||
#ifdef DEBUG_CAPS_CanCreateInstance
|
||||
char* cidStr = aCID.ToString();
|
||||
printf("### CanCreateInstance(%s) ", cidStr);
|
||||
nsCRT::free(cidStr);
|
||||
NS_Free(cidStr);
|
||||
#endif
|
||||
|
||||
nsresult rv = CheckXPCPermissions(nsnull, nsnull, nsnull, nsnull);
|
||||
|
@ -3029,7 +3082,7 @@ nsScriptSecurityManager::CanGetService(JSContext *cx,
|
|||
#ifdef DEBUG_CAPS_CanGetService
|
||||
char* cidStr = aCID.ToString();
|
||||
printf("### CanGetService(%s) ", cidStr);
|
||||
nsCRT::free(cidStr);
|
||||
NS_Free(cidStr);
|
||||
#endif
|
||||
|
||||
nsresult rv = CheckXPCPermissions(nsnull, nsnull, nsnull, nsnull);
|
||||
|
|
|
@ -179,7 +179,7 @@ check-interactive:
|
|||
-I$(topsrcdir)/build \
|
||||
$(testxpcsrcdir)/runxpcshelltests.py \
|
||||
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||
--test=$(SOLO_FILE) \
|
||||
--test-path=$(SOLO_FILE) \
|
||||
--interactive \
|
||||
$(DIST)/bin/xpcshell \
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
|
||||
|
@ -190,7 +190,7 @@ check-one:
|
|||
-I$(topsrcdir)/build \
|
||||
$(testxpcsrcdir)/runxpcshelltests.py \
|
||||
--symbols-path=$(DIST)/crashreporter-symbols \
|
||||
--test=$(SOLO_FILE) \
|
||||
--test-path=$(SOLO_FILE) \
|
||||
$(DIST)/bin/xpcshell \
|
||||
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
|
||||
|
||||
|
|
10
configure.in
10
configure.in
|
@ -1385,6 +1385,12 @@ sun4u | sparc*)
|
|||
x86_64 | ia64)
|
||||
CPU_ARCH="$OS_TEST"
|
||||
;;
|
||||
|
||||
arm)
|
||||
if test "$OS_TARGET" == "WINCE"; then
|
||||
CPU_ARCH="$OS_TEST"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$OS_TARGET"; then
|
||||
|
@ -2008,7 +2014,7 @@ case "$target" in
|
|||
;;
|
||||
|
||||
*-wince*)
|
||||
|
||||
TARGET_COMPILER_ABI=msvc
|
||||
MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
|
||||
AR_LIST="$AR -list"
|
||||
AR_EXTRACT="$AR -extract"
|
||||
|
@ -4508,7 +4514,7 @@ MOZ_DBGRINFO_MODULES=
|
|||
MOZ_ENABLE_CANVAS=1
|
||||
MOZ_ENABLE_CANVAS3D=
|
||||
MOZ_FEEDS=1
|
||||
MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
|
||||
MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp icon"
|
||||
MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
|
||||
MOZ_JAVAXPCOM=
|
||||
MOZ_JSDEBUGGER=1
|
||||
|
|
|
@ -105,8 +105,8 @@ class nsIBoxObject;
|
|||
|
||||
// IID for the nsIDocument interface
|
||||
#define NS_IDOCUMENT_IID \
|
||||
{ 0x46003091, 0x7f99, 0x420f, \
|
||||
{ 0x95, 0xbc, 0x28, 0xd7, 0xd5, 0x01, 0x5a, 0x41 } }
|
||||
{ 0xe0ca6723, 0x1efa, 0x4819, \
|
||||
{ 0x84, 0xbb, 0xfa, 0x48, 0x39, 0xe8, 0xef, 0x19 } }
|
||||
|
||||
// Flag for AddStyleSheet().
|
||||
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
|
||||
|
@ -1156,6 +1156,15 @@ public:
|
|||
*/
|
||||
virtual void MaybePreLoadImage(nsIURI* uri) = 0;
|
||||
|
||||
/**
|
||||
* Returns true if the locale used for the document specifies a direction of
|
||||
* right to left. For chrome documents, this comes from the chrome registry.
|
||||
* This is used to determine the current state for the :-moz-locale-dir pseudoclass
|
||||
* so once can know whether a document is expected to be rendered left-to-right
|
||||
* or right-to-left.
|
||||
*/
|
||||
virtual PRBool IsDocumentRightToLeft() { return PR_FALSE; }
|
||||
|
||||
protected:
|
||||
~nsIDocument()
|
||||
{
|
||||
|
|
|
@ -165,6 +165,7 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
|
|||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsDOMDataTransfer.h"
|
||||
#include "nsHtml5Module.h"
|
||||
#include "nsPresContext.h"
|
||||
|
||||
#ifdef IBMBIDI
|
||||
#include "nsIBidiKeyboard.h"
|
||||
|
|
|
@ -134,6 +134,7 @@
|
|||
#include "nsXBLInsertionPoint.h"
|
||||
#include "nsICSSStyleRule.h" /* For nsCSSSelectorList */
|
||||
#include "nsCSSRuleProcessor.h"
|
||||
#include "nsRuleProcessorData.h"
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsIXULDocument.h"
|
||||
|
@ -3209,15 +3210,10 @@ nsGenericElement::doInsertChildAt(nsIContent* aKid, PRUint32 aIndex,
|
|||
return rv;
|
||||
}
|
||||
|
||||
// The kid may have removed its parent from the document, so recheck that
|
||||
// that's still in the document before proceeding. Also, the kid may have
|
||||
// just removed itself, in which case we don't really want to fire
|
||||
// ContentAppended or a mutation event.
|
||||
// XXXbz What if the kid just moved us in the document? Scripts suck. We
|
||||
// really need to stop running them while we're in the middle of modifying
|
||||
// the DOM....
|
||||
NS_ASSERTION(aKid->GetNodeParent() == container,
|
||||
"Did we run script inappropriately?");
|
||||
|
||||
if (aNotify && aKid->GetNodeParent() == container) {
|
||||
if (aNotify) {
|
||||
// Note that we always want to call ContentInserted when things are added
|
||||
// as kids to documents
|
||||
if (aParent && isAppend) {
|
||||
|
@ -3730,7 +3726,7 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
|
|||
|
||||
// We want an update batch when we expect several mutations to be performed,
|
||||
// which is when we're replacing a node, or when we're inserting a fragment.
|
||||
mozAutoDocConditionalContentUpdateBatch(aDocument,
|
||||
mozAutoDocConditionalContentUpdateBatch batch(aDocument,
|
||||
aReplace || nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE);
|
||||
|
||||
// If we're replacing
|
||||
|
@ -3768,6 +3764,12 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
|
|||
if (nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
|
||||
PRUint32 count = newContent->GetChildCount();
|
||||
|
||||
if (!count) {
|
||||
returnVal.swap(*aReturn);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Copy the children into a separate array to avoid having to deal with
|
||||
// mutations to the fragment while we're inserting.
|
||||
nsCOMArray<nsIContent> fragChildren;
|
||||
|
@ -3793,25 +3795,12 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
|
|||
mutated = mutated || guard.Mutated(1);
|
||||
}
|
||||
|
||||
// Iterate through the fragment's children, and insert them in the new
|
||||
// parent
|
||||
for (i = 0; i < count; ++i) {
|
||||
// Get the n:th child from the array.
|
||||
nsIContent* childContent = fragChildren[i];
|
||||
|
||||
// If we've had any unexpeted mutations so far we need to recheck that
|
||||
// the child can still be inserted.
|
||||
if (mutated) {
|
||||
// We really only need to update insPos if we *just* got an unexpected
|
||||
// mutation as opposed to 3 insertions ago. But this is an edgecase so
|
||||
// no need to over optimize.
|
||||
insPos = refContent ? container->IndexOf(refContent) :
|
||||
container->GetChildCount();
|
||||
if (insPos < 0) {
|
||||
// Someone seriously messed up the childlist. We have no idea
|
||||
// where to insert the remaining children, so just bail.
|
||||
return NS_ERROR_DOM_NOT_FOUND_ERR;
|
||||
}
|
||||
// If we've had any unexpeted mutations so far we need to recheck that
|
||||
// the child can still be inserted.
|
||||
if (mutated) {
|
||||
for (i = 0; i < count; ++i) {
|
||||
// Get the n:th child from the array.
|
||||
nsIContent* childContent = fragChildren[i];
|
||||
|
||||
nsCOMPtr<nsIDOMNode> tmpNode = do_QueryInterface(childContent);
|
||||
PRUint16 tmpType = 0;
|
||||
|
@ -3824,18 +3813,64 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
|
|||
}
|
||||
}
|
||||
|
||||
nsMutationGuard guard;
|
||||
insPos = refContent ? container->IndexOf(refContent) :
|
||||
container->GetChildCount();
|
||||
if (insPos < 0) {
|
||||
// Someone seriously messed up the childlist. We have no idea
|
||||
// where to insert the remaining children, so just bail.
|
||||
return NS_ERROR_DOM_NOT_FOUND_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
PRBool appending = aParent && (insPos == container->GetChildCount());
|
||||
PRBool firstInsPos = insPos;
|
||||
|
||||
// Iterate through the fragment's children, and insert them in the new
|
||||
// parent
|
||||
for (i = 0; i < count; ++i, ++insPos) {
|
||||
nsIContent* childContent = fragChildren[i];
|
||||
|
||||
// XXXbz how come no reparenting here? That seems odd...
|
||||
// Insert the child.
|
||||
res = container->InsertChildAt(childContent, insPos, PR_TRUE);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
res = container->InsertChildAt(childContent, insPos, PR_FALSE);
|
||||
if (NS_FAILED(res)) {
|
||||
// Make sure to notify on any children that we did succeed to insert
|
||||
if (appending && i != 0) {
|
||||
nsNodeUtils::ContentAppended(aParent, firstInsPos);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// Check to see if any evil mutation events mucked around with the
|
||||
// child list.
|
||||
mutated = mutated || guard.Mutated(1);
|
||||
|
||||
++insPos;
|
||||
if (!appending) {
|
||||
nsNodeUtils::ContentInserted(container, childContent, insPos);
|
||||
}
|
||||
}
|
||||
|
||||
// Notify
|
||||
if (appending) {
|
||||
nsNodeUtils::ContentAppended(aParent, firstInsPos);
|
||||
}
|
||||
|
||||
// Fire mutation events. Optimize for the case when there are no listeners
|
||||
nsIDocument* doc = container->GetOwnerDoc();
|
||||
nsPIDOMWindow* window = nsnull;
|
||||
if (doc && (window = doc->GetInnerWindow()) &&
|
||||
window->HasMutationListeners(NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
|
||||
|
||||
for (i = 0; i < count; ++i, ++insPos) {
|
||||
nsIContent* childContent = fragChildren[i];
|
||||
|
||||
if (nsContentUtils::HasMutationListeners(childContent,
|
||||
NS_EVENT_BITS_MUTATION_NODEINSERTED, container)) {
|
||||
mozAutoRemovableBlockerRemover blockerRemover;
|
||||
|
||||
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_NODEINSERTED);
|
||||
mutation.mRelatedNode = do_QueryInterface(container);
|
||||
|
||||
mozAutoSubtreeModified subtree(container->GetOwnerDoc(), container);
|
||||
nsEventDispatcher::Dispatch(childContent, nsnull, &mutation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -503,6 +503,7 @@ GK_ATOM(listing, "listing")
|
|||
GK_ATOM(listitem, "listitem")
|
||||
GK_ATOM(listrows, "listrows")
|
||||
GK_ATOM(load, "load")
|
||||
GK_ATOM(localedir, "localedir")
|
||||
GK_ATOM(localName, "local-name")
|
||||
GK_ATOM(longdesc, "longdesc")
|
||||
#ifdef MOZ_MEDIA
|
||||
|
|
|
@ -45,656 +45,7 @@ relativesrcdir = content/canvas/test
|
|||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
_TEST_FILES_0 = \
|
||||
test_fallback.basic.html \
|
||||
test_fallback.multiple.html \
|
||||
test_fallback.nested.html \
|
||||
test_type.name.html \
|
||||
test_type.exists.html \
|
||||
test_type.delete.html \
|
||||
test_type.prototype.html \
|
||||
test_type.replace.html \
|
||||
test_type.extend.html \
|
||||
test_size.attributes.html \
|
||||
test_size.attributes.type.get.html \
|
||||
test_size.attributes.type.set.html \
|
||||
test_size.attributes.default.html \
|
||||
test_size.attributes.reflect.1.html \
|
||||
test_size.attributes.reflect.2.html \
|
||||
test_size.attributes.removed.html \
|
||||
test_size.attributes.parse.whitespace.html \
|
||||
test_size.attributes.parse.nonnumber.html \
|
||||
test_size.attributes.parse.zero.html \
|
||||
test_size.attributes.parse.negative.html \
|
||||
test_size.attributes.parse.zerosuffix.html \
|
||||
test_size.attributes.parse.floatsuffix.html \
|
||||
test_size.attributes.parse.badsuffix.html \
|
||||
test_size.attributes.parse.percentsuffix.html \
|
||||
test_size.attributes.setAttribute.whitespace.html \
|
||||
test_size.attributes.setAttribute.nonnumber.html \
|
||||
test_size.attributes.setAttribute.zero.html \
|
||||
test_size.attributes.setAttribute.negative.html \
|
||||
test_size.attributes.setAttribute.zerosuffix.html \
|
||||
test_size.attributes.setAttribute.floatsuffix.html \
|
||||
test_size.attributes.setAttribute.badsuffix.html \
|
||||
test_size.attributes.setAttribute.percentsuffix.html \
|
||||
test_size.attributes.style.html \
|
||||
test_initial.colour.html \
|
||||
test_initial.reset.different.html \
|
||||
test_initial.reset.same.html \
|
||||
test_initial.reset.path.html \
|
||||
test_initial.reset.clip.html \
|
||||
test_initial.reset.transform.html \
|
||||
test_initial.reset.gradient.html \
|
||||
test_initial.reset.pattern.html \
|
||||
test_context.emptystring.html \
|
||||
test_context.unrecognised.badname.html \
|
||||
test_context.unrecognised.badsuffix.html \
|
||||
test_context.unrecognised.nullsuffix.html \
|
||||
test_context.unrecognised.unicode.html \
|
||||
test_context.casesensitive.html \
|
||||
test_context.arguments.missing.html \
|
||||
test_context.arguments.extra.html \
|
||||
test_toDataURL.default.html \
|
||||
test_toDataURL.png.html \
|
||||
test_toDataURL.unrecognised.html \
|
||||
test_toDataURL.lowercase.html \
|
||||
test_toDataURL.arguments.1.html \
|
||||
test_toDataURL.arguments.2.html \
|
||||
test_toDataURL.arguments.3.html \
|
||||
test_toDataURL.nocontext.html \
|
||||
test_toDataURL.zerosize.html \
|
||||
test_toDataURL.primarycolours.html \
|
||||
test_toDataURL.complexcolours.html \
|
||||
test_2d.getcontext.exists.html \
|
||||
test_2d.type.exists.html \
|
||||
test_2d.type.delete.html \
|
||||
test_2d.type.prototype.html \
|
||||
test_2d.type.replace.html \
|
||||
test_2d.type.extend.html \
|
||||
test_2d.getcontext.unique.html \
|
||||
test_2d.getcontext.shared.html \
|
||||
test_2d.voidreturn.html \
|
||||
test_2d.missingargs.html \
|
||||
test_2d.scaled.html \
|
||||
test_2d.canvas.reference.html \
|
||||
test_2d.canvas.readonly.html \
|
||||
test_2d.state.saverestore.strokeStyle.html \
|
||||
test_2d.state.saverestore.fillStyle.html \
|
||||
test_2d.state.saverestore.globalAlpha.html \
|
||||
test_2d.state.saverestore.lineWidth.html \
|
||||
test_2d.state.saverestore.lineCap.html \
|
||||
test_2d.state.saverestore.lineJoin.html \
|
||||
test_2d.state.saverestore.miterLimit.html \
|
||||
test_2d.state.saverestore.shadowOffsetX.html \
|
||||
test_2d.state.saverestore.shadowOffsetY.html \
|
||||
test_2d.state.saverestore.shadowBlur.html \
|
||||
test_2d.state.saverestore.shadowColor.html \
|
||||
test_2d.state.saverestore.globalCompositeOperation.html \
|
||||
test_initial.reset.2dstate.html \
|
||||
test_2d.state.saverestore.transformation.html \
|
||||
test_2d.state.saverestore.clip.html \
|
||||
test_2d.state.saverestore.path.html \
|
||||
test_2d.state.saverestore.bitmap.html \
|
||||
test_2d.state.saverestore.stack.html \
|
||||
test_2d.state.saverestore.stackdepth.html \
|
||||
test_2d.state.saverestore.underflow.html \
|
||||
test_2d.transformation.order.html \
|
||||
test_2d.transformation.scale.basic.html \
|
||||
test_2d.transformation.scale.zero.html \
|
||||
test_2d.transformation.scale.negative.html \
|
||||
test_2d.transformation.scale.large.html \
|
||||
test_2d.transformation.scale.nonfinite.html \
|
||||
test_2d.transformation.scale.multiple.html \
|
||||
$(NULL)
|
||||
|
||||
_TEST_FILES_1 = \
|
||||
test_2d.transformation.rotate.zero.html \
|
||||
test_2d.transformation.rotate.radians.html \
|
||||
test_2d.transformation.rotate.direction.html \
|
||||
test_2d.transformation.rotate.wrap.html \
|
||||
test_2d.transformation.rotate.wrapnegative.html \
|
||||
test_2d.transformation.rotate.nonfinite.html \
|
||||
test_2d.transformation.translate.basic.html \
|
||||
test_2d.transformation.translate.nonfinite.html \
|
||||
test_2d.transformation.transform.identity.html \
|
||||
test_2d.transformation.transform.skewed.html \
|
||||
test_2d.transformation.transform.multiply.html \
|
||||
test_2d.transformation.transform.nonfinite.html \
|
||||
test_2d.transformation.setTransform.skewed.html \
|
||||
test_2d.transformation.setTransform.multiple.html \
|
||||
test_2d.transformation.setTransform.nonfinite.html \
|
||||
test_2d.composite.globalAlpha.range.html \
|
||||
test_2d.composite.globalAlpha.invalid.html \
|
||||
test_2d.composite.globalAlpha.default.html \
|
||||
test_2d.composite.globalAlpha.fill.html \
|
||||
test_2d.composite.globalAlpha.image.html \
|
||||
test_2d.composite.globalAlpha.canvas.html \
|
||||
test_2d.composite.globalAlpha.imagepattern.html \
|
||||
test_2d.composite.globalAlpha.canvaspattern.html \
|
||||
test_2d.composite.solid.source-over.html \
|
||||
test_2d.composite.solid.destination-over.html \
|
||||
test_2d.composite.solid.source-in.html \
|
||||
test_2d.composite.solid.destination-in.html \
|
||||
test_2d.composite.solid.source-out.html \
|
||||
test_2d.composite.solid.destination-out.html \
|
||||
test_2d.composite.solid.source-atop.html \
|
||||
test_2d.composite.solid.destination-atop.html \
|
||||
test_2d.composite.solid.copy.html \
|
||||
test_2d.composite.transparent.source-over.html \
|
||||
test_2d.composite.transparent.destination-over.html \
|
||||
test_2d.composite.transparent.source-in.html \
|
||||
test_2d.composite.transparent.destination-in.html \
|
||||
test_2d.composite.transparent.source-out.html \
|
||||
test_2d.composite.transparent.destination-out.html \
|
||||
test_2d.composite.transparent.source-atop.html \
|
||||
test_2d.composite.transparent.destination-atop.html \
|
||||
test_2d.composite.transparent.copy.html \
|
||||
test_2d.composite.image.source-over.html \
|
||||
test_2d.composite.image.destination-over.html \
|
||||
test_2d.composite.image.destination-out.html \
|
||||
test_2d.composite.image.source-atop.html \
|
||||
test_2d.composite.image.copy.html \
|
||||
test_2d.composite.canvas.source-over.html \
|
||||
test_2d.composite.canvas.destination-over.html \
|
||||
test_2d.composite.canvas.destination-out.html \
|
||||
test_2d.composite.canvas.source-atop.html \
|
||||
test_2d.composite.canvas.copy.html \
|
||||
test_2d.composite.uncovered.fill.copy.html \
|
||||
test_2d.composite.uncovered.image.copy.html \
|
||||
test_2d.composite.uncovered.pattern.copy.html \
|
||||
test_2d.composite.clip.source-over.html \
|
||||
test_2d.composite.clip.destination-over.html \
|
||||
test_2d.composite.clip.source-in.html \
|
||||
test_2d.composite.clip.destination-in.html \
|
||||
test_2d.composite.clip.source-out.html \
|
||||
test_2d.composite.clip.destination-out.html \
|
||||
test_2d.composite.clip.source-atop.html \
|
||||
test_2d.composite.clip.destination-atop.html \
|
||||
test_2d.composite.clip.copy.html \
|
||||
test_2d.composite.operation.get.html \
|
||||
test_2d.composite.operation.unrecognised.html \
|
||||
test_2d.composite.operation.darker.html \
|
||||
test_2d.composite.operation.over.html \
|
||||
test_2d.composite.operation.clear.html \
|
||||
test_2d.composite.operation.highlight.html \
|
||||
test_2d.composite.operation.nullsuffix.html \
|
||||
$(NULL)
|
||||
|
||||
_TEST_FILES_2 = \
|
||||
test_2d.composite.operation.casesensitive.html \
|
||||
test_2d.composite.operation.default.html \
|
||||
test_2d.fillStyle.parse.html4.html \
|
||||
test_2d.fillStyle.parse.hex3.html \
|
||||
test_2d.fillStyle.parse.hex6.html \
|
||||
test_2d.fillStyle.parse.rgb-num.html \
|
||||
test_2d.fillStyle.parse.rgb-clamp-1.html \
|
||||
test_2d.fillStyle.parse.rgb-clamp-2.html \
|
||||
test_2d.fillStyle.parse.rgb-clamp-3.html \
|
||||
test_2d.fillStyle.parse.rgb-clamp-4.html \
|
||||
test_2d.fillStyle.parse.rgb-clamp-5.html \
|
||||
test_2d.fillStyle.parse.rgb-percent.html \
|
||||
test_2d.fillStyle.parse.rgba-solid-1.html \
|
||||
test_2d.fillStyle.parse.rgba-solid-2.html \
|
||||
test_2d.fillStyle.parse.rgba-num-1.html \
|
||||
test_2d.fillStyle.parse.rgba-num-2.html \
|
||||
test_2d.fillStyle.parse.rgba-percent.html \
|
||||
test_2d.fillStyle.parse.rgba-clamp-1.html \
|
||||
test_2d.fillStyle.parse.rgba-clamp-2.html \
|
||||
test_2d.fillStyle.parse.transparent-1.html \
|
||||
test_2d.fillStyle.parse.transparent-2.html \
|
||||
test_2d.fillStyle.parse.hsl-1.html \
|
||||
test_2d.fillStyle.parse.hsl-2.html \
|
||||
test_2d.fillStyle.parse.hsl-3.html \
|
||||
test_2d.fillStyle.parse.hsl-4.html \
|
||||
test_2d.fillStyle.parse.hsl-5.html \
|
||||
test_2d.fillStyle.parse.hsl-clamp-1.html \
|
||||
test_2d.fillStyle.parse.hsl-clamp-2.html \
|
||||
test_2d.fillStyle.parse.hsl-clamp-3.html \
|
||||
test_2d.fillStyle.parse.hsl-clamp-4.html \
|
||||
test_2d.fillStyle.parse.hsla-1.html \
|
||||
test_2d.fillStyle.parse.hsla-2.html \
|
||||
test_2d.fillStyle.parse.hsla-clamp-1.html \
|
||||
test_2d.fillStyle.parse.hsla-clamp-2.html \
|
||||
test_2d.fillStyle.parse.hsla-clamp-3.html \
|
||||
test_2d.fillStyle.parse.hsla-clamp-4.html \
|
||||
test_2d.fillStyle.parse.hsla-clamp-5.html \
|
||||
test_2d.fillStyle.parse.hsla-clamp-6.html \
|
||||
test_2d.fillStyle.parse.svg-1.html \
|
||||
test_2d.fillStyle.parse.svg-2.html \
|
||||
test_2d.fillStyle.parse.invalid.hex3.html \
|
||||
test_2d.fillStyle.parse.invalid.hex6.html \
|
||||
test_2d.fillStyle.parse.invalid.rgb-1.html \
|
||||
test_2d.fillStyle.parse.invalid.rgb-2.html \
|
||||
test_2d.fillStyle.parse.invalid.rgb-3.html \
|
||||
test_2d.fillStyle.parse.invalid.rgb-4.html \
|
||||
test_2d.fillStyle.parse.invalid.rgb-5.html \
|
||||
test_2d.fillStyle.parse.invalid.rgb-6.html \
|
||||
test_2d.fillStyle.parse.invalid.rgb-7.html \
|
||||
test_2d.fillStyle.parse.invalid.rgba-1.html \
|
||||
test_2d.fillStyle.parse.invalid.rgba-2.html \
|
||||
test_2d.fillStyle.parse.invalid.rgba-3.html \
|
||||
test_2d.fillStyle.parse.invalid.rgba-4.html \
|
||||
test_2d.fillStyle.parse.invalid.rgba-5.html \
|
||||
test_2d.fillStyle.parse.invalid.hsl-1.html \
|
||||
test_2d.fillStyle.parse.invalid.hsl-2.html \
|
||||
test_2d.fillStyle.parse.invalid.hsl-3.html \
|
||||
test_2d.fillStyle.parse.invalid.hsl-4.html \
|
||||
test_2d.fillStyle.parse.invalid.hsl-5.html \
|
||||
test_2d.fillStyle.parse.invalid.hsla-1.html \
|
||||
test_2d.fillStyle.parse.invalid.hsla-2.html \
|
||||
test_2d.fillStyle.parse.system.html \
|
||||
test_2d.fillStyle.parse.current.basic.html \
|
||||
test_2d.fillStyle.parse.current.changed.html \
|
||||
test_2d.fillStyle.parse.current.removed.html \
|
||||
test_2d.fillStyle.invalidstring.html \
|
||||
test_2d.fillStyle.invalidtype.html \
|
||||
test_2d.fillStyle.get.solid.html \
|
||||
test_2d.fillStyle.get.semitransparent.html \
|
||||
test_2d.fillStyle.get.transparent.html \
|
||||
test_2d.fillStyle.default.html \
|
||||
test_2d.strokeStyle.default.html \
|
||||
test_2d.gradient.object.type.html \
|
||||
test_2d.gradient.object.return.html \
|
||||
test_2d.gradient.interpolate.solid.html \
|
||||
test_2d.gradient.interpolate.colour.html \
|
||||
test_2d.gradient.interpolate.alpha.html \
|
||||
test_2d.gradient.interpolate.colouralpha.html \
|
||||
test_2d.gradient.interpolate.outside.html \
|
||||
test_2d.gradient.interpolate.zerosize.html \
|
||||
test_2d.gradient.interpolate.vertical.html \
|
||||
test_2d.gradient.interpolate.multiple.html \
|
||||
test_2d.gradient.interpolate.overlap.html \
|
||||
test_2d.gradient.interpolate.overlap2.html \
|
||||
test_2d.gradient.empty.html \
|
||||
test_2d.gradient.object.update.html \
|
||||
test_2d.gradient.object.compare.html \
|
||||
test_2d.gradient.object.crosscanvas.html \
|
||||
test_2d.gradient.object.invalidoffset.html \
|
||||
test_2d.gradient.object.invalidcolour.html \
|
||||
test_2d.gradient.linear.nonfinite.html \
|
||||
test_2d.gradient.linear.transform.1.html \
|
||||
test_2d.gradient.linear.transform.2.html \
|
||||
test_2d.gradient.linear.transform.3.html \
|
||||
test_2d.gradient.radial.negative.html \
|
||||
test_2d.gradient.radial.nonfinite.html \
|
||||
test_2d.gradient.radial.inside1.html \
|
||||
$(NULL)
|
||||
|
||||
_TEST_FILES_3 = \
|
||||
test_2d.gradient.radial.cone.bottom.html \
|
||||
test_2d.gradient.radial.cone.cylinder.html \
|
||||
test_2d.gradient.radial.cone.shape1.html \
|
||||
test_2d.gradient.radial.transform.1.html \
|
||||
test_2d.gradient.radial.transform.2.html \
|
||||
test_2d.gradient.radial.transform.3.html \
|
||||
test_2d.pattern.basic.type.html \
|
||||
test_2d.pattern.basic.image.html \
|
||||
test_2d.pattern.basic.canvas.html \
|
||||
test_2d.pattern.basic.zerocanvas.html \
|
||||
test_2d.pattern.basic.nocontext.html \
|
||||
test_2d.pattern.image.undefined.html \
|
||||
test_2d.pattern.image.null.html \
|
||||
test_2d.pattern.image.string.html \
|
||||
test_2d.pattern.image.incomplete.html \
|
||||
test_2d.pattern.image.broken.html \
|
||||
test_2d.pattern.repeat.empty.html \
|
||||
test_2d.pattern.repeat.null.html \
|
||||
test_2d.pattern.repeat.undefined.html \
|
||||
test_2d.pattern.repeat.unrecognised.html \
|
||||
test_2d.pattern.repeat.case.html \
|
||||
test_2d.pattern.repeat.nullsuffix.html \
|
||||
test_2d.pattern.modify.image1.html \
|
||||
test_2d.pattern.modify.image2.html \
|
||||
test_2d.pattern.modify.canvas1.html \
|
||||
test_2d.pattern.modify.canvas2.html \
|
||||
test_2d.pattern.crosscanvas.html \
|
||||
test_2d.pattern.paint.norepeat.basic.html \
|
||||
test_2d.pattern.paint.norepeat.outside.html \
|
||||
test_2d.pattern.paint.norepeat.coord1.html \
|
||||
test_2d.pattern.paint.norepeat.coord2.html \
|
||||
test_2d.pattern.paint.norepeat.coord3.html \
|
||||
test_2d.pattern.paint.repeat.basic.html \
|
||||
test_2d.pattern.paint.repeat.outside.html \
|
||||
test_2d.pattern.paint.repeat.coord1.html \
|
||||
test_2d.pattern.paint.repeat.coord2.html \
|
||||
test_2d.pattern.paint.repeat.coord3.html \
|
||||
test_2d.pattern.paint.repeatx.basic.html \
|
||||
test_2d.pattern.paint.repeatx.outside.html \
|
||||
test_2d.pattern.paint.repeatx.coord1.html \
|
||||
test_2d.pattern.paint.repeaty.basic.html \
|
||||
test_2d.pattern.paint.repeaty.outside.html \
|
||||
test_2d.pattern.paint.repeaty.coord1.html \
|
||||
test_2d.pattern.paint.orientation.image.html \
|
||||
test_2d.pattern.paint.orientation.canvas.html \
|
||||
test_2d.pattern.animated.gif.html \
|
||||
test_2d.line.defaults.html \
|
||||
test_2d.line.width.basic.html \
|
||||
test_2d.line.width.transformed.html \
|
||||
test_2d.line.width.invalid.html \
|
||||
test_2d.line.cap.butt.html \
|
||||
test_2d.line.cap.round.html \
|
||||
test_2d.line.cap.square.html \
|
||||
test_2d.line.cap.open.html \
|
||||
test_2d.line.cap.invalid.html \
|
||||
test_2d.line.join.bevel.html \
|
||||
test_2d.line.join.round.html \
|
||||
test_2d.line.join.miter.html \
|
||||
test_2d.line.join.open.html \
|
||||
test_2d.line.join.closed.html \
|
||||
test_2d.line.join.invalid.html \
|
||||
test_2d.line.miter.exceeded.html \
|
||||
test_2d.line.miter.acute.html \
|
||||
test_2d.line.miter.obtuse.html \
|
||||
test_2d.line.miter.rightangle.html \
|
||||
test_2d.line.miter.lineedge.html \
|
||||
test_2d.line.miter.within.html \
|
||||
test_2d.line.miter.invalid.html \
|
||||
test_2d.line.cross.html \
|
||||
test_2d.line.union.html \
|
||||
test_2d.clearRect.basic.html \
|
||||
test_2d.clearRect.path.html \
|
||||
test_2d.clearRect.zero.html \
|
||||
test_2d.clearRect.negative.html \
|
||||
test_2d.clearRect.transform.html \
|
||||
test_2d.clearRect.globalalpha.html \
|
||||
test_2d.clearRect.globalcomposite.html \
|
||||
test_2d.clearRect.clip.html \
|
||||
test_2d.clearRect.shadow.html \
|
||||
test_2d.clearRect.nonfinite.html \
|
||||
test_2d.fillRect.basic.html \
|
||||
test_2d.fillRect.path.html \
|
||||
test_2d.fillRect.zero.html \
|
||||
test_2d.fillRect.negative.html \
|
||||
test_2d.fillRect.transform.html \
|
||||
test_2d.fillRect.clip.html \
|
||||
test_2d.fillRect.shadow.html \
|
||||
$(NULL)
|
||||
|
||||
_TEST_FILES_4 = \
|
||||
test_2d.fillRect.nonfinite.html \
|
||||
test_2d.strokeRect.basic.html \
|
||||
test_2d.strokeRect.path.html \
|
||||
test_2d.strokeRect.zero.1.html \
|
||||
test_2d.strokeRect.zero.2.html \
|
||||
test_2d.strokeRect.zero.3.html \
|
||||
test_2d.strokeRect.zero.4.html \
|
||||
test_2d.strokeRect.negative.html \
|
||||
test_2d.strokeRect.transform.html \
|
||||
test_2d.strokeRect.globalalpha.html \
|
||||
test_2d.strokeRect.globalcomposite.html \
|
||||
test_2d.strokeRect.clip.html \
|
||||
test_2d.strokeRect.shadow.html \
|
||||
test_2d.strokeRect.nonfinite.html \
|
||||
test_2d.path.initial.html \
|
||||
test_2d.path.beginPath.html \
|
||||
test_2d.path.moveTo.basic.html \
|
||||
test_2d.path.moveTo.newsubpath.html \
|
||||
test_2d.path.moveTo.multiple.html \
|
||||
test_2d.path.moveTo.nonfinite.html \
|
||||
test_2d.path.closePath.empty.html \
|
||||
test_2d.path.closePath.newline.html \
|
||||
test_2d.path.closePath.nextpoint.html \
|
||||
test_2d.path.lineTo.emptysubpath.html \
|
||||
test_2d.path.lineTo.basic.html \
|
||||
test_2d.path.lineTo.nextpoint.html \
|
||||
test_2d.path.lineTo.nonfinite.html \
|
||||
test_2d.path.quadraticCurveTo.emptysubpath.html \
|
||||
test_2d.path.quadraticCurveTo.basic.html \
|
||||
test_2d.path.quadraticCurveTo.shape.html \
|
||||
test_2d.path.quadraticCurveTo.scaled.html \
|
||||
test_2d.path.quadraticCurveTo.nonfinite.html \
|
||||
test_2d.path.bezierCurveTo.emptysubpath.html \
|
||||
test_2d.path.bezierCurveTo.basic.html \
|
||||
test_2d.path.bezierCurveTo.shape.html \
|
||||
test_2d.path.bezierCurveTo.scaled.html \
|
||||
test_2d.path.bezierCurveTo.nonfinite.html \
|
||||
test_2d.path.arcTo.emptysubpath.html \
|
||||
test_2d.path.arcTo.coincide.1.html \
|
||||
test_2d.path.arcTo.coincide.2.html \
|
||||
test_2d.path.arcTo.collinear.1.html \
|
||||
test_2d.path.arcTo.collinear.2.html \
|
||||
test_2d.path.arcTo.collinear.3.html \
|
||||
test_2d.path.arcTo.shape.curve1.html \
|
||||
test_2d.path.arcTo.shape.curve2.html \
|
||||
test_2d.path.arcTo.shape.start.html \
|
||||
test_2d.path.arcTo.shape.end.html \
|
||||
test_2d.path.arcTo.negative.html \
|
||||
test_2d.path.arcTo.zero.1.html \
|
||||
test_2d.path.arcTo.zero.2.html \
|
||||
test_2d.path.arcTo.transformation.html \
|
||||
test_2d.path.arcTo.scale.html \
|
||||
test_2d.path.arcTo.nonfinite.html \
|
||||
test_2d.path.arc.empty.html \
|
||||
test_2d.path.arc.nonempty.html \
|
||||
test_2d.path.arc.end.html \
|
||||
test_2d.path.arc.angle.1.html \
|
||||
test_2d.path.arc.angle.2.html \
|
||||
test_2d.path.arc.angle.3.html \
|
||||
test_2d.path.arc.angle.4.html \
|
||||
test_2d.path.arc.angle.5.html \
|
||||
test_2d.path.arc.angle.6.html \
|
||||
test_2d.path.arc.zero.1.html \
|
||||
test_2d.path.arc.zero.2.html \
|
||||
test_2d.path.arc.twopie.1.html \
|
||||
test_2d.path.arc.twopie.2.html \
|
||||
test_2d.path.arc.twopie.3.html \
|
||||
test_2d.path.arc.twopie.4.html \
|
||||
test_2d.path.arc.shape.1.html \
|
||||
test_2d.path.arc.shape.2.html \
|
||||
test_2d.path.arc.shape.4.html \
|
||||
test_2d.path.arc.shape.5.html \
|
||||
test_2d.path.arc.selfintersect.1.html \
|
||||
test_2d.path.arc.selfintersect.2.html \
|
||||
test_2d.path.arc.negative.html \
|
||||
test_2d.path.arc.zeroradius.html \
|
||||
test_2d.path.arc.scale.1.html \
|
||||
test_2d.path.arc.scale.2.html \
|
||||
test_2d.path.arc.nonfinite.html \
|
||||
test_2d.path.rect.basic.html \
|
||||
test_2d.path.rect.newsubpath.html \
|
||||
test_2d.path.rect.closed.html \
|
||||
test_2d.path.rect.end.1.html \
|
||||
test_2d.path.rect.end.2.html \
|
||||
test_2d.path.rect.zero.1.html \
|
||||
test_2d.path.rect.zero.2.html \
|
||||
test_2d.path.rect.zero.3.html \
|
||||
test_2d.path.rect.zero.4.html \
|
||||
test_2d.path.rect.zero.5.html \
|
||||
test_2d.path.rect.negative.html \
|
||||
test_2d.path.rect.winding.html \
|
||||
test_2d.path.rect.nonfinite.html \
|
||||
test_2d.path.fill.overlap.html \
|
||||
test_2d.path.fill.winding.add.html \
|
||||
test_2d.path.fill.winding.subtract.1.html \
|
||||
test_2d.path.fill.winding.subtract.2.html \
|
||||
$(NULL)
|
||||
|
||||
_TEST_FILES_5 = \
|
||||
test_2d.path.fill.winding.subtract.3.html \
|
||||
test_2d.path.fill.closed.basic.html \
|
||||
test_2d.path.fill.closed.unaffected.html \
|
||||
test_2d.path.stroke.overlap.html \
|
||||
test_2d.path.stroke.union.html \
|
||||
test_2d.path.stroke.unaffected.html \
|
||||
test_2d.path.stroke.scale1.html \
|
||||
test_2d.path.stroke.scale2.html \
|
||||
test_2d.path.stroke.skew.html \
|
||||
test_2d.path.stroke.empty.html \
|
||||
test_2d.path.stroke.prune.line.html \
|
||||
test_2d.path.stroke.prune.closed.html \
|
||||
test_2d.path.stroke.prune.curve.html \
|
||||
test_2d.path.stroke.prune.arc.html \
|
||||
test_2d.path.stroke.prune.rect.html \
|
||||
test_2d.path.stroke.prune.corner.html \
|
||||
test_2d.path.transformation.basic.html \
|
||||
test_2d.path.transformation.multiple.html \
|
||||
test_2d.path.transformation.changing.html \
|
||||
test_2d.path.clip.empty.html \
|
||||
test_2d.path.clip.basic.1.html \
|
||||
test_2d.path.clip.basic.2.html \
|
||||
test_2d.path.clip.intersect.html \
|
||||
test_2d.path.clip.winding.1.html \
|
||||
test_2d.path.clip.winding.2.html \
|
||||
test_2d.path.clip.unaffected.html \
|
||||
test_2d.path.isPointInPath.basic.1.html \
|
||||
test_2d.path.isPointInPath.basic.2.html \
|
||||
test_2d.path.isPointInPath.edge.html \
|
||||
test_2d.path.isPointInPath.empty.html \
|
||||
test_2d.path.isPointInPath.subpath.html \
|
||||
test_2d.path.isPointInPath.outside.html \
|
||||
test_2d.path.isPointInPath.unclosed.html \
|
||||
test_2d.path.isPointInPath.arc.html \
|
||||
test_2d.path.isPointInPath.bigarc.html \
|
||||
test_2d.path.isPointInPath.bezier.html \
|
||||
test_2d.path.isPointInPath.winding.html \
|
||||
test_2d.path.isPointInPath.transform.1.html \
|
||||
test_2d.path.isPointInPath.transform.2.html \
|
||||
test_2d.path.isPointInPath.transform.3.html \
|
||||
test_2d.path.isPointInPath.nonfinite.html \
|
||||
test_2d.drawImage.3arg.html \
|
||||
test_2d.drawImage.5arg.html \
|
||||
test_2d.drawImage.9arg.basic.html \
|
||||
test_2d.drawImage.9arg.sourcepos.html \
|
||||
test_2d.drawImage.9arg.sourcesize.html \
|
||||
test_2d.drawImage.9arg.destpos.html \
|
||||
test_2d.drawImage.9arg.destsize.html \
|
||||
test_2d.drawImage.canvas.html \
|
||||
test_2d.drawImage.self.1.html \
|
||||
test_2d.drawImage.self.2.html \
|
||||
test_2d.drawImage.null.html \
|
||||
test_2d.drawImage.wrongtype.html \
|
||||
test_2d.drawImage.floatsource.html \
|
||||
test_2d.drawImage.zerosource.html \
|
||||
test_2d.drawImage.negativesource.html \
|
||||
test_2d.drawImage.negativedest.html \
|
||||
test_2d.drawImage.outsidesource.html \
|
||||
test_2d.drawImage.incomplete.html \
|
||||
test_2d.drawImage.broken.html \
|
||||
test_2d.drawImage.animated.gif.html \
|
||||
test_2d.drawImage.animated.apng.html \
|
||||
test_2d.drawImage.animated.poster.html \
|
||||
test_2d.drawImage.path.html \
|
||||
test_2d.drawImage.transform.html \
|
||||
test_2d.drawImage.alpha.html \
|
||||
test_2d.drawImage.clip.html \
|
||||
test_2d.drawImage.composite.html \
|
||||
test_2d.drawImage.nowrap.html \
|
||||
test_2d.drawImage.nonfinite.html \
|
||||
test_2d.imageData.create.basic.html \
|
||||
test_2d.imageData.create.type.html \
|
||||
test_2d.imageData.create.initial.html \
|
||||
test_2d.imageData.create.large.html \
|
||||
test_2d.imageData.create.tiny.html \
|
||||
test_2d.imageData.create.negative.html \
|
||||
test_2d.imageData.create.zero.html \
|
||||
test_2d.imageData.create.nonfinite.html \
|
||||
test_2d.imageData.create.round.html \
|
||||
test_2d.imageData.get.basic.html \
|
||||
test_2d.imageData.get.type.html \
|
||||
test_2d.imageData.get.zero.html \
|
||||
test_2d.imageData.get.nonfinite.html \
|
||||
test_2d.imageData.get.source.outside.html \
|
||||
test_2d.imageData.get.source.negative.html \
|
||||
test_2d.imageData.get.source.size.html \
|
||||
test_2d.imageData.get.tiny.html \
|
||||
test_2d.imageData.get.nonpremul.html \
|
||||
test_2d.imageData.get.range.html \
|
||||
test_2d.imageData.get.clamp.html \
|
||||
test_2d.imageData.get.order.cols.html \
|
||||
test_2d.imageData.get.order.rows.html \
|
||||
test_2d.imageData.get.order.rgb.html \
|
||||
test_2d.imageData.get.order.alpha.html \
|
||||
test_2d.imageData.get.unaffected.html \
|
||||
test_2d.imageData.object.properties.html \
|
||||
test_2d.imageData.object.readonly.html \
|
||||
test_2d.imageData.object.ctor.html \
|
||||
test_2d.imageData.object.set.html \
|
||||
test_2d.imageData.object.undefined.html \
|
||||
$(NULL)
|
||||
|
||||
_TEST_FILES_6 = \
|
||||
test_2d.imageData.object.nan.html \
|
||||
test_2d.imageData.object.string.html \
|
||||
test_2d.imageData.object.clamp.html \
|
||||
test_2d.imageData.object.round.html \
|
||||
test_2d.imageData.put.null.html \
|
||||
test_2d.imageData.put.nonfinite.html \
|
||||
test_2d.imageData.put.basic.html \
|
||||
test_2d.imageData.put.created.html \
|
||||
test_2d.imageData.put.wrongtype.html \
|
||||
test_2d.imageData.put.cross.html \
|
||||
test_2d.imageData.put.alpha.html \
|
||||
test_2d.imageData.put.modified.html \
|
||||
test_2d.imageData.put.dirty.zero.html \
|
||||
test_2d.imageData.put.dirty.rect1.html \
|
||||
test_2d.imageData.put.dirty.rect2.html \
|
||||
test_2d.imageData.put.dirty.negative.html \
|
||||
test_2d.imageData.put.dirty.outside.html \
|
||||
test_2d.imageData.put.unchanged.html \
|
||||
test_2d.imageData.put.unaffected.html \
|
||||
test_2d.imageData.put.clip.html \
|
||||
test_2d.imageData.put.path.html \
|
||||
test_2d.shadow.attributes.shadowBlur.1.html \
|
||||
test_2d.shadow.attributes.shadowBlur.2.html \
|
||||
test_2d.shadow.attributes.shadowOffset.1.html \
|
||||
test_2d.shadow.attributes.shadowOffset.2.html \
|
||||
test_2d.shadow.attributes.shadowColor.1.html \
|
||||
test_2d.shadow.attributes.shadowColor.2.html \
|
||||
test_2d.shadow.basic.1.html \
|
||||
test_2d.shadow.basic.2.html \
|
||||
test_2d.shadow.offset.positiveX.html \
|
||||
test_2d.shadow.offset.negativeX.html \
|
||||
test_2d.shadow.offset.positiveY.html \
|
||||
test_2d.shadow.offset.negativeY.html \
|
||||
test_2d.shadow.outside.html \
|
||||
test_2d.shadow.clip.1.html \
|
||||
test_2d.shadow.clip.2.html \
|
||||
test_2d.shadow.clip.3.html \
|
||||
test_2d.shadow.stroke.basic.html \
|
||||
test_2d.shadow.stroke.cap.1.html \
|
||||
test_2d.shadow.stroke.cap.2.html \
|
||||
test_2d.shadow.stroke.join.1.html \
|
||||
test_2d.shadow.stroke.join.2.html \
|
||||
test_2d.shadow.stroke.join.3.html \
|
||||
test_2d.shadow.image.basic.html \
|
||||
test_2d.shadow.image.transparent.1.html \
|
||||
test_2d.shadow.image.transparent.2.html \
|
||||
test_2d.shadow.image.alpha.html \
|
||||
test_2d.shadow.image.section.html \
|
||||
test_2d.shadow.image.scale.html \
|
||||
test_2d.shadow.canvas.basic.html \
|
||||
test_2d.shadow.canvas.transparent.1.html \
|
||||
test_2d.shadow.canvas.transparent.2.html \
|
||||
test_2d.shadow.canvas.alpha.html \
|
||||
test_2d.shadow.pattern.basic.html \
|
||||
test_2d.shadow.pattern.transparent.1.html \
|
||||
test_2d.shadow.pattern.transparent.2.html \
|
||||
test_2d.shadow.pattern.alpha.html \
|
||||
test_2d.shadow.gradient.basic.html \
|
||||
test_2d.shadow.gradient.transparent.1.html \
|
||||
test_2d.shadow.gradient.transparent.2.html \
|
||||
test_2d.shadow.gradient.alpha.html \
|
||||
test_2d.shadow.transform.1.html \
|
||||
test_2d.shadow.transform.2.html \
|
||||
test_2d.shadow.blur.low.html \
|
||||
test_2d.shadow.blur.high.html \
|
||||
test_2d.shadow.alpha.1.html \
|
||||
test_2d.shadow.alpha.2.html \
|
||||
test_2d.shadow.alpha.3.html \
|
||||
test_2d.shadow.alpha.4.html \
|
||||
test_2d.shadow.alpha.5.html \
|
||||
test_2d.shadow.composite.1.html \
|
||||
test_2d.shadow.composite.2.html \
|
||||
test_2d.shadow.composite.3.html \
|
||||
test_2d.shadow.composite.4.html \
|
||||
test_2d.imageSmoothing.html \
|
||||
test_bug397524.html \
|
||||
test_bug405982.html \
|
||||
test_text.font.html \
|
||||
test_text.textAlign.html \
|
||||
test_text.textBaseline.html \
|
||||
test_text.measure.html \
|
||||
test_text.space.replace.html \
|
||||
test_canvas.html \
|
||||
image_transparent50.png \
|
||||
image_redtransparent.png \
|
||||
image_yellow.png \
|
||||
|
@ -714,7 +65,6 @@ _TEST_FILES_6 = \
|
|||
image_green.png \
|
||||
image_green-redirect \
|
||||
image_green-redirect^headers^ \
|
||||
test_2d.imagedata_coercion.html \
|
||||
$(NULL)
|
||||
|
||||
# xor and lighter aren't well handled by cairo; they mostly work, but we don't want
|
||||
|
@ -746,14 +96,14 @@ _TEST_FILES_6 = \
|
|||
# Tests that fail on Mac (possibly because spec is underdefined?). Bug 407105
|
||||
ifneq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
||||
# XXX vlad don't test these anywhere, cairo behaviour changed
|
||||
_TEST_FILES_3 += \
|
||||
_TEST_FILES_0 += \
|
||||
test_2d.line.join.parallel.html \
|
||||
test_2d.strokeRect.zero.5.html \
|
||||
$(NULL)
|
||||
|
||||
# This is an issue with Quartz's handling of radial gradients and some numeric
|
||||
# imprecision that results in errors here.
|
||||
_TEST_FILES_2 += \
|
||||
_TEST_FILES_0 += \
|
||||
test_2d.gradient.radial.inside2.html \
|
||||
test_2d.gradient.radial.inside3.html \
|
||||
test_2d.gradient.radial.outside1.html \
|
||||
|
@ -761,7 +111,7 @@ _TEST_FILES_2 += \
|
|||
test_2d.gradient.radial.cone.top.html \
|
||||
$(NULL)
|
||||
|
||||
_TEST_FILES_3 += \
|
||||
_TEST_FILES_0 += \
|
||||
test_2d.composite.uncovered.image.source-in.html \
|
||||
test_2d.composite.uncovered.image.destination-in.html \
|
||||
test_2d.composite.uncovered.image.source-out.html \
|
||||
|
@ -772,7 +122,7 @@ _TEST_FILES_3 += \
|
|||
# destination bounds seem to have problems with the BEVEL/SQUARE join/cap combo.
|
||||
# The joins are rendered as if with MITER; the correct behaviour is also seen
|
||||
# if BUTT is used instead of SQUARE.
|
||||
_TEST_FILES_4 += test_2d.line.cap.closed.html
|
||||
_TEST_FILES_0 += test_2d.line.cap.closed.html
|
||||
|
||||
endif
|
||||
|
||||
|
@ -780,7 +130,7 @@ endif
|
|||
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
||||
|
||||
# still need bug numbers
|
||||
_TEST_FILES_1 += \
|
||||
_TEST_FILES_0 += \
|
||||
test_2d.composite.uncovered.fill.source-in.html \
|
||||
test_2d.composite.uncovered.fill.destination-in.html \
|
||||
test_2d.composite.uncovered.fill.source-out.html \
|
||||
|
@ -792,7 +142,7 @@ _TEST_FILES_1 += \
|
|||
$(NULL)
|
||||
|
||||
# still need bug numbers
|
||||
_TEST_FILES_3 += \
|
||||
_TEST_FILES_0 += \
|
||||
test_2d.gradient.radial.outside2.html \
|
||||
test_2d.gradient.radial.outside3.html \
|
||||
test_2d.gradient.radial.cone.shape2.html \
|
||||
|
@ -801,9 +151,9 @@ _TEST_FILES_3 += \
|
|||
$(NULL)
|
||||
|
||||
# still need bug numbers
|
||||
_TEST_FILES_4 += test_2d.path.arc.shape.3.html
|
||||
_TEST_FILES_0 += test_2d.path.arc.shape.3.html
|
||||
|
||||
_TEST_FILES_5 += test_2d.path.rect.selfintersect.html
|
||||
_TEST_FILES_0 += test_2d.path.rect.selfintersect.html
|
||||
endif
|
||||
|
||||
# These tests only pass on Mac OS X >= 10.5; see bug 450114
|
||||
|
@ -818,22 +168,3 @@ endif
|
|||
# split up into groups to work around command-line length limits
|
||||
libs:: $(_TEST_FILES_0)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_TEST_FILES_1)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_TEST_FILES_2)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_TEST_FILES_3)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_TEST_FILES_4)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_TEST_FILES_5)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_TEST_FILES_6)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -38,7 +38,6 @@
|
|||
#include "nsDOMDataTransfer.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIVariant.h"
|
||||
|
@ -219,6 +218,52 @@ nsDOMDataTransfer::GetMozUserCancelled(PRBool* aUserCancelled)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDataTransfer::GetFiles(nsIDOMFileList** aFileList)
|
||||
{
|
||||
*aFileList = nsnull;
|
||||
|
||||
if (mEventType != NS_DRAGDROP_DROP && mEventType != NS_DRAGDROP_DRAGDROP)
|
||||
return NS_OK;
|
||||
|
||||
if (!mFiles) {
|
||||
mFiles = new nsDOMFileList();
|
||||
NS_ENSURE_TRUE(mFiles, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
PRUint32 count = mItems.Length();
|
||||
|
||||
for (PRUint32 i = 0; i < count; i++) {
|
||||
nsCOMPtr<nsIVariant> variant;
|
||||
nsresult rv = MozGetDataAt(NS_ConvertUTF8toUTF16(kFileMime), i, getter_AddRefs(variant));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!variant)
|
||||
continue;
|
||||
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
rv = variant->GetAsISupports(getter_AddRefs(supports));
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
continue;
|
||||
|
||||
nsCOMPtr<nsIFile> file = do_QueryInterface(supports);
|
||||
|
||||
if (!file)
|
||||
continue;
|
||||
|
||||
nsRefPtr<nsDOMFile> domFile = new nsDOMFile(file);
|
||||
NS_ENSURE_TRUE(domFile, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
if (!mFiles->Append(domFile))
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
*aFileList = mFiles;
|
||||
NS_ADDREF(*aFileList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDataTransfer::GetTypes(nsIDOMDOMStringList** aTypes)
|
||||
{
|
||||
|
@ -407,7 +452,7 @@ nsDOMDataTransfer::MozSetDataAt(const nsAString& aFormat,
|
|||
// XXX perhaps this should also limit any non-string type as well
|
||||
if ((aFormat.EqualsLiteral("application/x-moz-file-promise") ||
|
||||
aFormat.EqualsLiteral("application/x-moz-file")) &&
|
||||
!nsContentUtils::IsCallerChrome()) {
|
||||
!nsContentUtils::IsCallerTrustedForCapability("UniversalXPConnect")) {
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,11 @@
|
|||
#include "nsIDOMElement.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsDOMFile.h"
|
||||
|
||||
class nsITransferable;
|
||||
|
||||
/**
|
||||
|
@ -185,6 +190,9 @@ protected:
|
|||
// array of items, each containing an array of format->data pairs
|
||||
nsTArray<nsTArray<TransferItem> > mItems;
|
||||
|
||||
// array of files, containing only the files present in the dataTransfer
|
||||
nsRefPtr<nsDOMFileList> mFiles;
|
||||
|
||||
// the target of the drag. The drag and dragend events will fire at this.
|
||||
nsCOMPtr<nsIDOMElement> mDragTarget;
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
#include "nsIMarkupDocumentViewer.h"
|
||||
|
||||
#define AUTOMATIC_IMAGE_RESIZING_PREF "browser.enable_automatic_image_resizing"
|
||||
#define CLICK_IMAGE_RESIZING_PREF "browser.enable_click_image_resizing"
|
||||
|
||||
class nsImageDocument;
|
||||
|
||||
|
@ -146,6 +147,7 @@ protected:
|
|||
PRInt32 mImageHeight;
|
||||
|
||||
PRPackedBool mResizeImageByDefault;
|
||||
PRPackedBool mClickResizingEnabled;
|
||||
PRPackedBool mImageIsOverflowing;
|
||||
// mImageIsResized is true if the image is currently resized
|
||||
PRPackedBool mImageIsResized;
|
||||
|
@ -307,6 +309,8 @@ nsImageDocument::Init()
|
|||
|
||||
mResizeImageByDefault =
|
||||
nsContentUtils::GetBoolPref(AUTOMATIC_IMAGE_RESIZING_PREF);
|
||||
mClickResizingEnabled =
|
||||
nsContentUtils::GetBoolPref(CLICK_IMAGE_RESIZING_PREF);
|
||||
mShouldResize = mResizeImageByDefault;
|
||||
mFirstResize = PR_TRUE;
|
||||
|
||||
|
@ -560,7 +564,7 @@ nsImageDocument::HandleEvent(nsIDOMEvent* aEvent)
|
|||
if (eventType.EqualsLiteral("resize")) {
|
||||
CheckOverflowing(PR_FALSE);
|
||||
}
|
||||
else if (eventType.EqualsLiteral("click")) {
|
||||
else if (eventType.EqualsLiteral("click") && mClickResizingEnabled) {
|
||||
SetZoomLevel(1.0);
|
||||
mShouldResize = PR_TRUE;
|
||||
if (mImageIsResized) {
|
||||
|
|
|
@ -910,22 +910,16 @@ void nsOggDecodeStateMachine::PlayFrame() {
|
|||
}
|
||||
|
||||
double time;
|
||||
double prevTime = -1.0;
|
||||
PRUint32 hasAudio = frame->mAudioData.Length();
|
||||
for (;;) {
|
||||
// Even if the frame has had its audio data written we call
|
||||
// PlayAudio to ensure that any data we have buffered in the
|
||||
// nsAudioStream is written to the hardware.
|
||||
PlayAudio(frame);
|
||||
double hwtime = mAudioStream ? mAudioStream->GetPosition() : -1.0;
|
||||
double hwtime = mAudioStream && hasAudio ? mAudioStream->GetPosition() : -1.0;
|
||||
time = hwtime < 0.0 ?
|
||||
(TimeStamp::Now() - mPlayStartTime - mPauseDuration).ToSeconds() :
|
||||
hwtime;
|
||||
// Break out of the loop if we've not played any audio. This can
|
||||
// happen when the frame has no audio, and there's no audio pending
|
||||
// in the nsAudioStream.
|
||||
if (time == prevTime)
|
||||
break;
|
||||
prevTime = time;
|
||||
// Is it time for the next frame? Using an integer here avoids f.p.
|
||||
// rounding errors that can cause multiple 0ms waits (Bug 495352)
|
||||
PRInt64 wait = PRInt64((frame->mTime - time)*1000);
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
#include "nsIHTMLCSSStyleSheet.h"
|
||||
|
||||
#include "nsIStyleRuleProcessor.h"
|
||||
#include "nsRuleProcessorData.h"
|
||||
#include "nsIWeakReference.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
#include "nsCRT.h"
|
||||
#include "nsXBLEventHandler.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsPresContext.h"
|
||||
|
||||
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID,
|
||||
NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
|
||||
|
|
|
@ -1119,6 +1119,15 @@ nsXULElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|||
SetTitlebarColor(color, aName == nsGkAtoms::activetitlebarcolor);
|
||||
}
|
||||
|
||||
// if the localedir changed on the root element, reset the document direction
|
||||
if (aName == nsGkAtoms::localedir &&
|
||||
document && document->GetRootContent() == this) {
|
||||
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(document);
|
||||
if (xuldoc) {
|
||||
xuldoc->ResetDocumentDirection();
|
||||
}
|
||||
}
|
||||
|
||||
if (aName == nsGkAtoms::src && document) {
|
||||
LoadSrc();
|
||||
}
|
||||
|
@ -1365,6 +1374,15 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
|
|||
SetTitlebarColor(NS_RGBA(0, 0, 0, 0), aName == nsGkAtoms::activetitlebarcolor);
|
||||
}
|
||||
|
||||
// if the localedir changed on the root element, reset the document direction
|
||||
if (aName == nsGkAtoms::localedir &&
|
||||
doc && doc->GetRootContent() == this) {
|
||||
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(doc);
|
||||
if (xuldoc) {
|
||||
xuldoc->ResetDocumentDirection();
|
||||
}
|
||||
}
|
||||
|
||||
// If the accesskey attribute is removed, unregister it here
|
||||
// Also see nsXULLabelFrame, nsBoxFrame and nsTextBoxFrame's AttributeChanged
|
||||
if (aName == nsGkAtoms::accesskey || aName == nsGkAtoms::control) {
|
||||
|
@ -1793,8 +1811,7 @@ nsXULElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
|||
retval = NS_STYLE_HINT_FRAMECHANGE;
|
||||
} else {
|
||||
// if left or top changes we reflow. This will happen in xul
|
||||
// containers that manage positioned children such as a
|
||||
// bulletinboard.
|
||||
// containers that manage positioned children such as a stack.
|
||||
if (nsGkAtoms::left == aAttribute || nsGkAtoms::top == aAttribute)
|
||||
retval = NS_STYLE_HINT_REFLOW;
|
||||
}
|
||||
|
|
|
@ -122,6 +122,11 @@ public:
|
|||
* Callback notifying when a document could not be parsed properly.
|
||||
*/
|
||||
virtual PRBool OnDocumentParserError() = 0;
|
||||
|
||||
/**
|
||||
* Reset the document direction so that it is recomputed.
|
||||
*/
|
||||
virtual void ResetDocumentDirection() = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIXULDocument, NS_IXULDOCUMENT_IID)
|
||||
|
|
|
@ -95,7 +95,10 @@ include $(topsrcdir)/config/rules.mk
|
|||
LOCAL_INCLUDES = -I$(srcdir)/../../../base/src \
|
||||
-I$(srcdir)/../../content/src \
|
||||
-I$(srcdir)/../../templates/src \
|
||||
-I$(srcdir)/../../../../layout/base \
|
||||
-I$(srcdir)/../../../../layout/generic \
|
||||
-I$(srcdir)/../../../../layout/style \
|
||||
-I$(srcdir)/../../../../layout/xul/base/src \
|
||||
-I$(srcdir)/../../../xml/document/src \
|
||||
-I$(srcdir)/../../../events/src \
|
||||
$(NULL)
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
#include "nsXULPopupManager.h"
|
||||
#include "nsCCUncollectableMarker.h"
|
||||
#include "nsURILoader.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
|
@ -222,6 +223,7 @@ nsRefMapEntry::RemoveContent(nsIContent* aContent)
|
|||
|
||||
nsXULDocument::nsXULDocument(void)
|
||||
: nsXMLDocument("application/vnd.mozilla.xul+xml"),
|
||||
mDocDirection(Direction_Uninitialized),
|
||||
mState(eState_Master),
|
||||
mResolutionPhase(nsForwardReference::eStart)
|
||||
{
|
||||
|
@ -260,6 +262,10 @@ nsXULDocument::~nsXULDocument()
|
|||
|
||||
delete mTemplateBuilderTable;
|
||||
|
||||
nsContentUtils::UnregisterPrefCallback("intl.uidirection.",
|
||||
nsXULDocument::DirectionChanged,
|
||||
this);
|
||||
|
||||
if (--gRefCnt == 0) {
|
||||
NS_IF_RELEASE(gRDFService);
|
||||
|
||||
|
@ -1989,6 +1995,10 @@ nsXULDocument::Init()
|
|||
}
|
||||
}
|
||||
|
||||
nsContentUtils::RegisterPrefCallback("intl.uidirection.",
|
||||
nsXULDocument::DirectionChanged,
|
||||
this);
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (! gXULLog)
|
||||
gXULLog = PR_NewLogModule("nsXULDocument");
|
||||
|
@ -4627,6 +4637,100 @@ nsXULDocument::GetFocusController(nsIFocusController** aFocusController)
|
|||
*aFocusController = nsnull;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsXULDocument::IsDocumentRightToLeft()
|
||||
{
|
||||
if (mDocDirection == Direction_Uninitialized) {
|
||||
mDocDirection = Direction_LeftToRight; // default to ltr on failure
|
||||
|
||||
// setting the localedir attribute on the root element forces a
|
||||
// specific direction for the document.
|
||||
nsIContent* content = GetRootContent();
|
||||
if (content) {
|
||||
static nsIContent::AttrValuesArray strings[] =
|
||||
{&nsGkAtoms::ltr, &nsGkAtoms::rtl, nsnull};
|
||||
switch (content->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::localedir,
|
||||
strings, eCaseMatters)) {
|
||||
case 0: mDocDirection = Direction_LeftToRight; return PR_FALSE;
|
||||
case 1: mDocDirection = Direction_RightToLeft; return PR_TRUE;
|
||||
default: break;// otherwise, not a valid value, so fall through
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise, get the locale from the chrome registry and
|
||||
// look up the intl.uidirection.<locale> preference
|
||||
nsCOMPtr<nsIXULChromeRegistry> reg =
|
||||
do_GetService(NS_CHROMEREGISTRY_CONTRACTID);
|
||||
if (reg) {
|
||||
nsCAutoString package;
|
||||
PRBool isChrome;
|
||||
if (NS_SUCCEEDED(mDocumentURI->SchemeIs("chrome", &isChrome)) &&
|
||||
isChrome) {
|
||||
mDocumentURI->GetHostPort(package);
|
||||
}
|
||||
else {
|
||||
// use the 'global' package for about and resource uris.
|
||||
// otherwise, just default to left-to-right.
|
||||
PRBool isAbout, isResource;
|
||||
if (NS_SUCCEEDED(mDocumentURI->SchemeIs("about", &isAbout)) &&
|
||||
isAbout) {
|
||||
package.AssignLiteral("global");
|
||||
}
|
||||
else if (NS_SUCCEEDED(mDocumentURI->SchemeIs("resource", &isResource)) &&
|
||||
isResource) {
|
||||
package.AssignLiteral("global");
|
||||
}
|
||||
else {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
nsCAutoString locale;
|
||||
reg->GetSelectedLocale(package, locale);
|
||||
if (locale.Length() >= 2) {
|
||||
// first check the intl.uidirection.<locale> preference,
|
||||
// and if that is not set, check the same preference but
|
||||
// with just the first two characters of the locale. If
|
||||
// that isn't set, default to left-to-right.
|
||||
nsCAutoString prefString =
|
||||
NS_LITERAL_CSTRING("intl.uidirection.") + locale;
|
||||
nsAdoptingCString dir = nsContentUtils::GetCharPref(prefString.get());
|
||||
if (dir.IsEmpty()) {
|
||||
PRInt32 hyphen = prefString.FindChar('-');
|
||||
if (hyphen >= 1) {
|
||||
nsCAutoString shortPref(Substring(prefString, 0, hyphen));
|
||||
dir = nsContentUtils::GetCharPref(shortPref.get());
|
||||
}
|
||||
}
|
||||
|
||||
mDocDirection = dir.EqualsLiteral("rtl") ?
|
||||
Direction_RightToLeft : Direction_LeftToRight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (mDocDirection == Direction_RightToLeft);
|
||||
}
|
||||
|
||||
int
|
||||
nsXULDocument::DirectionChanged(const char* aPrefName, void* aData)
|
||||
{
|
||||
// reset the direction and reflow the document. This will happen if
|
||||
// the direction isn't actually being used, but that doesn't really
|
||||
// matter too much
|
||||
nsXULDocument* doc = (nsXULDocument *)aData;
|
||||
if (doc)
|
||||
doc->ResetDocumentDirection();
|
||||
|
||||
nsIPresShell *shell = doc->GetPrimaryShell();
|
||||
if (shell) {
|
||||
shell->FrameConstructor()->
|
||||
PostRestyleEvent(doc->GetRootContent(), eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult)
|
||||
{
|
||||
|
|
|
@ -182,6 +182,10 @@ public:
|
|||
|
||||
virtual void EndUpdate(nsUpdateType aUpdateType);
|
||||
|
||||
virtual PRBool IsDocumentRightToLeft();
|
||||
|
||||
virtual void ResetDocumentDirection() { mDocDirection = Direction_Uninitialized; }
|
||||
|
||||
static PRBool
|
||||
MatchAttribute(nsIContent* aContent,
|
||||
PRInt32 aNameSpaceID,
|
||||
|
@ -244,7 +248,8 @@ protected:
|
|||
return kNameSpaceID_XUL;
|
||||
}
|
||||
|
||||
protected:
|
||||
static NS_HIDDEN_(int) DirectionChanged(const char* aPrefName, void* aData);
|
||||
|
||||
// pseudo constants
|
||||
static PRInt32 gRefCnt;
|
||||
|
||||
|
@ -326,6 +331,17 @@ protected:
|
|||
|
||||
nsCOMPtr<nsIDOMNode> mTooltipNode; // [OWNER] element triggering the tooltip
|
||||
|
||||
/**
|
||||
* document direction for use with the -moz-locale-dir property
|
||||
*/
|
||||
enum DocumentDirection {
|
||||
Direction_Uninitialized, // not determined yet
|
||||
Direction_LeftToRight,
|
||||
Direction_RightToLeft
|
||||
};
|
||||
|
||||
DocumentDirection mDocDirection;
|
||||
|
||||
/**
|
||||
* Context stack, which maintains the state of the Builder and allows
|
||||
* it to be interrupted.
|
||||
|
|
|
@ -392,11 +392,8 @@ typedef struct {
|
|||
#endif
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
|
||||
|
||||
extern DB *
|
||||
#else
|
||||
PR_EXTERN(DB *)
|
||||
#endif
|
||||
dbopen (const char *, int, int, DBTYPE, const void *);
|
||||
|
||||
/* set or unset a global lock flag to disable the
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче