Backed out changeset 44c751cee3b1 (bug 837242) for suspicion of causing OSX Bustage CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2013-07-26 09:25:03 +02:00
Родитель 569ef7a7ef
Коммит 769cb44b6f
4 изменённых файлов: 31 добавлений и 34 удалений

Просмотреть файл

@ -3137,9 +3137,8 @@ nsDocument::ElementFromPointHelper(float aX, float aY,
return nullptr; // return null to premature XUL callers as a reminder to wait return nullptr; // return null to premature XUL callers as a reminder to wait
} }
nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt, nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt, true,
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | aIgnoreRootScrollFrame);
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
if (!ptFrame) { if (!ptFrame) {
return nullptr; return nullptr;
} }
@ -3193,8 +3192,7 @@ 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 | true, aIgnoreRootScrollFrame);
(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;
@ -9325,8 +9323,8 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY)
return nullptr; return nullptr;
} }
nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt, nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt, true,
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION); false);
if (!ptFrame) { if (!ptFrame) {
return nullptr; return nullptr;
} }

Просмотреть файл

@ -249,10 +249,10 @@ FindFrameTargetedByInputEvent(const nsGUIEvent *aEvent,
const nsPoint& aPointRelativeToRootFrame, const nsPoint& aPointRelativeToRootFrame,
uint32_t aFlags) uint32_t aFlags)
{ {
uint32_t flags = (aFlags & INPUT_IGNORE_ROOT_SCROLL_FRAME) ? bool ignoreRootScrollFrame = (aFlags & INPUT_IGNORE_ROOT_SCROLL_FRAME) != 0;
nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0;
nsIFrame* target = nsIFrame* target =
nsLayoutUtils::GetFrameForPoint(aRootFrame, aPointRelativeToRootFrame, flags); nsLayoutUtils::GetFrameForPoint(aRootFrame, aPointRelativeToRootFrame,
false, ignoreRootScrollFrame);
const EventRadiusPrefs* prefs = GetPrefsFor(aEvent->eventStructType); const EventRadiusPrefs* prefs = GetPrefsFor(aEvent->eventStructType);
if (!prefs || !prefs->mEnabled || (target && IsElementClickable(target))) { if (!prefs || !prefs->mEnabled || (target && IsElementClickable(target))) {
@ -271,7 +271,7 @@ FindFrameTargetedByInputEvent(const nsGUIEvent *aEvent,
nsRect targetRect = GetTargetRect(aRootFrame, aPointRelativeToRootFrame, prefs); nsRect targetRect = GetTargetRect(aRootFrame, aPointRelativeToRootFrame, prefs);
nsAutoTArray<nsIFrame*,8> candidates; nsAutoTArray<nsIFrame*,8> candidates;
nsresult rv = nsLayoutUtils::GetFramesForArea(aRootFrame, targetRect, candidates, nsresult rv = nsLayoutUtils::GetFramesForArea(aRootFrame, targetRect, candidates,
flags | nsLayoutUtils::EXCLUDE_COVERED_FRAMES); false, ignoreRootScrollFrame);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return target; return target;
} }

Просмотреть файл

@ -1802,12 +1802,15 @@ nsLayoutUtils::GetRemoteContentIds(nsIFrame* aFrame,
} }
nsIFrame* nsIFrame*
nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, uint32_t aFlags) nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt,
bool aShouldIgnoreSuppression,
bool aIgnoreRootScrollFrame)
{ {
PROFILER_LABEL("nsLayoutUtils", "GetFrameForPoint"); PROFILER_LABEL("nsLayoutUtils", "GetFrameForPoint");
nsresult rv; nsresult rv;
nsAutoTArray<nsIFrame*,8> outFrames; nsAutoTArray<nsIFrame*,8> outFrames;
rv = GetFramesForArea(aFrame, nsRect(aPt, nsSize(1, 1)), outFrames, aFlags); rv = GetFramesForArea(aFrame, nsRect(aPt, nsSize(1, 1)), outFrames,
aShouldIgnoreSuppression, aIgnoreRootScrollFrame);
NS_ENSURE_SUCCESS(rv, nullptr); NS_ENSURE_SUCCESS(rv, nullptr);
return outFrames.Length() ? outFrames.ElementAt(0) : nullptr; return outFrames.Length() ? outFrames.ElementAt(0) : nullptr;
} }
@ -1815,19 +1818,20 @@ nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, uint32_t aFlags)
nsresult nsresult
nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect, nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
nsTArray<nsIFrame*> &aOutFrames, nsTArray<nsIFrame*> &aOutFrames,
uint32_t aFlags) bool aShouldIgnoreSuppression,
bool aIgnoreRootScrollFrame)
{ {
PROFILER_LABEL("nsLayoutUtils","GetFramesForArea"); PROFILER_LABEL("nsLayoutUtils","GetFramesForArea");
nsDisplayListBuilder builder(aFrame, nsDisplayListBuilder::EVENT_DELIVERY, nsDisplayListBuilder builder(aFrame, nsDisplayListBuilder::EVENT_DELIVERY,
false); false);
nsDisplayList list; nsDisplayList list;
nsRect target(aRect); nsRect target(aRect);
if (aFlags & IGNORE_PAINT_SUPPRESSION) { if (aShouldIgnoreSuppression) {
builder.IgnorePaintSuppression(); builder.IgnorePaintSuppression();
} }
if (aFlags & IGNORE_ROOT_SCROLL_FRAME) { if (aIgnoreRootScrollFrame) {
nsIFrame* rootScrollFrame = nsIFrame* rootScrollFrame =
aFrame->PresContext()->PresShell()->GetRootScrollFrame(); aFrame->PresContext()->PresShell()->GetRootScrollFrame();
if (rootScrollFrame) { if (rootScrollFrame) {

Просмотреть файл

@ -526,28 +526,19 @@ public:
nsTArray<ViewID> &aOutIDs, nsTArray<ViewID> &aOutIDs,
bool aIgnoreRootScrollFrame); bool aIgnoreRootScrollFrame);
enum FrameForPointFlags {
/**
* When set, paint suppression is ignored, so we'll return non-root page
* elements even if paint suppression is stopping them from painting.
*/
IGNORE_PAINT_SUPPRESSION = 0x01,
/**
* When set, clipping due to the root scroll frame (and any other viewport-
* related clipping) is ignored.
*/
IGNORE_ROOT_SCROLL_FRAME = 0x02
};
/** /**
* Given aFrame, the root frame of a stacking context, find its descendant * Given aFrame, the root frame of a stacking context, find its descendant
* frame under the point aPt that receives a mouse event at that location, * frame under the point aPt that receives a mouse event at that location,
* or nullptr if there is no such frame. * or nullptr if there is no such frame.
* @param aPt the point, relative to the frame origin * @param aPt the point, relative to the frame origin
* @param aFlags some combination of FrameForPointFlags * @param aShouldIgnoreSuppression a boolean to control if the display
* list builder should ignore paint suppression or not
* @param aIgnoreRootScrollFrame whether or not the display list builder
* should ignore the root scroll frame.
*/ */
static nsIFrame* GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, static nsIFrame* GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt,
uint32_t aFlags = 0); bool aShouldIgnoreSuppression = false,
bool aIgnoreRootScrollFrame = false);
/** /**
* Given aFrame, the root frame of a stacking context, find all descendant * Given aFrame, the root frame of a stacking context, find all descendant
@ -555,11 +546,15 @@ public:
* or nullptr if there is no such frame. * or nullptr if there is no such frame.
* @param aRect the rect, relative to the frame origin * @param aRect the rect, relative to the frame origin
* @param aOutFrames an array to add all the frames found * @param aOutFrames an array to add all the frames found
* @param aFlags some combination of FrameForPointFlags * @param aShouldIgnoreSuppression a boolean to control if the display
* list builder should ignore paint suppression or not
* @param aIgnoreRootScrollFrame whether or not the display list builder
* should ignore the root scroll frame.
*/ */
static nsresult GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect, static nsresult GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
nsTArray<nsIFrame*> &aOutFrames, nsTArray<nsIFrame*> &aOutFrames,
uint32_t aFlags = 0); bool aShouldIgnoreSuppression = false,
bool aIgnoreRootScrollFrame = false);
/** /**
* Transform aRect relative to aAncestor down to the coordinate system of * Transform aRect relative to aAncestor down to the coordinate system of