Skip to content

Commit

Permalink
Back out babac1cc0741:ad287f78608a (bug 939049) for OS X build bustage
Browse files Browse the repository at this point in the history
CLOSED TREE
  • Loading branch information
philor committed Nov 19, 2013
1 parent 5159b57 commit bcebbd2
Show file tree
Hide file tree
Showing 42 changed files with 241 additions and 212 deletions.
30 changes: 17 additions & 13 deletions accessible/src/base/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,22 @@ LogDocShellState(nsIDocument* aDocumentNode)
printf("docshell busy: ");

nsAutoCString docShellBusy;
nsCOMPtr<nsIDocShell> docShell = aDocumentNode->GetDocShell();
uint32_t busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
docShell->GetBusyFlags(&busyFlags);
if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)
printf("'none'");
if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY)
printf("'busy'");
if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD)
printf(", 'before page load'");
if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)
printf(", 'page loading'");

nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
if (container) {
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
uint32_t busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
docShell->GetBusyFlags(&busyFlags);
if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)
printf("'none'");
if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY)
printf("'busy'");
if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD)
printf(", 'before page load'");
if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)
printf(", 'page loading'");
} else {
printf("[failed]");
}
}

static void
Expand All @@ -129,7 +132,8 @@ static void
LogDocShellTree(nsIDocument* aDocumentNode)
{
if (aDocumentNode->IsActive()) {
nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
treeItem->GetParent(getter_AddRefs(parentTreeItem));
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
Expand Down
3 changes: 2 additions & 1 deletion accessible/src/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
nsIPresShell* ps = aPresShell;
nsIDocument* documentNode = aPresShell->GetDocument();
if (documentNode) {
nsCOMPtr<nsIDocShellTreeItem> treeItem(documentNode->GetDocShell());
nsCOMPtr<nsISupports> container = documentNode->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
if (treeItem) {
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
Expand Down
14 changes: 10 additions & 4 deletions accessible/src/base/nsCoreUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,17 @@ nsCoreUtils::GetDocShellFor(nsINode *aNode)
if (!aNode)
return nullptr;

nsCOMPtr<nsIDocShell> docShell = aNode->OwnerDoc()->GetDocShell();
nsCOMPtr<nsISupports> container = aNode->OwnerDoc()->GetContainer();
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
return docShell.forget();
}

bool
nsCoreUtils::IsRootDocument(nsIDocument *aDocument)
{
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
do_QueryInterface(container);
NS_ASSERTION(docShellTreeItem, "No document shell for document!");

nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
Expand All @@ -413,7 +416,9 @@ nsCoreUtils::IsRootDocument(nsIDocument *aDocument)
bool
nsCoreUtils::IsContentDocument(nsIDocument *aDocument)
{
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
do_QueryInterface(container);
NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!");

int32_t contentType;
Expand All @@ -424,7 +429,8 @@ nsCoreUtils::IsContentDocument(nsIDocument *aDocument)
bool
nsCoreUtils::IsTabDocument(nsIDocument* aDocumentNode)
{
nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));

nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
treeItem->GetParent(getter_AddRefs(parentTreeItem));
Expand Down
10 changes: 7 additions & 3 deletions accessible/src/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,10 @@ Accessible::AccessKey() const
nsIDocument* document = mContent->GetCurrentDoc();
if (!document)
return KeyBinding();

nsCOMPtr<nsIDocShellTreeItem> treeItem(document->GetDocShell());
nsCOMPtr<nsISupports> container = document->GetContainer();
if (!container)
return KeyBinding();
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
if (!treeItem)
return KeyBinding();

Expand Down Expand Up @@ -1291,7 +1293,9 @@ Accessible::NativeAttributes()
nsCoreUtils::GetRoleContent(doc));

// Allow ARIA live region markup from outer documents to override
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
nsCOMPtr<nsISupports> container = doc->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
do_QueryInterface(container);
if (!docShellTreeItem)
break;

Expand Down
9 changes: 6 additions & 3 deletions accessible/src/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,8 @@ DocAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aRelativeFrame)
nsresult
DocAccessible::AddEventListeners()
{
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(mDocumentNode->GetDocShell());
nsCOMPtr<nsISupports> container = mDocumentNode->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));

// We want to add a command observer only if the document is content and has
// an editor.
Expand Down Expand Up @@ -720,7 +721,8 @@ DocAccessible::RemoveEventListeners()
if (mDocumentNode) {
mDocumentNode->RemoveObserver(this);

nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(mDocumentNode->GetDocShell());
nsCOMPtr<nsISupports> container = mDocumentNode->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
NS_ASSERTION(docShellTreeItem, "doc should support nsIDocShellTreeItem.");

if (docShellTreeItem) {
Expand Down Expand Up @@ -1985,7 +1987,8 @@ DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible)
bool
DocAccessible::IsLoadEventTarget() const
{
nsCOMPtr<nsIDocShellTreeItem> treeItem = mDocumentNode->GetDocShell();
nsCOMPtr<nsISupports> container = mDocumentNode->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(container);
NS_ASSERTION(treeItem, "No document shell for document!");

nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
Expand Down
22 changes: 9 additions & 13 deletions content/base/public/nsIDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "nsPropertyTable.h" // for member
#include "nsTHashtable.h" // for member
#include "mozilla/dom/DocumentBinding.h"
#include "mozilla/WeakPtr.h"
#include "Units.h"
#include "nsExpirationTracker.h"
#include "nsClassHashtable.h"
Expand All @@ -29,8 +28,6 @@ class imgIRequest;
class nsAString;
class nsBindingManager;
class nsCSSStyleSheet;
class nsIDocShell;
class nsDocShell;
class nsDOMNavigationTiming;
class nsDOMTouchList;
class nsEventStates;
Expand Down Expand Up @@ -1153,23 +1150,22 @@ class nsIDocument : public nsINode
* Set the container (docshell) for this document. Virtual so that
* docshell can call it.
*/
virtual void SetContainer(nsDocShell* aContainer);
virtual void SetContainer(nsISupports *aContainer);

/**
* Get the container (docshell) for this document.
*/
nsISupports* GetContainer() const;
already_AddRefed<nsISupports> GetContainer() const
{
nsCOMPtr<nsISupports> container = do_QueryReferent(mDocumentContainer);
return container.forget();
}

/**
* Get the container's load context for this document.
*/
nsILoadContext* GetLoadContext() const;

/**
* Get docshell the for this document.
*/
nsIDocShell* GetDocShell() const;

/**
* Set and get XML declaration. If aVersion is null there is no declaration.
* aStandalone takes values -1, 0 and 1 indicating respectively that there
Expand Down Expand Up @@ -1530,7 +1526,7 @@ class nsIDocument : public nsINode
void SetDisplayDocument(nsIDocument* aDisplayDocument)
{
NS_PRECONDITION(!GetShell() &&
!GetContainer() &&
!nsCOMPtr<nsISupports>(GetContainer()) &&
!GetWindow(),
"Shouldn't set mDisplayDocument on documents that already "
"have a presentation or a docshell or a window");
Expand Down Expand Up @@ -1700,7 +1696,7 @@ class nsIDocument : public nsINode
* @param aCloneContainer The container for the clone document.
*/
virtual already_AddRefed<nsIDocument>
CreateStaticClone(nsIDocShell* aCloneContainer);
CreateStaticClone(nsISupports* aCloneContainer);

/**
* If this document is a static clone, this returns the original
Expand Down Expand Up @@ -2231,7 +2227,7 @@ class nsIDocument : public nsINode

nsWeakPtr mDocumentLoadGroup;

mozilla::WeakPtr<nsDocShell> mDocumentContainer;
nsWeakPtr mDocumentContainer;

nsCString mCharacterSet;
int32_t mCharacterSetSource;
Expand Down
1 change: 0 additions & 1 deletion content/base/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ LOCAL_INCLUDES += [
'/content/xslt/src/xpath',
'/content/xul/content/src',
'/content/xul/document/src',
'/docshell/base',
'/dom/base',
'/dom/ipc',
'/dom/workers',
Expand Down
20 changes: 14 additions & 6 deletions content/base/src/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2622,7 +2622,10 @@ nsContentUtils::CanLoadImage(nsIURI* aURI, nsISupports* aContext,
uint32_t appType = nsIDocShell::APP_TYPE_UNKNOWN;

{
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aLoadingDocument->GetDocShell();
nsCOMPtr<nsISupports> container = aLoadingDocument->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
do_QueryInterface(container);

if (docShellTreeItem) {
nsCOMPtr<nsIDocShellTreeItem> root;
docShellTreeItem->GetRootTreeItem(getter_AddRefs(root));
Expand Down Expand Up @@ -3150,7 +3153,8 @@ nsContentUtils::IsChromeDoc(nsIDocument *aDocument)
bool
nsContentUtils::IsChildOfSameType(nsIDocument* aDoc)
{
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(aDoc->GetDocShell());
nsCOMPtr<nsISupports> container = aDoc->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(container));
nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
if (docShellAsItem) {
docShellAsItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
Expand Down Expand Up @@ -3231,7 +3235,8 @@ nsContentUtils::IsInChromeDocshell(nsIDocument *aDocument)
return IsInChromeDocshell(aDocument->GetDisplayDocument());
}

nsCOMPtr<nsIDocShellTreeItem> docShell(aDocument->GetDocShell());
nsCOMPtr<nsISupports> docContainer = aDocument->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShell(do_QueryInterface(docContainer));
int32_t itemType = nsIDocShellTreeItem::typeContent;
if (docShell) {
docShell->GetItemType(&itemType);
Expand Down Expand Up @@ -4971,7 +4976,8 @@ nsContentUtils::HidePopupsInDocument(nsIDocument* aDocument)
#ifdef MOZ_XUL
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
if (pm && aDocument) {
nsCOMPtr<nsIDocShellTreeItem> docShellToHide = aDocument->GetDocShell();
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellToHide = do_QueryInterface(container);
if (docShellToHide)
pm->HidePopupsInDocShell(docShellToHide);
}
Expand Down Expand Up @@ -5871,7 +5877,8 @@ nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent)
return false;
}

nsCOMPtr<nsIDocShell> docShell = subDoc->GetDocShell();
nsCOMPtr<nsISupports> container = subDoc->GetContainer();
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
if (!docShell) {
return false;
}
Expand Down Expand Up @@ -5981,7 +5988,8 @@ nsContentUtils::FindPresShellForDocument(const nsIDocument* aDoc)
return shell;
}

nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
nsCOMPtr<nsISupports> container = doc->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = do_QueryInterface(container);
while (docShellTreeItem) {
// We may be in a display:none subdocument, or we may not have a presshell
// created yet.
Expand Down
Loading

0 comments on commit bcebbd2

Please sign in to comment.