diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp index 16a946accd1..f8ca950621b 100644 --- a/accessible/src/html/nsHyperTextAccessible.cpp +++ b/accessible/src/html/nsHyperTextAccessible.cpp @@ -1310,7 +1310,8 @@ nsHyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY, if (pointInFrame.x < frameSize.width && pointInFrame.y < frameSize.height) { // Finished if (frame->GetType() == nsGkAtoms::textFrame) { - nsIFrame::ContentOffsets contentOffsets = frame->GetContentOffsetsFromPointExternal(pointInFrame, true); + nsIFrame::ContentOffsets contentOffsets = + frame->GetContentOffsetsFromPointExternal(pointInFrame, nsIFrame::IGNORE_SELECTION_STYLE); if (contentOffsets.IsNull() || contentOffsets.content != content) { return NS_OK; // Not found, will return -1 } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 1719bb0cbe5..ec32245fffd 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -3416,10 +3416,10 @@ static nsIFrame* AdjustFrameForSelectionStyles(nsIFrame* aFrame) { nsIFrame::ContentOffsets nsIFrame::GetContentOffsetsFromPoint(nsPoint aPoint, - bool aIgnoreSelectionStyle) + PRUint32 aFlags) { nsIFrame *adjustedFrame; - if (aIgnoreSelectionStyle) { + if (aFlags & IGNORE_SELECTION_STYLE) { adjustedFrame = this; } else { diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index ddacb711e8e..77516fdfa8a 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1289,6 +1289,11 @@ public: // to display on. bool associateWithNext; }; + enum { + IGNORE_SELECTION_STYLE = 0x01, + // Treat visibility:hidden frames as non-selectable + SKIP_HIDDEN = 0x02 + }; /** * This function calculates the content offsets for selection relative to * a point. Note that this should generally only be callled on the event @@ -1297,11 +1302,11 @@ public: * @param aPoint point relative to this frame */ ContentOffsets GetContentOffsetsFromPoint(nsPoint aPoint, - bool aIgnoreSelectionStyle = false); + PRUint32 aFlags = 0); virtual ContentOffsets GetContentOffsetsFromPointExternal(nsPoint aPoint, - bool aIgnoreSelectionStyle = false) - { return GetContentOffsetsFromPoint(aPoint, aIgnoreSelectionStyle); } + PRUint32 aFlags = 0) + { return GetContentOffsetsFromPoint(aPoint, aFlags); } /** * This structure holds information about a cursor. mContainer represents a