2009-06-29 02:44:22 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Henri Sivonen
|
2017-04-13 11:14:48 +03:00
|
|
|
* Copyright (c) 2008-2017 Mozilla Foundation
|
2009-06-29 02:44:22 +04:00
|
|
|
*
|
2018-03-16 18:26:06 +03:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
2009-06-29 02:44:22 +04:00
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
2018-03-16 18:26:06 +03:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
2009-06-29 02:44:22 +04:00
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
2018-03-16 18:26:06 +03:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
2009-06-29 02:44:22 +04:00
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2013-08-23 19:07:10 +04:00
|
|
|
#ifndef nsHtml5HtmlAttributes_h
|
|
|
|
#define nsHtml5HtmlAttributes_h
|
2009-06-29 02:44:22 +04:00
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
#include "nsAtom.h"
|
2009-09-21 15:43:43 +04:00
|
|
|
#include "nsHtml5AtomTable.h"
|
2017-03-20 15:45:15 +03:00
|
|
|
#include "nsHtml5String.h"
|
2014-02-28 03:04:46 +04:00
|
|
|
#include "nsNameSpaceManager.h"
|
2009-06-29 02:44:22 +04:00
|
|
|
#include "nsIContent.h"
|
2014-03-05 23:38:49 +04:00
|
|
|
#include "nsTraceRefcnt.h"
|
2009-06-29 02:44:22 +04:00
|
|
|
#include "jArray.h"
|
|
|
|
#include "nsHtml5ArrayCopy.h"
|
2010-07-30 14:15:38 +04:00
|
|
|
#include "nsAHtml5TreeBuilderState.h"
|
2009-06-29 02:44:22 +04:00
|
|
|
#include "nsHtml5ByteReadable.h"
|
2010-04-19 17:25:13 +04:00
|
|
|
#include "nsHtml5Macros.h"
|
2014-03-05 23:38:49 +04:00
|
|
|
#include "nsIContentHandle.h"
|
2017-04-13 11:14:48 +03:00
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsHtml5AttributeEntry.h"
|
2009-06-29 02:44:22 +04:00
|
|
|
|
2009-09-18 13:21:47 +04:00
|
|
|
class nsHtml5StreamParser;
|
2009-06-29 02:44:22 +04:00
|
|
|
|
|
|
|
class nsHtml5Tokenizer;
|
|
|
|
class nsHtml5TreeBuilder;
|
|
|
|
class nsHtml5MetaScanner;
|
|
|
|
class nsHtml5AttributeName;
|
|
|
|
class nsHtml5ElementName;
|
|
|
|
class nsHtml5UTF16Buffer;
|
|
|
|
class nsHtml5StateSnapshot;
|
|
|
|
class nsHtml5Portability;
|
|
|
|
|
|
|
|
class nsHtml5HtmlAttributes {
|
2018-03-16 18:26:06 +03:00
|
|
|
public:
|
|
|
|
static nsHtml5HtmlAttributes* EMPTY_ATTRIBUTES;
|
2017-04-13 11:14:48 +03:00
|
|
|
|
2018-03-16 18:26:06 +03:00
|
|
|
private:
|
|
|
|
AutoTArray<nsHtml5AttributeEntry, 5> mStorage;
|
|
|
|
int32_t mMode;
|
|
|
|
void AddEntry(nsHtml5AttributeEntry&& aEntry);
|
2017-04-13 11:14:48 +03:00
|
|
|
|
2018-03-16 18:26:06 +03:00
|
|
|
public:
|
|
|
|
explicit nsHtml5HtmlAttributes(int32_t aMode);
|
|
|
|
~nsHtml5HtmlAttributes();
|
2009-06-29 02:44:22 +04:00
|
|
|
|
2018-03-16 18:26:06 +03:00
|
|
|
// Remove getIndex when removing isindex support
|
|
|
|
int32_t getIndex(nsHtml5AttributeName* aName);
|
2009-06-29 02:44:22 +04:00
|
|
|
|
2018-03-16 18:26:06 +03:00
|
|
|
nsHtml5String getValue(nsHtml5AttributeName* aName);
|
|
|
|
int32_t getLength();
|
|
|
|
nsAtom* getLocalNameNoBoundsCheck(int32_t aIndex);
|
|
|
|
int32_t getURINoBoundsCheck(int32_t aIndex);
|
|
|
|
nsAtom* getPrefixNoBoundsCheck(int32_t aIndex);
|
|
|
|
nsHtml5String getValueNoBoundsCheck(int32_t aIndex);
|
|
|
|
nsHtml5AttributeName* getAttributeNameNoBoundsCheck(int32_t aIndex);
|
|
|
|
int32_t getLineNoBoundsCheck(int32_t aIndex);
|
|
|
|
void addAttribute(nsHtml5AttributeName* aName, nsHtml5String aValue,
|
|
|
|
int32_t aLine);
|
|
|
|
void AddAttributeWithLocal(nsAtom* aName, nsHtml5String aValue,
|
|
|
|
int32_t aLine);
|
|
|
|
void clear(int32_t aMode);
|
|
|
|
void releaseValue(int32_t aIndex);
|
|
|
|
void clearWithoutReleasingContents();
|
|
|
|
bool contains(nsHtml5AttributeName* aName);
|
|
|
|
void adjustForMath();
|
|
|
|
void adjustForSvg();
|
2018-11-12 17:37:09 +03:00
|
|
|
nsHtml5HtmlAttributes* cloneAttributes();
|
2018-03-16 18:26:06 +03:00
|
|
|
bool equalsAnother(nsHtml5HtmlAttributes* aOther);
|
|
|
|
static void initializeStatics();
|
|
|
|
static void releaseStatics();
|
|
|
|
};
|
2009-06-29 02:44:22 +04:00
|
|
|
|
|
|
|
#endif
|