mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-11-06 14:37:30 +09:00
import changes from win7-7/UXP:
bug1347737, bug1365982, bug1367206
This commit is contained in:
parent
c2b2ce2c5c
commit
0f035317a3
96 changed files with 1525 additions and 1329 deletions
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "nsIAtom.h"
|
||||
#include "nsHtml5AtomTable.h"
|
||||
#include "nsString.h"
|
||||
#include "nsHtml5String.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
|
|
@ -58,11 +58,11 @@
|
|||
nsHtml5HtmlAttributes* nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES = nullptr;
|
||||
|
||||
nsHtml5HtmlAttributes::nsHtml5HtmlAttributes(int32_t mode)
|
||||
: mode(mode),
|
||||
length(0),
|
||||
names(jArray<nsHtml5AttributeName*,int32_t>::newJArray(8)),
|
||||
values(jArray<nsString*,int32_t>::newJArray(8)),
|
||||
lines(jArray<int32_t,int32_t>::newJArray(8))
|
||||
: mode(mode)
|
||||
, length(0)
|
||||
, names(jArray<nsHtml5AttributeName*, int32_t>::newJArray(8))
|
||||
, values(jArray<nsHtml5String, int32_t>::newJArray(8))
|
||||
, lines(jArray<int32_t, int32_t>::newJArray(8))
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsHtml5HtmlAttributes);
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ nsHtml5HtmlAttributes::getIndex(nsHtml5AttributeName* name)
|
|||
return -1;
|
||||
}
|
||||
|
||||
nsString*
|
||||
nsHtml5String
|
||||
nsHtml5HtmlAttributes::getValue(nsHtml5AttributeName* name)
|
||||
{
|
||||
int32_t index = getIndex(name);
|
||||
|
|
@ -123,7 +123,7 @@ nsHtml5HtmlAttributes::getPrefixNoBoundsCheck(int32_t index)
|
|||
return names[index]->getPrefix(mode);
|
||||
}
|
||||
|
||||
nsString*
|
||||
nsHtml5String
|
||||
nsHtml5HtmlAttributes::getValueNoBoundsCheck(int32_t index)
|
||||
{
|
||||
MOZ_ASSERT(index < length && index >= 0, "Index out of bounds");
|
||||
|
|
@ -145,14 +145,17 @@ nsHtml5HtmlAttributes::getLineNoBoundsCheck(int32_t index)
|
|||
}
|
||||
|
||||
void
|
||||
nsHtml5HtmlAttributes::addAttribute(nsHtml5AttributeName* name, nsString* value, int32_t line)
|
||||
nsHtml5HtmlAttributes::addAttribute(nsHtml5AttributeName* name,
|
||||
nsHtml5String value,
|
||||
int32_t line)
|
||||
{
|
||||
if (names.length == length) {
|
||||
int32_t newLen = length << 1;
|
||||
jArray<nsHtml5AttributeName*,int32_t> newNames = jArray<nsHtml5AttributeName*,int32_t>::newJArray(newLen);
|
||||
nsHtml5ArrayCopy::arraycopy(names, newNames, names.length);
|
||||
names = newNames;
|
||||
jArray<nsString*,int32_t> newValues = jArray<nsString*,int32_t>::newJArray(newLen);
|
||||
jArray<nsHtml5String, int32_t> newValues =
|
||||
jArray<nsHtml5String, int32_t>::newJArray(newLen);
|
||||
nsHtml5ArrayCopy::arraycopy(values, newValues, values.length);
|
||||
values = newValues;
|
||||
jArray<int32_t,int32_t> newLines = jArray<int32_t,int32_t>::newJArray(newLen);
|
||||
|
|
@ -171,7 +174,7 @@ nsHtml5HtmlAttributes::clear(int32_t m)
|
|||
for (int32_t i = 0; i < length; i++) {
|
||||
names[i]->release();
|
||||
names[i] = nullptr;
|
||||
nsHtml5Portability::releaseString(values[i]);
|
||||
values[i].Release();
|
||||
values[i] = nullptr;
|
||||
}
|
||||
length = 0;
|
||||
|
|
@ -181,7 +184,7 @@ nsHtml5HtmlAttributes::clear(int32_t m)
|
|||
void
|
||||
nsHtml5HtmlAttributes::releaseValue(int32_t i)
|
||||
{
|
||||
nsHtml5Portability::releaseString(values[i]);
|
||||
values[i].Release();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue