Bug 1317367 part 4. Pass an explicit CallerType to HTMLInputElement::GetValueInternal. r=smaug

I'm not 100% sure that I'm being very consistent in my handling of
mFocusedValue, but since that's not used for file inputs, I don't think it
matters much...

A bigger problem is if people start using this caller type for things other than
file inputs.
This commit is contained in:
Boris Zbarsky
2016-11-15 12:46:32 -05:00
parent b2eaca6676
commit 0fa8643c26
13 changed files with 147 additions and 140 deletions

View File

@@ -8,6 +8,7 @@
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
#include "mozilla/dom/HTMLInputElement.h"
#include "nsIFormAutoComplete.h"
#include "nsIInputListAutoComplete.h"
#include "nsIAutoCompleteSimpleResult.h"
@@ -502,7 +503,9 @@ NS_IMETHODIMP
nsFormFillController::GetTextValue(nsAString & aTextValue)
{
if (mFocusedInput) {
mFocusedInput->GetValue(aTextValue);
nsCOMPtr<nsIContent> content = do_QueryInterface(mFocusedInput);
HTMLInputElement::FromContent(content)->GetValue(aTextValue,
CallerType::System);
} else {
aTextValue.Truncate();
}