mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 44c751cee3b1 (bug 837242) for suspicion of causing OSX Bustage CLOSED TREE
This commit is contained in:
parent
835b4ca022
commit
f9fb745d15
@ -3137,9 +3137,8 @@ nsDocument::ElementFromPointHelper(float aX, float aY,
|
||||
return nullptr; // return null to premature XUL callers as a reminder to wait
|
||||
}
|
||||
|
||||
nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt,
|
||||
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION |
|
||||
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
|
||||
nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt, true,
|
||||
aIgnoreRootScrollFrame);
|
||||
if (!ptFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -3193,8 +3192,7 @@ nsDocument::NodesFromRectHelper(float aX, float aY,
|
||||
|
||||
nsAutoTArray<nsIFrame*,8> outFrames;
|
||||
nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames,
|
||||
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION |
|
||||
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
|
||||
true, aIgnoreRootScrollFrame);
|
||||
|
||||
// Used to filter out repeated elements in sequence.
|
||||
nsIContent* lastAdded = nullptr;
|
||||
@ -9325,8 +9323,8 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt,
|
||||
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION);
|
||||
nsIFrame *ptFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, pt, true,
|
||||
false);
|
||||
if (!ptFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -249,10 +249,10 @@ FindFrameTargetedByInputEvent(const nsGUIEvent *aEvent,
|
||||
const nsPoint& aPointRelativeToRootFrame,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
uint32_t flags = (aFlags & INPUT_IGNORE_ROOT_SCROLL_FRAME) ?
|
||||
nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0;
|
||||
bool ignoreRootScrollFrame = (aFlags & INPUT_IGNORE_ROOT_SCROLL_FRAME) != 0;
|
||||
nsIFrame* target =
|
||||
nsLayoutUtils::GetFrameForPoint(aRootFrame, aPointRelativeToRootFrame, flags);
|
||||
nsLayoutUtils::GetFrameForPoint(aRootFrame, aPointRelativeToRootFrame,
|
||||
false, ignoreRootScrollFrame);
|
||||
|
||||
const EventRadiusPrefs* prefs = GetPrefsFor(aEvent->eventStructType);
|
||||
if (!prefs || !prefs->mEnabled || (target && IsElementClickable(target))) {
|
||||
@ -271,7 +271,7 @@ FindFrameTargetedByInputEvent(const nsGUIEvent *aEvent,
|
||||
nsRect targetRect = GetTargetRect(aRootFrame, aPointRelativeToRootFrame, prefs);
|
||||
nsAutoTArray<nsIFrame*,8> candidates;
|
||||
nsresult rv = nsLayoutUtils::GetFramesForArea(aRootFrame, targetRect, candidates,
|
||||
flags | nsLayoutUtils::EXCLUDE_COVERED_FRAMES);
|
||||
false, ignoreRootScrollFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
return target;
|
||||
}
|
||||
|
@ -1802,12 +1802,15 @@ nsLayoutUtils::GetRemoteContentIds(nsIFrame* aFrame,
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, uint32_t aFlags)
|
||||
nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt,
|
||||
bool aShouldIgnoreSuppression,
|
||||
bool aIgnoreRootScrollFrame)
|
||||
{
|
||||
PROFILER_LABEL("nsLayoutUtils", "GetFrameForPoint");
|
||||
nsresult rv;
|
||||
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);
|
||||
return outFrames.Length() ? outFrames.ElementAt(0) : nullptr;
|
||||
}
|
||||
@ -1815,19 +1818,20 @@ nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, uint32_t aFlags)
|
||||
nsresult
|
||||
nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
|
||||
nsTArray<nsIFrame*> &aOutFrames,
|
||||
uint32_t aFlags)
|
||||
bool aShouldIgnoreSuppression,
|
||||
bool aIgnoreRootScrollFrame)
|
||||
{
|
||||
PROFILER_LABEL("nsLayoutUtils","GetFramesForArea");
|
||||
nsDisplayListBuilder builder(aFrame, nsDisplayListBuilder::EVENT_DELIVERY,
|
||||
false);
|
||||
false);
|
||||
nsDisplayList list;
|
||||
nsRect target(aRect);
|
||||
|
||||
if (aFlags & IGNORE_PAINT_SUPPRESSION) {
|
||||
if (aShouldIgnoreSuppression) {
|
||||
builder.IgnorePaintSuppression();
|
||||
}
|
||||
|
||||
if (aFlags & IGNORE_ROOT_SCROLL_FRAME) {
|
||||
if (aIgnoreRootScrollFrame) {
|
||||
nsIFrame* rootScrollFrame =
|
||||
aFrame->PresContext()->PresShell()->GetRootScrollFrame();
|
||||
if (rootScrollFrame) {
|
||||
|
@ -526,28 +526,19 @@ public:
|
||||
nsTArray<ViewID> &aOutIDs,
|
||||
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
|
||||
* frame under the point aPt that receives a mouse event at that location,
|
||||
* or nullptr if there is no such frame.
|
||||
* @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,
|
||||
uint32_t aFlags = 0);
|
||||
bool aShouldIgnoreSuppression = false,
|
||||
bool aIgnoreRootScrollFrame = false);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @param aRect the rect, relative to the frame origin
|
||||
* @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,
|
||||
nsTArray<nsIFrame*> &aOutFrames,
|
||||
uint32_t aFlags = 0);
|
||||
bool aShouldIgnoreSuppression = false,
|
||||
bool aIgnoreRootScrollFrame = false);
|
||||
|
||||
/**
|
||||
* Transform aRect relative to aAncestor down to the coordinate system of
|
||||
|
Loading…
Reference in New Issue
Block a user