Back out f55504b0184f (bug 950427) for mochitest-4 and mochitest-oth bustage (at least)

CLOSED TREE
This commit is contained in:
Phil Ringnalda
2013-12-17 23:22:20 -08:00
parent 318e9198f5
commit 60097b7fbe
7 changed files with 37 additions and 37 deletions

View File

@@ -3131,20 +3131,6 @@ nsIDocument::ElementFromPoint(float aX, float aY)
return ElementFromPointHelper(aX, aY, false, true); return ElementFromPointHelper(aX, aY, false, true);
} }
static nsIContent*
GetNonanonymousContent(nsIFrame* aFrame)
{
for (nsIFrame* f = aFrame; f;
f = nsLayoutUtils::GetParentOrPlaceholderFor(f)) {
nsIContent* content = f->GetContent();
if (content && !content->IsInAnonymousSubtree()) {
return content;
}
}
return nullptr;
}
Element* Element*
nsDocument::ElementFromPointHelper(float aX, float aY, nsDocument::ElementFromPointHelper(float aX, float aY,
bool aIgnoreRootScrollFrame, bool aIgnoreRootScrollFrame,
@@ -3176,14 +3162,13 @@ nsDocument::ElementFromPointHelper(float aX, float aY,
} }
nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt, nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt,
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC | nsLayoutUtils::IGNORE_PAINT_SUPPRESSION |
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0)); (aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
if (!ptFrame) { if (!ptFrame) {
return nullptr; return nullptr;
} }
nsIContent* elem = GetNonanonymousContent(ptFrame); nsIContent* elem = GetContentInThisDocument(ptFrame);
NS_ASSERTION(!elem || elem->OwnerDoc() == this, "Wrong document");
if (elem && !elem->IsElement()) { if (elem && !elem->IsElement()) {
elem = elem->GetParent(); elem = elem->GetParent();
} }
@@ -3232,15 +3217,14 @@ nsDocument::NodesFromRectHelper(float aX, float aY,
nsAutoTArray<nsIFrame*,8> outFrames; nsAutoTArray<nsIFrame*,8> outFrames;
nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames, nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames,
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC | nsLayoutUtils::IGNORE_PAINT_SUPPRESSION |
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0)); (aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
// Used to filter out repeated elements in sequence. // Used to filter out repeated elements in sequence.
nsIContent* lastAdded = nullptr; nsIContent* lastAdded = nullptr;
for (uint32_t i = 0; i < outFrames.Length(); i++) { for (uint32_t i = 0; i < outFrames.Length(); i++) {
nsIContent* node = GetNonanonymousContent(outFrames[i]); nsIContent* node = GetContentInThisDocument(outFrames[i]);
NS_ASSERTION(!node || node->OwnerDoc() == this, "Wrong document");
if (node && !node->IsElement() && !node->IsNodeOfType(nsINode::eTEXT)) { if (node && !node->IsElement() && !node->IsNodeOfType(nsINode::eTEXT)) {
// We have a node that isn't an element or a text node, // We have a node that isn't an element or a text node,
@@ -8084,6 +8068,27 @@ nsDocument::DoUnblockOnload()
} }
} }
nsIContent*
nsDocument::GetContentInThisDocument(nsIFrame* aFrame) const
{
for (nsIFrame* f = aFrame; f;
f = nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(f)) {
nsIContent* content = f->GetContent();
if (!content || content->IsInAnonymousSubtree())
continue;
if (content->OwnerDoc() == this) {
return content;
}
// We must be in a subdocument so jump directly to the root frame.
// GetParentOrPlaceholderForCrossDoc gets called immediately to jump up to
// the containing document.
f = f->PresContext()->GetPresShell()->GetRootFrame();
}
return nullptr;
}
void void
nsDocument::DispatchPageTransition(EventTarget* aDispatchTarget, nsDocument::DispatchPageTransition(EventTarget* aDispatchTarget,
const nsAString& aType, const nsAString& aType,

View File

@@ -1310,6 +1310,16 @@ private:
mCSPWebConsoleErrorQueue.Flush(this); mCSPWebConsoleErrorQueue.Flush(this);
} }
/**
* Find the (non-anonymous) content in this document for aFrame. It will
* be aFrame's content node if that content is in this document and not
* anonymous. Otherwise, when aFrame is in a subdocument, we use the frame
* element containing the subdocument containing aFrame, and/or find the
* nearest non-anonymous ancestor in this document.
* Returns null if there is no such element.
*/
nsIContent* GetContentInThisDocument(nsIFrame* aFrame) const;
// Just like EnableStyleSheetsForSet, but doesn't check whether // Just like EnableStyleSheetsForSet, but doesn't check whether
// aSheetSet is null and allows the caller to control whether to set // aSheetSet is null and allows the caller to control whether to set
// aSheetSet as the preferred set in the CSSLoader. // aSheetSet as the preferred set in the CSSLoader.

View File

@@ -486,7 +486,6 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
mHadToIgnoreSuppression(false), mHadToIgnoreSuppression(false),
mIsAtRootOfPseudoStackingContext(false), mIsAtRootOfPseudoStackingContext(false),
mIncludeAllOutOfFlows(false), mIncludeAllOutOfFlows(false),
mDescendIntoSubdocuments(true),
mSelectedFramesOnly(false), mSelectedFramesOnly(false),
mAccurateVisibleRegions(false), mAccurateVisibleRegions(false),
mAllowMergingAndFlattening(true), mAllowMergingAndFlattening(true),

View File

@@ -283,11 +283,6 @@ public:
*/ */
void SetPaintingToWindow(bool aToWindow) { mIsPaintingToWindow = aToWindow; } void SetPaintingToWindow(bool aToWindow) { mIsPaintingToWindow = aToWindow; }
bool IsPaintingToWindow() const { return mIsPaintingToWindow; } bool IsPaintingToWindow() const { return mIsPaintingToWindow; }
/**
* Call this to prevent descending into subdocuments.
*/
void SetDescendIntoSubdocuments(bool aDescend) { mDescendIntoSubdocuments = aDescend; }
bool GetDescendIntoSubdocuments() { return mDescendIntoSubdocuments; }
/** /**
* Returns true if merging and flattening of display lists should be * Returns true if merging and flattening of display lists should be
@@ -652,7 +647,6 @@ private:
bool mHadToIgnoreSuppression; bool mHadToIgnoreSuppression;
bool mIsAtRootOfPseudoStackingContext; bool mIsAtRootOfPseudoStackingContext;
bool mIncludeAllOutOfFlows; bool mIncludeAllOutOfFlows;
bool mDescendIntoSubdocuments;
bool mSelectedFramesOnly; bool mSelectedFramesOnly;
bool mAccurateVisibleRegions; bool mAccurateVisibleRegions;
bool mAllowMergingAndFlattening; bool mAllowMergingAndFlattening;

View File

@@ -2090,9 +2090,6 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
builder.SetIgnoreScrollFrame(rootScrollFrame); builder.SetIgnoreScrollFrame(rootScrollFrame);
} }
} }
if (aFlags & IGNORE_CROSS_DOC) {
builder.SetDescendIntoSubdocuments(false);
}
builder.EnterPresShell(aFrame, target); builder.EnterPresShell(aFrame, target);
aFrame->BuildDisplayListForStackingContext(&builder, target, &list); aFrame->BuildDisplayListForStackingContext(&builder, target, &list);

View File

@@ -607,11 +607,7 @@ public:
* When set, clipping due to the root scroll frame (and any other viewport- * When set, clipping due to the root scroll frame (and any other viewport-
* related clipping) is ignored. * related clipping) is ignored.
*/ */
IGNORE_ROOT_SCROLL_FRAME = 0x02, IGNORE_ROOT_SCROLL_FRAME = 0x02
/**
* When set, return only content in the same document as aFrame.
*/
IGNORE_CROSS_DOC = 0x04
}; };
/** /**

View File

@@ -288,9 +288,8 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DisplayBorderBackgroundOutline(aBuilder, aLists); DisplayBorderBackgroundOutline(aBuilder, aLists);
} }
if (!mInnerView || !aBuilder->GetDescendIntoSubdocuments()) { if (!mInnerView)
return; return;
}
nsFrameLoader* frameLoader = FrameLoader(); nsFrameLoader* frameLoader = FrameLoader();
if (frameLoader) { if (frameLoader) {