Bug 451252 - "Highlight All" find selection not visible in elements that have -moz-user-select: none set; r+sr=roc

This commit is contained in:
Graeme McCutcheon 2008-09-07 16:12:50 +02:00
Родитель 51dca3fb4e
Коммит bc94c13609
16 изменённых файлов: 64 добавлений и 46 удалений

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

@ -111,14 +111,14 @@ nsFirstLetterFrame::SetInitialChildList(nsIAtom* aListName,
}
NS_IMETHODIMP
nsFirstLetterFrame::SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread)
nsFirstLetterFrame::SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread, SelectionType aType)
{
if (aSelected && ParentDisablesSelection())
return NS_OK;
nsIFrame *child = GetFirstChild(nsnull);
while (child)
{
child->SetSelected(aPresContext, aRange, aSelected, aSpread);
child->SetSelected(aPresContext, aRange, aSelected, aSpread, aType);
// don't worry about result. there are more frames to come
child = child->GetNextSibling();
}

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

@ -83,7 +83,7 @@ public:
virtual PRBool CanContinueTextRun() const;
NS_IMETHOD SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread);
NS_IMETHOD SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread, SelectionType aType);
//override of nsFrame method
NS_IMETHOD GetChildFrameContainingOffset(PRInt32 inContentOffset,

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

@ -4148,18 +4148,20 @@ nsFrame::VerifyTree() const
/*this method may.. invalidate if the state was changed or if aForceRedraw is PR_TRUE
it will not update immediately.*/
NS_IMETHODIMP
nsFrame::SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange, PRBool aSelected, nsSpread aSpread)
nsFrame::SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange, PRBool aSelected, nsSpread aSpread, SelectionType aType)
{
/*
if (aSelected && ParentDisablesSelection())
return NS_OK;
*/
// check whether style allows selection
PRBool selectable;
IsSelectable(&selectable, nsnull);
if (!selectable)
return NS_OK;
if (aType == nsISelectionController::SELECTION_NORMAL) {
// check whether style allows selection
PRBool selectable;
IsSelectable(&selectable, nsnull);
if (!selectable)
return NS_OK;
}
/*
if (eSpreadDown == aSpread){
@ -4186,7 +4188,7 @@ nsFrame::SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange, PRBool aS
GetFirstLeaf(aPresContext, &frame);
GetOffsets(start, end);
if (start && end) {
frame->SetSelected(aPresContext, aRange, aSelected, aSpread);
frame->SetSelected(aPresContext, aRange, aSelected, aSpread, aType);
}
}
#endif // IBMBIDI

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

@ -238,7 +238,7 @@ public:
NS_IMETHOD VerifyTree() const;
#endif
NS_IMETHOD SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread);
NS_IMETHOD SetSelected(nsPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread, SelectionType aType);
NS_IMETHOD GetSelected(PRBool *aSelected) const;
NS_IMETHOD IsSelectable(PRBool* aIsSelectable, PRUint8* aSelectStyle) const;

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

@ -1724,11 +1724,13 @@ public:
* @param aRange is the range that will dictate if the frames need to be redrawn null means the whole content needs to be redrawn
* @param aSelected is it selected?
* @param aSpread should it spread the selection to flow elements around it? or go down to its children?
* @param aType the selection type of the selection that you are setting on the frame
*/
NS_IMETHOD SetSelected(nsPresContext* aPresContext,
nsIDOMRange* aRange,
PRBool aSelected,
nsSpread aSpread) = 0;
nsSpread aSpread,
SelectionType aType) = 0;
NS_IMETHOD GetSelected(PRBool *aSelected) const = 0;

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

@ -5059,7 +5059,7 @@ nsTypedSelection::selectFrames(nsPresContext* aPresContext,
if (frame)
{
//NOTE: eSpreadDown is now IGNORED. Selected state is set only for given frame
frame->SetSelected(aPresContext, nsnull, aFlags, eSpreadDown);
frame->SetSelected(aPresContext, nsnull, aFlags, eSpreadDown, mType);
#ifndef OLD_TABLE_SELECTION
if (mFrameSelection->GetTableCellSelection())
{
@ -5084,7 +5084,7 @@ nsTypedSelection::selectFrames(nsPresContext* aPresContext,
//for given frame
//spread from here to hit all frames in flow
frame->SetSelected(aPresContext, nsnull,aFlags,eSpreadDown);
frame->SetSelected(aPresContext, nsnull, aFlags, eSpreadDown, mType);
nsRect frameRect = frame->GetRect();
//if a rect is 0 height/width then try to notify next
@ -5096,7 +5096,7 @@ nsTypedSelection::selectFrames(nsPresContext* aPresContext,
if (frame)
{
frameRect = frame->GetRect();
frame->SetSelected(aPresContext, nsnull,aFlags,eSpreadDown);
frame->SetSelected(aPresContext, nsnull, aFlags, eSpreadDown, mType);
}
else
break;
@ -5162,7 +5162,7 @@ nsTypedSelection::selectFrames(nsPresContext* aPresContext, nsIDOMRange *aRange,
{
frame = mFrameSelection->GetShell()->GetPrimaryFrameFor(content);
if (frame)
frame->SetSelected(aPresContext, aRange,aFlags,eSpreadDown);//spread from here to hit all frames in flow
frame->SetSelected(aPresContext, aRange, aFlags, eSpreadDown, mType);//spread from here to hit all frames in flow
}
//end start content
iter->First();
@ -5186,7 +5186,7 @@ nsTypedSelection::selectFrames(nsPresContext* aPresContext, nsIDOMRange *aRange,
{
frame = mFrameSelection->GetShell()->GetPrimaryFrameFor(content);
if (frame)
frame->SetSelected(aPresContext, aRange,aFlags,eSpreadDown);//spread from here to hit all frames in flow
frame->SetSelected(aPresContext, aRange, aFlags, eSpreadDown, mType);//spread from here to hit all frames in flow
}
}
//end end parent

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

@ -153,7 +153,8 @@ public:
NS_IMETHOD SetSelected(nsPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread);
nsSpread aSpread,
SelectionType aType);
virtual PRBool PeekOffsetNoAmount(PRBool aForward, PRInt32* aOffset);
virtual PRBool PeekOffsetCharacter(PRBool aForward, PRInt32* aOffset);

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

@ -4612,7 +4612,8 @@ NS_IMETHODIMP
nsTextFrame::SetSelected(nsPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread)
nsSpread aSpread,
SelectionType aType)
{
DEBUG_VERIFY_NOT_DIRTY(mState);
#if 0 //XXXrbs disable due to bug 310318
@ -4623,11 +4624,13 @@ nsTextFrame::SetSelected(nsPresContext* aPresContext,
if (aSelected && ParentDisablesSelection())
return NS_OK;
// check whether style allows selection
PRBool selectable;
IsSelectable(&selectable, nsnull);
if (!selectable)
return NS_OK;//do not continue no selection for this frame.
if (aType == nsISelectionController::SELECTION_NORMAL) {
// check whether style allows selection
PRBool selectable;
IsSelectable(&selectable, nsnull);
if (!selectable)
return NS_OK;//do not continue no selection for this frame.
}
PRBool found = PR_FALSE;
if (aRange) {
@ -4707,12 +4710,12 @@ nsTextFrame::SetSelected(nsPresContext* aPresContext,
{
nsIFrame* frame = GetPrevContinuation();
while(frame){
frame->SetSelected(aPresContext, aRange,aSelected,eSpreadNone);
frame->SetSelected(aPresContext, aRange,aSelected,eSpreadNone, aType);
frame = frame->GetPrevContinuation();
}
frame = GetNextContinuation();
while (frame){
frame->SetSelected(aPresContext, aRange,aSelected,eSpreadNone);
frame->SetSelected(aPresContext, aRange,aSelected,eSpreadNone, aType);
frame = frame->GetNextContinuation();
}
}

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

@ -242,19 +242,22 @@ NS_IMETHODIMP
nsSVGGlyphFrame::SetSelected(nsPresContext* aPresContext,
nsIDOMRange* aRange,
PRBool aSelected,
nsSpread aSpread)
nsSpread aSpread,
SelectionType aType)
{
#if defined(DEBUG) && defined(SVG_DEBUG_SELECTION)
printf("nsSVGGlyphFrame(%p)::SetSelected()\n", this);
#endif
// return nsSVGGlyphFrameBase::SetSelected(aPresContext, aRange, aSelected, aSpread);
// return nsSVGGlyphFrameBase::SetSelected(aPresContext, aRange, aSelected, aSpread, aType);
if (aType == nsISelectionController::SELECTION_NORMAL) {
// check whether style allows selection
PRBool selectable;
IsSelectable(&selectable, nsnull);
if (!selectable)
return NS_OK;
}
// check whether style allows selection
PRBool selectable;
IsSelectable(&selectable, nsnull);
if (!selectable)
return NS_OK;
if ( aSelected ){
mState |= NS_FRAME_SELECTED_CONTENT;
}

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

@ -86,7 +86,8 @@ public:
NS_IMETHOD SetSelected(nsPresContext* aPresContext,
nsIDOMRange* aRange,
PRBool aSelected,
nsSpread aSpread);
nsSpread aSpread,
SelectionType aType);
NS_IMETHOD GetSelected(PRBool *aSelected) const;
NS_IMETHOD IsSelectable(PRBool* aIsSelectable, PRUint8* aSelectStyle) const;

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

@ -493,7 +493,8 @@ NS_IMETHODIMP
nsTableCellFrame::SetSelected(nsPresContext* aPresContext,
nsIDOMRange* aRange,
PRBool aSelected,
nsSpread aSpread)
nsSpread aSpread,
SelectionType aType)
{
//traverse through children unselect tables
#if 0
@ -509,7 +510,7 @@ nsTableCellFrame::SetSelected(nsPresContext* aPresContext,
// Must call base class to set mSelected state and trigger repaint of frame
// Note that in current version, aRange and aSpread are ignored,
// only this frame is considered
nsFrame::SetSelected(aPresContext, aRange, aSelected, aSpread);
nsFrame::SetSelected(aPresContext, aRange, aSelected, aSpread, aType);
nsCOMPtr<nsFrameSelection> frameSelection =
aPresContext->PresShell()->FrameSelection();

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

@ -130,7 +130,8 @@ public:
NS_IMETHOD SetSelected(nsPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread);
nsSpread aSpread,
SelectionType aType);
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);

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

@ -1483,7 +1483,8 @@ NS_IMETHODIMP
nsTableFrame::SetSelected(nsPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread)
nsSpread aSpread,
SelectionType aType)
{
#if 0
//traverse through children unselect tables
@ -1498,8 +1499,8 @@ nsTableFrame::SetSelected(nsPresContext* aPresContext,
// Must call base class to set mSelected state and trigger repaint of frame
// Note that in current version, aRange and aSpread are ignored,
// only this frame is considered
nsFrame::SetSelected(aPresContext, aRange, aSelected, aSpread);
return NS_OK;//return nsFrame::SetSelected(aRange,aSelected,eSpreadNone);
nsFrame::SetSelected(aPresContext, aRange, aSelected, aSpread, aType);
return NS_OK;//return nsFrame::SetSelected(aRange,aSelected,eSpreadNone, aType);
}

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

@ -315,7 +315,8 @@ public:
NS_IMETHOD SetSelected(nsPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread);
nsSpread aSpread,
SelectionType aType);
virtual void MarkIntrinsicWidthsDirty();
// For border-collapse tables, the caller must not add padding and

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

@ -408,11 +408,12 @@ nsTableOuterFrame::BuildDisplayListForInnerTable(nsDisplayListBuilder* aBuilde
NS_IMETHODIMP nsTableOuterFrame::SetSelected(nsPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread)
nsSpread aSpread,
SelectionType aType)
{
nsresult result = nsFrame::SetSelected(aPresContext, aRange,aSelected, aSpread);
nsresult result = nsFrame::SetSelected(aPresContext, aRange,aSelected, aSpread, aType);
if (NS_SUCCEEDED(result) && mInnerTableFrame)
return mInnerTableFrame->SetSelected(aPresContext, aRange,aSelected, aSpread);
return mInnerTableFrame->SetSelected(aPresContext, aRange,aSelected, aSpread, aType);
return result;
}

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

@ -175,7 +175,8 @@ public:
NS_IMETHOD SetSelected(nsPresContext* aPresContext,
nsIDOMRange *aRange,
PRBool aSelected,
nsSpread aSpread);
nsSpread aSpread,
SelectionType aType);
NS_IMETHOD GetParentStyleContextFrame(nsPresContext* aPresContext,
nsIFrame** aProviderFrame,