Reproduce step:
1. Trigger text selection bubble on a non-editable element
2. Click select all
Actual result:
All the content will be select no matter the user-select is none or other.
Expected result:
Element with user-select: none should not be selected
It's the required feature: enable text selection for message bubble in Bug #1092437, so set the dependency for gaia feature.

I found if we have contenteditable elements in dom tree then our select all command would re-direct to nsHTMLEditor::SelectAll() instead of nsDocumentViewer::SelectAll(). So I add AutoApplyUserSelectStyle to nsHTMLEditor::SelectAll().

Comment on attachment 8534874[details][diff][review]
Apply AutoApplyUserSelectStyle to nsHTMLEditor::SelectAll().
This is the right way to do it, but I think we should only do this if the
node is non-editable. For example, load this in Firefox:
data:text/html,<div contenteditable>AAA<span style="-moz-user-select:none">BBB</span></div>
then click on the text, then CTRL+A (or Select All in the context menu).
Currently it selects all text and you can type DEL to delete all the
text. With your fix, "BBB" isn't deleted.
In general, things that are editable should ignore 'user-select',
otherwise it's hard to select or position the caret to edit the content.
So I think we should do it something like this:
Maybe<mozilla::dom::Selection::AutoApplyUserSelectStyle> userSelection;
if (!rootContent->IsEditable()) {
userSelection.emplace(selection);
}
Also, why only fix the !HasIndependentSelection() case?
It seems to me we should do this in both cases. If you agree, could you
refactor the code a bit to avoid the code repetition please?
In pseudo-code:
if (anchorContent->HasIndependentSelection()) {
SetAncestorLimiter();
rootContent = mRootElement;
} else {
rootContent = GetSelectionRootContent();
}
followed by the rest of the code which can be shared.
(please also remove the code comment as it seems to contradict
what the code is actually doing)
Also, can you write tests please? Two reftests should be enough, one for
the editable case and one non-editable.