small change to stop selection from being notified of clicks on non selecteable sytle content

git-svn-id: svn://10.0.0.236/trunk@64087 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mjudge%netscape.com 2000-03-25 01:14:39 +00:00
parent 9ccbf5cd10
commit b24e7a54c2
2 changed files with 34 additions and 0 deletions

View File

@ -901,6 +901,23 @@ nsFrame::HandlePress(nsIPresContext* aPresContext,
if (me->clickCount >1 )
return HandleMultiplePress(aPresContext,aEvent,aEventStatus);
// check whether style allows selection
// if not dont tell selection the mouse event even occured.
const nsStyleUserInterface* userinterface;
GetStyleData(eStyleStruct_UserInterface, (const nsStyleStruct*&)userinterface);
if (userinterface) {
if (userinterface->mUserSelect == NS_STYLE_USER_SELECT_AUTO) {
// if 'user-select' isn't set for this frame, use the parent's
if (mParent) {
mParent->GetStyleData(eStyleStruct_UserInterface, (const nsStyleStruct*&)userinterface);
}
}
if (userinterface->mUserSelect == NS_STYLE_USER_SELECT_NONE) {
return NS_OK;//do not continue no selection for this frame.
}
}
nsCOMPtr<nsIPresShell> shell;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell) {

View File

@ -901,6 +901,23 @@ nsFrame::HandlePress(nsIPresContext* aPresContext,
if (me->clickCount >1 )
return HandleMultiplePress(aPresContext,aEvent,aEventStatus);
// check whether style allows selection
// if not dont tell selection the mouse event even occured.
const nsStyleUserInterface* userinterface;
GetStyleData(eStyleStruct_UserInterface, (const nsStyleStruct*&)userinterface);
if (userinterface) {
if (userinterface->mUserSelect == NS_STYLE_USER_SELECT_AUTO) {
// if 'user-select' isn't set for this frame, use the parent's
if (mParent) {
mParent->GetStyleData(eStyleStruct_UserInterface, (const nsStyleStruct*&)userinterface);
}
}
if (userinterface->mUserSelect == NS_STYLE_USER_SELECT_NONE) {
return NS_OK;//do not continue no selection for this frame.
}
}
nsCOMPtr<nsIPresShell> shell;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell) {