mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1059165 - Part 3 - Do not show touch caret when content is empty. r=ehsan
We want HasNonEmptyTextContent() to descend recursively into editingHost since <div contenteditable="true"><span>123</span></div> should be considered as non-empty.
This commit is contained in:
parent
d04bc8538b
commit
3b4aaaf44c
@ -31,6 +31,7 @@
|
||||
#include "nsDOMTokenList.h"
|
||||
#include "nsCaret.h"
|
||||
#include "mozilla/dom/CustomEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@ -426,11 +427,24 @@ TouchCaret::IsDisplayable()
|
||||
return false;
|
||||
}
|
||||
|
||||
dom::Element* editingHost = focusFrame->GetContent()->GetEditingHost();
|
||||
if (!editingHost) {
|
||||
TOUCHCARET_LOG("Cannot get editing host!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!nsContentUtils::HasNonEmptyTextContent(
|
||||
editingHost, nsContentUtils::eRecurseIntoChildren)) {
|
||||
TOUCHCARET_LOG("The content is empty!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!IsCaretShowingInScrollFrame()) {
|
||||
TOUCHCARET_LOG("Caret does not show in the scrollable frame!");
|
||||
return false;
|
||||
}
|
||||
|
||||
TOUCHCARET_LOG("Touch caret is displayable!");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user