Bug 1932800 - Add a check to SelfIsSelectable to preserve editor drag and drop behavior. r=masayuki
We were relying on editable text frames not being empty. We fixed that on the previous patches but this caused editor d&d to break. For now this preserves the selection behavior. In the future we should look into removing the IsEmpty() condition or so, probably, or make it more subtle. Differential Revision: https://phabricator.services.mozilla.com/D229996
This commit is contained in:
@@ -5499,7 +5499,12 @@ static bool SelfIsSelectable(nsIFrame* aFrame, nsIFrame* aParentFrame,
|
||||
if (aFrame->Style()->UserSelect() == StyleUserSelect::None) {
|
||||
return false;
|
||||
}
|
||||
if (aFrame->IsEmpty()) {
|
||||
if (aFrame->IsEmpty() &&
|
||||
(!aFrame->IsTextFrame() || !aFrame->ContentIsEditable())) {
|
||||
// FIXME(emilio): Historically we haven't treated empty frames as
|
||||
// selectable, but also we had special-cases so that editable empty text
|
||||
// frames returned false from IsEmpty(). Sort this out (probably by
|
||||
// removing the IsEmpty() condition altogether).
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user