bug 15982 r=cmanske. needed more places to add checks for style turning off normal selection.
git-svn-id: svn://10.0.0.236/trunk@57411 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1857,6 +1857,21 @@ nsFrame::SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aS
|
||||
{
|
||||
if (aSelected && ParentDisablesSelection())
|
||||
return NS_OK;
|
||||
// check whether style allows selection
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
/* nsresult rv;
|
||||
|
||||
if (eSpreadDown == aSpread){
|
||||
|
||||
@@ -2098,6 +2098,21 @@ nsTextFrame::SetSelected(nsIPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}*/
|
||||
|
||||
// check whether style allows selection
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
PRBool found = PR_FALSE;
|
||||
PRBool wholeContentFound = PR_FALSE;//if the entire content we look at is selected.
|
||||
if (aRange) {
|
||||
|
||||
@@ -1857,6 +1857,21 @@ nsFrame::SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aS
|
||||
{
|
||||
if (aSelected && ParentDisablesSelection())
|
||||
return NS_OK;
|
||||
// check whether style allows selection
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
/* nsresult rv;
|
||||
|
||||
if (eSpreadDown == aSpread){
|
||||
|
||||
@@ -2098,6 +2098,21 @@ nsTextFrame::SetSelected(nsIPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}*/
|
||||
|
||||
// check whether style allows selection
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
PRBool found = PR_FALSE;
|
||||
PRBool wholeContentFound = PR_FALSE;//if the entire content we look at is selected.
|
||||
if (aRange) {
|
||||
|
||||
Reference in New Issue
Block a user