зеркало из https://github.com/mozilla/gecko-dev.git
Bug 710292 - Add a common HTMLSplitOnSpacesTokenizer tokenizer. r=khuey
This commit is contained in:
Родитель
a2890770eb
Коммит
5c749b2022
|
@ -82,6 +82,7 @@ static fp_except_t oldmask = fpsetmask(~allmask);
|
|||
#include "nsHtml5Parser.h"
|
||||
#include "nsIFragmentContentSink.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/GuardObjects.h"
|
||||
|
@ -1942,6 +1943,9 @@ private:
|
|||
static nsString* sModifierSeparator;
|
||||
};
|
||||
|
||||
typedef nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace>
|
||||
HTMLSplitOnSpacesTokenizer;
|
||||
|
||||
#define NS_HOLD_JS_OBJECTS(obj, clazz) \
|
||||
nsContentUtils::HoldJSObjects(NS_CYCLE_COLLECTION_UPCAST(obj, clazz), \
|
||||
&NS_CYCLE_COLLECTION_NAME(clazz))
|
||||
|
|
|
@ -114,7 +114,6 @@
|
|||
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsRadioVisitor.h"
|
||||
|
||||
|
@ -3904,8 +3903,7 @@ nsHTMLInputElement::GetValidationMessage(nsAString& aValidationMessage,
|
|||
bool
|
||||
nsHTMLInputElement::IsValidEmailAddressList(const nsAString& aValue)
|
||||
{
|
||||
nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace>
|
||||
tokenizer(aValue, ',');
|
||||
HTMLSplitOnSpacesTokenizer tokenizer(aValue, ',');
|
||||
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
if (!IsValidEmailAddress(tokenizer.nextToken())) {
|
||||
|
@ -4124,8 +4122,7 @@ nsHTMLInputElement::GetFilterFromAccept()
|
|||
nsAutoString accept;
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::accept, accept);
|
||||
|
||||
nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace>
|
||||
tokenizer(accept, ',');
|
||||
HTMLSplitOnSpacesTokenizer tokenizer(accept, ',');
|
||||
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
const nsDependentSubstring token = tokenizer.nextToken();
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
#include "nsIVariant.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "nsHTMLInputElement.h"
|
||||
#include "nsICapturePicker.h"
|
||||
#include "nsIFileURL.h"
|
||||
|
@ -759,8 +758,7 @@ nsFileControlFrame::ParseAcceptAttribute(AcceptAttrCallback aCallback,
|
|||
nsAutoString accept;
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accept, accept);
|
||||
|
||||
nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace>
|
||||
tokenizer(accept, ',');
|
||||
HTMLSplitOnSpacesTokenizer tokenizer(accept, ',');
|
||||
// Empty loop body because aCallback is doing the work
|
||||
while (tokenizer.hasMoreTokens() &&
|
||||
(*aCallback)(tokenizer.nextToken(), aClosure));
|
||||
|
|
Загрузка…
Ссылка в новой задаче