forked from mirrors/gecko-dev
Merge mozilla-central into electrolysis.
This commit is contained in:
commit
d74c6776f3
1070 changed files with 86503 additions and 6766 deletions
23
Makefile.in
23
Makefile.in
|
|
@ -130,16 +130,6 @@ distclean::
|
||||||
cat unallmakefiles | $(XARGS) rm -f
|
cat unallmakefiles | $(XARGS) rm -f
|
||||||
rm -f unallmakefiles $(DIST_GARBAGE)
|
rm -f unallmakefiles $(DIST_GARBAGE)
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
|
||||||
rebase:
|
|
||||||
ifdef MOZILLA_OFFICIAL
|
|
||||||
echo rebasing $(DIST)
|
|
||||||
/bin/find $(DIST) -name "*.dll" -a -not -name "msvc*" > rebase.lst
|
|
||||||
rebase -b 60000000 -R . -G rebase.lst
|
|
||||||
rm rebase.lst
|
|
||||||
endif
|
|
||||||
endif # WINNT
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
ifeq ($(OS_ARCH),WINNT)
|
||||||
# we want to copy PDB files on Windows
|
# we want to copy PDB files on Windows
|
||||||
MAKE_SYM_STORE_ARGS := -c
|
MAKE_SYM_STORE_ARGS := -c
|
||||||
|
|
@ -206,19 +196,6 @@ ifdef MOZ_CRASHREPORTER
|
||||||
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip"
|
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
|
||||||
signnss:
|
|
||||||
ifdef MOZILLA_OFFICIAL
|
|
||||||
echo signing NSS libs
|
|
||||||
cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
|
|
||||||
cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
|
|
||||||
cd $(DIST)/bin; ./shlibsign.exe -v -i nssdbm3.dll
|
|
||||||
endif # MOZILLA_OFFICIAL
|
|
||||||
|
|
||||||
deliver: rebase signnss
|
|
||||||
|
|
||||||
endif # WINNT
|
|
||||||
|
|
||||||
ifneq (,$(wildcard $(DIST)/bin/application.ini))
|
ifneq (,$(wildcard $(DIST)/bin/application.ini))
|
||||||
BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
|
BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -362,10 +362,14 @@ nsresult
|
||||||
nsAccessibilityService::GetInfo(nsIFrame* aFrame, nsIWeakReference** aShell, nsIDOMNode** aNode)
|
nsAccessibilityService::GetInfo(nsIFrame* aFrame, nsIWeakReference** aShell, nsIDOMNode** aNode)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(aFrame,"Error -- 1st argument (aFrame) is null!!");
|
NS_ASSERTION(aFrame,"Error -- 1st argument (aFrame) is null!!");
|
||||||
|
if (!aFrame) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
nsCOMPtr<nsIContent> content = aFrame->GetContent();
|
nsCOMPtr<nsIContent> content = aFrame->GetContent();
|
||||||
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
|
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
|
||||||
if (!content || !node)
|
if (!content || !node)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
*aNode = node;
|
*aNode = node;
|
||||||
NS_IF_ADDREF(*aNode);
|
NS_IF_ADDREF(*aNode);
|
||||||
|
|
||||||
|
|
@ -1326,6 +1330,12 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
|
|
||||||
*aIsHidden = PR_FALSE;
|
*aIsHidden = PR_FALSE;
|
||||||
|
|
||||||
|
// Frames can be deallocated when we flush layout, or when we call into code
|
||||||
|
// that can flush layout, either directly, or via DOM manipulation, or some
|
||||||
|
// CSS styles like :hover. We use the weak frame checks to avoid calling
|
||||||
|
// methods on a dead frame pointer.
|
||||||
|
nsWeakFrame weakFrame(*aFrameHint);
|
||||||
|
|
||||||
#ifdef DEBUG_A11Y
|
#ifdef DEBUG_A11Y
|
||||||
// Please leave this in for now, it's a convenient debugging method
|
// Please leave this in for now, it's a convenient debugging method
|
||||||
nsAutoString name;
|
nsAutoString name;
|
||||||
|
|
@ -1396,15 +1406,15 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
}
|
}
|
||||||
|
|
||||||
// We have a content node
|
// We have a content node
|
||||||
nsIFrame *frame = *aFrameHint;
|
|
||||||
#ifdef DEBUG_A11Y
|
#ifdef DEBUG_A11Y
|
||||||
static int frameHintFailed, frameHintTried, frameHintNonexistant, frameHintFailedForText;
|
static int frameHintFailed, frameHintTried, frameHintNonexistant, frameHintFailedForText;
|
||||||
++frameHintTried;
|
++frameHintTried;
|
||||||
#endif
|
#endif
|
||||||
if (!frame || content != frame->GetContent()) {
|
|
||||||
|
if (!weakFrame.GetFrame() || content != weakFrame.GetFrame()->GetContent()) {
|
||||||
// Frame hint not correct, get true frame, we try to optimize away from this
|
// Frame hint not correct, get true frame, we try to optimize away from this
|
||||||
frame = aPresShell->GetRealPrimaryFrameFor(content);
|
weakFrame = aPresShell->GetRealPrimaryFrameFor(content);
|
||||||
if (frame) {
|
if (weakFrame.GetFrame()) {
|
||||||
#ifdef DEBUG_A11Y_FRAME_OPTIMIZATION
|
#ifdef DEBUG_A11Y_FRAME_OPTIMIZATION
|
||||||
// Frame hint debugging
|
// Frame hint debugging
|
||||||
++frameHintFailed;
|
++frameHintFailed;
|
||||||
|
|
@ -1417,18 +1427,18 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
printf("* "); // Aaron's break point
|
printf("* "); // Aaron's break point
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (frame->GetContent() != content) {
|
if (weakFrame.GetFrame()->GetContent() != content) {
|
||||||
// Not the main content for this frame!
|
// Not the main content for this frame!
|
||||||
// For example, this happens because <area> elements return the
|
// For example, this happens because <area> elements return the
|
||||||
// image frame as their primary frame. The main content for the
|
// image frame as their primary frame. The main content for the
|
||||||
// image frame is the image content.
|
// image frame is the image content.
|
||||||
|
|
||||||
// Check if frame is an image frame, and content is <area>
|
// Check if frame is an image frame, and content is <area>
|
||||||
nsIImageFrame *imageFrame = do_QueryFrame(frame);
|
nsIImageFrame *imageFrame = do_QueryFrame(weakFrame.GetFrame());
|
||||||
nsCOMPtr<nsIDOMHTMLAreaElement> areaElmt = do_QueryInterface(content);
|
nsCOMPtr<nsIDOMHTMLAreaElement> areaElmt = do_QueryInterface(content);
|
||||||
if (imageFrame && areaElmt) {
|
if (imageFrame && areaElmt) {
|
||||||
nsCOMPtr<nsIAccessible> imageAcc;
|
nsCOMPtr<nsIAccessible> imageAcc;
|
||||||
CreateHTMLImageAccessible(frame, getter_AddRefs(imageAcc));
|
CreateHTMLImageAccessible(weakFrame.GetFrame(), getter_AddRefs(imageAcc));
|
||||||
if (imageAcc) {
|
if (imageAcc) {
|
||||||
// cache children
|
// cache children
|
||||||
PRInt32 childCount;
|
PRInt32 childCount;
|
||||||
|
|
@ -1440,34 +1450,44 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
*aFrameHint = frame;
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check frame to see if it is hidden
|
// Check frame to see if it is hidden
|
||||||
if (!frame || !frame->GetStyleVisibility()->IsVisible()) {
|
if (!weakFrame.GetFrame() ||
|
||||||
|
!weakFrame.GetFrame()->GetStyleVisibility()->IsVisible()) {
|
||||||
*aIsHidden = PR_TRUE;
|
*aIsHidden = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*aIsHidden)
|
if (*aIsHidden) {
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempt to create an accessible based on what we know
|
* Attempt to create an accessible based on what we know
|
||||||
*/
|
*/
|
||||||
if (content->IsNodeOfType(nsINode::eTEXT)) {
|
if (content->IsNodeOfType(nsINode::eTEXT)) {
|
||||||
// --- Create HTML for visible text frames ---
|
// --- Create HTML for visible text frames ---
|
||||||
if (frame->IsEmpty()) {
|
nsIFrame* f = weakFrame.GetFrame();
|
||||||
|
if (f && f->IsEmpty()) {
|
||||||
nsAutoString renderedWhitespace;
|
nsAutoString renderedWhitespace;
|
||||||
frame->GetRenderedText(&renderedWhitespace, nsnull, nsnull, 0, 1);
|
f->GetRenderedText(&renderedWhitespace, nsnull, nsnull, 0, 1);
|
||||||
if (renderedWhitespace.IsEmpty()) {
|
if (renderedWhitespace.IsEmpty()) {
|
||||||
// Really empty -- nothing is rendered
|
// Really empty -- nothing is rendered
|
||||||
*aIsHidden = PR_TRUE;
|
*aIsHidden = PR_TRUE;
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
frame->GetAccessible(getter_AddRefs(newAcc));
|
if (weakFrame.IsAlive()) {
|
||||||
return InitAccessible(newAcc, aAccessible, nsnull);
|
weakFrame.GetFrame()->GetAccessible(getter_AddRefs(newAcc));
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult rv = InitAccessible(newAcc, aAccessible, nsnull);
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool isHTML = content->IsHTML();
|
PRBool isHTML = content->IsHTML();
|
||||||
|
|
@ -1484,11 +1504,16 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::name, name);
|
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::name, name);
|
||||||
if (!name.IsEmpty()) {
|
if (!name.IsEmpty()) {
|
||||||
*aIsHidden = PR_TRUE;
|
*aIsHidden = PR_TRUE;
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult rv = CreateHyperTextAccessible(frame, getter_AddRefs(newAcc));
|
nsresult rv =
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
CreateHyperTextAccessible(weakFrame.GetFrame(), getter_AddRefs(newAcc));
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRoleMapEntry *roleMapEntry = nsAccUtils::GetRoleMapEntry(aNode);
|
nsRoleMapEntry *roleMapEntry = nsAccUtils::GetRoleMapEntry(aNode);
|
||||||
|
|
@ -1497,13 +1522,14 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
// Only create accessible for role of "presentation" if it is focusable --
|
// Only create accessible for role of "presentation" if it is focusable --
|
||||||
// in that case we need an accessible in case it gets focused, we
|
// in that case we need an accessible in case it gets focused, we
|
||||||
// don't want focus ever to be 'lost'
|
// don't want focus ever to be 'lost'
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newAcc && isHTML) { // HTML accessibles
|
if (weakFrame.IsAlive() && !newAcc && isHTML) { // HTML accessibles
|
||||||
PRBool tryTagNameOrFrame = PR_TRUE;
|
PRBool tryTagNameOrFrame = PR_TRUE;
|
||||||
|
|
||||||
nsIAtom *frameType = frame->GetType();
|
nsIAtom *frameType = weakFrame.GetFrame()->GetType();
|
||||||
|
|
||||||
PRBool partOfHTMLTable =
|
PRBool partOfHTMLTable =
|
||||||
frameType == nsAccessibilityAtoms::tableCaptionFrame ||
|
frameType == nsAccessibilityAtoms::tableCaptionFrame ||
|
||||||
|
|
@ -1554,6 +1580,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
// presentation if they aren't focusable and have not explicit ARIA
|
// presentation if they aren't focusable and have not explicit ARIA
|
||||||
// role (don't create accessibles for them unless they need to fire
|
// role (don't create accessibles for them unless they need to fire
|
||||||
// focus events).
|
// focus events).
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1598,9 +1625,13 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
// The method creates accessibles for table related content too therefore
|
// The method creates accessibles for table related content too therefore
|
||||||
// we do not call it if accessibles for table related content are
|
// we do not call it if accessibles for table related content are
|
||||||
// prevented above.
|
// prevented above.
|
||||||
nsresult rv = CreateHTMLAccessibleByMarkup(frame, aWeakShell, aNode,
|
nsresult rv =
|
||||||
|
CreateHTMLAccessibleByMarkup(weakFrame.GetFrame(), aWeakShell, aNode,
|
||||||
getter_AddRefs(newAcc));
|
getter_AddRefs(newAcc));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
if (NS_FAILED(rv)) {
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
if (!newAcc) {
|
if (!newAcc) {
|
||||||
// Do not create accessible object subtrees for non-rendered table
|
// Do not create accessible object subtrees for non-rendered table
|
||||||
|
|
@ -1609,14 +1640,19 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
// the table caption would still be created. By setting
|
// the table caption would still be created. By setting
|
||||||
// *aIsHidden = PR_TRUE we ensure that no descendant accessibles are
|
// *aIsHidden = PR_TRUE we ensure that no descendant accessibles are
|
||||||
// created.
|
// created.
|
||||||
if (frame->GetType() == nsAccessibilityAtoms::tableCaptionFrame &&
|
nsIFrame* f = weakFrame.GetFrame();
|
||||||
frame->GetRect().IsEmpty()) {
|
if (!f) {
|
||||||
|
f = aPresShell->GetRealPrimaryFrameFor(content);
|
||||||
|
}
|
||||||
|
if (f->GetType() == nsAccessibilityAtoms::tableCaptionFrame &&
|
||||||
|
f->GetRect().IsEmpty()) {
|
||||||
// XXX This is not the ideal place for this code, but right now there
|
// XXX This is not the ideal place for this code, but right now there
|
||||||
// is no better place:
|
// is no better place:
|
||||||
*aIsHidden = PR_TRUE;
|
*aIsHidden = PR_TRUE;
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
frame->GetAccessible(getter_AddRefs(newAcc)); // Try using frame to do it
|
f->GetAccessible(getter_AddRefs(newAcc)); // Try using frame to do it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1625,7 +1661,10 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
// Elements may implement nsIAccessibleProvider via XBL. This allows them to
|
// Elements may implement nsIAccessibleProvider via XBL. This allows them to
|
||||||
// say what kind of accessible to create.
|
// say what kind of accessible to create.
|
||||||
nsresult rv = GetAccessibleByType(aNode, getter_AddRefs(newAcc));
|
nsresult rv = GetAccessibleByType(aNode, getter_AddRefs(newAcc));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
if (NS_FAILED(rv)) {
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newAcc) {
|
if (!newAcc) {
|
||||||
|
|
@ -1651,7 +1690,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
// We don't do this for <body>, <html>, <window>, <dialog> etc. which
|
// We don't do this for <body>, <html>, <window>, <dialog> etc. which
|
||||||
// correspond to the doc accessible and will be created in any case
|
// correspond to the doc accessible and will be created in any case
|
||||||
if (!newAcc && content->Tag() != nsAccessibilityAtoms::body && content->GetParent() &&
|
if (!newAcc && content->Tag() != nsAccessibilityAtoms::body && content->GetParent() &&
|
||||||
(frame->IsFocusable() ||
|
((weakFrame.GetFrame() && weakFrame.GetFrame()->IsFocusable()) ||
|
||||||
(isHTML && nsCoreUtils::HasListener(content, NS_LITERAL_STRING("click"))) ||
|
(isHTML && nsCoreUtils::HasListener(content, NS_LITERAL_STRING("click"))) ||
|
||||||
HasUniversalAriaProperty(content, aWeakShell) || roleMapEntry ||
|
HasUniversalAriaProperty(content, aWeakShell) || roleMapEntry ||
|
||||||
HasRelatedContent(content) || nsCoreUtils::IsXLink(content))) {
|
HasRelatedContent(content) || nsCoreUtils::IsXLink(content))) {
|
||||||
|
|
@ -1660,7 +1699,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
// other accessibles can point to it, or so that it can hold a state, etc.
|
// other accessibles can point to it, or so that it can hold a state, etc.
|
||||||
if (isHTML) {
|
if (isHTML) {
|
||||||
// Interesting HTML container which may have selectable text and/or embedded objects
|
// Interesting HTML container which may have selectable text and/or embedded objects
|
||||||
CreateHyperTextAccessible(frame, getter_AddRefs(newAcc));
|
CreateHyperTextAccessible(weakFrame.GetFrame(), getter_AddRefs(newAcc));
|
||||||
}
|
}
|
||||||
else { // XUL, SVG, MathML etc.
|
else { // XUL, SVG, MathML etc.
|
||||||
// Interesting generic non-HTML container
|
// Interesting generic non-HTML container
|
||||||
|
|
@ -1668,7 +1707,9 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return InitAccessible(newAcc, aAccessible, roleMapEntry);
|
nsresult rv = InitAccessible(newAcc, aAccessible, roleMapEntry);
|
||||||
|
*aFrameHint = weakFrame.GetFrame();
|
||||||
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsIDOMXULElement.h"
|
#include "nsIDOMXULElement.h"
|
||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
#include "nsIFrame.h"
|
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
|
|
||||||
nsAccessibleTreeWalker::nsAccessibleTreeWalker(nsIWeakReference* aPresShell, nsIDOMNode* aNode, PRBool aWalkAnonContent):
|
nsAccessibleTreeWalker::nsAccessibleTreeWalker(nsIWeakReference* aPresShell, nsIDOMNode* aNode, PRBool aWalkAnonContent):
|
||||||
|
|
@ -59,7 +58,6 @@ nsAccessibleTreeWalker::nsAccessibleTreeWalker(nsIWeakReference* aPresShell, nsI
|
||||||
mState.siblingIndex = eSiblingsUninitialized;
|
mState.siblingIndex = eSiblingsUninitialized;
|
||||||
mState.siblingList = nsnull;
|
mState.siblingList = nsnull;
|
||||||
mState.isHidden = false;
|
mState.isHidden = false;
|
||||||
mState.frame = nsnull;
|
|
||||||
|
|
||||||
MOZ_COUNT_CTOR(nsAccessibleTreeWalker);
|
MOZ_COUNT_CTOR(nsAccessibleTreeWalker);
|
||||||
}
|
}
|
||||||
|
|
@ -121,12 +119,13 @@ void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode)
|
||||||
|
|
||||||
NS_IMETHODIMP nsAccessibleTreeWalker::PopState()
|
NS_IMETHODIMP nsAccessibleTreeWalker::PopState()
|
||||||
{
|
{
|
||||||
nsIFrame *frameParent = mState.frame? mState.frame->GetParent(): nsnull;
|
nsIFrame *frameParent =
|
||||||
|
mState.frame.GetFrame() ? mState.frame.GetFrame()->GetParent() : nsnull;
|
||||||
if (mState.prevState) {
|
if (mState.prevState) {
|
||||||
WalkState *toBeDeleted = mState.prevState;
|
WalkState *toBeDeleted = mState.prevState;
|
||||||
mState = *mState.prevState; // deep copy
|
mState = *mState.prevState; // deep copy
|
||||||
mState.isHidden = PR_FALSE; // If we were in a child, the parent wasn't hidden
|
mState.isHidden = PR_FALSE; // If we were in a child, the parent wasn't hidden
|
||||||
if (!mState.frame) {
|
if (!mState.frame.GetFrame()) {
|
||||||
mState.frame = frameParent;
|
mState.frame = frameParent;
|
||||||
}
|
}
|
||||||
delete toBeDeleted;
|
delete toBeDeleted;
|
||||||
|
|
@ -166,8 +165,8 @@ void nsAccessibleTreeWalker::GetNextDOMNode()
|
||||||
mState.domNode = do_QueryInterface(mState.parentContent->GetChildAt(++mState.siblingIndex));
|
mState.domNode = do_QueryInterface(mState.parentContent->GetChildAt(++mState.siblingIndex));
|
||||||
}
|
}
|
||||||
else if (mState.siblingIndex == eSiblingsWalkFrames) {
|
else if (mState.siblingIndex == eSiblingsWalkFrames) {
|
||||||
if (mState.frame) {
|
if (mState.frame.GetFrame()) {
|
||||||
mState.domNode = do_QueryInterface(mState.frame->GetContent());
|
mState.domNode = do_QueryInterface(mState.frame.GetFrame()->GetContent());
|
||||||
} else {
|
} else {
|
||||||
mState.domNode = nsnull;
|
mState.domNode = nsnull;
|
||||||
}
|
}
|
||||||
|
|
@ -230,18 +229,20 @@ NS_IMETHODIMP nsAccessibleTreeWalker::GetFirstChild()
|
||||||
|
|
||||||
void nsAccessibleTreeWalker::UpdateFrame(PRBool aTryFirstChild)
|
void nsAccessibleTreeWalker::UpdateFrame(PRBool aTryFirstChild)
|
||||||
{
|
{
|
||||||
if (!mState.frame) {
|
nsIFrame *curFrame = mState.frame.GetFrame();
|
||||||
|
if (!curFrame) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aTryFirstChild) {
|
if (aTryFirstChild) {
|
||||||
// If the frame implements nsIAnonymousContentCreator interface then go down
|
// If the frame implements nsIAnonymousContentCreator interface then go down
|
||||||
// through the frames and obtain anonymous nodes for them.
|
// through the frames and obtain anonymous nodes for them.
|
||||||
nsIAnonymousContentCreator* creator = do_QueryFrame(mState.frame);
|
nsIAnonymousContentCreator* creator = do_QueryFrame(curFrame);
|
||||||
mState.frame = mState.frame->GetFirstChild(nsnull);
|
nsIFrame *child = curFrame->GetFirstChild(nsnull);
|
||||||
|
mState.frame = child;
|
||||||
|
|
||||||
if (creator && mState.frame && mState.siblingIndex < 0) {
|
if (creator && child && mState.siblingIndex < 0) {
|
||||||
mState.domNode = do_QueryInterface(mState.frame->GetContent());
|
mState.domNode = do_QueryInterface(child->GetContent());
|
||||||
mState.siblingIndex = eSiblingsWalkFrames;
|
mState.siblingIndex = eSiblingsWalkFrames;
|
||||||
}
|
}
|
||||||
// temporary workaround for Bug 359210. We never want to walk frames.
|
// temporary workaround for Bug 359210. We never want to walk frames.
|
||||||
|
|
@ -268,7 +269,7 @@ void nsAccessibleTreeWalker::UpdateFrame(PRBool aTryFirstChild)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mState.frame = mState.frame->GetNextSibling();
|
mState.frame = curFrame->GetNextSibling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -285,9 +286,11 @@ PRBool nsAccessibleTreeWalker::GetAccessible()
|
||||||
mState.accessible = nsnull;
|
mState.accessible = nsnull;
|
||||||
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
|
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
|
||||||
|
|
||||||
|
nsIFrame *frame = mState.frame.GetFrame();
|
||||||
mAccService->GetAccessible(mState.domNode, presShell, mWeakShell,
|
mAccService->GetAccessible(mState.domNode, presShell, mWeakShell,
|
||||||
&mState.frame, &mState.isHidden,
|
&frame, &mState.isHidden,
|
||||||
getter_AddRefs(mState.accessible));
|
getter_AddRefs(mState.accessible));
|
||||||
|
mState.frame = frame;
|
||||||
return mState.accessible ? PR_TRUE : PR_FALSE;
|
return mState.accessible ? PR_TRUE : PR_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,8 @@
|
||||||
#ifndef _nsAccessibleTreeWalker_H_
|
#ifndef _nsAccessibleTreeWalker_H_
|
||||||
#define _nsAccessibleTreeWalker_H_
|
#define _nsAccessibleTreeWalker_H_
|
||||||
|
|
||||||
/* For documentation of the accessibility architecture, * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
|
/* For documentation of the accessibility architecture, see
|
||||||
|
* http://www.mozilla.org/access/architecture
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
@ -49,6 +50,7 @@
|
||||||
#include "nsIDOMNodeList.h"
|
#include "nsIDOMNodeList.h"
|
||||||
#include "nsIAccessibilityService.h"
|
#include "nsIAccessibilityService.h"
|
||||||
#include "nsIWeakReference.h"
|
#include "nsIWeakReference.h"
|
||||||
|
#include "nsIFrame.h"
|
||||||
|
|
||||||
enum { eSiblingsUninitialized = -1, eSiblingsWalkFrames = -2 };
|
enum { eSiblingsUninitialized = -1, eSiblingsWalkFrames = -2 };
|
||||||
|
|
||||||
|
|
@ -58,7 +60,7 @@ struct WalkState {
|
||||||
nsCOMPtr<nsIDOMNodeList> siblingList;
|
nsCOMPtr<nsIDOMNodeList> siblingList;
|
||||||
nsIContent *parentContent; // For walking normal DOM
|
nsIContent *parentContent; // For walking normal DOM
|
||||||
WalkState *prevState;
|
WalkState *prevState;
|
||||||
nsIFrame *frame; // Helps avoid GetPrimaryFrameFor() calls
|
nsWeakFrame frame; // Helps avoid GetPrimaryFrameFor() calls
|
||||||
PRInt32 siblingIndex; // Holds a state flag or an index into the siblingList
|
PRInt32 siblingIndex; // Holds a state flag or an index into the siblingList
|
||||||
PRBool isHidden; // Don't enter subtree if hidden
|
PRBool isHidden; // Don't enter subtree if hidden
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1157,8 +1157,7 @@ nsXULListCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessibleTable> table;
|
nsCOMPtr<nsIAccessibleTable> table;
|
||||||
GetTable(getter_AddRefs(table));
|
GetTable(getter_AddRefs(table));
|
||||||
if (!table)
|
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
// Get column header cell from XUL listhead.
|
// Get column header cell from XUL listhead.
|
||||||
nsCOMPtr<nsIAccessible> tableAcc(do_QueryInterface(table));
|
nsCOMPtr<nsIAccessible> tableAcc(do_QueryInterface(table));
|
||||||
|
|
@ -1209,8 +1208,7 @@ nsXULListCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessibleTable> table;
|
nsCOMPtr<nsIAccessibleTable> table;
|
||||||
GetTable(getter_AddRefs(table));
|
GetTable(getter_AddRefs(table));
|
||||||
if (!table)
|
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
// Calculate row header cells from ARIA markup.
|
// Calculate row header cells from ARIA markup.
|
||||||
return nsAccUtils::GetHeaderCellsFor(table, this,
|
return nsAccUtils::GetHeaderCellsFor(table, this,
|
||||||
|
|
@ -1229,8 +1227,7 @@ nsXULListCellAccessible::IsSelected(PRBool *aIsSelected)
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessibleTable> table;
|
nsCOMPtr<nsIAccessibleTable> table;
|
||||||
GetTable(getter_AddRefs(table));
|
GetTable(getter_AddRefs(table));
|
||||||
if (!table)
|
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
PRInt32 rowIdx = -1;
|
PRInt32 rowIdx = -1;
|
||||||
GetRowIndex(&rowIdx);
|
GetRowIndex(&rowIdx);
|
||||||
|
|
@ -1259,6 +1256,7 @@ nsXULListCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttribu
|
||||||
// "table-cell-index" attribute
|
// "table-cell-index" attribute
|
||||||
nsCOMPtr<nsIAccessibleTable> table;
|
nsCOMPtr<nsIAccessibleTable> table;
|
||||||
GetTable(getter_AddRefs(table));
|
GetTable(getter_AddRefs(table));
|
||||||
|
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
|
||||||
|
|
||||||
PRInt32 rowIdx = -1;
|
PRInt32 rowIdx = -1;
|
||||||
GetRowIndex(&rowIdx);
|
GetRowIndex(&rowIdx);
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,13 @@
|
||||||
// var gA11yEventDumpID = "eventdump"; // debug stuff
|
// var gA11yEventDumpID = "eventdump"; // debug stuff
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.openDialog("chrome://mochikit/content/a11y/accessible/name_nsRootAcc_wnd.xul",
|
var w = window.openDialog("chrome://mochikit/content/a11y/accessible/name_nsRootAcc_wnd.xul",
|
||||||
"nsRootAcc_name_test",
|
"nsRootAcc_name_test",
|
||||||
"chrome,width=600,height=600");
|
"chrome,width=600,height=600");
|
||||||
|
if (LINUX) {
|
||||||
|
w.focus();
|
||||||
|
}
|
||||||
|
|
||||||
]]>
|
]]>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,17 @@ VPATH = @srcdir@
|
||||||
|
|
||||||
include $(topsrcdir)/config/config.mk
|
include $(topsrcdir)/config/config.mk
|
||||||
|
|
||||||
DIRS = base components locales themes fuel app
|
PARALLEL_DIRS = \
|
||||||
|
base \
|
||||||
|
components \
|
||||||
|
fuel \
|
||||||
|
locales \
|
||||||
|
themes \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
DIRS = \
|
||||||
|
app \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
ifeq ($(OS_ARCH),WINNT)
|
||||||
ifdef MOZ_INSTALLER
|
ifdef MOZ_INSTALLER
|
||||||
|
|
|
||||||
|
|
@ -165,9 +165,7 @@ pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/Ve
|
||||||
pref("extensions.update.interval", 86400); // Check for updates to Extensions and
|
pref("extensions.update.interval", 86400); // Check for updates to Extensions and
|
||||||
// Themes every day
|
// Themes every day
|
||||||
// Non-symmetric (not shared by extensions) extension-specific [update] preferences
|
// Non-symmetric (not shared by extensions) extension-specific [update] preferences
|
||||||
pref("extensions.getMoreExtensionsURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/extensions/");
|
pref("extensions.getMoreThemesURL", "https://addons.mozilla.org/%LOCALE%/%APP%/getpersonas");
|
||||||
pref("extensions.getMoreThemesURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/themes/");
|
|
||||||
pref("extensions.getMorePluginsURL", "https://%LOCALE%.add-ons.mozilla.com/%LOCALE%/%APP%/%VERSION%/plugins/");
|
|
||||||
pref("extensions.dss.enabled", false); // Dynamic Skin Switching
|
pref("extensions.dss.enabled", false); // Dynamic Skin Switching
|
||||||
pref("extensions.dss.switchPending", false); // Non-dynamic switch pending after next
|
pref("extensions.dss.switchPending", false); // Non-dynamic switch pending after next
|
||||||
// restart.
|
// restart.
|
||||||
|
|
@ -178,6 +176,8 @@ pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description", "chrome://
|
||||||
pref("xpinstall.whitelist.add", "addons.mozilla.org");
|
pref("xpinstall.whitelist.add", "addons.mozilla.org");
|
||||||
pref("xpinstall.whitelist.add.36", "getpersonas.com");
|
pref("xpinstall.whitelist.add.36", "getpersonas.com");
|
||||||
|
|
||||||
|
pref("lightweightThemes.update.enabled", true);
|
||||||
|
|
||||||
pref("keyword.enabled", true);
|
pref("keyword.enabled", true);
|
||||||
pref("keyword.URL", "chrome://browser-region/locale/region.properties");
|
pref("keyword.URL", "chrome://browser-region/locale/region.properties");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,8 @@
|
||||||
oncommand="openHelpLink('ieusers');"/>
|
oncommand="openHelpLink('ieusers');"/>
|
||||||
#endif
|
#endif
|
||||||
<menuitem id="troubleShooting"
|
<menuitem id="troubleShooting"
|
||||||
accesskey="&helpTroubleshooting.accesskey;"
|
accesskey="&helpTroubleshootingInfo.accesskey;"
|
||||||
label="&helpTroubleshooting.label;"
|
label="&helpTroubleshootingInfo.label;"
|
||||||
oncommand="openTroubleshootingPage()"
|
oncommand="openTroubleshootingPage()"
|
||||||
onclick="checkForMiddleClick(this, event);"/>
|
onclick="checkForMiddleClick(this, event);"/>
|
||||||
<menuitem id="releaseNotes"
|
<menuitem id="releaseNotes"
|
||||||
|
|
|
||||||
|
|
@ -889,9 +889,9 @@ var BookmarksEventHandler = {
|
||||||
// Add "Open (Feed Name)" menuitem if it's a livemark with a siteURI
|
// Add "Open (Feed Name)" menuitem if it's a livemark with a siteURI
|
||||||
target._endOptOpenSiteURI = document.createElement("menuitem");
|
target._endOptOpenSiteURI = document.createElement("menuitem");
|
||||||
target._endOptOpenSiteURI.className = "openlivemarksite-menuitem";
|
target._endOptOpenSiteURI.className = "openlivemarksite-menuitem";
|
||||||
target._endOptOpenSiteURI.setAttribute("siteURI", siteURIString);
|
target._endOptOpenSiteURI.setAttribute("targetURI", siteURIString);
|
||||||
target._endOptOpenSiteURI.setAttribute("oncommand",
|
target._endOptOpenSiteURI.setAttribute("oncommand",
|
||||||
"openUILink(this.getAttribute('siteURI'), event);");
|
"openUILink(this.getAttribute('targetURI'), event);");
|
||||||
// If a user middle-clicks this item we serve the oncommand event
|
// If a user middle-clicks this item we serve the oncommand event
|
||||||
// We are using checkForMiddleClick because of Bug 246720
|
// We are using checkForMiddleClick because of Bug 246720
|
||||||
// Note: stopPropagation is needed to avoid serving middle-click
|
// Note: stopPropagation is needed to avoid serving middle-click
|
||||||
|
|
@ -922,6 +922,7 @@ var BookmarksEventHandler = {
|
||||||
fillInBHTooltip: function(aDocument, aEvent) {
|
fillInBHTooltip: function(aDocument, aEvent) {
|
||||||
var node;
|
var node;
|
||||||
var cropped = false;
|
var cropped = false;
|
||||||
|
var targetURI;
|
||||||
|
|
||||||
if (aDocument.tooltipNode.localName == "treechildren") {
|
if (aDocument.tooltipNode.localName == "treechildren") {
|
||||||
var tree = aDocument.tooltipNode.parentNode;
|
var tree = aDocument.tooltipNode.parentNode;
|
||||||
|
|
@ -933,18 +934,28 @@ var BookmarksEventHandler = {
|
||||||
node = tree.view.nodeForTreeIndex(row.value);
|
node = tree.view.nodeForTreeIndex(row.value);
|
||||||
cropped = tbo.isCellCropped(row.value, column.value);
|
cropped = tbo.isCellCropped(row.value, column.value);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
node = aDocument.tooltipNode.node;
|
// Check whether the tooltipNode is a Places node.
|
||||||
|
// In such a case use it, otherwise check for targetURI attribute.
|
||||||
|
var tooltipNode = aDocument.tooltipNode;
|
||||||
|
if (tooltipNode.node)
|
||||||
|
node = tooltipNode.node;
|
||||||
|
else {
|
||||||
|
// This is a static non-Places node.
|
||||||
|
targetURI = tooltipNode.getAttribute("targetURI");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!node)
|
if (!node && !targetURI)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var title = node.title;
|
// Show node.label as tooltip's title for non-Places nodes.
|
||||||
var url;
|
var title = node ? node.title : tooltipNode.label;
|
||||||
|
|
||||||
// Show URL only for URI-type nodes.
|
// Show URL only for Places URI-nodes or nodes with a targetURI attribute.
|
||||||
if (PlacesUtils.nodeIsURI(node))
|
var url;
|
||||||
url = node.uri;
|
if (targetURI || PlacesUtils.nodeIsURI(node))
|
||||||
|
url = targetURI || node.uri;
|
||||||
|
|
||||||
// Show tooltip for containers only if their title is cropped.
|
// Show tooltip for containers only if their title is cropped.
|
||||||
if (!cropped && !url)
|
if (!cropped && !url)
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
# Paul O’Shannessy <paul@oshannessy.com>
|
# Paul O’Shannessy <paul@oshannessy.com>
|
||||||
# Nils Maier <maierman@web.de>
|
# Nils Maier <maierman@web.de>
|
||||||
# Rob Arnold <robarnold@cmu.edu>
|
# Rob Arnold <robarnold@cmu.edu>
|
||||||
|
# Dietrich Ayala <dietrich@mozilla.com>
|
||||||
#
|
#
|
||||||
# Alternatively, the contents of this file may be used under the terms of
|
# 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
|
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
|
@ -152,6 +153,12 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#ifdef MOZ_CRASHREPORTER
|
||||||
|
XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter",
|
||||||
|
"@mozilla.org/xre/app-info;1",
|
||||||
|
"nsICrashReporter");
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We can avoid adding multiple load event listeners and save some time by adding
|
* We can avoid adding multiple load event listeners and save some time by adding
|
||||||
* one listener that calls all real handlers.
|
* one listener that calls all real handlers.
|
||||||
|
|
@ -4318,6 +4325,14 @@ var TabsProgressListener = {
|
||||||
},
|
},
|
||||||
|
|
||||||
onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||||
|
#ifdef MOZ_CRASHREPORTER
|
||||||
|
if (!aRequest.URI)
|
||||||
|
aRequest.QueryInterface(Ci.nsIChannel);
|
||||||
|
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START &&
|
||||||
|
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_DOCUMENT) {
|
||||||
|
gCrashReporter.annotateCrashReport("URL", aRequest.URI.spec);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
},
|
},
|
||||||
|
|
||||||
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI) {
|
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI) {
|
||||||
|
|
@ -6840,6 +6855,7 @@ let gPrivateBrowsingUI = {
|
||||||
this._observerService = Cc["@mozilla.org/observer-service;1"].
|
this._observerService = Cc["@mozilla.org/observer-service;1"].
|
||||||
getService(Ci.nsIObserverService);
|
getService(Ci.nsIObserverService);
|
||||||
this._observerService.addObserver(this, "private-browsing", false);
|
this._observerService.addObserver(this, "private-browsing", false);
|
||||||
|
this._observerService.addObserver(this, "private-browsing-transition-complete", false);
|
||||||
|
|
||||||
this._privateBrowsingService = Cc["@mozilla.org/privatebrowsing;1"].
|
this._privateBrowsingService = Cc["@mozilla.org/privatebrowsing;1"].
|
||||||
getService(Ci.nsIPrivateBrowsingService);
|
getService(Ci.nsIPrivateBrowsingService);
|
||||||
|
|
@ -6850,6 +6866,19 @@ let gPrivateBrowsingUI = {
|
||||||
|
|
||||||
uninit: function PBUI_unint() {
|
uninit: function PBUI_unint() {
|
||||||
this._observerService.removeObserver(this, "private-browsing");
|
this._observerService.removeObserver(this, "private-browsing");
|
||||||
|
this._observerService.removeObserver(this, "private-browsing-transition-complete");
|
||||||
|
},
|
||||||
|
|
||||||
|
get _disableUIOnToggle PBUI__disableUIOnTogle() {
|
||||||
|
if (this._privateBrowsingService.autoStarted)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
return !gPrefService.getBoolPref("browser.privatebrowsing.keep_current_session");
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
observe: function PBUI_observe(aSubject, aTopic, aData) {
|
observe: function PBUI_observe(aSubject, aTopic, aData) {
|
||||||
|
|
@ -6859,6 +6888,15 @@ let gPrivateBrowsingUI = {
|
||||||
else if (aData == "exit")
|
else if (aData == "exit")
|
||||||
this.onExitPrivateBrowsing();
|
this.onExitPrivateBrowsing();
|
||||||
}
|
}
|
||||||
|
else if (aTopic == "private-browsing-transition-complete") {
|
||||||
|
if (this._disableUIOnToggle) {
|
||||||
|
// use setTimeout here in order to make the code testable
|
||||||
|
setTimeout(function() {
|
||||||
|
document.getElementById("Tools:PrivateBrowsing")
|
||||||
|
.removeAttribute("disabled");
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_shouldEnter: function PBUI__shouldEnter() {
|
_shouldEnter: function PBUI__shouldEnter() {
|
||||||
|
|
@ -6954,6 +6992,10 @@ let gPrivateBrowsingUI = {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
DownloadMonitorPanel.updateStatus();
|
DownloadMonitorPanel.updateStatus();
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
if (this._disableUIOnToggle)
|
||||||
|
document.getElementById("Tools:PrivateBrowsing")
|
||||||
|
.setAttribute("disabled", "true");
|
||||||
},
|
},
|
||||||
|
|
||||||
onExitPrivateBrowsing: function PBUI_onExitPrivateBrowsing() {
|
onExitPrivateBrowsing: function PBUI_onExitPrivateBrowsing() {
|
||||||
|
|
@ -7004,6 +7046,10 @@ let gPrivateBrowsingUI = {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
DownloadMonitorPanel.updateStatus();
|
DownloadMonitorPanel.updateStatus();
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
if (this._disableUIOnToggle)
|
||||||
|
document.getElementById("Tools:PrivateBrowsing")
|
||||||
|
.setAttribute("disabled", "true");
|
||||||
},
|
},
|
||||||
|
|
||||||
_setPBMenuTitle: function PBUI__setPBMenuTitle(aMode) {
|
_setPBMenuTitle: function PBUI__setPBMenuTitle(aMode) {
|
||||||
|
|
@ -7124,9 +7170,11 @@ var LightWeightThemeWebInstaller = {
|
||||||
this._removePreviousNotifications();
|
this._removePreviousNotifications();
|
||||||
|
|
||||||
var notificationBox = gBrowser.getNotificationBox();
|
var notificationBox = gBrowser.getNotificationBox();
|
||||||
|
var notificationBar =
|
||||||
notificationBox.appendNotification(message, "lwtheme-install-request", "",
|
notificationBox.appendNotification(message, "lwtheme-install-request", "",
|
||||||
notificationBox.PRIORITY_INFO_MEDIUM,
|
notificationBox.PRIORITY_INFO_MEDIUM,
|
||||||
buttons);
|
buttons);
|
||||||
|
notificationBar.persistence = 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
_install: function (newTheme) {
|
_install: function (newTheme) {
|
||||||
|
|
@ -7160,10 +7208,13 @@ var LightWeightThemeWebInstaller = {
|
||||||
this._removePreviousNotifications();
|
this._removePreviousNotifications();
|
||||||
|
|
||||||
var notificationBox = gBrowser.getNotificationBox();
|
var notificationBox = gBrowser.getNotificationBox();
|
||||||
|
var notificationBar =
|
||||||
notificationBox.appendNotification(text("message"),
|
notificationBox.appendNotification(text("message"),
|
||||||
"lwtheme-install-notification", "",
|
"lwtheme-install-notification", "",
|
||||||
notificationBox.PRIORITY_INFO_MEDIUM,
|
notificationBox.PRIORITY_INFO_MEDIUM,
|
||||||
buttons);
|
buttons);
|
||||||
|
notificationBar.persistence = 1;
|
||||||
|
notificationBar.timeout = Date.now() + 20000; // 20 seconds
|
||||||
},
|
},
|
||||||
|
|
||||||
_removePreviousNotifications: function () {
|
_removePreviousNotifications: function () {
|
||||||
|
|
@ -7232,44 +7283,7 @@ var LightWeightThemeWebInstaller = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_getThemeFromNode: function (node) {
|
_getThemeFromNode: function (node) {
|
||||||
const MANDATORY = ["id", "name", "headerURL"];
|
return this._manager.parseTheme(node.getAttribute("data-browsertheme"),
|
||||||
const OPTIONAL = ["footerURL", "textcolor", "accentcolor", "iconURL",
|
node.baseURI);
|
||||||
"previewURL", "author", "description", "homepageURL"];
|
|
||||||
|
|
||||||
try {
|
|
||||||
var data = JSON.parse(node.getAttribute("data-browsertheme"));
|
|
||||||
} catch (e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!data || typeof data != "object")
|
|
||||||
return null;
|
|
||||||
|
|
||||||
for (let prop in data) {
|
|
||||||
if (!data[prop] ||
|
|
||||||
typeof data[prop] != "string" ||
|
|
||||||
MANDATORY.indexOf(prop) == -1 && OPTIONAL.indexOf(prop) == -1) {
|
|
||||||
delete data[prop];
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (/URL$/.test(prop)) {
|
|
||||||
try {
|
|
||||||
data[prop] = makeURLAbsolute(node.baseURI, data[prop]);
|
|
||||||
|
|
||||||
if (/^https?:/.test(data[prop]))
|
|
||||||
continue;
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
delete data[prop];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < MANDATORY.length; i++) {
|
|
||||||
if (!(MANDATORY[i] in data))
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,13 +53,21 @@ let observer = {
|
||||||
throw Components.results.NS_NOINTERFACE;
|
throw Components.results.NS_NOINTERFACE;
|
||||||
},
|
},
|
||||||
observe: function (aSubject, aTopic, aData) {
|
observe: function (aSubject, aTopic, aData) {
|
||||||
|
switch (aTopic) {
|
||||||
|
case "private-browsing":
|
||||||
gOpenLocationLastURLData = "";
|
gOpenLocationLastURLData = "";
|
||||||
|
break;
|
||||||
|
case "browser:purge-session-history":
|
||||||
|
gOpenLocationLastURL.reset();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Components.classes["@mozilla.org/observer-service;1"]
|
let os = Components.classes["@mozilla.org/observer-service;1"]
|
||||||
.getService(Components.interfaces.nsIObserverService)
|
.getService(Components.interfaces.nsIObserverService);
|
||||||
.addObserver(observer, "private-browsing", true);
|
os.addObserver(observer, "private-browsing", true);
|
||||||
|
os.addObserver(observer, "browser:purge-session-history", true);
|
||||||
|
|
||||||
let gOpenLocationLastURLData = "";
|
let gOpenLocationLastURLData = "";
|
||||||
let gOpenLocationLastURL = {
|
let gOpenLocationLastURL = {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ pageInfoTreeView.prototype = {
|
||||||
{
|
{
|
||||||
this.rows = this.data.push(row);
|
this.rows = this.data.push(row);
|
||||||
this.rowCountChanged(this.rows - 1, 1);
|
this.rowCountChanged(this.rows - 1, 1);
|
||||||
if (this.selection.count == 0 && this.rowCount)
|
if (this.selection.count == 0 && this.rowCount && !gImageElement)
|
||||||
this.selection.select(0);
|
this.selection.select(0);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,65 +40,38 @@
|
||||||
* modified by sub-document loads of content from a different domain.
|
* modified by sub-document loads of content from a different domain.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let testPage = 'data:text/html,<body><iframe id="a" src=""></iframe></body>';
|
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
||||||
// The zoom level before the sub-document load. We set this in continueTest
|
const TEST_PAGE_URL = 'data:text/html,<body><iframe src=""></iframe></body>';
|
||||||
// and then compare it to the current zoom level in finishTest to make sure
|
const TEST_IFRAME_URL = "http://test2.example.org/";
|
||||||
// it hasn't changed.
|
|
||||||
let zoomLevel;
|
|
||||||
|
|
||||||
// Prepare the test tab
|
// Prepare the test tab
|
||||||
gBrowser.selectedTab = gBrowser.addTab();
|
gBrowser.selectedTab = gBrowser.addTab();
|
||||||
let testBrowser = gBrowser.selectedBrowser;
|
let testBrowser = gBrowser.selectedBrowser;
|
||||||
|
|
||||||
let finishTest = function() {
|
testBrowser.addEventListener("load", function () {
|
||||||
testBrowser.removeProgressListener(progressListener);
|
testBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
is(ZoomManager.zoom, zoomLevel, "zoom is retained after sub-document load");
|
|
||||||
gBrowser.removeCurrentTab();
|
|
||||||
finish();
|
|
||||||
};
|
|
||||||
|
|
||||||
let progressListener = {
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
|
|
||||||
Ci.nsISupportsWeakReference]),
|
|
||||||
onStateChange: function() {},
|
|
||||||
onProgressChange: function() {},
|
|
||||||
onLocationChange: function() {
|
|
||||||
window.setTimeout(finishTest, 0);
|
|
||||||
},
|
|
||||||
onStatusChange: function() {},
|
|
||||||
onSecurityChange: function() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
let continueTest = function() {
|
|
||||||
// Change the zoom level and then save it so we can compare it to the level
|
// Change the zoom level and then save it so we can compare it to the level
|
||||||
// after loading the sub-document.
|
// after loading the sub-document.
|
||||||
FullZoom.enlarge();
|
FullZoom.enlarge();
|
||||||
zoomLevel = ZoomManager.zoom;
|
var zoomLevel = ZoomManager.zoom;
|
||||||
|
|
||||||
// Finish the test in a timeout after the sub-document location change
|
|
||||||
// to give the zoom controller time to respond to it.
|
|
||||||
testBrowser.addProgressListener(progressListener);
|
|
||||||
|
|
||||||
// Start the sub-document load.
|
// Start the sub-document load.
|
||||||
content.document.getElementById("a").src = "http://test2.example.org/";
|
executeSoon(function () {
|
||||||
};
|
testBrowser.addEventListener("load", function (e) {
|
||||||
|
testBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
// Continue the test after the test page has loaded.
|
is(e.target.defaultView.location, TEST_IFRAME_URL, "got the load event for the iframe");
|
||||||
// Note: in order for the sub-document load to trigger a location change
|
is(ZoomManager.zoom, zoomLevel, "zoom is retained after sub-document load");
|
||||||
// the way it does under real world usage scenarios, we have to continue
|
|
||||||
// the test in a timeout for some unknown reason.
|
|
||||||
let continueListener = function() {
|
|
||||||
window.setTimeout(continueTest, 0);
|
|
||||||
|
|
||||||
// Remove the load listener so it doesn't get called for the sub-document.
|
gBrowser.removeCurrentTab();
|
||||||
testBrowser.removeEventListener("load", continueListener, true);
|
finish();
|
||||||
};
|
}, true);
|
||||||
testBrowser.addEventListener("load", continueListener, true);
|
content.document.querySelector("iframe").src = TEST_IFRAME_URL;
|
||||||
|
});
|
||||||
|
}, true);
|
||||||
|
|
||||||
// Start the test by loading the test page.
|
content.location = TEST_PAGE_URL;
|
||||||
testBrowser.contentWindow.location = testPage;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ function test() {
|
||||||
|
|
||||||
content.location =
|
content.location =
|
||||||
"data:text/html," +
|
"data:text/html," +
|
||||||
|
"<img src='about:logo?b' height=300 width=350 alt=2>" +
|
||||||
"<img src='about:logo?a' height=200 width=250>" +
|
"<img src='about:logo?a' height=200 width=250>" +
|
||||||
"<img src='about:logo?b' height=200 width=250 alt=1>" +
|
"<img src='about:logo?b' height=200 width=250 alt=1>" +
|
||||||
"<img src='about:logo?b' height=200 width=250 alt=2>" +
|
|
||||||
"<img src='about:logo?b' height=100 width=150 alt=2 id='test-image'>";
|
"<img src='about:logo?b' height=100 width=150 alt=2 id='test-image'>";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,7 @@ function buildHelpMenu()
|
||||||
#ifdef MOZ_UPDATER
|
#ifdef MOZ_UPDATER
|
||||||
var updates =
|
var updates =
|
||||||
Components.classes["@mozilla.org/updates/update-service;1"].
|
Components.classes["@mozilla.org/updates/update-service;1"].
|
||||||
getService(Components.interfaces.nsIApplicationUpdateService);
|
getService(Components.interfaces.nsIApplicationUpdateService2);
|
||||||
var um =
|
var um =
|
||||||
Components.classes["@mozilla.org/updates/update-manager;1"].
|
Components.classes["@mozilla.org/updates/update-manager;1"].
|
||||||
getService(Components.interfaces.nsIUpdateManager);
|
getService(Components.interfaces.nsIUpdateManager);
|
||||||
|
|
@ -483,9 +483,9 @@ function buildHelpMenu()
|
||||||
// Disable the UI if the update enabled pref has been locked by the
|
// Disable the UI if the update enabled pref has been locked by the
|
||||||
// administrator or if we cannot update for some other reason
|
// administrator or if we cannot update for some other reason
|
||||||
var checkForUpdates = document.getElementById("checkForUpdates");
|
var checkForUpdates = document.getElementById("checkForUpdates");
|
||||||
var canUpdate = updates.canUpdate;
|
var canCheckForUpdates = updates.canCheckForUpdates;
|
||||||
checkForUpdates.setAttribute("disabled", !canUpdate);
|
checkForUpdates.setAttribute("disabled", !canCheckForUpdates);
|
||||||
if (!canUpdate)
|
if (!canCheckForUpdates)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var strings = document.getElementById("bundle_browser");
|
var strings = document.getElementById("bundle_browser");
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ MODULE = browsercomps
|
||||||
XPIDL_MODULE = browsercompsbase
|
XPIDL_MODULE = browsercompsbase
|
||||||
|
|
||||||
XPIDLSRCS = \
|
XPIDLSRCS = \
|
||||||
nsIBrowserHandler.idl \
|
|
||||||
nsIBrowserGlue.idl \
|
nsIBrowserGlue.idl \
|
||||||
|
nsIBrowserHandler.idl \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_PP_COMPONENTS = \
|
EXTRA_PP_COMPONENTS = \
|
||||||
|
|
@ -57,33 +57,33 @@ EXTRA_PP_COMPONENTS = \
|
||||||
|
|
||||||
EXTRA_JS_MODULES = distribution.js
|
EXTRA_JS_MODULES = distribution.js
|
||||||
|
|
||||||
DIRS = \
|
PARALLEL_DIRS = \
|
||||||
about \
|
about \
|
||||||
certerror \
|
certerror \
|
||||||
dirprovider \
|
dirprovider \
|
||||||
|
feeds \
|
||||||
microsummaries \
|
microsummaries \
|
||||||
|
places \
|
||||||
preferences \
|
preferences \
|
||||||
|
privatebrowsing \
|
||||||
search \
|
search \
|
||||||
sessionstore \
|
sessionstore \
|
||||||
shell \
|
shell \
|
||||||
sidebar \
|
sidebar \
|
||||||
feeds \
|
|
||||||
places \
|
|
||||||
privatebrowsing \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifndef WINCE
|
ifndef WINCE
|
||||||
DIRS += migration
|
PARALLEL_DIRS += migration
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
|
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
|
||||||
ifndef WINCE
|
ifndef WINCE
|
||||||
DIRS += wintaskbar
|
PARALLEL_DIRS += wintaskbar
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef MOZ_SAFE_BROWSING
|
ifdef MOZ_SAFE_BROWSING
|
||||||
DIRS += safebrowsing
|
PARALLEL_DIRS += safebrowsing
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DIRS += build
|
DIRS += build
|
||||||
|
|
|
||||||
|
|
@ -510,8 +510,15 @@
|
||||||
|
|
||||||
if (window.XULBrowserWindow) {
|
if (window.XULBrowserWindow) {
|
||||||
var nodeItem = event.target.node;
|
var nodeItem = event.target.node;
|
||||||
|
|
||||||
|
var linkURI;
|
||||||
if (nodeItem && PlacesUtils.nodeIsURI(nodeItem))
|
if (nodeItem && PlacesUtils.nodeIsURI(nodeItem))
|
||||||
window.XULBrowserWindow.setOverLink(nodeItem.uri, null);
|
linkURI = nodeItem.uri;
|
||||||
|
else if (node.hasAttribute("targetURI"))
|
||||||
|
linkURI = node.getAttribute("targetURI");
|
||||||
|
|
||||||
|
if (linkURI)
|
||||||
|
window.XULBrowserWindow.setOverLink(linkURI, null);
|
||||||
}
|
}
|
||||||
]]></handler>
|
]]></handler>
|
||||||
<handler event="DOMMenuItemInactive"><![CDATA[
|
<handler event="DOMMenuItemInactive"><![CDATA[
|
||||||
|
|
|
||||||
|
|
@ -1198,7 +1198,7 @@ var PlacesUIUtils = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all items marked as being the left pane folder.
|
// Get all items marked as being the left pane folder.
|
||||||
let items = as.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO, {});
|
let items = as.getItemsWithAnnotation(ORGANIZER_FOLDER_ANNO);
|
||||||
if (items.length > 1) {
|
if (items.length > 1) {
|
||||||
// Something went wrong, we cannot have more than one left pane folder,
|
// Something went wrong, we cannot have more than one left pane folder,
|
||||||
// remove all left pane folders and continue. We will create a new one.
|
// remove all left pane folders and continue. We will create a new one.
|
||||||
|
|
@ -1223,7 +1223,7 @@ var PlacesUIUtils = {
|
||||||
delete this.leftPaneQueries;
|
delete this.leftPaneQueries;
|
||||||
this.leftPaneQueries = {};
|
this.leftPaneQueries = {};
|
||||||
|
|
||||||
let items = as.getItemsWithAnnotation(ORGANIZER_QUERY_ANNO, {});
|
let items = as.getItemsWithAnnotation(ORGANIZER_QUERY_ANNO);
|
||||||
// While looping through queries we will also check for their validity.
|
// While looping through queries we will also check for their validity.
|
||||||
let queriesCount = 0;
|
let queriesCount = 0;
|
||||||
for(let i = 0; i < items.length; i++) {
|
for(let i = 0; i < items.length; i++) {
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,11 @@ const Ci = Components.interfaces;
|
||||||
const Cu = Components.utils;
|
const Cu = Components.utils;
|
||||||
const Cr = Components.results;
|
const Cr = Components.results;
|
||||||
|
|
||||||
|
const STATE_IDLE = 0;
|
||||||
|
const STATE_TRANSITION_STARTED = 1;
|
||||||
|
const STATE_WAITING_FOR_RESTORE = 2;
|
||||||
|
const STATE_RESTORE_FINISHED = 3;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//// PrivateBrowsingService
|
//// PrivateBrowsingService
|
||||||
|
|
||||||
|
|
@ -82,6 +87,7 @@ function PrivateBrowsingService() {
|
||||||
this._obs.addObserver(this, "quit-application-granted", true);
|
this._obs.addObserver(this, "quit-application-granted", true);
|
||||||
this._obs.addObserver(this, "private-browsing", true);
|
this._obs.addObserver(this, "private-browsing", true);
|
||||||
this._obs.addObserver(this, "command-line-startup", true);
|
this._obs.addObserver(this, "command-line-startup", true);
|
||||||
|
this._obs.addObserver(this, "sessionstore-browser-state-restored", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrivateBrowsingService.prototype = {
|
PrivateBrowsingService.prototype = {
|
||||||
|
|
@ -115,8 +121,8 @@ PrivateBrowsingService.prototype = {
|
||||||
// How to treat the non-private session
|
// How to treat the non-private session
|
||||||
_saveSession: true,
|
_saveSession: true,
|
||||||
|
|
||||||
// Make sure we don't allow re-enterant changing of the private mode
|
// The current status of the private browsing service
|
||||||
_alreadyChangingMode: false,
|
_currentStatus: STATE_IDLE,
|
||||||
|
|
||||||
// Whether the private browsing mode has been started automatically (ie. always-on)
|
// Whether the private browsing mode has been started automatically (ie. always-on)
|
||||||
_autoStarted: false,
|
_autoStarted: false,
|
||||||
|
|
@ -234,6 +240,7 @@ PrivateBrowsingService.prototype = {
|
||||||
// if we have transitioned out of private browsing mode and the session is
|
// if we have transitioned out of private browsing mode and the session is
|
||||||
// to be restored, do it now
|
// to be restored, do it now
|
||||||
if (!this._inPrivateBrowsing) {
|
if (!this._inPrivateBrowsing) {
|
||||||
|
this._currentStatus = STATE_WAITING_FOR_RESTORE;
|
||||||
ss.setBrowserState(this._savedBrowserState);
|
ss.setBrowserState(this._savedBrowserState);
|
||||||
this._savedBrowserState = null;
|
this._savedBrowserState = null;
|
||||||
|
|
||||||
|
|
@ -275,11 +282,35 @@ PrivateBrowsingService.prototype = {
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
// Transition into private browsing mode
|
// Transition into private browsing mode
|
||||||
|
this._currentStatus = STATE_WAITING_FOR_RESTORE;
|
||||||
ss.setBrowserState(JSON.stringify(privateBrowsingState));
|
ss.setBrowserState(JSON.stringify(privateBrowsingState));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_notifyIfTransitionComplete: function PBS__notifyIfTransitionComplete() {
|
||||||
|
switch (this._currentStatus) {
|
||||||
|
case STATE_TRANSITION_STARTED:
|
||||||
|
// no session store operation was needed, so just notify of transition completion
|
||||||
|
case STATE_RESTORE_FINISHED:
|
||||||
|
// restore has been completed
|
||||||
|
this._currentStatus = STATE_IDLE;
|
||||||
|
this._obs.notifyObservers(null, "private-browsing-transition-complete", "");
|
||||||
|
break;
|
||||||
|
case STATE_WAITING_FOR_RESTORE:
|
||||||
|
// too soon to notify...
|
||||||
|
break;
|
||||||
|
case STATE_IDLE:
|
||||||
|
// no need to notify
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// unexpected state observed
|
||||||
|
Cu.reportError("Unexpected private browsing status reached: " +
|
||||||
|
this._currentStatus);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_canEnterPrivateBrowsingMode: function PBS__canEnterPrivateBrowsingMode() {
|
_canEnterPrivateBrowsingMode: function PBS__canEnterPrivateBrowsingMode() {
|
||||||
let cancelEnter = Cc["@mozilla.org/supports-PRBool;1"].
|
let cancelEnter = Cc["@mozilla.org/supports-PRBool;1"].
|
||||||
createInstance(Ci.nsISupportsPRBool);
|
createInstance(Ci.nsISupportsPRBool);
|
||||||
|
|
@ -382,6 +413,12 @@ PrivateBrowsingService.prototype = {
|
||||||
aSubject.QueryInterface(Ci.nsICommandLine);
|
aSubject.QueryInterface(Ci.nsICommandLine);
|
||||||
this.handle(aSubject);
|
this.handle(aSubject);
|
||||||
break;
|
break;
|
||||||
|
case "sessionstore-browser-state-restored":
|
||||||
|
if (this._currentStatus == STATE_WAITING_FOR_RESTORE) {
|
||||||
|
this._currentStatus = STATE_RESTORE_FINISHED;
|
||||||
|
this._notifyIfTransitionComplete();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -416,11 +453,11 @@ PrivateBrowsingService.prototype = {
|
||||||
// status of the service while it's in the process of another transition.
|
// status of the service while it's in the process of another transition.
|
||||||
// So, we detect a reentrant call here and throw an error.
|
// So, we detect a reentrant call here and throw an error.
|
||||||
// This is documented in nsIPrivateBrowsingService.idl.
|
// This is documented in nsIPrivateBrowsingService.idl.
|
||||||
if (this._alreadyChangingMode)
|
if (this._currentStatus != STATE_IDLE)
|
||||||
throw Cr.NS_ERROR_FAILURE;
|
throw Cr.NS_ERROR_FAILURE;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this._alreadyChangingMode = true;
|
this._currentStatus = STATE_TRANSITION_STARTED;
|
||||||
|
|
||||||
if (val != this._inPrivateBrowsing) {
|
if (val != this._inPrivateBrowsing) {
|
||||||
if (val) {
|
if (val) {
|
||||||
|
|
@ -465,7 +502,7 @@ PrivateBrowsingService.prototype = {
|
||||||
"private browsing mode change request: " + ex.toString());
|
"private browsing mode change request: " + ex.toString());
|
||||||
} finally {
|
} finally {
|
||||||
this._windowsToClose = [];
|
this._windowsToClose = [];
|
||||||
this._alreadyChangingMode = false;
|
this._notifyIfTransitionComplete();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ _BROWSER_TEST_FILES = \
|
||||||
browser_privatebrowsing_certexceptionsui.js \
|
browser_privatebrowsing_certexceptionsui.js \
|
||||||
browser_privatebrowsing_crh.js \
|
browser_privatebrowsing_crh.js \
|
||||||
browser_privatebrowsing_downloadmonitor.js \
|
browser_privatebrowsing_downloadmonitor.js \
|
||||||
|
browser_privatebrowsing_fastswitch.js \
|
||||||
browser_privatebrowsing_findbar.js \
|
browser_privatebrowsing_findbar.js \
|
||||||
browser_privatebrowsing_forgetthissite.js \
|
browser_privatebrowsing_forgetthissite.js \
|
||||||
browser_privatebrowsing_geoprompt.js \
|
browser_privatebrowsing_geoprompt.js \
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
/* ***** 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
|
||||||
|
* Mozilla Foundation.
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Ehsan Akhgari <ehsan@mozilla.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 ***** */
|
||||||
|
|
||||||
|
// This test makes sure that users are prevented from toggling the private
|
||||||
|
// browsing mode too quickly, hence be proctected from symptoms in bug 526194.
|
||||||
|
|
||||||
|
function test() {
|
||||||
|
// initialization
|
||||||
|
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||||
|
getService(Ci.nsIPrivateBrowsingService);
|
||||||
|
let os = Cc["@mozilla.org/observer-service;1"].
|
||||||
|
getService(Ci.nsIObserverService);
|
||||||
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||||
|
getService(Ci.nsISessionStore);
|
||||||
|
let pbCmd = document.getElementById("Tools:PrivateBrowsing");
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
let observer = {
|
||||||
|
pass: 1,
|
||||||
|
observe: function(aSubject, aTopic, aData) {
|
||||||
|
switch (aTopic) {
|
||||||
|
case "private-browsing":
|
||||||
|
setTimeout(function() {
|
||||||
|
ok(document.getElementById("Tools:PrivateBrowsing").hasAttribute("disabled"),
|
||||||
|
"The private browsing command should be disabled immediately after the mode switch");
|
||||||
|
}, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "private-browsing-transition-complete":
|
||||||
|
if (this.pass++ == 1) {
|
||||||
|
setTimeout(function() {
|
||||||
|
ok(!pbCmd.hasAttribute("disabled"),
|
||||||
|
"The private browsing command should be re-enabled after entering the private browsing mode");
|
||||||
|
|
||||||
|
pb.privateBrowsingEnabled = false;
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setTimeout(function() {
|
||||||
|
ok(!pbCmd.hasAttribute("disabled"),
|
||||||
|
"The private browsing command should be re-enabled after exiting the private browsing mode");
|
||||||
|
|
||||||
|
os.removeObserver(observer, "private-browsing");
|
||||||
|
os.removeObserver(observer, "private-browsing-transition-complete");
|
||||||
|
finish();
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
os.addObserver(observer, "private-browsing", false);
|
||||||
|
os.addObserver(observer, "private-browsing-transition-complete", false);
|
||||||
|
|
||||||
|
pb.privateBrowsingEnabled = true;
|
||||||
|
}
|
||||||
|
|
@ -44,9 +44,6 @@ function do_test() {
|
||||||
getService(Ci.nsIObserverService);
|
getService(Ci.nsIObserverService);
|
||||||
var pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
|
var pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
|
||||||
getService(Ci.nsIPrivateBrowsingService);
|
getService(Ci.nsIPrivateBrowsingService);
|
||||||
var prefBranch = Cc["@mozilla.org/preferences-service;1"].
|
|
||||||
getService(Ci.nsIPrefBranch);
|
|
||||||
prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
|
||||||
|
|
||||||
var expectedQuitting;
|
var expectedQuitting;
|
||||||
var called = 0;
|
var called = 0;
|
||||||
|
|
@ -69,7 +66,6 @@ function do_test() {
|
||||||
// finish up the test
|
// finish up the test
|
||||||
if (expectedQuitting) {
|
if (expectedQuitting) {
|
||||||
os.removeObserver(this, kPrivateBrowsingNotification);
|
os.removeObserver(this, kPrivateBrowsingNotification);
|
||||||
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
|
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ const Cu = Components.utils;
|
||||||
|
|
||||||
const kPrivateBrowsingNotification = "private-browsing";
|
const kPrivateBrowsingNotification = "private-browsing";
|
||||||
const kPrivateBrowsingCancelVoteNotification = "private-browsing-cancel-vote";
|
const kPrivateBrowsingCancelVoteNotification = "private-browsing-cancel-vote";
|
||||||
|
const kPrivateBrowsingTransitionCompleteNotification = "private-browsing-transition-complete";
|
||||||
const kEnter = "enter";
|
const kEnter = "enter";
|
||||||
const kExit = "exit";
|
const kExit = "exit";
|
||||||
|
|
||||||
|
|
@ -94,6 +95,11 @@ if (!profileDir) {
|
||||||
dirSvc.QueryInterface(Ci.nsIDirectoryService).registerProvider(provider);
|
dirSvc.QueryInterface(Ci.nsIDirectoryService).registerProvider(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not attempt to restore any session since we don't have any windows
|
||||||
|
Cc["@mozilla.org/preferences-service;1"].
|
||||||
|
getService(Ci.nsIPrefBranch).
|
||||||
|
setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes any files that could make our tests fail.
|
* Removes any files that could make our tests fail.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
/* ***** 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
|
||||||
|
* Mozilla Foundation.
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Ehsan Akhgari <ehsan@mozilla.com>
|
||||||
|
*
|
||||||
|
* 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 ***** */
|
||||||
|
|
||||||
|
// Be neat: clear the pref that we have set
|
||||||
|
Cc["@mozilla.org/preferences-service;1"].
|
||||||
|
getService(Ci.nsIPrefBranch).
|
||||||
|
clearUserPref("browser.privatebrowsing.keep_current_session");
|
||||||
|
|
@ -45,9 +45,6 @@ function run_test_on_service() {
|
||||||
// initialization
|
// initialization
|
||||||
var os = Cc["@mozilla.org/observer-service;1"].
|
var os = Cc["@mozilla.org/observer-service;1"].
|
||||||
getService(Ci.nsIObserverService);
|
getService(Ci.nsIObserverService);
|
||||||
var prefBranch = Cc["@mozilla.org/preferences-service;1"].
|
|
||||||
getService(Ci.nsIPrefBranch);
|
|
||||||
prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
|
||||||
|
|
||||||
// the contract ID should be available
|
// the contract ID should be available
|
||||||
do_check_true(PRIVATEBROWSING_CONTRACT_ID in Cc);
|
do_check_true(PRIVATEBROWSING_CONTRACT_ID in Cc);
|
||||||
|
|
@ -220,7 +217,27 @@ function run_test_on_service() {
|
||||||
];
|
];
|
||||||
do_check_eq(observer.notifications.join(","), reference_order.join(","));
|
do_check_eq(observer.notifications.join(","), reference_order.join(","));
|
||||||
|
|
||||||
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
|
// make sure that the private browsing transition complete notification is
|
||||||
|
// raised correctly.
|
||||||
|
observer = {
|
||||||
|
observe: function(aSubject, aTopic, aData) {
|
||||||
|
this.notifications.push(aTopic + " " + aData);
|
||||||
|
},
|
||||||
|
notifications: []
|
||||||
|
};
|
||||||
|
os.addObserver(observer, kPrivateBrowsingNotification, false);
|
||||||
|
os.addObserver(observer, kPrivateBrowsingTransitionCompleteNotification, false);
|
||||||
|
pb.privateBrowsingEnabled = true;
|
||||||
|
pb.privateBrowsingEnabled = false;
|
||||||
|
os.removeObserver(observer, kPrivateBrowsingNotification);
|
||||||
|
os.removeObserver(observer, kPrivateBrowsingTransitionCompleteNotification);
|
||||||
|
reference_order = [
|
||||||
|
kPrivateBrowsingNotification + " " + kEnter,
|
||||||
|
kPrivateBrowsingTransitionCompleteNotification + " ",
|
||||||
|
kPrivateBrowsingNotification + " " + kExit,
|
||||||
|
kPrivateBrowsingTransitionCompleteNotification + " ",
|
||||||
|
];
|
||||||
|
do_check_eq(observer.notifications.join(","), reference_order.join(","));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support running tests on both the service itself and its wrapper
|
// Support running tests on both the service itself and its wrapper
|
||||||
|
|
|
||||||
|
|
@ -63,11 +63,7 @@ function run_test_on_service() {
|
||||||
// initialization
|
// initialization
|
||||||
var pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
|
var pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
|
||||||
getService(Ci.nsIPrivateBrowsingService);
|
getService(Ci.nsIPrivateBrowsingService);
|
||||||
var prefBranch = Cc["@mozilla.org/preferences-service;1"].
|
|
||||||
getService(Ci.nsIPrefBranch);
|
|
||||||
prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
|
||||||
|
|
||||||
try {
|
|
||||||
// about:privatebrowsing should be available before entering the private mode
|
// about:privatebrowsing should be available before entering the private mode
|
||||||
do_check_true(is_about_privatebrowsing_available());
|
do_check_true(is_about_privatebrowsing_available());
|
||||||
|
|
||||||
|
|
@ -82,9 +78,6 @@ function run_test_on_service() {
|
||||||
|
|
||||||
// about:privatebrowsing should be available after leaving the private mode
|
// about:privatebrowsing should be available after leaving the private mode
|
||||||
do_check_true(is_about_privatebrowsing_available());
|
do_check_true(is_about_privatebrowsing_available());
|
||||||
} finally {
|
|
||||||
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support running tests on both the service itself and its wrapper
|
// Support running tests on both the service itself and its wrapper
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,6 @@
|
||||||
// when entering and leaving the private browsing mode.
|
// when entering and leaving the private browsing mode.
|
||||||
|
|
||||||
function run_test_on_service() {
|
function run_test_on_service() {
|
||||||
var prefBranch = Cc["@mozilla.org/preferences-service;1"].
|
|
||||||
getService(Ci.nsIPrefBranch);
|
|
||||||
prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
|
||||||
|
|
||||||
var pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
|
var pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
|
||||||
getService(Ci.nsIPrivateBrowsingService);
|
getService(Ci.nsIPrivateBrowsingService);
|
||||||
|
|
||||||
|
|
@ -108,8 +104,6 @@ function run_test_on_service() {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
do_throw("Unexpected exception while testing HTTP auth manager: " + e);
|
do_throw("Unexpected exception while testing HTTP auth manager: " + e);
|
||||||
} finally {
|
|
||||||
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,13 @@ function run_test_on_service()
|
||||||
let Cu = Components.utils;
|
let Cu = Components.utils;
|
||||||
Cu.import("resource:///modules/openLocationLastURL.jsm");
|
Cu.import("resource:///modules/openLocationLastURL.jsm");
|
||||||
|
|
||||||
|
function clearHistory() {
|
||||||
|
// simulate clearing the private data
|
||||||
|
Cc["@mozilla.org/observer-service;1"].
|
||||||
|
getService(Ci.nsIObserverService).
|
||||||
|
notifyObservers(null, "browser:purge-session-history", "");
|
||||||
|
}
|
||||||
|
|
||||||
let pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
|
let pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
|
||||||
getService(Ci.nsIPrivateBrowsingService);
|
getService(Ci.nsIPrivateBrowsingService);
|
||||||
let pref = Cc["@mozilla.org/preferences-service;1"].
|
let pref = Cc["@mozilla.org/preferences-service;1"].
|
||||||
|
|
@ -64,6 +71,10 @@ function run_test_on_service()
|
||||||
gOpenLocationLastURL.value = url2;
|
gOpenLocationLastURL.value = url2;
|
||||||
do_check_eq(gOpenLocationLastURL.value, url2);
|
do_check_eq(gOpenLocationLastURL.value, url2);
|
||||||
|
|
||||||
|
clearHistory();
|
||||||
|
do_check_eq(gOpenLocationLastURL.value, "");
|
||||||
|
gOpenLocationLastURL.value = url2;
|
||||||
|
|
||||||
pb.privateBrowsingEnabled = true;
|
pb.privateBrowsingEnabled = true;
|
||||||
do_check_eq(gOpenLocationLastURL.value, "");
|
do_check_eq(gOpenLocationLastURL.value, "");
|
||||||
|
|
||||||
|
|
@ -76,6 +87,15 @@ function run_test_on_service()
|
||||||
|
|
||||||
pb.privateBrowsingEnabled = false;
|
pb.privateBrowsingEnabled = false;
|
||||||
do_check_eq(gOpenLocationLastURL.value, url2);
|
do_check_eq(gOpenLocationLastURL.value, url2);
|
||||||
|
|
||||||
|
pb.privateBrowsingEnabled = true;
|
||||||
|
gOpenLocationLastURL.value = url1;
|
||||||
|
do_check_neq(gOpenLocationLastURL.value, "");
|
||||||
|
clearHistory();
|
||||||
|
do_check_eq(gOpenLocationLastURL.value, "");
|
||||||
|
|
||||||
|
pb.privateBrowsingEnabled = false;
|
||||||
|
do_check_eq(gOpenLocationLastURL.value, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support running tests on both the service itself and its wrapper
|
// Support running tests on both the service itself and its wrapper
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,6 @@ function run_test_on_service() {
|
||||||
getService(Ci.nsIPrivateBrowsingService);
|
getService(Ci.nsIPrivateBrowsingService);
|
||||||
var os = Cc["@mozilla.org/observer-service;1"].
|
var os = Cc["@mozilla.org/observer-service;1"].
|
||||||
getService(Ci.nsIObserverService);
|
getService(Ci.nsIObserverService);
|
||||||
var prefBranch = Cc["@mozilla.org/preferences-service;1"].
|
|
||||||
getService(Ci.nsIPrefBranch);
|
|
||||||
prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
|
||||||
|
|
||||||
var observer = {
|
var observer = {
|
||||||
observe: function (aSubject, aTopic, aData) {
|
observe: function (aSubject, aTopic, aData) {
|
||||||
|
|
@ -66,7 +63,6 @@ function run_test_on_service() {
|
||||||
do_check_eq(observer.events.length, 0);
|
do_check_eq(observer.events.length, 0);
|
||||||
|
|
||||||
os.removeObserver(observer, "network:offline-status-changed", false);
|
os.removeObserver(observer, "network:offline-status-changed", false);
|
||||||
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support running tests on both the service itself and its wrapper
|
// Support running tests on both the service itself and its wrapper
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,10 @@ const CAPABILITIES = [
|
||||||
"DNSPrefetch", "Auth"
|
"DNSPrefetch", "Auth"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
#ifndef XP_WIN
|
||||||
|
#define BROKEN_WM_Z_ORDER
|
||||||
|
#endif
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
|
||||||
function debug(aMsg) {
|
function debug(aMsg) {
|
||||||
|
|
@ -182,6 +186,9 @@ SessionStoreService.prototype = {
|
||||||
// whether we clearing history on shutdown
|
// whether we clearing history on shutdown
|
||||||
_clearingOnShutdown: false,
|
_clearingOnShutdown: false,
|
||||||
|
|
||||||
|
// List of windows that are being closed during setBrowserState.
|
||||||
|
_closingWindows: [],
|
||||||
|
|
||||||
#ifndef XP_MACOSX
|
#ifndef XP_MACOSX
|
||||||
// whether the last window was closed and should be restored
|
// whether the last window was closed and should be restored
|
||||||
_restoreLastWindow: false,
|
_restoreLastWindow: false,
|
||||||
|
|
@ -336,6 +343,14 @@ SessionStoreService.prototype = {
|
||||||
}, false);
|
}, false);
|
||||||
break;
|
break;
|
||||||
case "domwindowclosed": // catch closed windows
|
case "domwindowclosed": // catch closed windows
|
||||||
|
if (this._closingWindows.length > 0) {
|
||||||
|
let index = this._closingWindows.indexOf(aSubject);
|
||||||
|
if (index != -1) {
|
||||||
|
this._closingWindows.splice(index, 1);
|
||||||
|
if (this._closingWindows.length == 0)
|
||||||
|
this._sendRestoreCompletedNotifications(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.onClose(aSubject);
|
this.onClose(aSubject);
|
||||||
break;
|
break;
|
||||||
case "quit-application-requested":
|
case "quit-application-requested":
|
||||||
|
|
@ -900,19 +915,21 @@ SessionStoreService.prototype = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// close all other browser windows
|
|
||||||
this._forEachBrowserWindow(function(aWindow) {
|
|
||||||
if (aWindow != window) {
|
|
||||||
aWindow.close();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// make sure closed window data isn't kept
|
// make sure closed window data isn't kept
|
||||||
this._closedWindows = [];
|
this._closedWindows = [];
|
||||||
|
|
||||||
// determine how many windows are meant to be restored
|
// determine how many windows are meant to be restored
|
||||||
this._restoreCount = state.windows ? state.windows.length : 0;
|
this._restoreCount = state.windows ? state.windows.length : 0;
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
// close all other browser windows
|
||||||
|
this._forEachBrowserWindow(function(aWindow) {
|
||||||
|
if (aWindow != window) {
|
||||||
|
self._closingWindows.push(aWindow);
|
||||||
|
aWindow.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// restore to the given state
|
// restore to the given state
|
||||||
this.restoreWindow(window, state, true);
|
this.restoreWindow(window, state, true);
|
||||||
},
|
},
|
||||||
|
|
@ -1191,13 +1208,14 @@ SessionStoreService.prototype = {
|
||||||
tabData.entries[0] = { url: browser.currentURI.spec };
|
tabData.entries[0] = { url: browser.currentURI.spec };
|
||||||
tabData.index = 1;
|
tabData.index = 1;
|
||||||
}
|
}
|
||||||
else if (browser.currentURI.spec == "about:blank" &&
|
|
||||||
browser.userTypedValue) {
|
// If there is a userTypedValue set, then either the user has typed something
|
||||||
// This can happen if the user opens a lot of tabs simultaneously and we
|
// in the URL bar, or a new tab was opened with a URI to load. userTypedClear
|
||||||
// try to save state before all of them are properly loaded. If we crash
|
// is used to indicate whether the tab was in some sort of loading state with
|
||||||
// then we get a bunch of about:blank tabs which isn't what we want.
|
// userTypedValue.
|
||||||
tabData.entries[0] = { url: browser.userTypedValue };
|
if (browser.userTypedValue) {
|
||||||
tabData.index = 1;
|
tabData.userTypedValue = browser.userTypedValue;
|
||||||
|
tabData.userTypedClear = browser.userTypedClear;
|
||||||
}
|
}
|
||||||
|
|
||||||
var disallow = [];
|
var disallow = [];
|
||||||
|
|
@ -2123,6 +2141,14 @@ SessionStoreService.prototype = {
|
||||||
browser.addEventListener("load", browser.__SS_restore, true);
|
browser.addEventListener("load", browser.__SS_restore, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle userTypedValue. Setting userTypedValue seems to update gURLbar
|
||||||
|
// as needed. Calling loadURI will cancel form filling in restoreDocument_proxy
|
||||||
|
if (tabData.userTypedValue) {
|
||||||
|
browser.userTypedValue = tabData.userTypedValue;
|
||||||
|
if (tabData.userTypedClear)
|
||||||
|
browser.loadURI(tabData.userTypedValue, null, null, true);
|
||||||
|
}
|
||||||
|
|
||||||
aWindow.setTimeout(function(){ _this.restoreHistory(aWindow, aTabs, aTabData, aIdMap); }, 0);
|
aWindow.setTimeout(function(){ _this.restoreHistory(aWindow, aTabs, aTabData, aIdMap); }, 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2598,7 +2624,7 @@ SessionStoreService.prototype = {
|
||||||
|
|
||||||
while (windowsEnum.hasMoreElements()) {
|
while (windowsEnum.hasMoreElements()) {
|
||||||
var window = windowsEnum.getNext();
|
var window = windowsEnum.getNext();
|
||||||
if (window.__SSi) {
|
if (window.__SSi && !window.closed) {
|
||||||
aFunc.call(this, window);
|
aFunc.call(this, window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2609,9 +2635,34 @@ SessionStoreService.prototype = {
|
||||||
* @returns Window reference
|
* @returns Window reference
|
||||||
*/
|
*/
|
||||||
_getMostRecentBrowserWindow: function sss_getMostRecentBrowserWindow() {
|
_getMostRecentBrowserWindow: function sss_getMostRecentBrowserWindow() {
|
||||||
var windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"].
|
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||||
getService(Ci.nsIWindowMediator);
|
getService(Ci.nsIWindowMediator);
|
||||||
return windowMediator.getMostRecentWindow("navigator:browser");
|
|
||||||
|
var win = wm.getMostRecentWindow("navigator:browser");
|
||||||
|
if (!win)
|
||||||
|
return null;
|
||||||
|
if (!win.closed)
|
||||||
|
return win;
|
||||||
|
|
||||||
|
#ifdef BROKEN_WM_Z_ORDER
|
||||||
|
win = null;
|
||||||
|
var windowsEnum = wm.getEnumerator("navigator:browser");
|
||||||
|
// this is oldest to newest, so this gets a bit ugly
|
||||||
|
while (windowsEnum.hasMoreElements()) {
|
||||||
|
let nextWin = windowsEnum.getNext();
|
||||||
|
if (!nextWin.closed)
|
||||||
|
win = nextWin;
|
||||||
|
}
|
||||||
|
return win;
|
||||||
|
#else
|
||||||
|
var windowsEnum = wm.getZOrderDOMWindowEnumerator("navigator:browser", true);
|
||||||
|
while (windowsEnum.hasMoreElements()) {
|
||||||
|
win = windowsEnum.getNext();
|
||||||
|
if (!win.closed)
|
||||||
|
return win;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
#endif
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2825,17 +2876,18 @@ SessionStoreService.prototype = {
|
||||||
return jsonString;
|
return jsonString;
|
||||||
},
|
},
|
||||||
|
|
||||||
_sendRestoreCompletedNotifications: function sss_sendRestoreCompletedNotifications() {
|
_sendRestoreCompletedNotifications:
|
||||||
if (this._restoreCount) {
|
function sss_sendRestoreCompletedNotifications(aOnWindowClose) {
|
||||||
|
if (this._restoreCount && !aOnWindowClose)
|
||||||
this._restoreCount--;
|
this._restoreCount--;
|
||||||
if (this._restoreCount == 0) {
|
|
||||||
|
if (this._restoreCount == 0 && this._closingWindows.length == 0) {
|
||||||
// This was the last window restored at startup, notify observers.
|
// This was the last window restored at startup, notify observers.
|
||||||
this._observerService.notifyObservers(null,
|
this._observerService.notifyObservers(null,
|
||||||
this._browserSetState ? NOTIFY_BROWSER_STATE_RESTORED : NOTIFY_WINDOWS_RESTORED,
|
this._browserSetState ? NOTIFY_BROWSER_STATE_RESTORED : NOTIFY_WINDOWS_RESTORED,
|
||||||
"");
|
"");
|
||||||
this._browserSetState = false;
|
this._browserSetState = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,6 @@ relativesrcdir = browser/components/sessionstore/test/browser
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
# browser_477657.js is disabled, because it's unreliable (bug 482975).
|
|
||||||
# browser_480148.js is disabled, because it breaks browser_420786.js (see bug 483382).
|
|
||||||
|
|
||||||
_BROWSER_TEST_FILES = \
|
_BROWSER_TEST_FILES = \
|
||||||
browser_248970_a.js \
|
browser_248970_a.js \
|
||||||
browser_248970_b.js \
|
browser_248970_b.js \
|
||||||
|
|
@ -97,6 +94,8 @@ _BROWSER_TEST_FILES = \
|
||||||
browser_466937_sample.html \
|
browser_466937_sample.html \
|
||||||
browser_476161.js \
|
browser_476161.js \
|
||||||
browser_476161_sample.html \
|
browser_476161_sample.html \
|
||||||
|
browser_477657.js \
|
||||||
|
browser_480148.js \
|
||||||
browser_480893.js \
|
browser_480893.js \
|
||||||
browser_483330.js \
|
browser_483330.js \
|
||||||
browser_485482.js \
|
browser_485482.js \
|
||||||
|
|
@ -108,6 +107,7 @@ _BROWSER_TEST_FILES = \
|
||||||
browser_493467.js \
|
browser_493467.js \
|
||||||
browser_495495.js \
|
browser_495495.js \
|
||||||
browser_514751.js \
|
browser_514751.js \
|
||||||
|
browser_522545.js \
|
||||||
browser_526613.js \
|
browser_526613.js \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,22 @@
|
||||||
* nsSessionStore restore a window next time it gets a chance and will post
|
* nsSessionStore restore a window next time it gets a chance and will post
|
||||||
* notifications. The latter won't.
|
* notifications. The latter won't.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
||||||
// Some urls that might be opened in tabs and/or popups
|
// Some urls that might be opened in tabs and/or popups
|
||||||
|
|
@ -217,9 +232,9 @@ function test() {
|
||||||
newWin.removeEventListener("load", arguments.callee, false);
|
newWin.removeEventListener("load", arguments.callee, false);
|
||||||
newWin.gBrowser.addEventListener("load", function(aEvent) {
|
newWin.gBrowser.addEventListener("load", function(aEvent) {
|
||||||
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
for each (let url in TEST_URLS) {
|
TEST_URLS.forEach(function (url) {
|
||||||
newWin.gBrowser.addTab(url);
|
newWin.gBrowser.addTab(url);
|
||||||
}
|
});
|
||||||
|
|
||||||
executeSoon(function() testFn(newWin));
|
executeSoon(function() testFn(newWin));
|
||||||
}, true);
|
}, true);
|
||||||
|
|
@ -498,7 +513,11 @@ function test() {
|
||||||
// Mac tests
|
// Mac tests
|
||||||
testMacNotifications(
|
testMacNotifications(
|
||||||
function() testNotificationCount(
|
function() testNotificationCount(
|
||||||
function() cleanupTestsuite() + finish()
|
function() {
|
||||||
|
cleanupTestsuite();
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
|
finish();
|
||||||
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -510,7 +529,11 @@ function test() {
|
||||||
function() testOpenCloseOnlyPopup(
|
function() testOpenCloseOnlyPopup(
|
||||||
function() testOpenCloseRestoreFromPopup (
|
function() testOpenCloseRestoreFromPopup (
|
||||||
function() testNotificationCount(
|
function() testNotificationCount(
|
||||||
function() cleanupTestsuite() + finish()
|
function() {
|
||||||
|
cleanupTestsuite();
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
|
finish();
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,18 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 394759 **/
|
/** Test for Bug 394759 **/
|
||||||
|
|
||||||
|
|
@ -56,9 +68,8 @@ function test() {
|
||||||
gPrefService.setIntPref("browser.sessionstore.max_windows_undo", max_windows_undo + 1);
|
gPrefService.setIntPref("browser.sessionstore.max_windows_undo", max_windows_undo + 1);
|
||||||
let closedWindowCount = ss.getClosedWindowCount();
|
let closedWindowCount = ss.getClosedWindowCount();
|
||||||
|
|
||||||
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no", testURL);
|
let newWin = openDialog(location, "", "chrome,all,dialog=no", testURL);
|
||||||
newWin.addEventListener("load", function(aEvent) {
|
newWin.addEventListener("load", function(aEvent) {
|
||||||
newWin.removeEventListener("load", arguments.callee, false);
|
|
||||||
newWin.gBrowser.addEventListener("load", function(aEvent) {
|
newWin.gBrowser.addEventListener("load", function(aEvent) {
|
||||||
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
|
|
@ -87,7 +98,6 @@ function test() {
|
||||||
"The reopened window was removed from Recently Closed Windows");
|
"The reopened window was removed from Recently Closed Windows");
|
||||||
|
|
||||||
newWin2.addEventListener("load", function(aEvent) {
|
newWin2.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, false);
|
|
||||||
newWin2.gBrowser.addEventListener("SSTabRestored", function(aEvent) {
|
newWin2.gBrowser.addEventListener("SSTabRestored", function(aEvent) {
|
||||||
newWin2.gBrowser.removeEventListener("SSTabRestored", arguments.callee, true);
|
newWin2.gBrowser.removeEventListener("SSTabRestored", arguments.callee, true);
|
||||||
|
|
||||||
|
|
@ -142,18 +152,17 @@ function test() {
|
||||||
let settings = "chrome,dialog=no," +
|
let settings = "chrome,dialog=no," +
|
||||||
(winData.isPopup ? "all=no" : "all");
|
(winData.isPopup ? "all=no" : "all");
|
||||||
let url = "http://window" + windowsToOpen.length + ".example.com";
|
let url = "http://window" + windowsToOpen.length + ".example.com";
|
||||||
let window = openDialog(location, "_blank", settings, url);
|
let win = openDialog(location, "", settings, url);
|
||||||
window.addEventListener("load", function(aEvent) {
|
win.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
win.gBrowser.addEventListener("load", function(aEvent) {
|
||||||
window.gBrowser.addEventListener("load", function(aEvent) {
|
win.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
|
||||||
// the window _should_ have state with a tab of url, but it doesn't
|
// the window _should_ have state with a tab of url, but it doesn't
|
||||||
// always happend before window.close(). addTab ensure we don't treat
|
// always happend before window.close(). addTab ensure we don't treat
|
||||||
// this window as a stateless window
|
// this window as a stateless window
|
||||||
window.gBrowser.addTab();
|
win.gBrowser.addTab();
|
||||||
|
|
||||||
executeSoon(function() {
|
executeSoon(function() {
|
||||||
window.close();
|
win.close();
|
||||||
executeSoon(function() {
|
executeSoon(function() {
|
||||||
openWindowRec(windowsToOpen, expectedResults, recCallback);
|
openWindowRec(windowsToOpen, expectedResults, recCallback);
|
||||||
});
|
});
|
||||||
|
|
@ -191,6 +200,12 @@ function test() {
|
||||||
|
|
||||||
// backup old state
|
// backup old state
|
||||||
let oldState = ss.getBrowserState();
|
let oldState = ss.getBrowserState();
|
||||||
|
let oldState_wins = JSON.parse(oldState).windows.length;
|
||||||
|
if (oldState_wins != 1) {
|
||||||
|
ok(false, "oldState in test_purge has " + oldState_wins + " windows instead of 1");
|
||||||
|
info(oldState);
|
||||||
|
}
|
||||||
|
|
||||||
// create a new state for testing
|
// create a new state for testing
|
||||||
const REMEMBER = Date.now(), FORGET = Math.random();
|
const REMEMBER = Date.now(), FORGET = Math.random();
|
||||||
let testState = {
|
let testState = {
|
||||||
|
|
@ -257,30 +272,30 @@ function test() {
|
||||||
let closedWindowData = JSON.parse(ss.getClosedWindowData());
|
let closedWindowData = JSON.parse(ss.getClosedWindowData());
|
||||||
|
|
||||||
// First set of tests for _closedWindows[0] - tests basics
|
// First set of tests for _closedWindows[0] - tests basics
|
||||||
let window = closedWindowData[0];
|
let win = closedWindowData[0];
|
||||||
is(window.tabs.length, 1, "1 tab was removed");
|
is(win.tabs.length, 1, "1 tab was removed");
|
||||||
is(countOpenTabsByTitle(window.tabs, FORGET), 0,
|
is(countOpenTabsByTitle(win.tabs, FORGET), 0,
|
||||||
"The correct tab was removed");
|
"The correct tab was removed");
|
||||||
is(countOpenTabsByTitle(window.tabs, REMEMBER), 1,
|
is(countOpenTabsByTitle(win.tabs, REMEMBER), 1,
|
||||||
"The correct tab was remembered");
|
"The correct tab was remembered");
|
||||||
is(window.selected, 1, "Selected tab has changed");
|
is(win.selected, 1, "Selected tab has changed");
|
||||||
is(window.title, REMEMBER, "The window title was correctly updated");
|
is(win.title, REMEMBER, "The window title was correctly updated");
|
||||||
|
|
||||||
// Test more complicated case
|
// Test more complicated case
|
||||||
window = closedWindowData[1];
|
win = closedWindowData[1];
|
||||||
is(window.tabs.length, 3, "2 tabs were removed");
|
is(win.tabs.length, 3, "2 tabs were removed");
|
||||||
is(countOpenTabsByTitle(window.tabs, FORGET), 0,
|
is(countOpenTabsByTitle(win.tabs, FORGET), 0,
|
||||||
"The correct tabs were removed");
|
"The correct tabs were removed");
|
||||||
is(countOpenTabsByTitle(window.tabs, REMEMBER), 3,
|
is(countOpenTabsByTitle(win.tabs, REMEMBER), 3,
|
||||||
"The correct tabs were remembered");
|
"The correct tabs were remembered");
|
||||||
is(window.selected, 3, "Selected tab has changed");
|
is(win.selected, 3, "Selected tab has changed");
|
||||||
is(window.title, REMEMBER, "The window title was correctly updated");
|
is(win.title, REMEMBER, "The window title was correctly updated");
|
||||||
|
|
||||||
// Tests handling of _closedTabs
|
// Tests handling of _closedTabs
|
||||||
window = closedWindowData[2];
|
win = closedWindowData[2];
|
||||||
is(countClosedTabsByTitle(window._closedTabs, REMEMBER), 1,
|
is(countClosedTabsByTitle(win._closedTabs, REMEMBER), 1,
|
||||||
"The correct number of tabs were removed, and the correct ones");
|
"The correct number of tabs were removed, and the correct ones");
|
||||||
is(countClosedTabsByTitle(window._closedTabs, FORGET), 0,
|
is(countClosedTabsByTitle(win._closedTabs, FORGET), 0,
|
||||||
"All tabs to be forgotten were indeed removed");
|
"All tabs to be forgotten were indeed removed");
|
||||||
|
|
||||||
// restore pre-test state
|
// restore pre-test state
|
||||||
|
|
@ -288,9 +303,13 @@ function test() {
|
||||||
executeSoon(callback);
|
executeSoon(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
test_basic(function() {
|
test_basic(function() {
|
||||||
|
is(browserWindowsCount(), 1, "number of browser windows after test_basic");
|
||||||
test_behavior(function() {
|
test_behavior(function() {
|
||||||
|
is(browserWindowsCount(), 1, "number of browser windows after test_behavior");
|
||||||
test_purge(function() {
|
test_purge(function() {
|
||||||
|
is(browserWindowsCount(), 1, "number of browser windows after test_purge");
|
||||||
finish();
|
finish();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Private Browsing Test for Bug 394759 **/
|
/** Private Browsing Test for Bug 394759 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
|
@ -85,8 +98,6 @@ function test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function continue_test() {
|
function continue_test() {
|
||||||
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
|
|
||||||
getService(Ci.nsIWindowWatcher);
|
|
||||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||||
getService(Ci.nsIPrivateBrowsingService);
|
getService(Ci.nsIPrivateBrowsingService);
|
||||||
// Ensure Private Browsing mode is disabled.
|
// Ensure Private Browsing mode is disabled.
|
||||||
|
|
@ -108,21 +119,14 @@ function continue_test() {
|
||||||
value: "uniq" + (++now) },
|
value: "uniq" + (++now) },
|
||||||
];
|
];
|
||||||
|
|
||||||
let loadWasCalled = false;
|
|
||||||
function openWindowAndTest(aTestIndex, aRunNextTestInPBMode) {
|
function openWindowAndTest(aTestIndex, aRunNextTestInPBMode) {
|
||||||
info("Opening new window");
|
info("Opening new window");
|
||||||
let windowObserver = {
|
function onLoad(event) {
|
||||||
observe: function(aSubject, aTopic, aData) {
|
|
||||||
if (aTopic === "domwindowopened") {
|
|
||||||
info("New window has been opened");
|
|
||||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
|
||||||
win.addEventListener("load", function onLoad(event) {
|
|
||||||
win.removeEventListener("load", onLoad, false);
|
win.removeEventListener("load", onLoad, false);
|
||||||
info("New window has been loaded");
|
info("New window has been loaded");
|
||||||
win.gBrowser.addEventListener("load", function(aEvent) {
|
win.gBrowser.addEventListener("load", function(aEvent) {
|
||||||
win.gBrowser.removeEventListener("load", arguments.callee, true);
|
win.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
info("New window browser has been loaded");
|
info("New window browser has been loaded");
|
||||||
loadWasCalled = true;
|
|
||||||
executeSoon(function() {
|
executeSoon(function() {
|
||||||
// Add a tab.
|
// Add a tab.
|
||||||
win.gBrowser.addTab();
|
win.gBrowser.addTab();
|
||||||
|
|
@ -172,6 +176,7 @@ function continue_test() {
|
||||||
if (aTestIndex == TESTS.length - 1) {
|
if (aTestIndex == TESTS.length - 1) {
|
||||||
if (gPrefService.prefHasUserValue("browser.sessionstore.interval"))
|
if (gPrefService.prefHasUserValue("browser.sessionstore.interval"))
|
||||||
gPrefService.clearUserPref("browser.sessionstore.interval");
|
gPrefService.clearUserPref("browser.sessionstore.interval");
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -181,21 +186,10 @@ function continue_test() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, true);
|
}, true);
|
||||||
}, false);
|
|
||||||
}
|
}
|
||||||
else if (aTopic === "domwindowclosed") {
|
|
||||||
info("Window closed");
|
|
||||||
ww.unregisterNotification(this);
|
|
||||||
if (!loadWasCalled) {
|
|
||||||
ok(false, "Window was closed before load could fire!");
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ww.registerNotification(windowObserver);
|
|
||||||
// Open a window.
|
// Open a window.
|
||||||
openDialog(location, "_blank", "chrome,all,dialog=no", TESTS[aTestIndex].url);
|
var win = openDialog(location, "", "chrome,all,dialog=no", TESTS[aTestIndex].url);
|
||||||
|
win.addEventListener("load", onLoad, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
openWindowAndTest(0, true);
|
openWindowAndTest(0, true);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ function test() {
|
||||||
let tab = gBrowser.addTab(testUrl);
|
let tab = gBrowser.addTab(testUrl);
|
||||||
|
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
// enable all stylesheets and verify that they're correctly persisted
|
// enable all stylesheets and verify that they're correctly persisted
|
||||||
Array.forEach(tab.linkedBrowser.contentDocument.styleSheets, function(aSS, aIx) {
|
Array.forEach(tab.linkedBrowser.contentDocument.styleSheets, function(aSS, aIx) {
|
||||||
pendingCount++;
|
pendingCount++;
|
||||||
|
|
@ -54,7 +54,7 @@ function test() {
|
||||||
|
|
||||||
let newTab = gBrowser.duplicateTab(tab);
|
let newTab = gBrowser.duplicateTab(tab);
|
||||||
newTab.linkedBrowser.addEventListener("load", function(aEvent) {
|
newTab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
newTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
let states = Array.map(newTab.linkedBrowser.contentDocument.styleSheets,
|
let states = Array.map(newTab.linkedBrowser.contentDocument.styleSheets,
|
||||||
function(aSS) !aSS.disabled);
|
function(aSS) !aSS.disabled);
|
||||||
let correct = states.indexOf(true) == aIx && states.indexOf(true, aIx + 1) == -1;
|
let correct = states.indexOf(true) == aIx && states.indexOf(true, aIx + 1) == -1;
|
||||||
|
|
@ -74,7 +74,7 @@ function test() {
|
||||||
tab.linkedBrowser.markupDocumentViewer.authorStyleDisabled = true;
|
tab.linkedBrowser.markupDocumentViewer.authorStyleDisabled = true;
|
||||||
let newTab = gBrowser.duplicateTab(tab);
|
let newTab = gBrowser.duplicateTab(tab);
|
||||||
newTab.linkedBrowser.addEventListener("load", function(aEvent) {
|
newTab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
newTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
is(newTab.linkedBrowser.markupDocumentViewer.authorStyleDisabled, true,
|
is(newTab.linkedBrowser.markupDocumentViewer.authorStyleDisabled, true,
|
||||||
"disabled all stylesheets");
|
"disabled all stylesheets");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,22 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
// test that cookies are stored and restored correctly by sessionstore,
|
// test that cookies are stored and restored correctly by sessionstore,
|
||||||
// bug 423132.
|
// bug 423132.
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
// test setup
|
// test setup
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
@ -101,6 +114,7 @@ function test() {
|
||||||
gPrefService.clearUserPref("browser.sessionstore.interval");
|
gPrefService.clearUserPref("browser.sessionstore.interval");
|
||||||
cs.removeAll();
|
cs.removeAll();
|
||||||
newWin.close();
|
newWin.close();
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
}, true);
|
}, true);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ function test() {
|
||||||
|
|
||||||
let tab = gBrowser.addTab();
|
let tab = gBrowser.addTab();
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
let tabState = { entries: [] };
|
let tabState = { entries: [] };
|
||||||
let max_entries = gPrefService.getIntPref("browser.sessionhistory.max_entries");
|
let max_entries = gPrefService.getIntPref("browser.sessionhistory.max_entries");
|
||||||
|
|
@ -54,7 +54,7 @@ function test() {
|
||||||
|
|
||||||
ss.setTabState(tab, JSON.stringify(tabState));
|
ss.setTabState(tab, JSON.stringify(tabState));
|
||||||
tab.addEventListener("SSTabRestored", function(aEvent) {
|
tab.addEventListener("SSTabRestored", function(aEvent) {
|
||||||
this.removeEventListener("SSTabRestored", arguments.callee, false);
|
tab.removeEventListener("SSTabRestored", arguments.callee, false);
|
||||||
tabState = eval("(" + ss.getTabState(tab) + ")");
|
tabState = eval("(" + ss.getTabState(tab) + ")");
|
||||||
is(tabState.entries.length, max_entries, "session history filled to the limit");
|
is(tabState.entries.length, max_entries, "session history filled to the limit");
|
||||||
is(tabState.entries[0].url, baseURL + 0, "... but not more");
|
is(tabState.entries[0].url, baseURL + 0, "... but not more");
|
||||||
|
|
|
||||||
|
|
@ -60,15 +60,15 @@ function test() {
|
||||||
|
|
||||||
// find the data for the newly added tab and delete it
|
// find the data for the newly added tab and delete it
|
||||||
let state = eval(aSubject.data);
|
let state = eval(aSubject.data);
|
||||||
for each (let winData in state.windows) {
|
state.windows.forEach(function (winData) {
|
||||||
for each (let tabData in winData.tabs) {
|
winData.tabs.forEach(function (tabData) {
|
||||||
if (tabData.extData && uniqueName in tabData.extData &&
|
if (tabData.extData && uniqueName in tabData.extData &&
|
||||||
tabData.extData[uniqueName] == uniqueValue) {
|
tabData.extData[uniqueName] == uniqueValue) {
|
||||||
delete tabData.extData[uniqueName];
|
delete tabData.extData[uniqueName];
|
||||||
valueWasCleaned = true;
|
valueWasCleaned = true;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
});
|
||||||
|
|
||||||
ok(valueWasCleaned, "found and removed the specific tab value");
|
ok(valueWasCleaned, "found and removed the specific tab value");
|
||||||
aSubject.data = uneval(state);
|
aSubject.data = uneval(state);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ function test() {
|
||||||
"browser/components/sessionstore/test/browser/browser_454908_sample.html";
|
"browser/components/sessionstore/test/browser/browser_454908_sample.html";
|
||||||
let tab = gBrowser.addTab(testURL);
|
let tab = gBrowser.addTab(testURL);
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = tab.linkedBrowser.contentDocument;
|
let doc = tab.linkedBrowser.contentDocument;
|
||||||
for (let id in fieldValues)
|
for (let id in fieldValues)
|
||||||
doc.getElementById(id).value = fieldValues[id];
|
doc.getElementById(id).value = fieldValues[id];
|
||||||
|
|
@ -60,7 +60,7 @@ function test() {
|
||||||
|
|
||||||
tab = undoCloseTab();
|
tab = undoCloseTab();
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = tab.linkedBrowser.contentDocument;
|
let doc = tab.linkedBrowser.contentDocument;
|
||||||
for (let id in fieldValues) {
|
for (let id in fieldValues) {
|
||||||
let node = doc.getElementById(id);
|
let node = doc.getElementById(id);
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ function test() {
|
||||||
// wait for all frames to load completely
|
// wait for all frames to load completely
|
||||||
if (frameCount++ < 2)
|
if (frameCount++ < 2)
|
||||||
return;
|
return;
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
let iframes = tab.linkedBrowser.contentWindow.frames;
|
let iframes = tab.linkedBrowser.contentWindow.frames;
|
||||||
iframes[1].document.body.innerHTML = uniqueValue;
|
iframes[1].document.body.innerHTML = uniqueValue;
|
||||||
|
|
@ -60,18 +60,10 @@ function test() {
|
||||||
// wait for all frames to load (and reload!) completely
|
// wait for all frames to load (and reload!) completely
|
||||||
if (frameCount++ < 2)
|
if (frameCount++ < 2)
|
||||||
return;
|
return;
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab2.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
let pass = 0;
|
|
||||||
const MAX_PASS = 6;
|
|
||||||
executeSoon(function() {
|
executeSoon(function() {
|
||||||
info("Checking innerHTML, pass: " + (pass + 1));
|
|
||||||
let iframes = tab2.linkedBrowser.contentWindow.frames;
|
let iframes = tab2.linkedBrowser.contentWindow.frames;
|
||||||
if (iframes[1].document.body.innerHTML != uniqueValue &&
|
|
||||||
++pass <= MAX_PASS) {
|
|
||||||
setTimeout(arguments.callee, 500);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
is(iframes[1].document.body.innerHTML, uniqueValue,
|
is(iframes[1].document.body.innerHTML, uniqueValue,
|
||||||
"rich textarea's content correctly duplicated");
|
"rich textarea's content correctly duplicated");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,14 @@
|
||||||
<iframe></iframe>
|
<iframe></iframe>
|
||||||
|
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
frames[0].addEventListener("DOMContentLoaded", function() {
|
var loadCount = 0;
|
||||||
frames[0].removeEventListener("DOMContentLoaded", arguments.callee, false);
|
frames[0].addEventListener("DOMContentLoaded", handleLoad, false);
|
||||||
|
frames[1].addEventListener("DOMContentLoaded", handleLoad, false);
|
||||||
|
function handleLoad() {
|
||||||
|
if (++loadCount < 2)
|
||||||
|
return;
|
||||||
|
frames[0].removeEventListener("DOMContentLoaded", handleLoad, false);
|
||||||
|
frames[1].removeEventListener("DOMContentLoaded", handleLoad, false);
|
||||||
frames[0].document.designMode = "on";
|
frames[0].document.designMode = "on";
|
||||||
frames[0].document.__defineGetter__("designMode", function() {
|
frames[0].document.__defineGetter__("designMode", function() {
|
||||||
// inject a cross domain file ...
|
// inject a cross domain file ...
|
||||||
|
|
@ -31,6 +37,6 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
frames[1].document.designMode = "on";
|
frames[1].document.designMode = "on";
|
||||||
}, false);
|
};
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 461634 **/
|
/** Test for Bug 461634 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
// test setup
|
// test setup
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
|
|
@ -65,9 +78,8 @@ function test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// open a window and add the above closed tab list
|
// open a window and add the above closed tab list
|
||||||
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no");
|
let newWin = open(location, "", "chrome,all");
|
||||||
newWin.addEventListener("load", function(aEvent) {
|
newWin.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, false);
|
|
||||||
gPrefService.setIntPref("browser.sessionstore.max_tabs_undo",
|
gPrefService.setIntPref("browser.sessionstore.max_tabs_undo",
|
||||||
test_state.windows[0]._closedTabs.length);
|
test_state.windows[0]._closedTabs.length);
|
||||||
ss.setWindowState(newWin, JSON.stringify(test_state), true);
|
ss.setWindowState(newWin, JSON.stringify(test_state), true);
|
||||||
|
|
@ -103,6 +115,7 @@ function test() {
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
newWin.close();
|
newWin.close();
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo");
|
gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo");
|
||||||
finish();
|
finish();
|
||||||
}, false);
|
}, false);
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,14 @@ function test() {
|
||||||
let testURL = "http://localhost:8888/browser/" +
|
let testURL = "http://localhost:8888/browser/" +
|
||||||
"browser/components/sessionstore/test/browser/browser_461743_sample.html";
|
"browser/components/sessionstore/test/browser/browser_461743_sample.html";
|
||||||
|
|
||||||
|
let frameCount = 0;
|
||||||
let tab = gBrowser.addTab(testURL);
|
let tab = gBrowser.addTab(testURL);
|
||||||
info("New tab added");
|
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
info("New tab loaded");
|
// Wait for all frames to load completely.
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
if (frameCount++ < 2)
|
||||||
executeSoon(function() {
|
return;
|
||||||
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
let tab2 = gBrowser.duplicateTab(tab);
|
let tab2 = gBrowser.duplicateTab(tab);
|
||||||
info("Duplicated tab");
|
|
||||||
tab2.linkedBrowser.addEventListener("461743", function(aEvent) {
|
tab2.linkedBrowser.addEventListener("461743", function(aEvent) {
|
||||||
tab2.linkedBrowser.removeEventListener("461743", arguments.callee, true);
|
tab2.linkedBrowser.removeEventListener("461743", arguments.callee, true);
|
||||||
is(aEvent.data, "done", "XSS injection was attempted");
|
is(aEvent.data, "done", "XSS injection was attempted");
|
||||||
|
|
@ -60,13 +60,12 @@ function test() {
|
||||||
isnot(innerHTML, Components.utils.reportError.toString(),
|
isnot(innerHTML, Components.utils.reportError.toString(),
|
||||||
"chrome access denied!");
|
"chrome access denied!");
|
||||||
|
|
||||||
// clean up
|
// Clean up.
|
||||||
gBrowser.removeTab(tab2);
|
gBrowser.removeTab(tab2);
|
||||||
gBrowser.removeTab(tab);
|
gBrowser.removeTab(tab);
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
});
|
});
|
||||||
}, true, true);
|
}, true, true);
|
||||||
});
|
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,15 @@
|
||||||
var chromeUrl = "chrome://global/content/mozilla.xhtml";
|
var chromeUrl = "chrome://global/content/mozilla.xhtml";
|
||||||
var exploitUrl = "javascript:try { document.body.innerHTML = Components.utils.reportError; } catch (ex) { }";
|
var exploitUrl = "javascript:try { document.body.innerHTML = Components.utils.reportError; } catch (ex) { }";
|
||||||
|
|
||||||
window.onload = function() {
|
var loadCount = 0;
|
||||||
|
frames[0].addEventListener("DOMContentLoaded", handleLoad, false);
|
||||||
|
frames[1].addEventListener("DOMContentLoaded", handleLoad, false);
|
||||||
|
function handleLoad() {
|
||||||
|
if (++loadCount < 2)
|
||||||
|
return;
|
||||||
|
frames[0].removeEventListener("DOMContentLoaded", handleLoad, false);
|
||||||
|
frames[1].removeEventListener("DOMContentLoaded", handleLoad, false);
|
||||||
|
|
||||||
var flip = 0;
|
var flip = 0;
|
||||||
MutationEvent.prototype.toString = function() {
|
MutationEvent.prototype.toString = function() {
|
||||||
return flip++ == 0 ? chromeUrl : exploitUrl;
|
return flip++ == 0 ? chromeUrl : exploitUrl;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ function test() {
|
||||||
// wait for all frames to load completely
|
// wait for all frames to load completely
|
||||||
if (frameCount++ < 3)
|
if (frameCount++ < 3)
|
||||||
return;
|
return;
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
function typeText(aTextField, aValue) {
|
function typeText(aTextField, aValue) {
|
||||||
aTextField.value = aValue;
|
aTextField.value = aValue;
|
||||||
|
|
@ -69,7 +69,7 @@ function test() {
|
||||||
// wait for all frames to load (and reload!) completely
|
// wait for all frames to load (and reload!) completely
|
||||||
if (frameCount++ < 4)
|
if (frameCount++ < 4)
|
||||||
return;
|
return;
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab2.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
let win = tab2.linkedBrowser.contentWindow;
|
let win = tab2.linkedBrowser.contentWindow;
|
||||||
isnot(win.frames[0].document.getElementById("original").value, uniqueValue,
|
isnot(win.frames[0].document.getElementById("original").value, uniqueValue,
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ function test() {
|
||||||
// wait for all frames to load completely
|
// wait for all frames to load completely
|
||||||
if (frameCount++ < 5)
|
if (frameCount++ < 5)
|
||||||
return;
|
return;
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
function typeText(aTextField, aValue) {
|
function typeText(aTextField, aValue) {
|
||||||
aTextField.value = aValue;
|
aTextField.value = aValue;
|
||||||
|
|
@ -69,7 +69,7 @@ function test() {
|
||||||
// wait for all frames to load completely
|
// wait for all frames to load completely
|
||||||
if (frameCount++ < 5)
|
if (frameCount++ < 5)
|
||||||
return;
|
return;
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab2.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
let doc = tab2.linkedBrowser.contentDocument;
|
let doc = tab2.linkedBrowser.contentDocument;
|
||||||
let win = tab2.linkedBrowser.contentWindow;
|
let win = tab2.linkedBrowser.contentWindow;
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 464199 **/
|
/** Test for Bug 464199 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
// test setup
|
// test setup
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
|
|
@ -73,9 +86,8 @@ function test() {
|
||||||
aClosedTabList.filter(function(aData) aData.title == aTitle).length;
|
aClosedTabList.filter(function(aData) aData.title == aTitle).length;
|
||||||
|
|
||||||
// open a window and add the above closed tab list
|
// open a window and add the above closed tab list
|
||||||
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no");
|
let newWin = open(location, "", "chrome,all");
|
||||||
newWin.addEventListener("load", function(aEvent) {
|
newWin.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, false);
|
|
||||||
gPrefService.setIntPref("browser.sessionstore.max_tabs_undo",
|
gPrefService.setIntPref("browser.sessionstore.max_tabs_undo",
|
||||||
test_state.windows[0]._closedTabs.length);
|
test_state.windows[0]._closedTabs.length);
|
||||||
ss.setWindowState(newWin, JSON.stringify(test_state), true);
|
ss.setWindowState(newWin, JSON.stringify(test_state), true);
|
||||||
|
|
@ -103,6 +115,7 @@ function test() {
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
newWin.close();
|
newWin.close();
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
if (gPrefService.prefHasUserValue("browser.sessionstore.max_tabs_undo"))
|
if (gPrefService.prefHasUserValue("browser.sessionstore.max_tabs_undo"))
|
||||||
gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo");
|
gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo");
|
||||||
finish();
|
finish();
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 465223 **/
|
/** Test for Bug 465223 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
// test setup
|
// test setup
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
|
|
@ -49,7 +62,6 @@ function test() {
|
||||||
// open a window and set a value on it
|
// open a window and set a value on it
|
||||||
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no");
|
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no");
|
||||||
newWin.addEventListener("load", function(aEvent) {
|
newWin.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, false);
|
|
||||||
ss.setWindowValue(newWin, uniqueKey1, uniqueValue1);
|
ss.setWindowValue(newWin, uniqueKey1, uniqueValue1);
|
||||||
|
|
||||||
let newState = { windows: [{ tabs:[{ entries: [] }], extData: {} }] };
|
let newState = { windows: [{ tabs:[{ entries: [] }], extData: {} }] };
|
||||||
|
|
@ -75,6 +87,7 @@ function test() {
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
newWin.close();
|
newWin.close();
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,14 @@ function test() {
|
||||||
|
|
||||||
let tab = gBrowser.addTab(testURL);
|
let tab = gBrowser.addTab(testURL);
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = tab.linkedBrowser.contentDocument;
|
let doc = tab.linkedBrowser.contentDocument;
|
||||||
doc.getElementById("reverse_thief").value = "/home/user/secret2";
|
doc.getElementById("reverse_thief").value = "/home/user/secret2";
|
||||||
doc.getElementById("bystander").value = testPath;
|
doc.getElementById("bystander").value = testPath;
|
||||||
|
|
||||||
let tab2 = gBrowser.duplicateTab(tab);
|
let tab2 = gBrowser.duplicateTab(tab);
|
||||||
tab2.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab2.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab2.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
doc = tab2.linkedBrowser.contentDocument;
|
doc = tab2.linkedBrowser.contentDocument;
|
||||||
is(doc.getElementById("thief").value, "",
|
is(doc.getElementById("thief").value, "",
|
||||||
"file path wasn't set to text field value");
|
"file path wasn't set to text field value");
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ function test() {
|
||||||
"browser/components/sessionstore/test/browser/browser_476161_sample.html";
|
"browser/components/sessionstore/test/browser/browser_476161_sample.html";
|
||||||
let tab = gBrowser.addTab(testURL);
|
let tab = gBrowser.addTab(testURL);
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = tab.linkedBrowser.contentDocument;
|
let doc = tab.linkedBrowser.contentDocument;
|
||||||
|
|
||||||
doc.getElementById("modify1").value += Math.random();
|
doc.getElementById("modify1").value += Math.random();
|
||||||
|
|
@ -51,7 +51,7 @@ function test() {
|
||||||
|
|
||||||
let tab2 = gBrowser.duplicateTab(tab);
|
let tab2 = gBrowser.duplicateTab(tab);
|
||||||
tab2.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab2.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab2.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = tab2.linkedBrowser.contentDocument;
|
let doc = tab2.linkedBrowser.contentDocument;
|
||||||
let changed = doc.getElementById("changed").textContent.trim().split();
|
let changed = doc.getElementById("changed").textContent.trim().split();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,15 +34,31 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 477657 **/
|
/** Test for Bug 477657 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
|
// Test fails randomly on OS X (bug 482975)
|
||||||
|
if ("nsILocalFileMac" in Ci)
|
||||||
|
return;
|
||||||
|
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
||||||
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no");
|
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no");
|
||||||
newWin.addEventListener("load", function(aEvent) {
|
newWin.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, false);
|
|
||||||
let newState = { windows: [{
|
let newState = { windows: [{
|
||||||
tabs: [{ entries: [] }],
|
tabs: [{ entries: [] }],
|
||||||
_closedTabs: [{
|
_closedTabs: [{
|
||||||
|
|
@ -88,6 +104,7 @@ function test() {
|
||||||
"the window was explicitly unmaximized");
|
"the window was explicitly unmaximized");
|
||||||
|
|
||||||
newWin.close();
|
newWin.close();
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
}, 0);
|
}, 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,24 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 484108 **/
|
/** Test for Bug 484108 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
// builds the tests state based on a few parameters
|
// builds the tests state based on a few parameters
|
||||||
function buildTestState(num, selected) {
|
function buildTestState(num, selected) {
|
||||||
|
|
@ -65,10 +81,6 @@ function test() {
|
||||||
return expected;
|
return expected;
|
||||||
}
|
}
|
||||||
|
|
||||||
// test setup
|
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
|
||||||
waitForExplicitFinish();
|
|
||||||
|
|
||||||
// the number of tests we're running
|
// the number of tests we're running
|
||||||
let numTests = 4;
|
let numTests = 4;
|
||||||
let completedTests = 0;
|
let completedTests = 0;
|
||||||
|
|
@ -111,6 +123,7 @@ function test() {
|
||||||
if (++completedTests == numTests) {
|
if (++completedTests == numTests) {
|
||||||
this.window.removeEventListener("load", this, false);
|
this.window.removeEventListener("load", this, false);
|
||||||
this.window.removeEventListener("SSTabRestoring", this, false);
|
this.window.removeEventListener("SSTabRestoring", this, false);
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,13 @@ function test() {
|
||||||
gBrowser.selectedTab = tab;
|
gBrowser.selectedTab = tab;
|
||||||
let browser = tab.linkedBrowser;
|
let browser = tab.linkedBrowser;
|
||||||
browser.addEventListener("load", function(aEvent) {
|
browser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
browser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = browser.contentDocument;
|
let doc = browser.contentDocument;
|
||||||
|
|
||||||
// click on the "Start New Session" button after about:sessionrestore is loaded
|
// click on the "Start New Session" button after about:sessionrestore is loaded
|
||||||
doc.getElementById("errorCancel").click();
|
doc.getElementById("errorCancel").click();
|
||||||
browser.addEventListener("load", function(aEvent) {
|
browser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
browser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = browser.contentDocument;
|
let doc = browser.contentDocument;
|
||||||
|
|
||||||
is(doc.URL, "about:blank", "loaded page is about:blank");
|
is(doc.URL, "about:blank", "loaded page is about:blank");
|
||||||
|
|
@ -64,13 +64,13 @@ function test() {
|
||||||
gPrefService.setIntPref("browser.startup.page", 1);
|
gPrefService.setIntPref("browser.startup.page", 1);
|
||||||
gBrowser.loadURI("about:sessionrestore");
|
gBrowser.loadURI("about:sessionrestore");
|
||||||
browser.addEventListener("load", function(aEvent) {
|
browser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
browser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = browser.contentDocument;
|
let doc = browser.contentDocument;
|
||||||
|
|
||||||
// click on the "Start New Session" button after about:sessionrestore is loaded
|
// click on the "Start New Session" button after about:sessionrestore is loaded
|
||||||
doc.getElementById("errorCancel").click();
|
doc.getElementById("errorCancel").click();
|
||||||
browser.addEventListener("load", function(aEvent) {
|
browser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
browser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = browser.contentDocument;
|
let doc = browser.contentDocument;
|
||||||
|
|
||||||
is(doc.URL, homepage, "loaded page is the homepage");
|
is(doc.URL, homepage, "loaded page is the homepage");
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,14 @@ function test() {
|
||||||
"browser/components/sessionstore/test/browser/browser_485482_sample.html";
|
"browser/components/sessionstore/test/browser/browser_485482_sample.html";
|
||||||
let tab = gBrowser.addTab(testURL);
|
let tab = gBrowser.addTab(testURL);
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
let doc = tab.linkedBrowser.contentDocument;
|
let doc = tab.linkedBrowser.contentDocument;
|
||||||
doc.querySelector("input[type=text]").value = uniqueValue;
|
doc.querySelector("input[type=text]").value = uniqueValue;
|
||||||
doc.querySelector("input[type=checkbox]").checked = true;
|
doc.querySelector("input[type=checkbox]").checked = true;
|
||||||
|
|
||||||
let tab2 = gBrowser.duplicateTab(tab);
|
let tab2 = gBrowser.duplicateTab(tab);
|
||||||
tab2.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab2.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab2.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
doc = tab2.linkedBrowser.contentDocument;
|
doc = tab2.linkedBrowser.contentDocument;
|
||||||
is(doc.querySelector("input[type=text]").value, uniqueValue,
|
is(doc.querySelector("input[type=text]").value, uniqueValue,
|
||||||
"generated XPath expression was valid");
|
"generated XPath expression was valid");
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ function test() {
|
||||||
|
|
||||||
let tab = gBrowser.addTab();
|
let tab = gBrowser.addTab();
|
||||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||||
this.removeEventListener("load", arguments.callee, true);
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
ss.setTabValue(tab, "bug485563", uniqueValue);
|
ss.setTabValue(tab, "bug485563", uniqueValue);
|
||||||
let tabState = eval("(" + ss.getTabState(tab) + ")");
|
let tabState = eval("(" + ss.getTabState(tab) + ")");
|
||||||
is(tabState.extData["bug485563"], uniqueValue,
|
is(tabState.extData["bug485563"], uniqueValue,
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 490040 **/
|
/** Test for Bug 490040 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||||
getService(Ci.nsISessionStore);
|
getService(Ci.nsISessionStore);
|
||||||
|
|
@ -154,6 +167,7 @@ function test() {
|
||||||
else {
|
else {
|
||||||
if (gPrefService.prefHasUserValue("browser.sessionstore.max_windows_undo"))
|
if (gPrefService.prefHasUserValue("browser.sessionstore.max_windows_undo"))
|
||||||
gPrefService.clearUserPref("browser.sessionstore.max_windows_undo");
|
gPrefService.clearUserPref("browser.sessionstore.max_windows_undo");
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 491168 **/
|
/** Test for Bug 491168 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
// test setup
|
// test setup
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
|
|
@ -72,6 +85,7 @@ function test() {
|
||||||
is(window.content.document.referrer, REFERRER2, "document.referrer is still correct after closing and reopening the tab.");
|
is(window.content.document.referrer, REFERRER2, "document.referrer is still correct after closing and reopening the tab.");
|
||||||
gBrowser.removeTab(newTab);
|
gBrowser.removeTab(newTab);
|
||||||
|
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
}, true);
|
}, true);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 491577 **/
|
/** Test for Bug 491577 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
// test setup
|
// test setup
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
|
|
@ -149,6 +162,7 @@ function test() {
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
newWin.close();
|
newWin.close();
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
if (gPrefService.prefHasUserValue("browser.sessionstore.max_windows_undo"))
|
if (gPrefService.prefHasUserValue("browser.sessionstore.max_windows_undo"))
|
||||||
gPrefService.clearUserPref("browser.sessionstore.max_windows_undo");
|
gPrefService.clearUserPref("browser.sessionstore.max_windows_undo");
|
||||||
finish();
|
finish();
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 493467 **/
|
/** Test for Bug 493467 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
|
|
||||||
|
|
@ -66,4 +79,5 @@ function test() {
|
||||||
// leading "allow") to nsSessionStore.js's CAPABILITIES array. Thanks.
|
// leading "allow") to nsSessionStore.js's CAPABILITIES array. Thanks.
|
||||||
|
|
||||||
gBrowser.removeTab(tab);
|
gBrowser.removeTab(tab);
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 495495 **/
|
/** Test for Bug 495495 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
|
@ -79,7 +92,10 @@ function test() {
|
||||||
|
|
||||||
testState(state1, {readOnly: false, enablehistory: "true"}, function() {
|
testState(state1, {readOnly: false, enablehistory: "true"}, function() {
|
||||||
testState(state2, {readOnly: true, enablehistory: "false"}, function() {
|
testState(state2, {readOnly: true, enablehistory: "false"}, function() {
|
||||||
executeSoon(finish);
|
executeSoon(function () {
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
|
finish();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,21 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/** Test for Bug 514751 (Wallpaper) **/
|
/** Test for Bug 514751 (Wallpaper) **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||||
getService(Ci.nsISessionStore);
|
getService(Ci.nsISessionStore);
|
||||||
|
|
@ -81,6 +94,7 @@ function test() {
|
||||||
|
|
||||||
case "domwindowclosed":
|
case "domwindowclosed":
|
||||||
ww.unregisterNotification(this);
|
ww.unregisterNotification(this);
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
319
browser/components/sessionstore/test/browser/browser_522545.js
Normal file
319
browser/components/sessionstore/test/browser/browser_522545.js
Normal file
|
|
@ -0,0 +1,319 @@
|
||||||
|
/* ***** 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
|
||||||
|
* Mozilla Corporation.
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* 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 ***** */
|
||||||
|
|
||||||
|
function browserWindowsCount() {
|
||||||
|
let count = 0;
|
||||||
|
let e = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||||
|
.getService(Ci.nsIWindowMediator)
|
||||||
|
.getEnumerator("navigator:browser");
|
||||||
|
while (e.hasMoreElements()) {
|
||||||
|
if (!e.getNext().closed)
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
function test() {
|
||||||
|
/** Test for Bug 522545 **/
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open initially");
|
||||||
|
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||||
|
getService(Ci.nsISessionStore);
|
||||||
|
let os = Cc["@mozilla.org/observer-service;1"].
|
||||||
|
getService(Ci.nsIObserverService);
|
||||||
|
|
||||||
|
function waitForBrowserState(aState, aSetStateCallback) {
|
||||||
|
let observer = {
|
||||||
|
observe: function(aSubject, aTopic, aData) {
|
||||||
|
os.removeObserver(this, "sessionstore-browser-state-restored");
|
||||||
|
executeSoon(aSetStateCallback);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
os.addObserver(observer, "sessionstore-browser-state-restored", false);
|
||||||
|
ss.setBrowserState(JSON.stringify(aState));
|
||||||
|
}
|
||||||
|
|
||||||
|
// This tests the following use case:
|
||||||
|
// User opens a new tab which gets focus. The user types something into the
|
||||||
|
// address bar, then crashes or quits.
|
||||||
|
function test_newTabFocused() {
|
||||||
|
let state = {
|
||||||
|
windows: [{
|
||||||
|
tabs: [
|
||||||
|
{ entries: [{ url: "about:mozilla" }] },
|
||||||
|
{ entries: [], userTypedValue: "example.com", userTypedClear: 0 }
|
||||||
|
],
|
||||||
|
selected: 2
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
waitForBrowserState(state, function() {
|
||||||
|
let browser = gBrowser.selectedBrowser;
|
||||||
|
is(browser.currentURI.spec, "about:blank",
|
||||||
|
"No history entries still sets currentURI to about:blank");
|
||||||
|
is(browser.userTypedValue, "example.com",
|
||||||
|
"userTypedValue was correctly restored");
|
||||||
|
is(browser.userTypedClear, 0,
|
||||||
|
"userTypeClear restored as expected");
|
||||||
|
is(gURLBar.value, "example.com",
|
||||||
|
"Address bar's value correctly restored");
|
||||||
|
// Change tabs to make sure address bar value gets updated
|
||||||
|
gBrowser.selectedTab = gBrowser.tabContainer.getItemAtIndex(0);
|
||||||
|
is(gURLBar.value, "about:mozilla",
|
||||||
|
"Address bar's value correctly updated");
|
||||||
|
runNextTest();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// This tests the following use case:
|
||||||
|
// User opens a new tab which gets focus. The user types something into the
|
||||||
|
// address bar, switches back to the first tab, then crashes or quits.
|
||||||
|
function test_newTabNotFocused() {
|
||||||
|
let state = {
|
||||||
|
windows: [{
|
||||||
|
tabs: [
|
||||||
|
{ entries: [{ url: "about:mozilla" }] },
|
||||||
|
{ entries: [], userTypedValue: "example.org", userTypedClear: 0 }
|
||||||
|
],
|
||||||
|
selected: 1
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
waitForBrowserState(state, function() {
|
||||||
|
let browser = gBrowser.getBrowserAtIndex(1);
|
||||||
|
is(browser.currentURI.spec, "about:blank",
|
||||||
|
"No history entries still sets currentURI to about:blank");
|
||||||
|
is(browser.userTypedValue, "example.org",
|
||||||
|
"userTypedValue was correctly restored");
|
||||||
|
is(browser.userTypedClear, 0,
|
||||||
|
"userTypeClear restored as expected");
|
||||||
|
is(gURLBar.value, "about:mozilla",
|
||||||
|
"Address bar's value correctly restored");
|
||||||
|
// Change tabs to make sure address bar value gets updated
|
||||||
|
gBrowser.selectedTab = gBrowser.tabContainer.getItemAtIndex(1);
|
||||||
|
is(gURLBar.value, "example.org",
|
||||||
|
"Address bar's value correctly updated");
|
||||||
|
runNextTest();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// This tests the following use case:
|
||||||
|
// User is in a tab with session history, then types something in the
|
||||||
|
// address bar, then crashes or quits.
|
||||||
|
function test_existingSHEnd_noClear() {
|
||||||
|
let state = {
|
||||||
|
windows: [{
|
||||||
|
tabs: [{
|
||||||
|
entries: [{ url: "about:mozilla" }, { url: "about:config" }],
|
||||||
|
index: 2,
|
||||||
|
userTypedValue: "example.com",
|
||||||
|
userTypedClear: 0
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
waitForBrowserState(state, function() {
|
||||||
|
let browser = gBrowser.selectedBrowser;
|
||||||
|
is(browser.currentURI.spec, "about:config",
|
||||||
|
"browser.currentURI set to current entry in SH");
|
||||||
|
is(browser.userTypedValue, "example.com",
|
||||||
|
"userTypedValue was correctly restored");
|
||||||
|
is(browser.userTypedClear, 0,
|
||||||
|
"userTypeClear restored as expected");
|
||||||
|
is(gURLBar.value, "example.com",
|
||||||
|
"Address bar's value correctly restored to userTypedValue");
|
||||||
|
runNextTest();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// This tests the following use case:
|
||||||
|
// User is in a tab with session history, presses back at some point, then
|
||||||
|
// types something in the address bar, then crashes or quits.
|
||||||
|
function test_existingSHMiddle_noClear() {
|
||||||
|
let state = {
|
||||||
|
windows: [{
|
||||||
|
tabs: [{
|
||||||
|
entries: [{ url: "about:mozilla" }, { url: "about:config" }],
|
||||||
|
index: 1,
|
||||||
|
userTypedValue: "example.org",
|
||||||
|
userTypedClear: 0
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
waitForBrowserState(state, function() {
|
||||||
|
let browser = gBrowser.selectedBrowser;
|
||||||
|
is(browser.currentURI.spec, "about:mozilla",
|
||||||
|
"browser.currentURI set to current entry in SH");
|
||||||
|
is(browser.userTypedValue, "example.org",
|
||||||
|
"userTypedValue was correctly restored");
|
||||||
|
is(browser.userTypedClear, 0,
|
||||||
|
"userTypeClear restored as expected");
|
||||||
|
is(gURLBar.value, "example.org",
|
||||||
|
"Address bar's value correctly restored to userTypedValue");
|
||||||
|
runNextTest();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// This test simulates lots of tabs opening at once and then quitting/crashing.
|
||||||
|
function test_getBrowserState_lotsOfTabsOpening() {
|
||||||
|
let uris = [];
|
||||||
|
for (let i = 0; i < 25; i++)
|
||||||
|
uris.push("http://example.com/" + i);
|
||||||
|
|
||||||
|
// We're listening for the first non-"about:blank" load event, which should
|
||||||
|
// indicate one of the tabs has loaded and the others haven't. So one should
|
||||||
|
// be in a non-userTypedValue case, while others should still have
|
||||||
|
// userTypedValue and userTypedClear set.
|
||||||
|
gBrowser.addEventListener("load", function(aEvent) {
|
||||||
|
if (gBrowser.currentURI.spec == "about:blank")
|
||||||
|
return;
|
||||||
|
gBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
|
let state = JSON.parse(ss.getBrowserState());
|
||||||
|
|
||||||
|
let hasSH = state.windows[0].tabs.some(function(aTab) {
|
||||||
|
return !("userTypedValue" in aTab) && aTab.entries[0].url;
|
||||||
|
});
|
||||||
|
let hasUTV = state.windows[0].tabs.some(function(aTab) {
|
||||||
|
return aTab.userTypedValue && aTab.userTypedClear && !aTab.entries.length;
|
||||||
|
});
|
||||||
|
|
||||||
|
ok(hasSH, "At least one tab has it's entry in SH");
|
||||||
|
ok(hasUTV, "At least one tab has a userTypedValue with userTypedClear with no loaded URL");
|
||||||
|
|
||||||
|
runNextTest();
|
||||||
|
|
||||||
|
}, true);
|
||||||
|
gBrowser.loadTabs(uris);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This simulates setting a userTypedValue and ensures that just typing in the
|
||||||
|
// URL bar doesn't set userTypedClear as well.
|
||||||
|
function test_getBrowserState_userTypedValue() {
|
||||||
|
let state = {
|
||||||
|
windows: [{
|
||||||
|
tabs: [{ entries: [] }]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
waitForBrowserState(state, function() {
|
||||||
|
let browser = gBrowser.selectedBrowser;
|
||||||
|
// Make sure this tab isn't loading and state is clear before we test.
|
||||||
|
is(browser.userTypedValue, null, "userTypedValue is empty to start");
|
||||||
|
is(browser.userTypedClear, 0, "userTypedClear is 0 to start");
|
||||||
|
|
||||||
|
gURLBar.value = "mozilla.org";
|
||||||
|
let event = document.createEvent("Events");
|
||||||
|
event.initEvent("input", true, false);
|
||||||
|
gURLBar.dispatchEvent(event);
|
||||||
|
|
||||||
|
is(browser.userTypedValue, "mozilla.org",
|
||||||
|
"userTypedValue was set when changing gURLBar.value");
|
||||||
|
is(browser.userTypedClear, 0,
|
||||||
|
"userTypedClear was not changed when changing gURLBar.value");
|
||||||
|
|
||||||
|
// Now make sure ss gets these values too
|
||||||
|
let newState = JSON.parse(ss.getBrowserState());
|
||||||
|
is(newState.windows[0].tabs[0].userTypedValue, "mozilla.org",
|
||||||
|
"sessionstore got correct userTypedValue");
|
||||||
|
is(newState.windows[0].tabs[0].userTypedClear, 0,
|
||||||
|
"sessionstore got correct userTypedClear");
|
||||||
|
runNextTest();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// test_getBrowserState_lotsOfTabsOpening tested userTypedClear in a few cases,
|
||||||
|
// but not necessarily any that had legitimate URIs in the state of loading
|
||||||
|
// (eg, "http://example.com"), so this test will cover that case.
|
||||||
|
function test_userTypedClearLoadURI() {
|
||||||
|
let state = {
|
||||||
|
windows: [{
|
||||||
|
tabs: [
|
||||||
|
{ entries: [], userTypedValue: "http://example.com", userTypedClear: 2 }
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
// Set state here and listen for load event because waitForBrowserState
|
||||||
|
// doesn't guarantee all the tabs have loaded, so the test could continue
|
||||||
|
// before we're in a testable state. This is important here because of the
|
||||||
|
// distinction between "http://example.com" and "http://example.com/".
|
||||||
|
ss.setBrowserState(JSON.stringify(state));
|
||||||
|
gBrowser.addEventListener("load", function(aEvent) {
|
||||||
|
if (gBrowser.currentURI.spec == "about:blank")
|
||||||
|
return;
|
||||||
|
gBrowser.removeEventListener("load", arguments.callee, true);
|
||||||
|
|
||||||
|
let browser = gBrowser.selectedBrowser;
|
||||||
|
is(browser.currentURI.spec, "http://example.com/",
|
||||||
|
"userTypedClear=2 caused userTypedValue to be loaded");
|
||||||
|
is(browser.userTypedValue, null,
|
||||||
|
"userTypedValue was null after loading a URI");
|
||||||
|
is(browser.userTypedClear, 0,
|
||||||
|
"userTypeClear reset to 0");
|
||||||
|
is(gURLBar.value, "http://example.com/",
|
||||||
|
"Address bar's value set after loading URI");
|
||||||
|
runNextTest();
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let tests = [test_newTabFocused, test_newTabNotFocused,
|
||||||
|
test_existingSHEnd_noClear, test_existingSHMiddle_noClear,
|
||||||
|
test_getBrowserState_lotsOfTabsOpening,
|
||||||
|
test_getBrowserState_userTypedValue, test_userTypedClearLoadURI];
|
||||||
|
let originalState = ss.getBrowserState();
|
||||||
|
info(JSON.parse(originalState).windows.length);
|
||||||
|
info(originalState);
|
||||||
|
function runNextTest() {
|
||||||
|
if (tests.length) {
|
||||||
|
tests.shift().call();
|
||||||
|
} else {
|
||||||
|
ss.setBrowserState(originalState);
|
||||||
|
executeSoon(function () {
|
||||||
|
is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run the tests!
|
||||||
|
runNextTest();
|
||||||
|
}
|
||||||
|
|
@ -49,10 +49,20 @@ function test() {
|
||||||
|
|
||||||
function browserWindowsCount() {
|
function browserWindowsCount() {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
let e = wm.getXULWindowEnumerator("navigator:browser");
|
let e = wm.getEnumerator("navigator:browser");
|
||||||
while (e.hasMoreElements()) {
|
while (e.hasMoreElements()) {
|
||||||
|
let win = e.getNext();
|
||||||
|
if (!win.closed) {
|
||||||
++count;
|
++count;
|
||||||
e.getNext();
|
if (win != window) {
|
||||||
|
try {
|
||||||
|
var tabs = win.gBrowser.mTabs.length;
|
||||||
|
} catch (e) {
|
||||||
|
info(e);
|
||||||
|
}
|
||||||
|
info("secondary window: " + [win.document.readyState, win.content.location, tabs]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
|
@ -82,14 +92,21 @@ function test() {
|
||||||
if (this.pass++ == 1) {
|
if (this.pass++ == 1) {
|
||||||
is(browserWindowsCount(), 2, "Two windows should exist at this point");
|
is(browserWindowsCount(), 2, "Two windows should exist at this point");
|
||||||
|
|
||||||
// executeSoon is needed here in order to let the first window be focused
|
// let the first window be focused (see above)
|
||||||
// (see above)
|
function pollMostRecentWindow() {
|
||||||
executeSoon(function() {
|
if (wm.getMostRecentWindow("navigator:browser") == window) {
|
||||||
ss.setBrowserState(oldState);
|
ss.setBrowserState(oldState);
|
||||||
});
|
} else {
|
||||||
|
info("waiting for the current window to become active");
|
||||||
|
setTimeout(pollMostRecentWindow, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.focus(); //XXX Why is this needed?
|
||||||
|
pollMostRecentWindow();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
is(browserWindowsCount(), 1, "Only one window should exist after cleanup");
|
is(browserWindowsCount(), 1, "Only one window should exist after cleanup");
|
||||||
|
ok(!window.closed, "Restoring the old state should have left this window open");
|
||||||
os.removeObserver(this, "sessionstore-browser-state-restored");
|
os.removeObserver(this, "sessionstore-browser-state-restored");
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,9 @@
|
||||||
const Ci = Components.interfaces;
|
|
||||||
const Cc = Components.classes;
|
|
||||||
|
|
||||||
const DG_BACKGROUND = "/desktop/gnome/background"
|
const DG_BACKGROUND = "/desktop/gnome/background"
|
||||||
const DG_IMAGE_KEY = DG_BACKGROUND + "/picture_filename";
|
const DG_IMAGE_KEY = DG_BACKGROUND + "/picture_filename";
|
||||||
const DG_OPTION_KEY = DG_BACKGROUND + "/picture_options";
|
const DG_OPTION_KEY = DG_BACKGROUND + "/picture_options";
|
||||||
const DG_DRAW_BG_KEY = DG_BACKGROUND + "/draw_background";
|
const DG_DRAW_BG_KEY = DG_BACKGROUND + "/draw_background";
|
||||||
|
|
||||||
var testPage;
|
|
||||||
|
|
||||||
function url(spec) {
|
|
||||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
|
||||||
getService(Ci.nsIIOService);
|
|
||||||
return ios.newURI(spec, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onPageLoad() {
|
function onPageLoad() {
|
||||||
testPage.events.removeListener("load", onPageLoad);
|
|
||||||
|
|
||||||
var bs = Cc["@mozilla.org/intl/stringbundle;1"].
|
var bs = Cc["@mozilla.org/intl/stringbundle;1"].
|
||||||
getService(Ci.nsIStringBundleService);
|
getService(Ci.nsIStringBundleService);
|
||||||
var brandName = bs.createBundle("chrome://branding/locale/brand.properties").
|
var brandName = bs.createBundle("chrome://branding/locale/brand.properties").
|
||||||
|
|
@ -49,7 +36,7 @@ function onPageLoad() {
|
||||||
var prevOptionKey = gconf.getString(DG_OPTION_KEY);
|
var prevOptionKey = gconf.getString(DG_OPTION_KEY);
|
||||||
var prevDrawBgKey = gconf.getBool(DG_DRAW_BG_KEY);
|
var prevDrawBgKey = gconf.getBool(DG_DRAW_BG_KEY);
|
||||||
|
|
||||||
var image = testPage.document.getElementsByTagName("img")[0];
|
var image = content.document.images[0];
|
||||||
|
|
||||||
function checkWallpaper(position, expectedGConfPosition) {
|
function checkWallpaper(position, expectedGConfPosition) {
|
||||||
shell.setDesktopBackground(image, position);
|
shell.setDesktopBackground(image, position);
|
||||||
|
|
@ -72,10 +59,10 @@ function onPageLoad() {
|
||||||
gconf.setBool(DG_DRAW_BG_KEY, prevDrawBgKey);
|
gconf.setBool(DG_DRAW_BG_KEY, prevDrawBgKey);
|
||||||
|
|
||||||
wpFile.remove(false);
|
wpFile.remove(false);
|
||||||
if (wpFileBackup.exists()) {
|
if (wpFileBackup.exists())
|
||||||
wpFileBackup.moveTo(null, wpFile.leafName);
|
wpFileBackup.moveTo(null, wpFile.leafName);
|
||||||
}
|
|
||||||
testPage.close();
|
gBrowser.removeCurrentTab();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,15 +71,12 @@ function test() {
|
||||||
getService(Ci.nsIXULRuntime).OS;
|
getService(Ci.nsIXULRuntime).OS;
|
||||||
|
|
||||||
// This test is Linux specific for now
|
// This test is Linux specific for now
|
||||||
if (osString != "Linux") {
|
if (osString != "Linux")
|
||||||
finish();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
testPage = Application.activeWindow.open(url("about:blank"));
|
gBrowser.selectedTab = gBrowser.addTab();
|
||||||
testPage.events.addListener("load", onPageLoad);
|
gBrowser.selectedBrowser.addEventListener("load", onPageLoad, true);
|
||||||
testPage.load(url("about:logo"));
|
content.location = "about:logo";
|
||||||
testPage.focus();
|
|
||||||
|
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -505,3 +505,8 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
||||||
@BINPATH@/components/FastStartup.js
|
@BINPATH@/components/FastStartup.js
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
; [OS/2]
|
||||||
|
#ifdef XP_OS2
|
||||||
|
@BINPATH@/MozSounds.cmd
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -585,6 +585,8 @@ res/viewsource.css
|
||||||
res/mathml.css
|
res/mathml.css
|
||||||
res/loading-image.png
|
res/loading-image.png
|
||||||
res/broken-image.png
|
res/broken-image.png
|
||||||
|
res/loading-image.gif
|
||||||
|
res/broken-image.gif
|
||||||
res/html/gopher-audio.gif
|
res/html/gopher-audio.gif
|
||||||
res/html/gopher-binary.gif
|
res/html/gopher-binary.gif
|
||||||
res/html/gopher-find.gif
|
res/html/gopher-find.gif
|
||||||
|
|
@ -638,8 +640,6 @@ init.d/README
|
||||||
redo-prebinding.sh
|
redo-prebinding.sh
|
||||||
res/viewer.properties
|
res/viewer.properties
|
||||||
res/bloatcycle.html
|
res/bloatcycle.html
|
||||||
res/broken-image.gif
|
|
||||||
res/loading-image.gif
|
|
||||||
components/browsersearch.xpt
|
components/browsersearch.xpt
|
||||||
components/nsResetPref.js
|
components/nsResetPref.js
|
||||||
plugins/Default Plugin.plugin/Contents/Info.plist
|
plugins/Default Plugin.plugin/Contents/Info.plist
|
||||||
|
|
@ -653,6 +653,7 @@ plugins/Default Plugin.plugin/Contents/Resources/English.lproj/InfoPlist.strings
|
||||||
../Plug-Ins/PrintPDE.plugin/Contents/Resources/English.lproj/PrintPDE.nib/classes.nib
|
../Plug-Ins/PrintPDE.plugin/Contents/Resources/English.lproj/PrintPDE.nib/classes.nib
|
||||||
../Plug-Ins/PrintPDE.plugin/Contents/Resources/English.lproj/PrintPDE.nib/info.nib
|
../Plug-Ins/PrintPDE.plugin/Contents/Resources/English.lproj/PrintPDE.nib/info.nib
|
||||||
../Plug-Ins/PrintPDE.plugin/Contents/Resources/English.lproj/PrintPDE.nib/objects.xib
|
../Plug-Ins/PrintPDE.plugin/Contents/Resources/English.lproj/PrintPDE.nib/objects.xib
|
||||||
|
../Resources/firefox-bin.rsrc
|
||||||
res/cursors/CVS/Entries
|
res/cursors/CVS/Entries
|
||||||
res/cursors/CVS/Repository
|
res/cursors/CVS/Repository
|
||||||
res/cursors/CVS/Root
|
res/cursors/CVS/Root
|
||||||
|
|
@ -748,6 +749,7 @@ components/necko_socket.xpt
|
||||||
components/necko_strconv.xpt
|
components/necko_strconv.xpt
|
||||||
components/necko_viewsource.xpt
|
components/necko_viewsource.xpt
|
||||||
components/necko_wifi.xpt
|
components/necko_wifi.xpt
|
||||||
|
components/oji.xpt
|
||||||
components/parentalcontrols.xpt
|
components/parentalcontrols.xpt
|
||||||
components/pipboot.xpt
|
components/pipboot.xpt
|
||||||
components/pipnss.xpt
|
components/pipnss.xpt
|
||||||
|
|
@ -804,6 +806,7 @@ run-mozilla.sh
|
||||||
firefox
|
firefox
|
||||||
dependentlibs.list
|
dependentlibs.list
|
||||||
components/nsProgressDialog.js
|
components/nsProgressDialog.js
|
||||||
|
libwidget.rsrc
|
||||||
#endif
|
#endif
|
||||||
#ifdef XP_UNIX
|
#ifdef XP_UNIX
|
||||||
#ifndef XP_MACOSX
|
#ifndef XP_MACOSX
|
||||||
|
|
@ -812,6 +815,8 @@ chrome/icons/default/default.xpm
|
||||||
dictionaries/PL.dic
|
dictionaries/PL.dic
|
||||||
dictionaries/PL.aff
|
dictionaries/PL.aff
|
||||||
libjemalloc.so
|
libjemalloc.so
|
||||||
|
icons/mozicon16.xpm
|
||||||
|
icons/mozicon50.xpm
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
|
|
@ -838,3 +843,4 @@ components/brwsrcmp.dll
|
||||||
components/nsUpdateService.js
|
components/nsUpdateService.js
|
||||||
components/nsUpdateServiceStub.js
|
components/nsUpdateServiceStub.js
|
||||||
#endif
|
#endif
|
||||||
|
old-homepage-default.properties
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
<!ENTITY helpReleaseNotes.label "Release Notes">
|
<!ENTITY helpReleaseNotes.label "Release Notes">
|
||||||
<!ENTITY helpReleaseNotes.accesskey "N">
|
<!ENTITY helpReleaseNotes.accesskey "N">
|
||||||
|
|
||||||
<!ENTITY helpTroubleshooting.label "Troubleshooting Information">
|
<!ENTITY helpTroubleshootingInfo.label "Troubleshooting Information">
|
||||||
<!ENTITY helpTroubleshooting.accesskey "T">
|
<!ENTITY helpTroubleshootingInfo.accesskey "T">
|
||||||
|
|
||||||
<!ENTITY updateCmd.label "Check for Updates…">
|
<!ENTITY updateCmd.label "Check for Updates…">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<ShortName>Yahoo</ShortName>
|
<ShortName>Yahoo</ShortName>
|
||||||
<Description>Yahoo Search</Description>
|
<Description>Yahoo Search</Description>
|
||||||
<InputEncoding>UTF-8</InputEncoding>
|
<InputEncoding>UTF-8</InputEncoding>
|
||||||
<Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAJECAP8AAAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+py+0NogQuyBDEnEd2kHkfFWUamEzmpZSfmaIHPHrRguUm/fT+UwAAOw==</Image>
|
<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbgJqAIoCdgCaAnoAnhKCAKYijgCuLpIAskKeALpSpgC+Yq4AzHy8ANqezgDmvt4A7tLqAPz5+wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKlRFIoABWAKERERE6ADcKMzzu2hOgAAhERK8REWCWBERE36ERMHMEREvo6iEgY6hEn6Pu0mAzqkz/xjMzoDNwpERERDoAMzAKlERIoAAzMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAP//AADAOQAAgBkAAAAPAAAACQAAAAkAAAAIAAAACAAAAAgAAIAYAADAOAAA//8AAP//AAD//wAA</Image>
|
||||||
<Url type="application/x-suggestions+json" method="GET"
|
<Url type="application/x-suggestions+json" method="GET"
|
||||||
template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchTerms}" />
|
template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchTerms}" />
|
||||||
<Url type="text/html" method="GET" template="http://search.yahoo.com/search">
|
<Url type="text/html" method="GET" template="http://search.yahoo.com/search">
|
||||||
|
|
|
||||||
|
|
@ -1268,7 +1268,9 @@ tabpanels {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs-closebutton > .toolbarbutton-icon {
|
.tabs-closebutton > .toolbarbutton-icon {
|
||||||
margin: 0;
|
/* XXX Buttons have padding in widget/ that we don't want here but can't override with good CSS, so we must
|
||||||
|
use evil CSS to give the impression of smaller content */
|
||||||
|
margin: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tabbrowser arrowscrollbox arrows */
|
/* Tabbrowser arrowscrollbox arrows */
|
||||||
|
|
|
||||||
|
|
@ -46,25 +46,6 @@
|
||||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||||
@namespace html url("http://www.w3.org/1999/xhtml");
|
@namespace html url("http://www.w3.org/1999/xhtml");
|
||||||
|
|
||||||
#urlbar:-moz-lwtheme:not([focused="true"]),
|
|
||||||
.searchbar-textbox:-moz-lwtheme:not([focused="true"]) {
|
|
||||||
opacity: .85;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabbrowser-tab:-moz-lwtheme[selected="true"] {
|
|
||||||
text-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabbrowser-tabs:-moz-lwtheme {
|
|
||||||
-moz-appearance: none;
|
|
||||||
background: none;
|
|
||||||
border-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabbrowser-tab:-moz-lwtheme:not([selected="true"]) {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menubar-items {
|
#menubar-items {
|
||||||
-moz-box-orient: vertical; /* for flex hack */
|
-moz-box-orient: vertical; /* for flex hack */
|
||||||
}
|
}
|
||||||
|
|
@ -77,7 +58,7 @@
|
||||||
min-height: 24px;
|
min-height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#navigator-toolbox:-moz-system-metric(windows-default-theme) {
|
#navigator-toolbox:-moz-system-metric(windows-default-theme):not(:-moz-lwtheme) {
|
||||||
padding-bottom: 1px; /* uxtheme border drawing fix/hack */
|
padding-bottom: 1px; /* uxtheme border drawing fix/hack */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,15 +210,6 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
|
||||||
padding: 5px !important;
|
padding: 5px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
toolbar[iconsize="large"][mode="icons"] .toolbarbutton-1:-moz-system-metric(windows-default-theme),
|
|
||||||
.toolbarbutton-menubutton-button:-moz-system-metric(windows-default-theme) {
|
|
||||||
padding: 6px; /* uxtheme border drawing fix/hack */
|
|
||||||
}
|
|
||||||
|
|
||||||
toolbar[iconsize="large"][mode="icons"] .toolbarbutton-1[checked="true"]:-moz-system-metric(windows-default-theme) {
|
|
||||||
padding: 6px !important; /* uxtheme border drawing fix/hack */
|
|
||||||
}
|
|
||||||
|
|
||||||
#back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
|
#back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
|
||||||
#forward-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
|
#forward-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
|
||||||
#back-forward-dropmarker:-moz-locale-dir(rtl) > .toolbarbutton-icon {
|
#back-forward-dropmarker:-moz-locale-dir(rtl) > .toolbarbutton-icon {
|
||||||
|
|
@ -884,6 +856,11 @@ toolbar[iconsize="small"] #fullscreen-button:hover:active {
|
||||||
min-width: 7em;
|
min-width: 7em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#urlbar:-moz-lwtheme:not([focused="true"]),
|
||||||
|
.searchbar-textbox:-moz-lwtheme:not([focused="true"]) {
|
||||||
|
opacity: .85;
|
||||||
|
}
|
||||||
|
|
||||||
#urlbar:-moz-system-metric(windows-default-theme) {
|
#urlbar:-moz-system-metric(windows-default-theme) {
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
|
|
@ -1159,6 +1136,12 @@ statusbarpanel#statusbar-display {
|
||||||
background: -moz-dialog url("chrome://browser/skin/tabbrowser/tabbrowser-tabs-bkgnd.png") repeat-x;
|
background: -moz-dialog url("chrome://browser/skin/tabbrowser/tabbrowser-tabs-bkgnd.png") repeat-x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tabbrowser-tabs:-moz-lwtheme {
|
||||||
|
-moz-appearance: none;
|
||||||
|
background: none;
|
||||||
|
border-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
.tabbrowser-tabs:-moz-system-metric(touch-enabled) {
|
.tabbrowser-tabs:-moz-system-metric(touch-enabled) {
|
||||||
min-height: .81cm;
|
min-height: .81cm;
|
||||||
}
|
}
|
||||||
|
|
@ -1168,19 +1151,42 @@ statusbarpanel#statusbar-display {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tabs */
|
/* Tabs */
|
||||||
.tabbrowser-tab {
|
.tabbrowser-tab,
|
||||||
|
.tabbrowser-arrowscrollbox > .scrollbutton-up,
|
||||||
|
.tabbrowser-arrowscrollbox > .scrollbutton-down,
|
||||||
|
.tabs-newtab-button,
|
||||||
|
.tabs-alltabs-button {
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
background: url("chrome://browser/skin/tabbrowser/tab-bkgnd.png") repeat-x;
|
background: url("chrome://browser/skin/tabbrowser/tab-bkgnd.png") repeat-x;
|
||||||
margin: 3px 0px 4px;
|
margin: 3px 0px 4px;
|
||||||
padding: 0px 1px 1px 0px;
|
|
||||||
border: 2px solid;
|
border: 2px solid;
|
||||||
border-right-width: 1px;
|
border-right-width: 1px;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
-moz-border-top-colors: ThreeDShadow rgba(255,255,255,.3);
|
||||||
|
-moz-border-left-colors: ThreeDShadow rgba(255,255,255,.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbrowser-tab:-moz-lwtheme-brighttext,
|
||||||
|
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-lwtheme-brighttext,
|
||||||
|
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-lwtheme-brighttext,
|
||||||
|
.tabs-newtab-button:-moz-lwtheme-brighttext,
|
||||||
|
.tabs-alltabs-button:-moz-lwtheme-brighttext {
|
||||||
|
background-color: rgba(0,0,0,.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbrowser-tab:-moz-lwtheme-darktext,
|
||||||
|
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-lwtheme-darktext,
|
||||||
|
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-lwtheme-darktext,
|
||||||
|
.tabs-newtab-button:-moz-lwtheme-darktext,
|
||||||
|
.tabs-alltabs-button:-moz-lwtheme-darktext {
|
||||||
|
background-color: rgba(255,255,255,.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbrowser-tab {
|
||||||
|
padding: 0 1px 1px 0;
|
||||||
-moz-border-radius-topleft: 2px;
|
-moz-border-radius-topleft: 2px;
|
||||||
-moz-border-radius-topright: 2px;
|
-moz-border-radius-topright: 2px;
|
||||||
-moz-border-top-colors: ThreeDShadow rgba(255,255,255,.3);
|
|
||||||
-moz-border-right-colors: rgba(0,0,0,.1);
|
-moz-border-right-colors: rgba(0,0,0,.1);
|
||||||
-moz-border-left-colors: ThreeDShadow rgba(255,255,255,.3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabbrowser-tab:hover,
|
.tabbrowser-tab:hover,
|
||||||
|
|
@ -1207,6 +1213,14 @@ statusbarpanel#statusbar-display {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tabbrowser-tab:-moz-lwtheme[selected="true"] {
|
||||||
|
text-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbrowser-tab:-moz-lwtheme:not([selected="true"]) {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
.tabbrowser-tab[busy] > .tab-icon-image {
|
.tabbrowser-tab[busy] > .tab-icon-image {
|
||||||
list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
|
list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
|
||||||
-moz-image-region: rect(0, 16px, 16px, 0);
|
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||||
|
|
@ -1332,17 +1346,9 @@ tabpanels {
|
||||||
.tabbrowser-arrowscrollbox > .scrollbutton-down,
|
.tabbrowser-arrowscrollbox > .scrollbutton-down,
|
||||||
.tabs-newtab-button,
|
.tabs-newtab-button,
|
||||||
.tabs-alltabs-button {
|
.tabs-alltabs-button {
|
||||||
-moz-appearance: none;
|
|
||||||
width: 18px;
|
width: 18px;
|
||||||
margin: 3px 0px 4px;
|
padding: 0;
|
||||||
padding: 0px;
|
|
||||||
border: 2px solid;
|
|
||||||
border-right-width: 1px;
|
|
||||||
border-bottom: none;
|
|
||||||
-moz-border-top-colors: ThreeDShadow rgba(255,255,255,.3);
|
|
||||||
-moz-border-right-colors: ThreeDShadow;
|
-moz-border-right-colors: ThreeDShadow;
|
||||||
-moz-border-left-colors: ThreeDShadow rgba(255,255,255,.3);
|
|
||||||
background: url("chrome://browser/skin/tabbrowser/tab-bkgnd.png") repeat-x;
|
|
||||||
-moz-image-region: rect(0, 11px, 14px, 0);
|
-moz-image-region: rect(0, 11px, 14px, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1865,15 +1871,6 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
||||||
-moz-padding-end: 2px;
|
-moz-padding-end: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nav-bar[mode="full"]:not([currentset]):-moz-system-metric(windows-default-theme),
|
|
||||||
#nav-bar[mode="full"][currentset$=",urlbar-container"]:-moz-system-metric(windows-default-theme),
|
|
||||||
#nav-bar[mode="full"][currentset$=",search-container"]:-moz-system-metric(windows-default-theme),
|
|
||||||
#nav-bar[iconsize="large"][mode="icons"]:not([currentset]):-moz-system-metric(windows-default-theme),
|
|
||||||
#nav-bar[iconsize="large"][mode="icons"][currentset$=",urlbar-container"]:-moz-system-metric(windows-default-theme),
|
|
||||||
#nav-bar[iconsize="large"][mode="icons"][currentset$=",search-container"]:-moz-system-metric(windows-default-theme) {
|
|
||||||
-moz-padding-end: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ::::: Keyboard UI Panel ::::: */
|
/* ::::: Keyboard UI Panel ::::: */
|
||||||
|
|
||||||
.KUI-panel {
|
.KUI-panel {
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ __all__ = [
|
||||||
"log",
|
"log",
|
||||||
"runApp",
|
"runApp",
|
||||||
"Process",
|
"Process",
|
||||||
|
"addExtraCommonOptions",
|
||||||
"initializeProfile",
|
"initializeProfile",
|
||||||
"DIST_BIN",
|
"DIST_BIN",
|
||||||
"DEFAULT_APP",
|
"DEFAULT_APP",
|
||||||
|
|
@ -351,6 +352,15 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
||||||
prefsFile.write("".join(prefs))
|
prefsFile.write("".join(prefs))
|
||||||
prefsFile.close()
|
prefsFile.close()
|
||||||
|
|
||||||
|
def addExtraCommonOptions(parser):
|
||||||
|
"Adds command-line options which are common to mochitest and reftest."
|
||||||
|
|
||||||
|
parser.add_option("--setpref",
|
||||||
|
action = "append", type = "string",
|
||||||
|
default = [],
|
||||||
|
dest = "extraPrefs", metavar = "PREF=VALUE",
|
||||||
|
help = "defines an extra user preference")
|
||||||
|
|
||||||
def fillCertificateDB(profileDir, certPath, utilityPath, xrePath):
|
def fillCertificateDB(profileDir, certPath, utilityPath, xrePath):
|
||||||
pwfilePath = os.path.join(profileDir, ".crtdbpw")
|
pwfilePath = os.path.join(profileDir, ".crtdbpw")
|
||||||
|
|
||||||
|
|
@ -437,15 +447,13 @@ def environment(env = None, xrePath = DIST_BIN, crashreporter = True):
|
||||||
if crashreporter:
|
if crashreporter:
|
||||||
env['MOZ_CRASHREPORTER_NO_REPORT'] = '1'
|
env['MOZ_CRASHREPORTER_NO_REPORT'] = '1'
|
||||||
env['MOZ_CRASHREPORTER'] = '1'
|
env['MOZ_CRASHREPORTER'] = '1'
|
||||||
|
else:
|
||||||
|
env['MOZ_CRASHREPORTER_DISABLE'] = '1'
|
||||||
|
|
||||||
env['GNOME_DISABLE_CRASH_DIALOG'] = "1"
|
env['GNOME_DISABLE_CRASH_DIALOG'] = "1"
|
||||||
return env
|
return env
|
||||||
|
|
||||||
if IS_WIN32:
|
if IS_WIN32:
|
||||||
#XXX: disabled on windows for now, see bug 525370
|
|
||||||
def readWithTimeout(f, timeout):
|
|
||||||
return (f.readline(), False)
|
|
||||||
elif False:
|
|
||||||
#XXX: figure out what's going wrong with this code!
|
|
||||||
import ctypes, time, msvcrt
|
import ctypes, time, msvcrt
|
||||||
PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe
|
PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe
|
||||||
GetLastError = ctypes.windll.kernel32.GetLastError
|
GetLastError = ctypes.windll.kernel32.GetLastError
|
||||||
|
|
@ -456,18 +464,24 @@ elif False:
|
||||||
is received within |timeout| seconds, return a blank line.
|
is received within |timeout| seconds, return a blank line.
|
||||||
Returns a tuple (line, did_timeout), where |did_timeout| is True
|
Returns a tuple (line, did_timeout), where |did_timeout| is True
|
||||||
if the read timed out, and False otherwise."""
|
if the read timed out, and False otherwise."""
|
||||||
|
if timeout is None:
|
||||||
|
# shortcut to allow callers to pass in "None" for no timeout.
|
||||||
|
return (f.readline(), False)
|
||||||
x = msvcrt.get_osfhandle(f.fileno())
|
x = msvcrt.get_osfhandle(f.fileno())
|
||||||
l = ctypes.c_long()
|
l = ctypes.c_long()
|
||||||
buf = ctypes.create_string_buffer('', 1024)
|
|
||||||
done = time.time() + timeout
|
done = time.time() + timeout
|
||||||
while time.time() < done:
|
while time.time() < done:
|
||||||
if PeekNamedPipe(x, buf, len(buf), None, ctypes.byref(l), None) == 0:
|
if PeekNamedPipe(x, None, 0, None, ctypes.byref(l), None) == 0:
|
||||||
err = GetLastError()
|
err = GetLastError()
|
||||||
if err == 38 or err == 109: # ERROR_HANDLE_EOF || ERROR_BROKEN_PIPE
|
if err == 38 or err == 109: # ERROR_HANDLE_EOF || ERROR_BROKEN_PIPE
|
||||||
return ('', False)
|
return ('', False)
|
||||||
if (l > 0 and '\n' in buf.value):
|
else:
|
||||||
|
log.error("readWithTimeout got error: %d", err)
|
||||||
|
if l > 0:
|
||||||
|
# we're assuming that the output is line-buffered,
|
||||||
|
# which is not unreasonable
|
||||||
return (f.readline(), False)
|
return (f.readline(), False)
|
||||||
time.sleep(0.1)
|
time.sleep(0.01)
|
||||||
return ('', True)
|
return ('', True)
|
||||||
else:
|
else:
|
||||||
def readWithTimeout(f, timeout):
|
def readWithTimeout(f, timeout):
|
||||||
|
|
@ -493,7 +507,7 @@ def triggerBreakpad(proc, utilityPath):
|
||||||
crashinject = os.path.normpath(os.path.join(utilityPath, "crashinject.exe"))
|
crashinject = os.path.normpath(os.path.join(utilityPath, "crashinject.exe"))
|
||||||
if os.path.exists(crashinject) and subprocess.Popen([crashinject, str(proc.pid)]).wait() == 0:
|
if os.path.exists(crashinject) and subprocess.Popen([crashinject, str(proc.pid)]).wait() == 0:
|
||||||
return
|
return
|
||||||
#TODO: kill the process such that it triggers Breakpad on OS X
|
#TODO: kill the process such that it triggers Breakpad on OS X (bug 525296)
|
||||||
log.info("Can't trigger Breakpad, just killing process")
|
log.info("Can't trigger Breakpad, just killing process")
|
||||||
proc.kill()
|
proc.kill()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,9 +70,6 @@ if __name__ == '__main__':
|
||||||
appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
|
appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
|
||||||
status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
|
status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
|
||||||
# the profiling HTML doesn't output anything,
|
# the profiling HTML doesn't output anything,
|
||||||
# so let's just set this really high for now.
|
# so let's just run this without a timeout
|
||||||
#FIXME: the POSIX codepath accepts None
|
timeout = None)
|
||||||
# as "no timeout", the Windows codepath
|
|
||||||
# should too.
|
|
||||||
timeout = 1800.0)
|
|
||||||
sys.exit(status)
|
sys.exit(status)
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <Windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <Windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
// make sure we only ever spawn one thread
|
// make sure we only ever spawn one thread
|
||||||
DWORD tid = -1;
|
DWORD tid = -1;
|
||||||
|
|
|
||||||
|
|
@ -632,6 +632,10 @@ LIBOSSO_LIBS = @LIBOSSO_LIBS@
|
||||||
LIBHILDONFM_CFLAGS = @LIBHILDONFM_CFLAGS@
|
LIBHILDONFM_CFLAGS = @LIBHILDONFM_CFLAGS@
|
||||||
LIBHILDONFM_LIBS = @LIBHILDONFM_LIBS@
|
LIBHILDONFM_LIBS = @LIBHILDONFM_LIBS@
|
||||||
|
|
||||||
|
MOZ_ENABLE_LIBCONIC = @MOZ_ENABLE_LIBCONIC@
|
||||||
|
LIBCONIC_CFLAGS = @LIBCONIC_CFLAGS@
|
||||||
|
LIBCONIC_LIBS = @LIBCONIC_LIBS@
|
||||||
|
|
||||||
MACOS_SDK_DIR = @MACOS_SDK_DIR@
|
MACOS_SDK_DIR = @MACOS_SDK_DIR@
|
||||||
NEXT_ROOT = @NEXT_ROOT@
|
NEXT_ROOT = @NEXT_ROOT@
|
||||||
GCC_VERSION = @GCC_VERSION@
|
GCC_VERSION = @GCC_VERSION@
|
||||||
|
|
|
||||||
|
|
@ -555,7 +555,6 @@ pango/pango-break.h
|
||||||
pango/pango-fontmap.h
|
pango/pango-fontmap.h
|
||||||
pango/pango.h
|
pango/pango.h
|
||||||
pango/pangoxft.h
|
pango/pangoxft.h
|
||||||
pango/pangox.h
|
|
||||||
pango/pango-utils.h
|
pango/pango-utils.h
|
||||||
pango-types.h
|
pango-types.h
|
||||||
pascal.h
|
pascal.h
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ def lockFile(lockfile, max_wait = 600):
|
||||||
# and read its contents to report the owner PID
|
# and read its contents to report the owner PID
|
||||||
f = open(lockfile, "r")
|
f = open(lockfile, "r")
|
||||||
s = os.stat(lockfile)
|
s = os.stat(lockfile)
|
||||||
except OSError, e:
|
except EnvironmentError, e:
|
||||||
if e.errno != errno.ENOENT:
|
if e.errno != errno.ENOENT:
|
||||||
sys.exit("%s exists but stat() failed: %s" %
|
sys.exit("%s exists but stat() failed: %s" %
|
||||||
(lockfile, e.strerror))
|
(lockfile, e.strerror))
|
||||||
|
|
|
||||||
45
configure.in
45
configure.in
|
|
@ -1506,6 +1506,25 @@ if test "$GNU_CXX"; then
|
||||||
if test "$ac_has_wno_invalid_offsetof" = "yes"; then
|
if test "$ac_has_wno_invalid_offsetof" = "yes"; then
|
||||||
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
|
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
|
||||||
|
ac_has_wno_variadic_macros,
|
||||||
|
[
|
||||||
|
AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
_SAVE_CXXFLAGS="$CXXFLAGS"
|
||||||
|
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros"
|
||||||
|
AC_TRY_COMPILE([],
|
||||||
|
[return(0);],
|
||||||
|
ac_has_wno_variadic_macros="yes",
|
||||||
|
ac_has_wno_variadic_macros="no")
|
||||||
|
CXXFLAGS="$_SAVE_CXXFLAGS"
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
if test "$ac_has_wno_variadic_macros" = "yes"; then
|
||||||
|
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
|
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
|
||||||
fi
|
fi
|
||||||
|
|
@ -4156,12 +4175,16 @@ if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
|
||||||
AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
|
AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# try harder, when checking for __thread support, see bug 521750 comment #33 and below
|
||||||
|
_SAVE_LDFLAGS=$LDFLAGS
|
||||||
|
LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS"
|
||||||
AC_CACHE_CHECK(for __thread keyword for TLS variables,
|
AC_CACHE_CHECK(for __thread keyword for TLS variables,
|
||||||
ac_cv_thread_keyword,
|
ac_cv_thread_keyword,
|
||||||
[AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
|
[AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
|
||||||
[return tlsIsMainThread;],
|
[return tlsIsMainThread;],
|
||||||
ac_cv_thread_keyword=yes,
|
ac_cv_thread_keyword=yes,
|
||||||
ac_cv_thread_keyword=no)])
|
ac_cv_thread_keyword=no)])
|
||||||
|
LDFLAGS=$_SAVE_LDFLAGS
|
||||||
if test "$ac_cv_thread_keyword" = yes; then
|
if test "$ac_cv_thread_keyword" = yes; then
|
||||||
AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
|
AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
|
||||||
fi
|
fi
|
||||||
|
|
@ -6220,6 +6243,28 @@ MOZ_ARG_DISABLE_BOOL(zipwriter,
|
||||||
MOZ_ZIPWRITER=1 )
|
MOZ_ZIPWRITER=1 )
|
||||||
AC_SUBST(MOZ_ZIPWRITER)
|
AC_SUBST(MOZ_ZIPWRITER)
|
||||||
|
|
||||||
|
dnl ========================================================
|
||||||
|
dnl = Disable libconic
|
||||||
|
dnl ========================================================
|
||||||
|
MOZ_ENABLE_LIBCONIC=1
|
||||||
|
MOZ_ARG_DISABLE_BOOL(libconic,
|
||||||
|
[ --disable-libconic Disable libconic],
|
||||||
|
MOZ_ENABLE_LIBCONIC=,
|
||||||
|
MOZ_ENABLE_LIBCONIC=1 )
|
||||||
|
|
||||||
|
if test -n "$MOZ_ENABLE_LIBCONIC"; then
|
||||||
|
PKG_CHECK_MODULES(LIBCONIC, conic,
|
||||||
|
MOZ_ENABLE_LIBCONIC=1,
|
||||||
|
MOZ_ENABLE_LIBCONIC=)
|
||||||
|
fi
|
||||||
|
if test "$MOZ_ENABLE_LIBCONIC"; then
|
||||||
|
AC_DEFINE(MOZ_ENABLE_LIBCONIC)
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(MOZ_ENABLE_LIBCONIC)
|
||||||
|
AC_SUBST(LIBCONIC_CFLAGS)
|
||||||
|
AC_SUBST(LIBCONIC_LIBS)
|
||||||
|
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
dnl = Hildon and OSSO checks
|
dnl = Hildon and OSSO checks
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ interface nsIDOMFile : nsISupports
|
||||||
|
|
||||||
readonly attribute DOMString name;
|
readonly attribute DOMString name;
|
||||||
readonly attribute unsigned long long size;
|
readonly attribute unsigned long long size;
|
||||||
readonly attribute DOMString mediaType;
|
readonly attribute DOMString type;
|
||||||
|
|
||||||
DOMString getAsText(in DOMString encoding); // raises(FileException) on retrieval
|
DOMString getAsText(in DOMString encoding); // raises(FileException) on retrieval
|
||||||
DOMString getAsDataURL(); // raises(FileException) on retrieval
|
DOMString getAsDataURL(); // raises(FileException) on retrieval
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ interface nsIDOMFileReader : nsISupports
|
||||||
|
|
||||||
void abort();
|
void abort();
|
||||||
|
|
||||||
const unsigned short INITIAL = 0;
|
const unsigned short EMPTY = 0;
|
||||||
const unsigned short LOADING = 1;
|
const unsigned short LOADING = 1;
|
||||||
const unsigned short DONE = 2;
|
const unsigned short DONE = 2;
|
||||||
readonly attribute unsigned short readyState;
|
readonly attribute unsigned short readyState;
|
||||||
|
|
|
||||||
|
|
@ -1178,14 +1178,16 @@ public:
|
||||||
enum DocumentTheme {
|
enum DocumentTheme {
|
||||||
Doc_Theme_Uninitialized, // not determined yet
|
Doc_Theme_Uninitialized, // not determined yet
|
||||||
Doc_Theme_None,
|
Doc_Theme_None,
|
||||||
|
Doc_Theme_Neutral,
|
||||||
Doc_Theme_Dark,
|
Doc_Theme_Dark,
|
||||||
Doc_Theme_Bright
|
Doc_Theme_Bright
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns Doc_Theme_None if there is no lightweight theme specified, Doc_Theme_Dark
|
* Returns Doc_Theme_None if there is no lightweight theme specified,
|
||||||
* for a dark theme and Doc_Theme_Bright for a light theme. This is used to
|
* Doc_Theme_Dark for a dark theme, Doc_Theme_Bright for a light theme, and
|
||||||
* determine the state of the pseudoclasses :-moz-lwtheme and :-moz-lwtheme-text.
|
* Doc_Theme_Neutral for any other theme. This is used to determine the state
|
||||||
|
* of the pseudoclasses :-moz-lwtheme and :-moz-lwtheme-text.
|
||||||
*/
|
*/
|
||||||
virtual int GetDocumentLWTheme() { return Doc_Theme_None; }
|
virtual int GetDocumentLWTheme() { return Doc_Theme_None; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,12 @@
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsIScriptLoaderObserver.h"
|
#include "nsIScriptLoaderObserver.h"
|
||||||
|
#include "nsWeakPtr.h"
|
||||||
|
#include "nsIParser.h"
|
||||||
|
|
||||||
// e68ddc48-4055-4ba9-978d-c49d9cf3189a
|
|
||||||
#define NS_ISCRIPTELEMENT_IID \
|
#define NS_ISCRIPTELEMENT_IID \
|
||||||
{ 0xe68ddc48, 0x4055, 0x4ba9, \
|
{ 0xa28c198e, 0x14f0, 0x42b1, \
|
||||||
{ 0x97, 0x8d, 0xc4, 0x9d, 0x9c, 0xf3, 0x18, 0x9a } }
|
{ 0x8f, 0x6b, 0x0e, 0x7f, 0xca, 0xb4, 0xf4, 0xe8 } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal interface implemented by script elements
|
* Internal interface implemented by script elements
|
||||||
|
|
@ -60,7 +61,8 @@ public:
|
||||||
: mLineNumber(0),
|
: mLineNumber(0),
|
||||||
mIsEvaluated(PR_FALSE),
|
mIsEvaluated(PR_FALSE),
|
||||||
mMalformed(PR_FALSE),
|
mMalformed(PR_FALSE),
|
||||||
mDoneAddingChildren(PR_TRUE)
|
mDoneAddingChildren(PR_TRUE),
|
||||||
|
mCreatorParser(nsnull)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,11 +124,52 @@ public:
|
||||||
mDoneAddingChildren = PR_FALSE;
|
mDoneAddingChildren = PR_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetCreatorParser(nsIParser* aParser)
|
||||||
|
{
|
||||||
|
mCreatorParser = getter_AddRefs(NS_GetWeakReference(aParser));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Informs the creator parser that the evaluation of this script is starting
|
||||||
|
*/
|
||||||
|
void BeginEvaluating()
|
||||||
|
{
|
||||||
|
// Once the async attribute is supported, don't do this if this is an
|
||||||
|
// async script.
|
||||||
|
nsCOMPtr<nsIParser> parser = do_QueryReferent(mCreatorParser);
|
||||||
|
if (parser) {
|
||||||
|
parser->BeginEvaluatingParserInsertedScript();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Informs the creator parser that the evaluation of this script is ending
|
||||||
|
*/
|
||||||
|
void EndEvaluating()
|
||||||
|
{
|
||||||
|
// Once the async attribute is supported, don't do this if this is an
|
||||||
|
// async script.
|
||||||
|
nsCOMPtr<nsIParser> parser = do_QueryReferent(mCreatorParser);
|
||||||
|
if (parser) {
|
||||||
|
parser->EndEvaluatingParserInsertedScript();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a pointer to the creator parser if this has one or null if not
|
||||||
|
*/
|
||||||
|
already_AddRefed<nsIParser> GetCreatorParser()
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIParser> parser = do_QueryReferent(mCreatorParser);
|
||||||
|
return parser.forget();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PRUint32 mLineNumber;
|
PRUint32 mLineNumber;
|
||||||
PRPackedBool mIsEvaluated;
|
PRPackedBool mIsEvaluated;
|
||||||
PRPackedBool mMalformed;
|
PRPackedBool mMalformed;
|
||||||
PRPackedBool mDoneAddingChildren;
|
PRPackedBool mDoneAddingChildren;
|
||||||
|
nsWeakPtr mCreatorParser;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptElement, NS_ISCRIPTELEMENT_IID)
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptElement, NS_ISCRIPTELEMENT_IID)
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ nsDOMFile::GetSize(PRUint64 *aFileSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDOMFile::GetMediaType(nsAString &aMediaType)
|
nsDOMFile::GetType(nsAString &aType)
|
||||||
{
|
{
|
||||||
if (!mContentType.Length()) {
|
if (!mContentType.Length()) {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
@ -133,17 +133,17 @@ nsDOMFile::GetMediaType(nsAString &aMediaType)
|
||||||
do_GetService(NS_MIMESERVICE_CONTRACTID, &rv);
|
do_GetService(NS_MIMESERVICE_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCAutoString mediaType;
|
nsCAutoString mimeType;
|
||||||
rv = mimeService->GetTypeFromFile(mFile, mediaType);
|
rv = mimeService->GetTypeFromFile(mFile, mimeType);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
SetDOMStringToNull(aMediaType);
|
aType.Truncate();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppendUTF8toUTF16(mediaType, mContentType);
|
AppendUTF8toUTF16(mimeType, mContentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
aMediaType = mContentType;
|
aType = mContentType;
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ nsDOMFileReader::Notify(const char *aCharset, nsDetectionConfident aConf)
|
||||||
nsDOMFileReader::nsDOMFileReader()
|
nsDOMFileReader::nsDOMFileReader()
|
||||||
: mFileData(nsnull), mReadCount(0),
|
: mFileData(nsnull), mReadCount(0),
|
||||||
mDataLen(0), mDataFormat(0),
|
mDataLen(0), mDataFormat(0),
|
||||||
mReadyState(nsIDOMFileReader::INITIAL),
|
mReadyState(nsIDOMFileReader::EMPTY),
|
||||||
mProgressEventWasDelayed(PR_FALSE),
|
mProgressEventWasDelayed(PR_FALSE),
|
||||||
mTimerIsActive(PR_FALSE),
|
mTimerIsActive(PR_FALSE),
|
||||||
mReadTotal(0), mReadTransferred(0),
|
mReadTotal(0), mReadTransferred(0),
|
||||||
|
|
@ -319,7 +319,7 @@ nsDOMFileReader::Abort()
|
||||||
DispatchProgressEvent(NS_LITERAL_STRING(ABORT_STR));
|
DispatchProgressEvent(NS_LITERAL_STRING(ABORT_STR));
|
||||||
DispatchProgressEvent(NS_LITERAL_STRING(LOADEND_STR));
|
DispatchProgressEvent(NS_LITERAL_STRING(LOADEND_STR));
|
||||||
|
|
||||||
mReadyState = nsIDOMFileReader::INITIAL;
|
mReadyState = nsIDOMFileReader::EMPTY;
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -509,6 +509,15 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||||
!aElement->GetScriptAsync();
|
!aElement->GetScriptAsync();
|
||||||
mPreloads.RemoveElementAt(i);
|
mPreloads.RemoveElementAt(i);
|
||||||
|
|
||||||
|
if (nsContentUtils::GetBoolPref("content.scriptloader.logloads")) {
|
||||||
|
nsCString spec;
|
||||||
|
request->mURI->GetSpec(spec);
|
||||||
|
printf("Grabbing existing speculative load for %s (%p). async:%d defer:%d\n",
|
||||||
|
spec.get(), request.get(), aElement->GetScriptAsync(),
|
||||||
|
request->mDefer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rv = CheckContentPolicy(mDocument, aElement, request->mURI, type);
|
rv = CheckContentPolicy(mDocument, aElement, request->mURI, type);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
// Note, we're dropping our last ref to request here.
|
// Note, we're dropping our last ref to request here.
|
||||||
|
|
@ -558,6 +567,14 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||||
request->mIsInline = PR_FALSE;
|
request->mIsInline = PR_FALSE;
|
||||||
request->mLoading = PR_TRUE;
|
request->mLoading = PR_TRUE;
|
||||||
|
|
||||||
|
if (nsContentUtils::GetBoolPref("content.scriptloader.logloads")) {
|
||||||
|
nsCString spec;
|
||||||
|
request->mURI->GetSpec(spec);
|
||||||
|
printf("Starting normal load for %s (%p). async:%d defer:%d\n",
|
||||||
|
spec.get(), request.get(), aElement->GetScriptAsync(),
|
||||||
|
request->mDefer);
|
||||||
|
}
|
||||||
|
|
||||||
rv = StartLoad(request, type);
|
rv = StartLoad(request, type);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
return rv;
|
return rv;
|
||||||
|
|
@ -570,6 +587,10 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||||
|
|
||||||
request->mLineNo = aElement->GetScriptLineNumber();
|
request->mLineNo = aElement->GetScriptLineNumber();
|
||||||
|
|
||||||
|
if (nsContentUtils::GetBoolPref("content.scriptloader.logloads")) {
|
||||||
|
printf("Creating inline request (%p).\n", request.get());
|
||||||
|
}
|
||||||
|
|
||||||
// If we've got existing pending requests, add ourselves
|
// If we've got existing pending requests, add ourselves
|
||||||
// to this list.
|
// to this list.
|
||||||
if (!hadPendingRequests && ReadyToExecuteScripts() &&
|
if (!hadPendingRequests && ReadyToExecuteScripts() &&
|
||||||
|
|
@ -609,6 +630,10 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest)
|
||||||
nsAFlatString* script;
|
nsAFlatString* script;
|
||||||
nsAutoString textData;
|
nsAutoString textData;
|
||||||
|
|
||||||
|
if (nsContentUtils::GetBoolPref("content.scriptloader.logloads")) {
|
||||||
|
printf("Running request (%p).\n", aRequest);
|
||||||
|
}
|
||||||
|
|
||||||
// If there's no script text, we try to get it from the element
|
// If there's no script text, we try to get it from the element
|
||||||
if (aRequest->mIsInline) {
|
if (aRequest->mIsInline) {
|
||||||
// XXX This is inefficient - GetText makes multiple
|
// XXX This is inefficient - GetText makes multiple
|
||||||
|
|
@ -622,7 +647,9 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
FireScriptAvailable(NS_OK, aRequest);
|
FireScriptAvailable(NS_OK, aRequest);
|
||||||
|
aRequest->mElement->BeginEvaluating();
|
||||||
nsresult rv = EvaluateScript(aRequest, *script);
|
nsresult rv = EvaluateScript(aRequest, *script);
|
||||||
|
aRequest->mElement->EndEvaluating();
|
||||||
FireScriptEvaluated(rv, aRequest);
|
FireScriptEvaluated(rv, aRequest);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
|
@ -957,6 +984,13 @@ nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
|
||||||
NS_ASSERTION(request, "null request in stream complete handler");
|
NS_ASSERTION(request, "null request in stream complete handler");
|
||||||
NS_ENSURE_TRUE(request, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(request, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
|
if (nsContentUtils::GetBoolPref("content.scriptloader.logloads")) {
|
||||||
|
nsCString spec;
|
||||||
|
request->mURI->GetSpec(spec);
|
||||||
|
printf("Finished loading %s (%p). status:%d\n", spec.get(), request,
|
||||||
|
aStatus);
|
||||||
|
}
|
||||||
|
|
||||||
nsresult rv = PrepareLoadedRequest(request, aLoader, aStatus, aStringLen,
|
nsresult rv = PrepareLoadedRequest(request, aLoader, aStatus, aStringLen,
|
||||||
aString);
|
aString);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
|
@ -1110,6 +1144,14 @@ nsScriptLoader::PreloadURI(nsIURI *aURI, const nsAString &aCharset,
|
||||||
request->mLoading = PR_TRUE;
|
request->mLoading = PR_TRUE;
|
||||||
request->mDefer = PR_FALSE; // This is computed later when we go to execute the
|
request->mDefer = PR_FALSE; // This is computed later when we go to execute the
|
||||||
// script.
|
// script.
|
||||||
|
|
||||||
|
if (nsContentUtils::GetBoolPref("content.scriptloader.logloads")) {
|
||||||
|
nsCString spec;
|
||||||
|
request->mURI->GetSpec(spec);
|
||||||
|
printf("Starting speculative load for %s (%p).\n", spec.get(),
|
||||||
|
request.get());
|
||||||
|
}
|
||||||
|
|
||||||
nsresult rv = StartLoad(request, aType);
|
nsresult rv = StartLoad(request, aType);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@
|
||||||
#include "nsIPromptFactory.h"
|
#include "nsIPromptFactory.h"
|
||||||
#include "nsIWindowWatcher.h"
|
#include "nsIWindowWatcher.h"
|
||||||
#include "nsCommaSeparatedTokenizer.h"
|
#include "nsCommaSeparatedTokenizer.h"
|
||||||
|
#include "nsIConsoleService.h"
|
||||||
|
|
||||||
#define LOAD_STR "load"
|
#define LOAD_STR "load"
|
||||||
#define ERROR_STR "error"
|
#define ERROR_STR "error"
|
||||||
|
|
@ -1757,8 +1758,6 @@ nsXMLHttpRequest::Open(const nsACString& method, const nsACString& url,
|
||||||
PRBool async, const nsAString& user,
|
PRBool async, const nsAString& user,
|
||||||
const nsAString& password, PRUint8 optional_argc)
|
const nsAString& password, PRUint8 optional_argc)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
|
||||||
|
|
||||||
if (nsContentUtils::GetCurrentJSContext()) {
|
if (nsContentUtils::GetCurrentJSContext()) {
|
||||||
// We're (likely) called from JS
|
// We're (likely) called from JS
|
||||||
|
|
||||||
|
|
@ -2238,6 +2237,25 @@ nsXMLHttpRequest::Send(nsIVariant *aBody)
|
||||||
|
|
||||||
httpChannel->SetReferrer(codebase);
|
httpChannel->SetReferrer(codebase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some extensions override the http protocol handler and provide their own
|
||||||
|
// implementation. The channels returned from that implementation doesn't
|
||||||
|
// seem to always implement the nsIUploadChannel2 interface, presumably
|
||||||
|
// because it's a new interface.
|
||||||
|
// Eventually we should remove this and simply require that http channels
|
||||||
|
// implement the new interface.
|
||||||
|
// See bug 529041
|
||||||
|
nsCOMPtr<nsIUploadChannel2> uploadChannel2 =
|
||||||
|
do_QueryInterface(httpChannel);
|
||||||
|
if (!uploadChannel2) {
|
||||||
|
nsCOMPtr<nsIConsoleService> consoleService =
|
||||||
|
do_GetService(NS_CONSOLESERVICE_CONTRACTID);
|
||||||
|
if (consoleService) {
|
||||||
|
consoleService->LogStringMessage(NS_LITERAL_STRING(
|
||||||
|
"Http channel implementation doesn't support nsIUploadChannel2. An extension has supplied a non-functional http protocol handler. This will break behavior and in future releases not work at all."
|
||||||
|
).get());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mUploadTransferred = 0;
|
mUploadTransferred = 0;
|
||||||
|
|
@ -2379,9 +2397,6 @@ nsXMLHttpRequest::Send(nsIVariant *aBody)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (postDataStream) {
|
if (postDataStream) {
|
||||||
nsCOMPtr<nsIUploadChannel2> uploadChannel(do_QueryInterface(httpChannel));
|
|
||||||
NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel");
|
|
||||||
|
|
||||||
// If no content type header was set by the client, we set it to
|
// If no content type header was set by the client, we set it to
|
||||||
// application/xml.
|
// application/xml.
|
||||||
nsCAutoString contentType;
|
nsCAutoString contentType;
|
||||||
|
|
@ -2437,7 +2452,25 @@ nsXMLHttpRequest::Send(nsIVariant *aBody)
|
||||||
|
|
||||||
// We want to use a newer version of the upload channel that won't
|
// We want to use a newer version of the upload channel that won't
|
||||||
// ignore the necessary headers for an empty Content-Type.
|
// ignore the necessary headers for an empty Content-Type.
|
||||||
rv = uploadChannel->ExplicitSetUploadStream(postDataStream, contentType, -1, method, PR_FALSE);
|
nsCOMPtr<nsIUploadChannel2> uploadChannel2(do_QueryInterface(httpChannel));
|
||||||
|
// This assertion will fire if buggy extensions are installed
|
||||||
|
NS_ASSERTION(uploadChannel2, "http must support nsIUploadChannel");
|
||||||
|
if (uploadChannel2) {
|
||||||
|
uploadChannel2->ExplicitSetUploadStream(postDataStream, contentType,
|
||||||
|
-1, method, PR_FALSE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// http channel doesn't support the new nsIUploadChannel2. Emulate
|
||||||
|
// as best we can using nsIUploadChannel
|
||||||
|
if (contentType.IsEmpty()) {
|
||||||
|
contentType.AssignLiteral("application/octet-stream");
|
||||||
|
}
|
||||||
|
nsCOMPtr<nsIUploadChannel> uploadChannel =
|
||||||
|
do_QueryInterface(httpChannel);
|
||||||
|
uploadChannel->SetUploadStream(postDataStream, contentType, -1);
|
||||||
|
// Reset the method to its original value
|
||||||
|
httpChannel->SetRequestMethod(method);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -262,6 +262,7 @@ _TEST_FILES = test_bug5141.html \
|
||||||
bug461735-redirect1.sjs \
|
bug461735-redirect1.sjs \
|
||||||
bug461735-redirect2.sjs \
|
bug461735-redirect2.sjs \
|
||||||
bug461735-post-redirect.js \
|
bug461735-post-redirect.js \
|
||||||
|
test_bug513194.html \
|
||||||
test_bug461735.html \
|
test_bug461735.html \
|
||||||
test_bug380418.html \
|
test_bug380418.html \
|
||||||
test_bug465767.html \
|
test_bug465767.html \
|
||||||
|
|
@ -337,5 +338,9 @@ _TEST_FILES = test_bug5141.html \
|
||||||
# test_bug444546.html \
|
# test_bug444546.html \
|
||||||
# bug444546.sjs \
|
# bug444546.sjs \
|
||||||
|
|
||||||
|
# Disabled due to making the harness time out
|
||||||
|
# test_bug503473.html \
|
||||||
|
# file_bug503473-frame.sjs \
|
||||||
|
|
||||||
libs:: $(_TEST_FILES)
|
libs:: $(_TEST_FILES)
|
||||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
|
|
||||||
23
content/base/test/file_bug503473-frame.sjs
Normal file
23
content/base/test/file_bug503473-frame.sjs
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
function handleRequest(request, response) {
|
||||||
|
response.processAsync();
|
||||||
|
response.setStatusLine(request.httpVersion, 200, "OK");
|
||||||
|
response.setHeader("Content-Type", "text/html; charset=utf-8", false);
|
||||||
|
response.setHeader("Cache-Control", "no-cache", false);
|
||||||
|
|
||||||
|
response.write(
|
||||||
|
'<!DOCTYPE html>' +
|
||||||
|
'<div></div>' +
|
||||||
|
'<script>' +
|
||||||
|
'function doWrite() {' +
|
||||||
|
' document.write("<p></p>");' +
|
||||||
|
' parent.done();' +
|
||||||
|
' document.close();' +
|
||||||
|
'}' +
|
||||||
|
'setTimeout(doWrite, 1);' +
|
||||||
|
'</script>'
|
||||||
|
);
|
||||||
|
|
||||||
|
response.bodyOutputStream.flush();
|
||||||
|
// leave the stream open
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -4,6 +4,13 @@
|
||||||
<!-- Async script that isn't preloaded -->
|
<!-- Async script that isn't preloaded -->
|
||||||
<script async src="file_bug503481.sjs?blockOn=R&body=runFirst();"></script>
|
<script async src="file_bug503481.sjs?blockOn=R&body=runFirst();"></script>
|
||||||
<script>
|
<script>
|
||||||
|
function enableLogs(b) {
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||||
|
.getService(Components.interfaces.nsIPrefBranch);
|
||||||
|
prefs.setBoolPref("content.scriptloader.logloads", b);
|
||||||
|
}
|
||||||
|
enableLogs(true);
|
||||||
firstRan = false;
|
firstRan = false;
|
||||||
secondRan = false;
|
secondRan = false;
|
||||||
thirdRan = false;
|
thirdRan = false;
|
||||||
|
|
@ -37,6 +44,7 @@ function done() {
|
||||||
parent.is(forthRan, true, "forth should have run by onload");
|
parent.is(forthRan, true, "forth should have run by onload");
|
||||||
parent.is(fifthRan, true, "fifth should have run by onload");
|
parent.is(fifthRan, true, "fifth should have run by onload");
|
||||||
parent.is(sixthRan, true, "sixth should have run by onload");
|
parent.is(sixthRan, true, "sixth should have run by onload");
|
||||||
|
enableLogs(false);
|
||||||
parent.SimpleTest.finish();
|
parent.SimpleTest.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
46
content/base/test/test_bug503473.html
Normal file
46
content/base/test/test_bug503473.html
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<!--
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=503473
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<title>Test for Bug 503473</title>
|
||||||
|
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||||
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=503473">Mozilla Bug 503473</a>
|
||||||
|
<p id="display"></p>
|
||||||
|
<pre id="test">
|
||||||
|
<script class="testbody" type="text/javascript">
|
||||||
|
|
||||||
|
/** Test for Bug 503473 **/
|
||||||
|
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||||
|
.getService(Components.interfaces.nsIPrefBranch);
|
||||||
|
var gOriginalHtml5Pref = prefs.getBoolPref("html5.enable");
|
||||||
|
prefs.setBoolPref("html5.enable", true);
|
||||||
|
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
|
||||||
|
function done() {
|
||||||
|
var iframe = document.getElementById("iframe");
|
||||||
|
var divs = iframe.contentWindow.document.getElementsByTagName("div").length;
|
||||||
|
is(divs, 0, "Div wasn't blown away.")
|
||||||
|
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
prefs.setBoolPref("html5.enable", gOriginalHtml5Pref);
|
||||||
|
|
||||||
|
SimpleTest.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</pre>
|
||||||
|
<div id="content" style="display: none">
|
||||||
|
<iframe id='iframe' src="file_bug503473-frame.sjs">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
72
content/base/test/test_bug513194.html
Normal file
72
content/base/test/test_bug513194.html
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<!--
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=513194
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<title>Test for Bug 513194</title>
|
||||||
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||||
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<pre id="test">
|
||||||
|
<script class="testbody" type="text/javascript">
|
||||||
|
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||||
|
|
||||||
|
const Cc = Components.classes;
|
||||||
|
const Ci = Components.interfaces;
|
||||||
|
const Cr = Components.results;
|
||||||
|
|
||||||
|
var consoleService =
|
||||||
|
Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService);
|
||||||
|
|
||||||
|
var consoleListener = {
|
||||||
|
seenError: false,
|
||||||
|
|
||||||
|
observe: function(message) {
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||||
|
|
||||||
|
if (this.seenError) {
|
||||||
|
ok(false, "Seen too many errors!");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.seenError = true;
|
||||||
|
|
||||||
|
ok(message.message.indexOf("Unknown property") > -1,
|
||||||
|
"Wrong message");
|
||||||
|
},
|
||||||
|
|
||||||
|
finish: function() {
|
||||||
|
ok(this.seenError , "Didn't get message.");
|
||||||
|
SimpleTest.finish();
|
||||||
|
},
|
||||||
|
|
||||||
|
QueryInterface: function(iid) {
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||||
|
if (iid.equals(Ci.nsIConsoleListener) ||
|
||||||
|
iid.equals(Ci.nsISupports)) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
throw Cr.NS_NOINTERFACE;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
consoleService.reset();
|
||||||
|
consoleService.registerListener(consoleListener);
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
|
||||||
|
document.write("<style>qux { foo: bar; }<\/style>");
|
||||||
|
|
||||||
|
function done() {
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||||
|
consoleListener.finish();
|
||||||
|
consoleService.unregisterListener(consoleListener);
|
||||||
|
}
|
||||||
|
setTimeout(done, 1);
|
||||||
|
</script>
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
@ -27,6 +27,10 @@ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
|
||||||
// Write a test file > 8192 characters
|
// Write a test file > 8192 characters
|
||||||
|
|
||||||
|
is(FileReader.EMPTY, 0, "correct EMPTY value");
|
||||||
|
is(FileReader.LOADING, 1, "correct LOADING value");
|
||||||
|
is(FileReader.DONE, 2, "correct DONE value");
|
||||||
|
|
||||||
var testData = "asdfblahqwer";
|
var testData = "asdfblahqwer";
|
||||||
for (var i = 0; i < 10; i++) {
|
for (var i = 0; i < 10; i++) {
|
||||||
testData = testData + testData;
|
testData = testData + testData;
|
||||||
|
|
@ -62,8 +66,10 @@ var domFileBinary2 = utf16File.getAsBinary();
|
||||||
var domFileBinary3 = utf32File.getAsBinary();
|
var domFileBinary3 = utf32File.getAsBinary();
|
||||||
|
|
||||||
var request1 = new FileReader();
|
var request1 = new FileReader();
|
||||||
|
is(request1.readyState, FileReader.EMPTY, "correct initial readyState");
|
||||||
request1.onload = handleTextISO1;
|
request1.onload = handleTextISO1;
|
||||||
request1.readAsText(file, "iso-8859-1");
|
request1.readAsText(file, "iso-8859-1");
|
||||||
|
is(request1.readyState, FileReader.LOADING, "correct loading readyState");
|
||||||
|
|
||||||
var request2 = new FileReader();
|
var request2 = new FileReader();
|
||||||
request2.onload = handleTextUTF8;
|
request2.onload = handleTextUTF8;
|
||||||
|
|
@ -89,8 +95,10 @@ request6.readAsText(utf32File, "UTF-32");
|
||||||
|
|
||||||
//Test binary data accessor
|
//Test binary data accessor
|
||||||
var request7 = new FileReader();
|
var request7 = new FileReader();
|
||||||
|
is(request7.readyState, FileReader.EMPTY, "correct initial readyState");
|
||||||
request7.onload = handleDataBinary;
|
request7.onload = handleDataBinary;
|
||||||
request7.readAsBinaryString(file);
|
request7.readAsBinaryString(file);
|
||||||
|
is(request7.readyState, FileReader.LOADING, "correct loading readyState");
|
||||||
|
|
||||||
var request71 = new FileReader();
|
var request71 = new FileReader();
|
||||||
request71.onload = handleDataBinary16;
|
request71.onload = handleDataBinary16;
|
||||||
|
|
@ -172,6 +180,7 @@ function handleCancel(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleTextISO1(event) {
|
function handleTextISO1(event) {
|
||||||
|
is(event.target.readyState, FileReader.DONE, "correct final readyState");
|
||||||
var fileAsText = event.target.result;
|
var fileAsText = event.target.result;
|
||||||
var error = event.target.error;
|
var error = event.target.error;
|
||||||
is(error, null, "error code set to null for successful data accesses");
|
is(error, null, "error code set to null for successful data accesses");
|
||||||
|
|
@ -232,6 +241,7 @@ function handleDataURI2(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDataBinary(event) {
|
function handleDataBinary(event) {
|
||||||
|
is(event.target.readyState, FileReader.DONE, "correct final readyState");
|
||||||
var fileAsBinary = event.target.result;
|
var fileAsBinary = event.target.result;
|
||||||
is(domFileBinary.length, fileAsBinary.length, "binary data async length should match dom file binary");
|
is(domFileBinary.length, fileAsBinary.length, "binary data async length should match dom file binary");
|
||||||
is(domFileBinary, fileAsBinary, "binary data async string result should match dom file binary");
|
is(domFileBinary, fileAsBinary, "binary data async string result should match dom file binary");
|
||||||
|
|
|
||||||
|
|
@ -298,54 +298,6 @@ WebGLContext::GetCanvas(nsIDOMHTMLCanvasElement **aCanvas)
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* readonly attribute nsIWebGLBuffer currentArrayBufferBinding; */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetCurrentArrayBufferBinding(nsIWebGLBuffer **aCurrentArrayBufferBinding)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* readonly attribute nsIWebGLBuffer currentElementArrayBufferBinding; */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetCurrentElementArrayBufferBinding(nsIWebGLBuffer **aCurrentElementArrayBufferBinding)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* readonly attribute nsIWebGLFramebuffer currentFramebufferBinding; */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetCurrentFramebufferBinding(nsIWebGLFramebuffer **aCurrentFramebufferBinding)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* readonly attribute nsIWebGLRenderbuffer currentRenderbufferBinding; */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetCurrentRenderbufferBinding(nsIWebGLRenderbuffer **aCurrentRenderbufferBinding)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* readonly attribute nsIWebGLTexture currentTextureBinding2D; */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetCurrentTextureBinding2D(nsIWebGLTexture **aCurrentTextureBinding2D)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* readonly attribute nsIWebGLTexture currentTextureBindingCubeMap; */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetCurrentTextureBindingCubeMap(nsIWebGLTexture **aCurrentTextureBindingCubeMap)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* readonly attribute nsIWebGLProgram currentProgram; */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetCurrentProgram(nsIWebGLProgram **aCurrentProgram)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* void present (); */
|
/* void present (); */
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
@ -1509,6 +1461,34 @@ WebGLContext::GetBufferParameteri(GLenum target, GLenum pname, GLint *retval)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
WebGLContext::GetBufferParameter(GLenum target, GLenum pname)
|
||||||
|
{
|
||||||
|
NativeJSContext js;
|
||||||
|
if (NS_FAILED(js.error))
|
||||||
|
return js.error;
|
||||||
|
|
||||||
|
MakeContextCurrent();
|
||||||
|
|
||||||
|
switch (pname) {
|
||||||
|
case LOCAL_GL_BUFFER_SIZE:
|
||||||
|
case LOCAL_GL_BUFFER_USAGE:
|
||||||
|
case LOCAL_GL_BUFFER_ACCESS:
|
||||||
|
case LOCAL_GL_BUFFER_MAPPED:
|
||||||
|
{
|
||||||
|
PRInt32 iv = 0;
|
||||||
|
gl->fGetBufferParameteriv(target, pname, (GLint*) &iv);
|
||||||
|
js.SetRetVal(iv);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetFramebufferAttachmentParameteri(GLenum target, GLenum attachment, GLenum pname, GLint *retval)
|
WebGLContext::GetFramebufferAttachmentParameteri(GLenum target, GLenum attachment, GLenum pname, GLint *retval)
|
||||||
{
|
{
|
||||||
|
|
@ -1546,6 +1526,43 @@ WebGLContext::GetFramebufferAttachmentParameteri(GLenum target, GLenum attachmen
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
WebGLContext::GetFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname)
|
||||||
|
{
|
||||||
|
NativeJSContext js;
|
||||||
|
if (NS_FAILED(js.error))
|
||||||
|
return js.error;
|
||||||
|
|
||||||
|
MakeContextCurrent();
|
||||||
|
|
||||||
|
switch (attachment) {
|
||||||
|
case LOCAL_GL_COLOR_ATTACHMENT0:
|
||||||
|
case LOCAL_GL_DEPTH_ATTACHMENT:
|
||||||
|
case LOCAL_GL_STENCIL_ATTACHMENT:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (pname) {
|
||||||
|
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
|
||||||
|
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
|
||||||
|
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
|
||||||
|
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
|
||||||
|
{
|
||||||
|
PRInt32 iv = 0;
|
||||||
|
gl->fGetFramebufferAttachmentParameteriv(target, attachment, pname, (GLint*) &iv);
|
||||||
|
js.SetRetVal(iv);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetRenderbufferParameteri(GLenum target, GLenum pname, GLint *retval)
|
WebGLContext::GetRenderbufferParameteri(GLenum target, GLenum pname, GLint *retval)
|
||||||
{
|
{
|
||||||
|
|
@ -1579,6 +1596,39 @@ WebGLContext::GetRenderbufferParameteri(GLenum target, GLenum pname, GLint *retv
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
WebGLContext::GetRenderbufferParameter(GLenum target, GLenum pname)
|
||||||
|
{
|
||||||
|
NativeJSContext js;
|
||||||
|
if (NS_FAILED(js.error))
|
||||||
|
return js.error;
|
||||||
|
|
||||||
|
MakeContextCurrent();
|
||||||
|
|
||||||
|
switch (pname) {
|
||||||
|
case LOCAL_GL_RENDERBUFFER_WIDTH:
|
||||||
|
case LOCAL_GL_RENDERBUFFER_HEIGHT:
|
||||||
|
case LOCAL_GL_RENDERBUFFER_INTERNAL_FORMAT:
|
||||||
|
case LOCAL_GL_RENDERBUFFER_RED_SIZE:
|
||||||
|
case LOCAL_GL_RENDERBUFFER_GREEN_SIZE:
|
||||||
|
case LOCAL_GL_RENDERBUFFER_BLUE_SIZE:
|
||||||
|
case LOCAL_GL_RENDERBUFFER_ALPHA_SIZE:
|
||||||
|
case LOCAL_GL_RENDERBUFFER_DEPTH_SIZE:
|
||||||
|
case LOCAL_GL_RENDERBUFFER_STENCIL_SIZE:
|
||||||
|
{
|
||||||
|
PRInt32 iv = 0;
|
||||||
|
gl->fGetRenderbufferParameteriv(target, pname, (GLint*) &iv);
|
||||||
|
js.SetRetVal(iv);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::CreateBuffer(nsIWebGLBuffer **retval)
|
WebGLContext::CreateBuffer(nsIWebGLBuffer **retval)
|
||||||
{
|
{
|
||||||
|
|
@ -1664,6 +1714,45 @@ WebGLContext::GetProgrami(nsIWebGLProgram *prog, PRUint32 pname, GLint *retval)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
WebGLContext::GetProgramParameter(nsIWebGLProgram *prog, PRUint32 pname)
|
||||||
|
{
|
||||||
|
if (!prog || static_cast<WebGLProgram*>(prog)->Deleted())
|
||||||
|
return ErrorMessage("%s: program is null or deleted!", __FUNCTION__);
|
||||||
|
|
||||||
|
GLuint program = static_cast<WebGLProgram*>(prog)->GLName();
|
||||||
|
|
||||||
|
NativeJSContext js;
|
||||||
|
if (NS_FAILED(js.error))
|
||||||
|
return js.error;
|
||||||
|
|
||||||
|
MakeContextCurrent();
|
||||||
|
|
||||||
|
switch (pname) {
|
||||||
|
case LOCAL_GL_CURRENT_PROGRAM:
|
||||||
|
case LOCAL_GL_DELETE_STATUS:
|
||||||
|
case LOCAL_GL_LINK_STATUS:
|
||||||
|
case LOCAL_GL_VALIDATE_STATUS:
|
||||||
|
case LOCAL_GL_ATTACHED_SHADERS:
|
||||||
|
case LOCAL_GL_INFO_LOG_LENGTH:
|
||||||
|
case LOCAL_GL_ACTIVE_UNIFORMS:
|
||||||
|
case LOCAL_GL_ACTIVE_UNIFORM_MAX_LENGTH:
|
||||||
|
case LOCAL_GL_ACTIVE_ATTRIBUTES:
|
||||||
|
case LOCAL_GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
|
||||||
|
{
|
||||||
|
PRInt32 iv = 0;
|
||||||
|
gl->fGetProgramiv(program, pname, (GLint*) &iv);
|
||||||
|
js.SetRetVal(iv);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetProgramInfoLog(nsIWebGLProgram *prog, nsAString& retval)
|
WebGLContext::GetProgramInfoLog(nsIWebGLProgram *prog, nsAString& retval)
|
||||||
{
|
{
|
||||||
|
|
@ -1863,35 +1952,6 @@ WebGLContext::GetTexParameterf(GLenum target, GLenum pname, GLfloat *retval)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nsICanvasArray getTexParameterfv (in GLenum target, in GLenum pname); */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetTexParameterfv(GLenum target, GLenum pname, nsICanvasArray **retval)
|
|
||||||
{
|
|
||||||
NativeJSContext js;
|
|
||||||
if (NS_FAILED(js.error))
|
|
||||||
return js.error;
|
|
||||||
|
|
||||||
MakeContextCurrent();
|
|
||||||
|
|
||||||
switch (pname) {
|
|
||||||
case LOCAL_GL_TEXTURE_MIN_FILTER:
|
|
||||||
case LOCAL_GL_TEXTURE_MAG_FILTER:
|
|
||||||
case LOCAL_GL_TEXTURE_WRAP_S:
|
|
||||||
case LOCAL_GL_TEXTURE_WRAP_T:
|
|
||||||
{
|
|
||||||
float fv = 0;
|
|
||||||
gl->fGetTexParameterfv(target, pname, (GLfloat*) &fv);
|
|
||||||
js.SetRetVal(&fv, 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetTexParameteri(GLenum target, GLenum pname, GLint *retval)
|
WebGLContext::GetTexParameteri(GLenum target, GLenum pname, GLint *retval)
|
||||||
{
|
{
|
||||||
|
|
@ -1920,9 +1980,8 @@ WebGLContext::GetTexParameteri(GLenum target, GLenum pname, GLint *retval)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nsICanvasArray getTexParameteriv (in GLenum target, in GLenum pname); */
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetTexParameteriv(GLenum target, GLenum pname, nsICanvasArray **retval)
|
WebGLContext::GetTexParameter(GLenum target, GLenum pname)
|
||||||
{
|
{
|
||||||
NativeJSContext js;
|
NativeJSContext js;
|
||||||
if (NS_FAILED(js.error))
|
if (NS_FAILED(js.error))
|
||||||
|
|
@ -1936,9 +1995,9 @@ WebGLContext::GetTexParameteriv(GLenum target, GLenum pname, nsICanvasArray **re
|
||||||
case LOCAL_GL_TEXTURE_WRAP_S:
|
case LOCAL_GL_TEXTURE_WRAP_S:
|
||||||
case LOCAL_GL_TEXTURE_WRAP_T:
|
case LOCAL_GL_TEXTURE_WRAP_T:
|
||||||
{
|
{
|
||||||
PRInt32 iv = 0;
|
float fv = 0;
|
||||||
gl->fGetTexParameteriv(target, pname, (GLint*) &iv);
|
gl->fGetTexParameterfv(target, pname, (GLfloat*) &fv);
|
||||||
js.SetRetVal(&iv, 1);
|
js.SetRetVal(fv);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1950,8 +2009,9 @@ WebGLContext::GetTexParameteriv(GLenum target, GLenum pname, nsICanvasArray **re
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX fix */
|
/* XXX fix */
|
||||||
|
/* any getUniform(in WebGLProgram program, in WebGLUniformLocation location) raises(DOMException); */
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetUniformf(nsIWebGLProgram *prog, GLint location, GLfloat *retval)
|
WebGLContext::GetUniform(nsIWebGLProgram *prog, GLint location)
|
||||||
{
|
{
|
||||||
if (!prog || static_cast<WebGLProgram*>(prog)->Deleted())
|
if (!prog || static_cast<WebGLProgram*>(prog)->Deleted())
|
||||||
return ErrorMessage("%s: program is null or deleted!", __FUNCTION__);
|
return ErrorMessage("%s: program is null or deleted!", __FUNCTION__);
|
||||||
|
|
@ -1998,25 +2058,6 @@ WebGLContext::GetUniformf(nsIWebGLProgram *prog, GLint location, GLfloat *retval
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
/* nsICanvasArray getUniformfv (in nsIWebGLProgram program, in GLint location); */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetUniformfv(nsIWebGLProgram *program, GLint location, nsICanvasArray **retval)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
/* GLint getUniformi (in nsIWebGLProgram program, in GLint location); */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetUniformi(nsIWebGLProgram *program, GLint location, GLint *retval)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* nsICanvasArray getUniformiv (in nsIWebGLProgram program, in GLint location); */
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetUniformiv(nsIWebGLProgram *program, GLint location, nsICanvasArray **retval)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetUniformLocation(nsIWebGLProgram *prog, const nsAString& name, GLint *retval)
|
WebGLContext::GetUniformLocation(nsIWebGLProgram *prog, const nsAString& name, GLint *retval)
|
||||||
|
|
@ -2032,55 +2073,7 @@ WebGLContext::GetUniformLocation(nsIWebGLProgram *prog, const nsAString& name, G
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetVertexAttribf(GLuint index, GLenum pname, GLfloat *retval)
|
WebGLContext::GetVertexAttrib(GLuint index, GLenum pname)
|
||||||
{
|
|
||||||
NativeJSContext js;
|
|
||||||
if (NS_FAILED(js.error))
|
|
||||||
return js.error;
|
|
||||||
|
|
||||||
MakeContextCurrent();
|
|
||||||
|
|
||||||
switch (pname) {
|
|
||||||
// int
|
|
||||||
case LOCAL_GL_VERTEX_ATTRIB_ARRAY_SIZE:
|
|
||||||
case LOCAL_GL_VERTEX_ATTRIB_ARRAY_STRIDE:
|
|
||||||
case LOCAL_GL_VERTEX_ATTRIB_ARRAY_TYPE:
|
|
||||||
case LOCAL_GL_VERTEX_ATTRIB_ARRAY_ENABLED:
|
|
||||||
case LOCAL_GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:
|
|
||||||
case LOCAL_GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
|
|
||||||
{
|
|
||||||
PRInt32 iv = 0;
|
|
||||||
gl->fGetVertexAttribiv(index, pname, (GLint*) &iv);
|
|
||||||
*retval = (GLfloat) iv;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LOCAL_GL_CURRENT_VERTEX_ATTRIB:
|
|
||||||
{
|
|
||||||
GLfloat fv[4] = { 0 };
|
|
||||||
gl->fGetVertexAttribfv(index, LOCAL_GL_CURRENT_VERTEX_ATTRIB, &fv[0]);
|
|
||||||
js.SetRetVal(fv, 4);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
// not supported; doesn't make sense to return a pointer unless we have some kind of buffer object abstraction
|
|
||||||
case LOCAL_GL_VERTEX_ATTRIB_ARRAY_POINTER:
|
|
||||||
default:
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetVertexAttribfv(GLuint index, GLenum pname, nsICanvasArray **retval)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetVertexAttribi(GLuint index, GLenum pname, GLint *retval)
|
|
||||||
{
|
{
|
||||||
NativeJSContext js;
|
NativeJSContext js;
|
||||||
if (NS_FAILED(js.error))
|
if (NS_FAILED(js.error))
|
||||||
|
|
@ -2121,12 +2114,6 @@ WebGLContext::GetVertexAttribi(GLuint index, GLenum pname, GLint *retval)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
WebGLContext::GetVertexAttribiv(GLuint index, GLenum pname, nsICanvasArray **retval)
|
|
||||||
{
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* GLuint getVertexAttribOffset (in GLuint index, in GLenum pname); */
|
/* GLuint getVertexAttribOffset (in GLuint index, in GLenum pname); */
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetVertexAttribOffset(GLuint index, GLenum pname, GLuint *retval)
|
WebGLContext::GetVertexAttribOffset(GLuint index, GLenum pname, GLuint *retval)
|
||||||
|
|
@ -2744,11 +2731,38 @@ WebGLContext::GetShaderi(nsIWebGLShader *shobj, GLenum pname, GLint *_retval)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nsICanvasIntArray getShaderiv (in nsIWebGLShader shader, in GLenum pname); */
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetShaderiv(nsIWebGLShader *shader, GLenum pname, nsICanvasIntArray **retval)
|
WebGLContext::GetShaderParameter(nsIWebGLShader *shobj, GLenum pname)
|
||||||
{
|
{
|
||||||
|
if (!shobj || static_cast<WebGLShader*>(shobj)->Deleted())
|
||||||
|
return ErrorMessage("%s: shader is null or deleted!", __FUNCTION__);
|
||||||
|
|
||||||
|
GLuint shader = static_cast<WebGLShader*>(shobj)->GLName();
|
||||||
|
|
||||||
|
NativeJSContext js;
|
||||||
|
if (NS_FAILED(js.error))
|
||||||
|
return js.error;
|
||||||
|
|
||||||
|
MakeContextCurrent();
|
||||||
|
|
||||||
|
switch (pname) {
|
||||||
|
case LOCAL_GL_SHADER_TYPE:
|
||||||
|
case LOCAL_GL_DELETE_STATUS:
|
||||||
|
case LOCAL_GL_COMPILE_STATUS:
|
||||||
|
case LOCAL_GL_INFO_LOG_LENGTH:
|
||||||
|
case LOCAL_GL_SHADER_SOURCE_LENGTH:
|
||||||
|
{
|
||||||
|
PRInt32 iv = 0;
|
||||||
|
gl->fGetShaderiv(shader, pname, (GLint*) &iv);
|
||||||
|
js.SetRetVal(iv);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
@ -2960,9 +2974,7 @@ WebGLContext::TexSubImage2D()
|
||||||
&argTarget, &argLevel, &argX, &argY,
|
&argTarget, &argLevel, &argX, &argY,
|
||||||
&argWidth, &argHeight, &argFormat, &argType,
|
&argWidth, &argHeight, &argFormat, &argType,
|
||||||
&argPixelsObj) ||
|
&argPixelsObj) ||
|
||||||
!argPixelsObj ||
|
!argPixelsObj)
|
||||||
!::JS_IsArrayObject(js.ctx, argPixelsObj) ||
|
|
||||||
!::JS_GetArrayLength(js.ctx, argPixelsObj, &argPixelsLen))
|
|
||||||
{
|
{
|
||||||
return ErrorMessage("texSubImage2D: argument error");
|
return ErrorMessage("texSubImage2D: argument error");
|
||||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
return NS_ERROR_DOM_SYNTAX_ERR;
|
||||||
|
|
@ -3043,12 +3055,17 @@ WebGLContext::TexSubImage2D()
|
||||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
return NS_ERROR_DOM_SYNTAX_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleBuffer sbuffer(bufferType, bufferSize, js.ctx, argPixelsObj, argPixelsLen);
|
nsCOMPtr<nsICanvasArray> arrayObj;
|
||||||
if (!sbuffer.Valid())
|
nsresult rv;
|
||||||
return NS_ERROR_FAILURE;
|
rv = nsContentUtils::XPConnect()->WrapJS(js.ctx, argPixelsObj, NS_GET_IID(nsISupports), getter_AddRefs(arrayObj));
|
||||||
|
arrayObj = do_QueryInterface(arrayObj, &rv);
|
||||||
|
|
||||||
|
if (NS_FAILED(rv) || !arrayObj) {
|
||||||
|
return ErrorMessage("texSubImage2D: pixels arg is not a WebGL array");
|
||||||
|
}
|
||||||
|
|
||||||
MakeContextCurrent();
|
MakeContextCurrent();
|
||||||
gl->fTexSubImage2D (argTarget, argLevel, argX, argY, argWidth, argHeight, argFormat, argType, (void *) sbuffer.data);
|
gl->fTexSubImage2D (argTarget, argLevel, argX, argY, argWidth, argHeight, argFormat, argType, arrayObj->NativePointer());
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
@ -3115,9 +3132,7 @@ WebGLContext::TexImage2D()
|
||||||
&argTarget, &argLevel, &argInternalFormat, &argWidth,
|
&argTarget, &argLevel, &argInternalFormat, &argWidth,
|
||||||
&argHeight, &argBorder, &argFormat, &argType,
|
&argHeight, &argBorder, &argFormat, &argType,
|
||||||
&argPixelsObj) ||
|
&argPixelsObj) ||
|
||||||
!argPixelsObj ||
|
!argPixelsObj)
|
||||||
!::JS_IsArrayObject(js.ctx, argPixelsObj) ||
|
|
||||||
!::JS_GetArrayLength(js.ctx, argPixelsObj, &argPixelsLen))
|
|
||||||
{
|
{
|
||||||
return ErrorMessage("texImage2D: argument error");
|
return ErrorMessage("texImage2D: argument error");
|
||||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
return NS_ERROR_DOM_SYNTAX_ERR;
|
||||||
|
|
@ -3225,12 +3240,17 @@ WebGLContext::TexImage2D()
|
||||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
return NS_ERROR_DOM_SYNTAX_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleBuffer sbuffer(bufferType, bufferSize, js.ctx, argPixelsObj, argPixelsLen);
|
nsCOMPtr<nsICanvasArray> arrayObj;
|
||||||
if (!sbuffer.Valid())
|
nsresult rv;
|
||||||
return NS_ERROR_FAILURE;
|
rv = nsContentUtils::XPConnect()->WrapJS(js.ctx, argPixelsObj, NS_GET_IID(nsISupports), getter_AddRefs(arrayObj));
|
||||||
|
arrayObj = do_QueryInterface(arrayObj, &rv);
|
||||||
|
|
||||||
|
if (NS_FAILED(rv) || !arrayObj) {
|
||||||
|
return ErrorMessage("texImage2D: pixels arg is not a WebGL array");
|
||||||
|
}
|
||||||
|
|
||||||
MakeContextCurrent();
|
MakeContextCurrent();
|
||||||
gl->fTexImage2D (argTarget, argLevel, argInternalFormat, argWidth, argHeight, argBorder, argFormat, argType, (void *) sbuffer.data);
|
gl->fTexImage2D (argTarget, argLevel, argInternalFormat, argWidth, argHeight, argBorder, argFormat, argType, arrayObj->NativePointer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
||||||
|
|
@ -955,6 +955,10 @@ nsCanvasRenderingContext2D::InitializeWithSurface(nsIDocShell *docShell, gfxASur
|
||||||
|
|
||||||
mThebes->NewPath();
|
mThebes->NewPath();
|
||||||
|
|
||||||
|
// always force a redraw, because if the surface dimensions were reset
|
||||||
|
// then the surface became cleared, and we need to redraw everything.
|
||||||
|
Redraw();
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -374,8 +374,7 @@ nsDOMUIEvent::GetIsChar(PRBool* aIsChar)
|
||||||
|
|
||||||
NS_METHOD nsDOMUIEvent::GetCompositionReply(nsTextEventReply** aReply)
|
NS_METHOD nsDOMUIEvent::GetCompositionReply(nsTextEventReply** aReply)
|
||||||
{
|
{
|
||||||
if((mEvent->message == NS_COMPOSITION_START) ||
|
if((mEvent->message == NS_COMPOSITION_START))
|
||||||
(mEvent->message == NS_COMPOSITION_QUERY))
|
|
||||||
{
|
{
|
||||||
*aReply = &(static_cast<nsCompositionEvent*>(mEvent)->theReply);
|
*aReply = &(static_cast<nsCompositionEvent*>(mEvent)->theReply);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
||||||
|
|
@ -211,9 +211,7 @@ static const EventDispatchData sCompositionEvents[] = {
|
||||||
{ NS_COMPOSITION_START,
|
{ NS_COMPOSITION_START,
|
||||||
HANDLER(&nsIDOMCompositionListener::HandleStartComposition) },
|
HANDLER(&nsIDOMCompositionListener::HandleStartComposition) },
|
||||||
{ NS_COMPOSITION_END,
|
{ NS_COMPOSITION_END,
|
||||||
HANDLER(&nsIDOMCompositionListener::HandleEndComposition) },
|
HANDLER(&nsIDOMCompositionListener::HandleEndComposition) }
|
||||||
{ NS_COMPOSITION_QUERY,
|
|
||||||
HANDLER(&nsIDOMCompositionListener::HandleQueryComposition) }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EventDispatchData sTextEvents[] = {
|
static const EventDispatchData sTextEvents[] = {
|
||||||
|
|
|
||||||
|
|
@ -499,6 +499,9 @@ nsIMEStateManager::OnTextStateFocus(nsPresContext* aPresContext,
|
||||||
nsCOMPtr<nsIWidget> widget;
|
nsCOMPtr<nsIWidget> widget;
|
||||||
nsresult rv = vm->GetRootWidget(getter_AddRefs(widget));
|
nsresult rv = vm->GetRootWidget(getter_AddRefs(widget));
|
||||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_NOT_AVAILABLE);
|
NS_ENSURE_SUCCESS(rv, NS_ERROR_NOT_AVAILABLE);
|
||||||
|
if (!widget) {
|
||||||
|
return NS_OK; // Sometimes, there are no widgets.
|
||||||
|
}
|
||||||
|
|
||||||
rv = widget->OnIMEFocusChange(PR_TRUE);
|
rv = widget->OnIMEFocusChange(PR_TRUE);
|
||||||
if (rv == NS_ERROR_NOT_IMPLEMENTED)
|
if (rv == NS_ERROR_NOT_IMPLEMENTED)
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,6 @@ nsHTMLOptGroupElement::InsertChildAt(nsIContent* aKid,
|
||||||
nsresult
|
nsresult
|
||||||
nsHTMLOptGroupElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify, PRBool aMutationEvent)
|
nsHTMLOptGroupElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify, PRBool aMutationEvent)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(aMutationEvent, "Someone tried to inhibit mutation events on optgroup child removal.");
|
|
||||||
nsSafeOptionListMutation safeMutation(GetSelect(), this, nsnull, aIndex);
|
nsSafeOptionListMutation safeMutation(GetSelect(), this, nsnull, aIndex);
|
||||||
nsresult rv = nsGenericHTMLElement::RemoveChildAt(aIndex, aNotify, aMutationEvent);
|
nsresult rv = nsGenericHTMLElement::RemoveChildAt(aIndex, aNotify, aMutationEvent);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
|
|
||||||
|
|
@ -371,8 +371,16 @@ void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||||
if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) {
|
if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) {
|
||||||
// nowrap: enum
|
// nowrap: enum
|
||||||
if (aAttributes->GetAttr(nsGkAtoms::nowrap)) {
|
if (aAttributes->GetAttr(nsGkAtoms::nowrap)) {
|
||||||
|
// See if our width is not a nonzero integer width.
|
||||||
|
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
|
||||||
|
nsCompatibility mode = aData->mPresContext->CompatibilityMode();
|
||||||
|
if (!value || value->Type() != nsAttrValue::eInteger ||
|
||||||
|
value->GetIntegerValue() == 0 ||
|
||||||
|
eCompatibility_NavQuirks != mode) {
|
||||||
aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_NOWRAP, eCSSUnit_Enumerated);
|
aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_NOWRAP, eCSSUnit_Enumerated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TextReset)) {
|
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TextReset)) {
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue