Backed out changeset 4aad6ecf4b7d (bug 1098161) for marionette test failures

This commit is contained in:
Carsten "Tomcat" Book 2014-12-22 09:34:14 +01:00
parent 078237732a
commit 92ecd32f49
2 changed files with 0 additions and 32 deletions

View File

@ -547,7 +547,6 @@ SelectionCarets::SelectWord()
bool selectable;
ptFrame->IsSelectable(&selectable, nullptr);
if (!selectable) {
SELECTIONCARETS_LOG("Unable to select");
return NS_OK;
}
@ -558,18 +557,14 @@ SelectionCarets::SelectWord()
// target frame isn't editable and our focus content is editable, we should
// clear focus.
nsFocusManager* fm = nsFocusManager::GetFocusManager();
nsIContent* editingHost = ptFrame->GetContent()->GetEditingHost();
if (editingHost) {
SELECTIONCARETS_LOG("Select editable content %p", editingHost);
nsCOMPtr<nsIDOMElement> elt = do_QueryInterface(editingHost->GetParent());
if (elt) {
fm->SetFocus(elt, 0);
}
} else {
nsIContent* focusedContent = GetFocusedContent();
SELECTIONCARETS_LOG("Select non-editable content %p", focusedContent);
if (focusedContent && focusedContent->GetTextEditorRootContent()) {
nsIDOMWindow* win = mPresShell->GetDocument()->GetWindow();
if (win) {
@ -578,18 +573,6 @@ SelectionCarets::SelectWord()
}
}
nsIContent* selectedContent = ptFrame->GetContent();
if (selectedContent && !nsContentUtils::HasNonEmptyTextContent(
selectedContent, nsContentUtils::eRecurseIntoChildren)) {
SELECTIONCARETS_LOG("Select content %p with empty text", selectedContent);
// Long tap event on this non-editable content with empty text, no action
// for selectioncarets but need to dispatch the touchcarettap event
// to support the short cut mode
DispatchCustomEvent(NS_LITERAL_STRING("touchcarettap"));
return NS_OK;
}
SetSelectionDragState(true);
nsFrame* frame = static_cast<nsFrame*>(ptFrame);
nsresult rs = frame->SelectByTypeAtPoint(mPresShell->GetPresContext(), ptInFrame,
@ -1025,20 +1008,6 @@ SelectionCarets::GetSelectionBoundingRect(Selection* aSel)
return res;
}
void
SelectionCarets::DispatchCustomEvent(const nsAString& aEvent)
{
bool defaultActionEnabled = true;
nsIDocument* doc = mPresShell->GetDocument();
MOZ_ASSERT(doc);
nsContentUtils::DispatchTrustedEvent(doc,
ToSupports(doc),
aEvent,
true,
false,
&defaultActionEnabled);
}
void
SelectionCarets::DispatchSelectionStateChangedEvent(Selection* aSelection,
SelectionState aState)

View File

@ -207,7 +207,6 @@ private:
dom::SelectionState aState);
void DispatchSelectionStateChangedEvent(dom::Selection* aSelection,
const dom::Sequence<dom::SelectionState>& aStates);
void DispatchCustomEvent(const nsAString& aEvent);
nsRect GetSelectionBoundingRect(dom::Selection* aSel);
/**