82151 r=jfrancis sr = kin

This commit is contained in:
mjudge%netscape.com 2002-04-16 02:42:09 +00:00
parent b0f1fe2322
commit cbca07291c
14 changed files with 216 additions and 102 deletions

View File

@ -992,7 +992,7 @@ void nsCaret::DrawCaret()
presContext->GetDeviceContext(getter_AddRefs(dx));
if (dx)
dx->GetDevUnitsToTwips(tDevUnitsToTwips);
mCaretTwipsWidth = tDevUnitsToTwips * mCaretPixelsWidth;
mCaretTwipsWidth = (nscoord)(tDevUnitsToTwips * (float)mCaretPixelsWidth);
}
caretRect.width = mCaretTwipsWidth;

View File

@ -97,7 +97,7 @@ public:
nsLeafIterator(nsIPresContext* aPresContext, nsIFrame *start);
void SetExtensive(PRBool aExtensive) {mExtensive = aExtensive;}
PRBool GetExtensive(){return mExtensive;}
void SetLockInScrollView(PRBool aLockScroll){mLockScroll = aLockScroll;}
private :
NS_IMETHOD Next();
@ -106,6 +106,7 @@ private :
nsIPresContext* mPresContext;
PRPackedBool mExtensive;
PRBool mLockScroll;
};
class nsFocusIterator : public nsFrameIterator
@ -184,7 +185,8 @@ nsresult
NS_NewFrameTraversal(nsIBidirectionalEnumerator **aEnumerator,
nsTraversalType aType,
nsIPresContext* aPresContext,
nsIFrame *aStart)
nsIFrame *aStart,
PRBool aLockInScrollView)
{
if (!aEnumerator || !aStart)
return NS_ERROR_NULL_POINTER;
@ -194,6 +196,7 @@ NS_NewFrameTraversal(nsIBidirectionalEnumerator **aEnumerator,
nsLeafIterator *trav = new nsLeafIterator(aPresContext, aStart);
if (!trav)
return NS_ERROR_OUT_OF_MEMORY;
trav->SetLockInScrollView(aLockInScrollView);
*aEnumerator = NS_STATIC_CAST(nsIBidirectionalEnumerator*, trav);
NS_ADDREF(trav);
trav->SetExtensive(PR_FALSE);
@ -262,7 +265,7 @@ nsFrameTraversal::NewFrameTraversal(nsIBidirectionalEnumerator **aEnumerator,
{
return NS_NewFrameTraversal(aEnumerator, NS_STATIC_CAST(nsTraversalType,
aType),
aPresContext, aStart);
aPresContext, aStart,PR_FALSE);
}
/*********nsFrameIterator************/
@ -328,6 +331,7 @@ nsLeafIterator::nsLeafIterator(nsIPresContext* aPresContext, nsIFrame *aStart)
setStart(aStart);
setCurrent(aStart);
setLast(aStart);
SetLockInScrollView(PR_FALSE);
}
static PRBool
@ -380,9 +384,18 @@ nsLeafIterator::Next()
else
{
parent = result;
// check if FrameType of result is TextInputFrame
if (mLockScroll) //lock the traversal when we hit a scroll frame
{
nsCOMPtr<nsIAtom> atom;
nsresult res = result->GetFrameType(getter_AddRefs(atom));
if ( NS_SUCCEEDED(res) && atom ) {
if ( atom.get() == nsLayoutAtoms::scrollFrame ) return NS_ERROR_FAILURE;
}
}
if (mExtensive)
break;
}
}
}
}
}
@ -403,35 +416,66 @@ nsLeafIterator::Prev()
nsIFrame *parent = getCurrent();
if (!parent)
parent = getLast();
while(parent){
nsIFrame *grandParent;
if (NS_SUCCEEDED(parent->GetParent(&grandParent)) && grandParent &&
NS_SUCCEEDED(grandParent->FirstChild(mPresContext, nsnull,&result))){
nsFrameList list(result);
result = list.GetPrevSiblingFor(parent);
if (result){
parent = result;
while(NS_SUCCEEDED(parent->FirstChild(mPresContext, nsnull,&result)) && result){
parent = result;
while(NS_SUCCEEDED(parent->GetNextSibling(&result)) && result){
parent = result;
if (NS_SUCCEEDED(parent->GetParent(&grandParent)) && grandParent )
{
// check if FrameType of grandParent is TextInputFrame
if (mLockScroll) //lock the traversal when we hit a scroll frame
{
nsCOMPtr<nsIAtom> atom;
nsresult res = grandParent->GetFrameType(getter_AddRefs(atom));
if ( NS_SUCCEEDED(res) && atom )
{
#ifdef DEBUG_skamio
nsAutoString aString;
res = atom->ToString(aString);
if ( NS_SUCCEEDED(res) ) {
printf("%s:%d\n", __FILE__, __LINE__);
printf("FrameType: %s\n", NS_ConvertUCS2toUTF8(aString).get());
}
#endif
if ( atom.get() == nsLayoutAtoms::scrollFrame )
return NS_ERROR_FAILURE;
}
result = parent;
break;
}
else if (NS_FAILED(parent->GetParent(&result)) || !result){
if (NS_SUCCEEDED(grandParent->FirstChild(mPresContext, nsnull,&result)))
{
nsFrameList list(result);
result = list.GetPrevSiblingFor(parent);
if (result)
{
parent = result;
while(NS_SUCCEEDED(parent->FirstChild(mPresContext, nsnull,&result)) && result)
{
parent = result;
while(NS_SUCCEEDED(parent->GetNextSibling(&result)) && result)
{
parent = result;
}
}
result = parent;
break;
}
else if (NS_FAILED(parent->GetParent(&result)) || !result)
{
result = nsnull;
break;
}
else
{
parent = result;
if (mExtensive)
break;
}
else
{
parent = result;
if (mExtensive)
break;
}
}
}
else{
else
{
setLast(parent);
result = nsnull;
break;

View File

@ -44,7 +44,8 @@
nsresult NS_NewFrameTraversal(nsIBidirectionalEnumerator **aEnumerator,
nsTraversalType aType,
nsIPresContext* aPresContext,
nsIFrame *aStart);
nsIFrame *aStart,
PRBool aLockInScrollView);
nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult);

View File

@ -85,6 +85,7 @@ struct SelectionDetails
* @param mEatingWS boolean to tell us the state of our search for Next/Prev
* @param mPreferLeft true = prev line end, false = next line begin
* @param mJumpLines if this is true then its ok to cross lines while peeking
* @param mScrollViewStop if this is true then stop peeking across scroll view boundary
*/
struct nsPeekOffsetStruct
{
@ -95,11 +96,18 @@ struct nsPeekOffsetStruct
PRInt32 aStartOffset,
PRBool aEatingWS,
PRBool aPreferLeft,
PRBool aJumpLines)
PRBool aJumpLines,
PRBool aScrollViewStop)
{
mTracker=aTracker;mDesiredX=aDesiredX;mAmount=aAmount;
mDirection=aDirection;mStartOffset=aStartOffset;mEatingWS=aEatingWS;
mPreferLeft=aPreferLeft;mJumpLines = aJumpLines;
mTracker=aTracker;
mDesiredX=aDesiredX;
mAmount=aAmount;
mDirection=aDirection;
mStartOffset=aStartOffset;
mEatingWS=aEatingWS;
mPreferLeft=aPreferLeft;
mJumpLines = aJumpLines;
mScrollViewStop = aScrollViewStop;
}
nsIFocusTracker *mTracker;
nscoord mDesiredX;
@ -113,6 +121,7 @@ struct nsPeekOffsetStruct
PRBool mEatingWS;
PRBool mPreferLeft;
PRBool mJumpLines;
PRBool mScrollViewStop;
};
class nsIScrollableView;

View File

@ -3244,6 +3244,7 @@ PresShell::CompleteMove(PRBool aForward, PRBool aExtend)
pos.mTracker = this;
pos.mContentOffset = 0;
pos.mContentOffsetEnd = 0;
pos.mScrollViewStop = PR_FALSE;//dont stop on scrolled views.
if (aForward)
{
outsideLimit = 1;//search from end

View File

@ -44,7 +44,8 @@
nsresult NS_NewFrameTraversal(nsIBidirectionalEnumerator **aEnumerator,
nsTraversalType aType,
nsIPresContext* aPresContext,
nsIFrame *aStart);
nsIFrame *aStart,
PRBool aLockInScrollView);
nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult);

View File

@ -85,6 +85,7 @@ struct SelectionDetails
* @param mEatingWS boolean to tell us the state of our search for Next/Prev
* @param mPreferLeft true = prev line end, false = next line begin
* @param mJumpLines if this is true then its ok to cross lines while peeking
* @param mScrollViewStop if this is true then stop peeking across scroll view boundary
*/
struct nsPeekOffsetStruct
{
@ -95,11 +96,18 @@ struct nsPeekOffsetStruct
PRInt32 aStartOffset,
PRBool aEatingWS,
PRBool aPreferLeft,
PRBool aJumpLines)
PRBool aJumpLines,
PRBool aScrollViewStop)
{
mTracker=aTracker;mDesiredX=aDesiredX;mAmount=aAmount;
mDirection=aDirection;mStartOffset=aStartOffset;mEatingWS=aEatingWS;
mPreferLeft=aPreferLeft;mJumpLines = aJumpLines;
mTracker=aTracker;
mDesiredX=aDesiredX;
mAmount=aAmount;
mDirection=aDirection;
mStartOffset=aStartOffset;
mEatingWS=aEatingWS;
mPreferLeft=aPreferLeft;
mJumpLines = aJumpLines;
mScrollViewStop = aScrollViewStop;
}
nsIFocusTracker *mTracker;
nscoord mDesiredX;
@ -113,6 +121,7 @@ struct nsPeekOffsetStruct
PRBool mEatingWS;
PRBool mPreferLeft;
PRBool mJumpLines;
PRBool mScrollViewStop;
};
class nsIScrollableView;

View File

@ -992,7 +992,7 @@ void nsCaret::DrawCaret()
presContext->GetDeviceContext(getter_AddRefs(dx));
if (dx)
dx->GetDevUnitsToTwips(tDevUnitsToTwips);
mCaretTwipsWidth = tDevUnitsToTwips * mCaretPixelsWidth;
mCaretTwipsWidth = (nscoord)(tDevUnitsToTwips * (float)mCaretPixelsWidth);
}
caretRect.width = mCaretTwipsWidth;

View File

@ -97,7 +97,7 @@ public:
nsLeafIterator(nsIPresContext* aPresContext, nsIFrame *start);
void SetExtensive(PRBool aExtensive) {mExtensive = aExtensive;}
PRBool GetExtensive(){return mExtensive;}
void SetLockInScrollView(PRBool aLockScroll){mLockScroll = aLockScroll;}
private :
NS_IMETHOD Next();
@ -106,6 +106,7 @@ private :
nsIPresContext* mPresContext;
PRPackedBool mExtensive;
PRBool mLockScroll;
};
class nsFocusIterator : public nsFrameIterator
@ -184,7 +185,8 @@ nsresult
NS_NewFrameTraversal(nsIBidirectionalEnumerator **aEnumerator,
nsTraversalType aType,
nsIPresContext* aPresContext,
nsIFrame *aStart)
nsIFrame *aStart,
PRBool aLockInScrollView)
{
if (!aEnumerator || !aStart)
return NS_ERROR_NULL_POINTER;
@ -194,6 +196,7 @@ NS_NewFrameTraversal(nsIBidirectionalEnumerator **aEnumerator,
nsLeafIterator *trav = new nsLeafIterator(aPresContext, aStart);
if (!trav)
return NS_ERROR_OUT_OF_MEMORY;
trav->SetLockInScrollView(aLockInScrollView);
*aEnumerator = NS_STATIC_CAST(nsIBidirectionalEnumerator*, trav);
NS_ADDREF(trav);
trav->SetExtensive(PR_FALSE);
@ -262,7 +265,7 @@ nsFrameTraversal::NewFrameTraversal(nsIBidirectionalEnumerator **aEnumerator,
{
return NS_NewFrameTraversal(aEnumerator, NS_STATIC_CAST(nsTraversalType,
aType),
aPresContext, aStart);
aPresContext, aStart,PR_FALSE);
}
/*********nsFrameIterator************/
@ -328,6 +331,7 @@ nsLeafIterator::nsLeafIterator(nsIPresContext* aPresContext, nsIFrame *aStart)
setStart(aStart);
setCurrent(aStart);
setLast(aStart);
SetLockInScrollView(PR_FALSE);
}
static PRBool
@ -380,9 +384,18 @@ nsLeafIterator::Next()
else
{
parent = result;
// check if FrameType of result is TextInputFrame
if (mLockScroll) //lock the traversal when we hit a scroll frame
{
nsCOMPtr<nsIAtom> atom;
nsresult res = result->GetFrameType(getter_AddRefs(atom));
if ( NS_SUCCEEDED(res) && atom ) {
if ( atom.get() == nsLayoutAtoms::scrollFrame ) return NS_ERROR_FAILURE;
}
}
if (mExtensive)
break;
}
}
}
}
}
@ -403,35 +416,66 @@ nsLeafIterator::Prev()
nsIFrame *parent = getCurrent();
if (!parent)
parent = getLast();
while(parent){
nsIFrame *grandParent;
if (NS_SUCCEEDED(parent->GetParent(&grandParent)) && grandParent &&
NS_SUCCEEDED(grandParent->FirstChild(mPresContext, nsnull,&result))){
nsFrameList list(result);
result = list.GetPrevSiblingFor(parent);
if (result){
parent = result;
while(NS_SUCCEEDED(parent->FirstChild(mPresContext, nsnull,&result)) && result){
parent = result;
while(NS_SUCCEEDED(parent->GetNextSibling(&result)) && result){
parent = result;
if (NS_SUCCEEDED(parent->GetParent(&grandParent)) && grandParent )
{
// check if FrameType of grandParent is TextInputFrame
if (mLockScroll) //lock the traversal when we hit a scroll frame
{
nsCOMPtr<nsIAtom> atom;
nsresult res = grandParent->GetFrameType(getter_AddRefs(atom));
if ( NS_SUCCEEDED(res) && atom )
{
#ifdef DEBUG_skamio
nsAutoString aString;
res = atom->ToString(aString);
if ( NS_SUCCEEDED(res) ) {
printf("%s:%d\n", __FILE__, __LINE__);
printf("FrameType: %s\n", NS_ConvertUCS2toUTF8(aString).get());
}
#endif
if ( atom.get() == nsLayoutAtoms::scrollFrame )
return NS_ERROR_FAILURE;
}
result = parent;
break;
}
else if (NS_FAILED(parent->GetParent(&result)) || !result){
if (NS_SUCCEEDED(grandParent->FirstChild(mPresContext, nsnull,&result)))
{
nsFrameList list(result);
result = list.GetPrevSiblingFor(parent);
if (result)
{
parent = result;
while(NS_SUCCEEDED(parent->FirstChild(mPresContext, nsnull,&result)) && result)
{
parent = result;
while(NS_SUCCEEDED(parent->GetNextSibling(&result)) && result)
{
parent = result;
}
}
result = parent;
break;
}
else if (NS_FAILED(parent->GetParent(&result)) || !result)
{
result = nsnull;
break;
}
else
{
parent = result;
if (mExtensive)
break;
}
else
{
parent = result;
if (mExtensive)
break;
}
}
}
else{
else
{
setLast(parent);
result = nsnull;
break;

View File

@ -5690,7 +5690,7 @@ nsBlockFrame::HandleEvent(nsIPresContext* aPresContext,
pos.mTracker = tracker;
pos.mDirection = eDirNext;
pos.mDesiredX = aEvent->point.x;
pos.mScrollViewStop = PR_FALSE;
result = nsFrame::GetNextPrevLineFromeBlockFrame(aPresContext,
&pos,
mainframe,

View File

@ -1130,7 +1130,7 @@ nsFrame::HandlePress(nsIPresContext* aPresContext,
if (me->clickCount >1 )
{
rv = frameselection->SetMouseDownState( PR_TRUE );
return HandleMultiplePress(aPresContext,aEvent,aEventStatus);
return HandleMultiplePress(aPresContext, aEvent, aEventStatus);
}
nsCOMPtr<nsIContent> content;
@ -1331,7 +1331,8 @@ nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack,
aStartPos,
PR_FALSE,
PR_TRUE,
aJumpLines);
aJumpLines,
PR_TRUE);//limit on scrolled views
rv = PeekOffset(aPresContext, &startpos);
if (NS_FAILED(rv))
return rv;
@ -1343,7 +1344,8 @@ nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack,
aStartPos,
PR_FALSE,
PR_FALSE,
aJumpLines);
aJumpLines,
PR_TRUE);//limit on scrolled views
rv = PeekOffset(aPresContext, &endpos);
if (NS_FAILED(rv))
return rv;
@ -3017,7 +3019,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
nsCOMPtr<nsIBidirectionalEnumerator> frameTraversal;
result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), LEAF,
aPresContext, resultFrame);
aPresContext, resultFrame, aPos->mScrollViewStop);
if (NS_FAILED(result))
return result;
nsISupports *isupports = nsnull;
@ -3117,7 +3119,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
if (!found){
resultFrame = storeOldResultFrame;
result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), LEAF,
aPresContext, resultFrame);
aPresContext, resultFrame, aPos->mScrollViewStop);
}
while ( !found ){
nsCOMPtr<nsIPresContext> context;
@ -3836,11 +3838,11 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
aPresContext,
(lineJump && lineIsRTL)
? (aPos->mDirection == eDirNext) ? lastFrame : firstFrame
: traversedFrame);
: traversedFrame, aPos->mScrollViewStop);
#else
//if we are a container frame we MUST init with last leaf for eDirNext
//
result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal),LEAF, aPresContext, traversedFrame);
result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), LEAF, aPresContext, traversedFrame, pos->mScrollViewStop);
#endif
if (NS_FAILED(result))
return result;
@ -3891,7 +3893,7 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
thisBlock = blockFrame;
result = blockFrame->GetParent(&blockFrame);
if (NS_SUCCEEDED(result) && blockFrame){
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator), getter_AddRefs(it));
}
else
blockFrame = nsnull;
@ -3914,7 +3916,7 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
}
else
{
result = it->GetLine(thisLine, &firstFrame, &lineFrameCount,nonUsedRect,
result = it->GetLine(thisLine, &firstFrame, &lineFrameCount, nonUsedRect,
&lineFlags);
if (NS_FAILED(result))
return result;
@ -3958,9 +3960,9 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
aPos->mStartOffset = -1;
#ifdef IBMBIDI
PRUint8 oldLevel, newLevel, baseLevel;
GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**)&oldLevel,sizeof(oldLevel));
newFrame->GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**)&newLevel,sizeof(newLevel));
newFrame->GetBidiProperty(aPresContext, nsLayoutAtoms::baseLevel, (void**)&baseLevel,sizeof(baseLevel));
GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**)&oldLevel, sizeof(oldLevel));
newFrame->GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**)&newLevel, sizeof(newLevel));
newFrame->GetBidiProperty(aPresContext, nsLayoutAtoms::baseLevel, (void**)&baseLevel, sizeof(baseLevel));
if (newLevel & 1) // The new frame is RTL, go to the other end
aPos->mStartOffset = -1 - aPos->mStartOffset;
@ -4246,7 +4248,7 @@ nsFrame::CaptureMouse(nsIPresContext* aPresContext, PRBool aGrabMouseEvents)
return rv;
if (!parent)
return NS_ERROR_FAILURE;
parent->GetView(aPresContext,&view);
parent->GetView(aPresContext, &view);
}
nsCOMPtr<nsIViewManager> viewMan;
@ -4256,9 +4258,9 @@ nsFrame::CaptureMouse(nsIPresContext* aPresContext, PRBool aGrabMouseEvents)
view->GetViewManager(*getter_AddRefs(viewMan));
if (viewMan) {
if (aGrabMouseEvents) {
viewMan->GrabMouseEvents(view,result);
viewMan->GrabMouseEvents(view, result);
} else {
viewMan->GrabMouseEvents(nsnull,result);
viewMan->GrabMouseEvents(nsnull, result);
}
}
}
@ -4271,7 +4273,7 @@ nsFrame::IsMouseCaptured(nsIPresContext* aPresContext)
{
// get its view
nsIView* view = nsnull;
GetView(aPresContext, & view);
GetView(aPresContext, &view);
if (!view)
{
nsIFrame *parent;//might be THIS frame thats ok
@ -4281,7 +4283,7 @@ nsFrame::IsMouseCaptured(nsIPresContext* aPresContext)
if (!parent)
return NS_ERROR_FAILURE;
parent->GetView(aPresContext,&view);
parent->GetView(aPresContext, &view);
}
nsCOMPtr<nsIViewManager> viewMan;
@ -4771,7 +4773,7 @@ void DR_State::AddFrameTypeInfo(nsIAtom* aFrameType,
DR_FrameTypeInfo* DR_State::GetFrameTypeInfo(nsIAtom* aFrameType)
{
PRInt32 numEntries = mFrameTypeTable.Count();
NS_ASSERTION(numEntries != 0,"empty FrameTypeTable");
NS_ASSERTION(numEntries != 0, "empty FrameTypeTable");
for (PRInt32 i = 0; i < numEntries; i++) {
DR_FrameTypeInfo* info = (DR_FrameTypeInfo*)mFrameTypeTable.ElementAt(i);
if (info && (info->mType == aFrameType)) {
@ -4784,7 +4786,7 @@ DR_FrameTypeInfo* DR_State::GetFrameTypeInfo(nsIAtom* aFrameType)
DR_FrameTypeInfo* DR_State::GetFrameTypeInfo(char* aFrameName)
{
PRInt32 numEntries = mFrameTypeTable.Count();
NS_ASSERTION(numEntries != 0,"empty FrameTypeTable");
NS_ASSERTION(numEntries != 0, "empty FrameTypeTable");
for (PRInt32 i = 0; i < numEntries; i++) {
DR_FrameTypeInfo* info = (DR_FrameTypeInfo*)mFrameTypeTable.ElementAt(i);
if (info && ((strcmp(aFrameName, info->mName) == 0) || (strcmp(aFrameName, info->mNameAbbrev) == 0))) {
@ -4843,7 +4845,7 @@ void DR_State::DisplayFrameTypeInfo(nsIFrame* aFrame,
for (PRInt32 i = 0; i < aIndent; i++) {
printf(" ");
}
if(!strcmp(frameTypeInfo->mNameAbbrev,"unknown")) {
if(!strcmp(frameTypeInfo->mNameAbbrev, "unknown")) {
nsAutoString name;
nsIFrameDebug* frameDebug;
if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {

View File

@ -5690,7 +5690,7 @@ nsBlockFrame::HandleEvent(nsIPresContext* aPresContext,
pos.mTracker = tracker;
pos.mDirection = eDirNext;
pos.mDesiredX = aEvent->point.x;
pos.mScrollViewStop = PR_FALSE;
result = nsFrame::GetNextPrevLineFromeBlockFrame(aPresContext,
&pos,
mainframe,

View File

@ -1130,7 +1130,7 @@ nsFrame::HandlePress(nsIPresContext* aPresContext,
if (me->clickCount >1 )
{
rv = frameselection->SetMouseDownState( PR_TRUE );
return HandleMultiplePress(aPresContext,aEvent,aEventStatus);
return HandleMultiplePress(aPresContext, aEvent, aEventStatus);
}
nsCOMPtr<nsIContent> content;
@ -1331,7 +1331,8 @@ nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack,
aStartPos,
PR_FALSE,
PR_TRUE,
aJumpLines);
aJumpLines,
PR_TRUE);//limit on scrolled views
rv = PeekOffset(aPresContext, &startpos);
if (NS_FAILED(rv))
return rv;
@ -1343,7 +1344,8 @@ nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack,
aStartPos,
PR_FALSE,
PR_FALSE,
aJumpLines);
aJumpLines,
PR_TRUE);//limit on scrolled views
rv = PeekOffset(aPresContext, &endpos);
if (NS_FAILED(rv))
return rv;
@ -3017,7 +3019,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
nsCOMPtr<nsIBidirectionalEnumerator> frameTraversal;
result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), LEAF,
aPresContext, resultFrame);
aPresContext, resultFrame, aPos->mScrollViewStop);
if (NS_FAILED(result))
return result;
nsISupports *isupports = nsnull;
@ -3117,7 +3119,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
if (!found){
resultFrame = storeOldResultFrame;
result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), LEAF,
aPresContext, resultFrame);
aPresContext, resultFrame, aPos->mScrollViewStop);
}
while ( !found ){
nsCOMPtr<nsIPresContext> context;
@ -3836,11 +3838,11 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
aPresContext,
(lineJump && lineIsRTL)
? (aPos->mDirection == eDirNext) ? lastFrame : firstFrame
: traversedFrame);
: traversedFrame, aPos->mScrollViewStop);
#else
//if we are a container frame we MUST init with last leaf for eDirNext
//
result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal),LEAF, aPresContext, traversedFrame);
result = NS_NewFrameTraversal(getter_AddRefs(frameTraversal), LEAF, aPresContext, traversedFrame, pos->mScrollViewStop);
#endif
if (NS_FAILED(result))
return result;
@ -3891,7 +3893,7 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
thisBlock = blockFrame;
result = blockFrame->GetParent(&blockFrame);
if (NS_SUCCEEDED(result) && blockFrame){
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator),getter_AddRefs(it));
result = blockFrame->QueryInterface(NS_GET_IID(nsILineIteratorNavigator), getter_AddRefs(it));
}
else
blockFrame = nsnull;
@ -3914,7 +3916,7 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
}
else
{
result = it->GetLine(thisLine, &firstFrame, &lineFrameCount,nonUsedRect,
result = it->GetLine(thisLine, &firstFrame, &lineFrameCount, nonUsedRect,
&lineFlags);
if (NS_FAILED(result))
return result;
@ -3958,9 +3960,9 @@ nsFrame::GetFrameFromDirection(nsIPresContext* aPresContext, nsPeekOffsetStruct
aPos->mStartOffset = -1;
#ifdef IBMBIDI
PRUint8 oldLevel, newLevel, baseLevel;
GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**)&oldLevel,sizeof(oldLevel));
newFrame->GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**)&newLevel,sizeof(newLevel));
newFrame->GetBidiProperty(aPresContext, nsLayoutAtoms::baseLevel, (void**)&baseLevel,sizeof(baseLevel));
GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**)&oldLevel, sizeof(oldLevel));
newFrame->GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**)&newLevel, sizeof(newLevel));
newFrame->GetBidiProperty(aPresContext, nsLayoutAtoms::baseLevel, (void**)&baseLevel, sizeof(baseLevel));
if (newLevel & 1) // The new frame is RTL, go to the other end
aPos->mStartOffset = -1 - aPos->mStartOffset;
@ -4246,7 +4248,7 @@ nsFrame::CaptureMouse(nsIPresContext* aPresContext, PRBool aGrabMouseEvents)
return rv;
if (!parent)
return NS_ERROR_FAILURE;
parent->GetView(aPresContext,&view);
parent->GetView(aPresContext, &view);
}
nsCOMPtr<nsIViewManager> viewMan;
@ -4256,9 +4258,9 @@ nsFrame::CaptureMouse(nsIPresContext* aPresContext, PRBool aGrabMouseEvents)
view->GetViewManager(*getter_AddRefs(viewMan));
if (viewMan) {
if (aGrabMouseEvents) {
viewMan->GrabMouseEvents(view,result);
viewMan->GrabMouseEvents(view, result);
} else {
viewMan->GrabMouseEvents(nsnull,result);
viewMan->GrabMouseEvents(nsnull, result);
}
}
}
@ -4271,7 +4273,7 @@ nsFrame::IsMouseCaptured(nsIPresContext* aPresContext)
{
// get its view
nsIView* view = nsnull;
GetView(aPresContext, & view);
GetView(aPresContext, &view);
if (!view)
{
nsIFrame *parent;//might be THIS frame thats ok
@ -4281,7 +4283,7 @@ nsFrame::IsMouseCaptured(nsIPresContext* aPresContext)
if (!parent)
return NS_ERROR_FAILURE;
parent->GetView(aPresContext,&view);
parent->GetView(aPresContext, &view);
}
nsCOMPtr<nsIViewManager> viewMan;
@ -4771,7 +4773,7 @@ void DR_State::AddFrameTypeInfo(nsIAtom* aFrameType,
DR_FrameTypeInfo* DR_State::GetFrameTypeInfo(nsIAtom* aFrameType)
{
PRInt32 numEntries = mFrameTypeTable.Count();
NS_ASSERTION(numEntries != 0,"empty FrameTypeTable");
NS_ASSERTION(numEntries != 0, "empty FrameTypeTable");
for (PRInt32 i = 0; i < numEntries; i++) {
DR_FrameTypeInfo* info = (DR_FrameTypeInfo*)mFrameTypeTable.ElementAt(i);
if (info && (info->mType == aFrameType)) {
@ -4784,7 +4786,7 @@ DR_FrameTypeInfo* DR_State::GetFrameTypeInfo(nsIAtom* aFrameType)
DR_FrameTypeInfo* DR_State::GetFrameTypeInfo(char* aFrameName)
{
PRInt32 numEntries = mFrameTypeTable.Count();
NS_ASSERTION(numEntries != 0,"empty FrameTypeTable");
NS_ASSERTION(numEntries != 0, "empty FrameTypeTable");
for (PRInt32 i = 0; i < numEntries; i++) {
DR_FrameTypeInfo* info = (DR_FrameTypeInfo*)mFrameTypeTable.ElementAt(i);
if (info && ((strcmp(aFrameName, info->mName) == 0) || (strcmp(aFrameName, info->mNameAbbrev) == 0))) {
@ -4843,7 +4845,7 @@ void DR_State::DisplayFrameTypeInfo(nsIFrame* aFrame,
for (PRInt32 i = 0; i < aIndent; i++) {
printf(" ");
}
if(!strcmp(frameTypeInfo->mNameAbbrev,"unknown")) {
if(!strcmp(frameTypeInfo->mNameAbbrev, "unknown")) {
nsAutoString name;
nsIFrameDebug* frameDebug;
if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {

View File

@ -3244,6 +3244,7 @@ PresShell::CompleteMove(PRBool aForward, PRBool aExtend)
pos.mTracker = this;
pos.mContentOffset = 0;
pos.mContentOffsetEnd = 0;
pos.mScrollViewStop = PR_FALSE;//dont stop on scrolled views.
if (aForward)
{
outsideLimit = 1;//search from end