Merge mozilla-inbound to mozilla-central. a=merge

This commit is contained in:
Andreea Pavel 2018-09-22 12:34:50 +03:00
commit 62ce7b988d
334 changed files with 1753 additions and 1473 deletions

6
Cargo.lock generated
View File

@ -1662,7 +1662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "plane-split"
version = "0.13.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2651,7 +2651,7 @@ dependencies = [
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"plane-split 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plane-split 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2974,7 +2974,7 @@ dependencies = [
"checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03"
"checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2"
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
"checksum plane-split 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "64d766f38b15fe1337bdddfc869ef5c50437323f857aaaadc6490197db80a1b8"
"checksum plane-split 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cd1ab9bf7197c31ac8004a487cd1ddc5cf420029fb53023fdcab0540b5fa1410"
"checksum podio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e5422a1ee1bc57cc47ae717b0137314258138f38fd5f3cea083f43a9725383a0"
"checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
"checksum proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "77997c53ae6edd6d187fec07ec41b207063b5ee6f33680e9fa86d405cdd313d4"

View File

@ -0,0 +1,36 @@
/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "SessionAccessibility.h"
#include "AndroidUiThread.h"
#include "nsThreadUtils.h"
#ifdef DEBUG
#include <android/log.h>
#define AALOG(args...) \
__android_log_print(ANDROID_LOG_INFO, "GeckoAccessibilityNative", ##args)
#else
#define AALOG(args...) \
do { \
} while (0)
#endif
template<>
const char nsWindow::NativePtr<mozilla::a11y::SessionAccessibility>::sName[] =
"SessionAccessibility";
using namespace mozilla::a11y;
void
SessionAccessibility::SetAttached(bool aAttached)
{
if (RefPtr<nsThread> uiThread = GetAndroidUiThread()) {
uiThread->Dispatch(NS_NewRunnableFunction(
"SessionAccessibility::Attach",
[aAttached,
sa = java::SessionAccessibility::NativeProvider::GlobalRef(
mSessionAccessibility)] { sa->SetAttached(aAttached); }));
}
}

View File

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_a11y_SessionAccessibility_h_
#define mozilla_a11y_SessionAccessibility_h_
#include "GeneratedJNINatives.h"
#include "nsWindow.h"
namespace mozilla {
namespace a11y {
class SessionAccessibility final
: public java::SessionAccessibility::NativeProvider::Natives<SessionAccessibility>
{
public:
typedef java::SessionAccessibility::NativeProvider::Natives<SessionAccessibility> Base;
SessionAccessibility(
nsWindow::NativePtr<SessionAccessibility>* aPtr,
nsWindow* aWindow,
java::SessionAccessibility::NativeProvider::Param aSessionAccessibility)
: mWindow(aPtr, aWindow)
, mSessionAccessibility(aSessionAccessibility)
{
SetAttached(true);
}
void OnDetach() { SetAttached(false); }
// Native implementations
using Base::AttachNative;
using Base::DisposeNative;
NS_INLINE_DECL_REFCOUNTING(SessionAccessibility)
private:
~SessionAccessibility() {}
void SetAttached(bool aAttached);
nsWindow::WindowPtr<SessionAccessibility> mWindow; // Parent only
java::SessionAccessibility::NativeProvider::GlobalRef mSessionAccessibility;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -6,11 +6,13 @@
EXPORTS.mozilla.a11y += ['AccessibleWrap.h',
'HyperTextAccessibleWrap.h',
'SessionAccessibility.h',
]
SOURCES += [
'AccessibleWrap.cpp',
'Platform.cpp',
'SessionAccessibility.cpp',
]
LOCAL_INCLUDES += [

View File

@ -4,6 +4,7 @@
#include "AccGroupInfo.h"
#include "nsAccUtils.h"
#include "TableAccessible.h"
#include "Role.h"
#include "States.h"
@ -185,6 +186,75 @@ AccGroupInfo::FirstItemOf(const Accessible* aContainer)
return nullptr;
}
uint32_t
AccGroupInfo::TotalItemCount(Accessible* aContainer, bool* aIsHierarchical)
{
uint32_t itemCount = 0;
switch (aContainer->Role()) {
case roles::TABLE:
if (nsCoreUtils::GetUIntAttr(aContainer->GetContent(),
nsGkAtoms::aria_rowcount,
(int32_t*)&itemCount)) {
break;
}
if (TableAccessible* tableAcc = aContainer->AsTable()) {
return tableAcc->RowCount();
}
break;
case roles::ROW:
if (Accessible* table = nsAccUtils::TableFor(aContainer)) {
if (nsCoreUtils::GetUIntAttr(table->GetContent(),
nsGkAtoms::aria_colcount,
(int32_t*)&itemCount)) {
break;
}
if (TableAccessible* tableAcc = table->AsTable()) {
return tableAcc->ColCount();
}
}
break;
case roles::OUTLINE:
case roles::LIST:
case roles::MENUBAR:
case roles::MENUPOPUP:
case roles::COMBOBOX:
case roles::GROUPING:
case roles::TREE_TABLE:
case roles::COMBOBOX_LIST:
case roles::LISTBOX:
case roles::DEFINITION_LIST:
case roles::EDITCOMBOBOX:
case roles::RADIO_GROUP:
case roles::PAGETABLIST: {
Accessible* childItem = AccGroupInfo::FirstItemOf(aContainer);
if (!childItem) {
childItem = aContainer->FirstChild();
if (childItem->IsTextLeaf()) {
// First child can be a text leaf, check its sibling for an item.
childItem = childItem->NextSibling();
}
}
if (childItem) {
GroupPos groupPos = childItem->GroupPosition();
itemCount = groupPos.setSize;
if (groupPos.level && aIsHierarchical) {
*aIsHierarchical = true;
}
}
break;
}
default:
break;
}
return itemCount;
}
Accessible*
AccGroupInfo::NextItemTo(Accessible* aItem)
{

View File

@ -69,6 +69,11 @@ public:
*/
static Accessible* FirstItemOf(const Accessible* aContainer);
/**
* Return total number of items in container, and if it is has nested collections.
*/
static uint32_t TotalItemCount(Accessible* aContainer, bool* aIsHierarchical);
/**
* Return next item of the same group to the given item.
*/

View File

@ -1048,6 +1048,20 @@ Accessible::NativeAttributes()
nsAccUtils::SetAccGroupAttrs(attributes, groupPos.level,
groupPos.setSize, groupPos.posInSet);
bool hierarchical = false;
uint32_t itemCount = AccGroupInfo::TotalItemCount(this, &hierarchical);
if (itemCount) {
nsAutoString itemCountStr;
itemCountStr.AppendInt(itemCount);
attributes->SetStringProperty(NS_LITERAL_CSTRING("child-item-count"),
itemCountStr, unused);
}
if (hierarchical) {
attributes->SetStringProperty(NS_LITERAL_CSTRING("hierarchical"),
NS_LITERAL_STRING("true"), unused);
}
// If the accessible doesn't have own content (such as list item bullet or
// xul tree item) then don't calculate content based attributes.
if (!HasOwnContent())

View File

@ -25,6 +25,26 @@ function testAbsentAttrs(aAccOrElmOrID, aAbsentAttrs) {
testAttrsInternal(aAccOrElmOrID, {}, true, aAbsentAttrs);
}
/**
* Test object attributes that aren't right, but should be (todo)
*
* @param aAccOrElmOrID [in] the accessible identifier
* @param aKey [in] attribute name
* @param aExpectedValue [in] expected attribute value
*/
function todoAttr(aAccOrElmOrID, aKey, aExpectedValue) {
var accessible = getAccessible(aAccOrElmOrID);
if (!accessible)
return;
var attrs = null;
try {
attrs = accessible.attributes;
} catch (e) { }
todo_is(attrs.getStringProperty(aKey), aExpectedValue, "attributes match");
}
/**
* Test CSS based object attributes.
*/
@ -96,6 +116,16 @@ function testGroupAttrs(aAccOrElmOrID, aPosInSet, aSetSize, aLevel) {
}
}
function testGroupParentAttrs(aAccOrElmOrID, aChildItemCount, aIsHierarchical) {
testAttrs(aAccOrElmOrID, { "child-item-count": String(aChildItemCount) }, true);
if (aIsHierarchical) {
testAttrs(aAccOrElmOrID, { "hierarchical": "true" }, true);
} else {
testAbsentAttrs(aAccOrElmOrID, { "hierarchical": "true" });
}
}
// //////////////////////////////////////////////////////////////////////////////
// Text attributes.

View File

@ -24,6 +24,9 @@
testGroupAttrs("opt3-nosize", 3, 4);
testGroupAttrs("opt4-nosize", 4, 4);
// Container should have item count and not hierarchical
testGroupParentAttrs(getAccessible("opt1-nosize").parent, 4, false);
// ////////////////////////////////////////////////////////////////////////
// HTML select
testGroupAttrs("opt1", 1, 2);
@ -58,32 +61,45 @@
testGroupAttrs("li2", 2, 3);
testGroupAttrs("li3", 3, 3);
// ul should have item count and not hierarchical
testGroupParentAttrs("ul", 3, false);
// ////////////////////////////////////////////////////////////////////////
// HTML ul/ol (nested lists)
testGroupAttrs("li4", 1, 3, 1);
testGroupAttrs("li5", 2, 3, 1);
testGroupAttrs("li6", 3, 3, 1);
// ol with nested list should have 1st level item count and be hierarchical
testGroupParentAttrs("ol", 3, true);
testGroupAttrs("n_li4", 1, 3, 2);
testGroupAttrs("n_li5", 2, 3, 2);
testGroupAttrs("n_li6", 3, 3, 2);
// nested ol should have item count and be hierarchical
testGroupParentAttrs("ol_nested", 3, true);
// ////////////////////////////////////////////////////////////////////////
// ARIA list
testGroupAttrs("li7", 1, 3);
testGroupAttrs("li8", 2, 3);
testGroupAttrs("li9", 3, 3);
// simple flat aria list
testGroupParentAttrs("aria-list_1", 3, false);
// ////////////////////////////////////////////////////////////////////////
// ARIA list (nested lists: list -> listitem -> list -> listitem)
testGroupAttrs("li10", 1, 3, 1);
testGroupAttrs("li11", 2, 3, 1);
testGroupAttrs("li12", 3, 3, 1);
// aria list with nested list
testGroupParentAttrs("aria-list_2", 3, true);
testGroupAttrs("n_li10", 1, 3, 2);
testGroupAttrs("n_li11", 2, 3, 2);
testGroupAttrs("n_li12", 3, 3, 2);
// nested aria list.
testGroupParentAttrs("aria-list_2_1", 3, true);
// ////////////////////////////////////////////////////////////////////////
// ARIA list (nested lists: list -> listitem -> group -> listitem)
@ -93,6 +109,8 @@
testGroupAttrs("lgt_li2", 2, 2, 1);
testGroupAttrs("lgt_li2_nli1", 1, 2, 2);
testGroupAttrs("lgt_li2_nli2", 2, 2, 2);
// aria list with nested list
testGroupParentAttrs("aria-list_3", 2, true);
// ////////////////////////////////////////////////////////////////////////
// ARIA menu (menuitem, separator, menuitemradio and menuitemcheckbox)
@ -103,18 +121,27 @@
testGroupAttrs("menu_item1.3", 1, 3);
testGroupAttrs("menu_item1.4", 2, 3);
testGroupAttrs("menu_item1.5", 3, 3);
// menu bar item count
testGroupParentAttrs("menubar", 2, false);
// Bug 1492529. Menu should have total number of items 5 from both sets,
// but only has the first 2 item set.
todoAttr("menu", "child-item-count", "5");
// ////////////////////////////////////////////////////////////////////////
// ARIA tab
testGroupAttrs("tab_1", 1, 3);
testGroupAttrs("tab_2", 2, 3);
testGroupAttrs("tab_3", 3, 3);
// tab list tab count
testGroupParentAttrs("tablist_1", 3, false);
// ////////////////////////////////////////////////////////////////////////
// ARIA radio
testGroupAttrs("r1", 1, 3);
testGroupAttrs("r2", 2, 3);
testGroupAttrs("r3", 3, 3);
// explicit aria radio group
testGroupParentAttrs("rg1", 3, false);
// ////////////////////////////////////////////////////////////////////////
// ARIA tree
@ -126,6 +153,7 @@
testGroupAttrs("ti6", 2, 3, 2);
testGroupAttrs("ti7", 3, 3, 2);
testGroupAttrs("ti8", 3, 3, 1);
testGroupParentAttrs("tree_1", 3, true);
// ////////////////////////////////////////////////////////////////////////
// ARIA tree (tree -> treeitem -> group -> treeitem)
@ -135,6 +163,7 @@
testGroupAttrs("tree2_ti2", 2, 2, 1);
testGroupAttrs("tree2_ti2a", 1, 2, 2);
testGroupAttrs("tree2_ti2b", 2, 2, 2);
testGroupParentAttrs("tree_2", 2, true);
// ////////////////////////////////////////////////////////////////////////
// ARIA tree (tree -> treeitem, group -> treeitem)
@ -144,6 +173,7 @@
testGroupAttrs("tree3_ti2", 2, 2, 1);
testGroupAttrs("tree3_ti2a", 1, 2, 2);
testGroupAttrs("tree3_ti2b", 2, 2, 2);
testGroupParentAttrs("tree_3", 2, true);
// ////////////////////////////////////////////////////////////////////////
// ARIA grid
@ -154,6 +184,7 @@
testGroupAttrs("grid_row2", 2, 2);
testAbsentAttrs("grid_cell3", {"posinset": "", "setsize": ""});
testAbsentAttrs("grid_cell4", {"posinset": "", "setsize": ""});
testGroupParentAttrs("grid", 2, false);
// ////////////////////////////////////////////////////////////////////////
// ARIA treegrid
@ -169,6 +200,10 @@
testAbsentAttrs("treegrid_cell5", {"posinset": "", "setsize": ""});
testAbsentAttrs("treegrid_cell6", {"posinset": "", "setsize": ""});
testGroupParentAttrs("treegrid", 2, true);
// row child item count provided by parent grid's aria-colcount
testGroupParentAttrs("treegrid_row1", 4, false);
// ////////////////////////////////////////////////////////////////////////
// HTML headings
testGroupAttrs("h1", 0, 0, 1);
@ -177,6 +212,8 @@
testGroupAttrs("h4", 0, 0, 4);
testGroupAttrs("h5", 0, 0, 5);
testGroupAttrs("h6", 0, 0, 6);
// No child item counts or "hierarchical" flag for parent of headings
testAbsentAttrs("headings", {"child-item-count": "", "hierarchical": ""});
// ////////////////////////////////////////////////////////////////////////
// ARIA combobox
@ -184,26 +221,36 @@
testGroupAttrs("combo1_opt2", 2, 4);
testGroupAttrs("combo1_opt3", 3, 4);
testGroupAttrs("combo1_opt4", 4, 4);
testGroupParentAttrs("combo1", 4, false);
// ////////////////////////////////////////////////////////////////////////
// ARIA table
testGroupAttrs("table_cell", 3, 4);
testGroupAttrs("table_row", 2, 2);
// grid child item count provided by aria-rowcount
testGroupParentAttrs("table", 2, false);
// row child item count provided by parent grid's aria-colcount
testGroupParentAttrs("table_row", 4, false);
// ////////////////////////////////////////////////////////////////////////
// ARIA list constructed by ARIA owns
testGroupAttrs("t1_li1", 1, 3);
testGroupAttrs("t1_li2", 2, 3);
testGroupAttrs("t1_li3", 3, 3);
testGroupParentAttrs("aria-list_4", 3, false);
// Test that group position information updates after deleting node.
testGroupAttrs("tree4_ti1", 1, 2, 1);
testGroupAttrs("tree4_ti2", 2, 2, 1);
testGroupParentAttrs("tree4", 2, true);
var tree4element = document.getElementById("tree4_ti1");
var tree4acc = getAccessible("tree4");
tree4element.remove();
waitForEvent(EVENT_REORDER, tree4acc, function() {
testGroupAttrs("tree4_ti2", 1, 1, 1);
testGroupParentAttrs("tree4", 1, true);
SimpleTest.finish();
});
}
@ -269,17 +316,17 @@
<input type="radio" id="radio3" name="group2"/>
<input type="radio" id="radio4" name="group2"/>
<ul>
<ul id="ul">
<li id="li1">Oranges</li>
<li id="li2">Apples</li>
<li id="li3">Bananas</li>
</ul>
<ol>
<ol id="ol">
<li id="li4">Oranges</li>
<li id="li5">Apples</li>
<li id="li6">Bananas
<ul>
<ul id="ol_nested">
<li id="n_li4">Oranges</li>
<li id="n_li5">Apples</li>
<li id="n_li6">Bananas</li>
@ -287,17 +334,17 @@
</li>
</ol>
<span role="list">
<span role="list" id="aria-list_1">
<span role="listitem" id="li7">Oranges</span>
<span role="listitem" id="li8">Apples</span>
<span role="listitem" id="li9">Bananas</span>
</span>
<span role="list">
<span role="list" id="aria-list_2">
<span role="listitem" id="li10">Oranges</span>
<span role="listitem" id="li11">Apples</span>
<span role="listitem" id="li12">Bananas
<span role="list">
<span role="list" id="aria-list_2_1">
<span role="listitem" id="n_li10">Oranges</span>
<span role="listitem" id="n_li11">Apples</span>
<span role="listitem" id="n_li12">Bananas</span>
@ -305,7 +352,7 @@
</span>
</span>
<div role="list">
<div role="list" id="aria-list_3">
<div role="listitem" id="lgt_li1">Item 1
<div role="group">
<div role="listitem" id="lgt_li1_nli1">Item 1A</div>
@ -320,9 +367,9 @@
</div>
</div>
<ul role="menubar">
<ul role="menubar" id="menubar">
<li role="menuitem" aria-haspopup="true" id="menu_item1">File
<ul role="menu">
<ul role="menu" id="menu">
<li role="menuitem" id="menu_item1.1">New</li>
<li role="menuitem" id="menu_item1.2">Open…</li>
<li role="separator">-----</li>
@ -346,7 +393,7 @@
<li id="r3" role="radio" aria-checked="false">Jimmy Johns</li>
</ul>
<table role="tree">
<table role="tree" id="tree_1">
<tr role="presentation">
<td role="treeitem" aria-expanded="true" aria-level="1"
id="ti1">vegetables</td>
@ -375,7 +422,7 @@
</tr>
</table>
<ul role="tree">
<ul role="tree" id="tree_2">
<li role="treeitem" id="tree2_ti1">Item 1
<ul role="group">
<li role="treeitem" id="tree2_ti1a">Item 1A</li>
@ -390,7 +437,7 @@
</li>
</div>
<div role="tree">
<div role="tree" id="tree_3">
<div role="treeitem" id="tree3_ti1">Item 1</div>
<div role="group">
<li role="treeitem" id="tree3_ti1a">Item 1A</li>
@ -408,7 +455,7 @@
id="tree4_ti1">Item 1</div><div role="treeitem"
id="tree4_ti2">Item 2</div></div>
<table role="grid">
<table role="grid" id="grid">
<tr role="row" id="grid_row1">
<td role="gridcell" id="grid_cell1">cell1</td>
<td role="gridcell" id="grid_cell2">cell2</td>
@ -419,7 +466,7 @@
</tr>
</table>
<div role="treegrid">
<div role="treegrid" id="treegrid" aria-colcount="4">
<div role="row" aria-level="1" id="treegrid_row1">
<div role="gridcell" id="treegrid_cell1">cell1</div>
<div role="gridcell" id="treegrid_cell2">cell2</div>
@ -434,12 +481,14 @@
</div>
</div>
<h1 id="h1">heading1</h1>
<h2 id="h2">heading2</h2>
<h3 id="h3">heading3</h3>
<h4 id="h4">heading4</h4>
<h5 id="h5">heading5</h5>
<h6 id="h6">heading6</h6>
<div id="headings">
<h1 id="h1">heading1</h1>
<h2 id="h2">heading2</h2>
<h3 id="h3">heading3</h3>
<h4 id="h4">heading4</h4>
<h5 id="h5">heading5</h5>
<h6 id="h6">heading6</h6>
</div>
<ul id="combo1" role="combobox">Password
<li id="combo1_opt1" role="option">Xyzzy</li>
@ -453,13 +502,13 @@
<input type="radio" id="radio5" name="group3">
</form>
<div role="table" aria-colcount="4" aria-rowcount="2">
<div role="table" aria-colcount="4" aria-rowcount="2" id="table">
<div role="row" id="table_row" aria-rowindex="2">
<div role="cell" id="table_cell" aria-colindex="3">cell</div>
</div>
</div>
<div role="list" aria-owns="t1_li1 t1_li2 t1_li3">
<div role="list" aria-owns="t1_li1 t1_li2 t1_li3" id="aria-list_4">
<div role="listitem" id="t1_li2">Apples</div>
<div role="listitem" id="t1_li1">Oranges</div>
</span>

View File

@ -37,7 +37,7 @@ bool Attr::sInitialized;
Attr::Attr(nsDOMAttributeMap *aAttrMap,
already_AddRefed<dom::NodeInfo>&& aNodeInfo,
const nsAString& aValue)
: nsINode(aNodeInfo), mAttrMap(aAttrMap), mValue(aValue)
: nsINode(std::move(aNodeInfo)), mAttrMap(aAttrMap), mValue(aValue)
{
MOZ_ASSERT(mNodeInfo, "We must get a nodeinfo here!");
MOZ_ASSERT(mNodeInfo->NodeType() == ATTRIBUTE_NODE,

View File

@ -41,19 +41,8 @@
namespace mozilla {
namespace dom {
CharacterData::CharacterData(already_AddRefed<dom::NodeInfo>& aNodeInfo)
: nsIContent(aNodeInfo)
{
MOZ_ASSERT(mNodeInfo->NodeType() == TEXT_NODE ||
mNodeInfo->NodeType() == CDATA_SECTION_NODE ||
mNodeInfo->NodeType() == COMMENT_NODE ||
mNodeInfo->NodeType() == PROCESSING_INSTRUCTION_NODE ||
mNodeInfo->NodeType() == DOCUMENT_TYPE_NODE,
"Bad NodeType in aNodeInfo");
}
CharacterData::CharacterData(already_AddRefed<dom::NodeInfo>&& aNodeInfo)
: nsIContent(aNodeInfo)
: nsIContent(std::move(aNodeInfo))
{
MOZ_ASSERT(mNodeInfo->NodeType() == TEXT_NODE ||
mNodeInfo->NodeType() == CDATA_SECTION_NODE ||

View File

@ -85,7 +85,6 @@ public:
NS_DECL_ADDSIZEOFEXCLUDINGTHIS
explicit CharacterData(already_AddRefed<dom::NodeInfo>& aNodeInfo);
explicit CharacterData(already_AddRefed<dom::NodeInfo>&& aNodeInfo);
void MarkAsMaybeModifiedFrequently()

View File

@ -26,7 +26,7 @@ private:
public:
explicit Comment(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: CharacterData(aNodeInfo)
: CharacterData(std::move(aNodeInfo))
{
Init();
}

View File

@ -43,8 +43,8 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DocumentFragment, FragmentOrElement)
explicit DocumentFragment(already_AddRefed<dom::NodeInfo>& aNodeInfo)
: FragmentOrElement(aNodeInfo), mHost(nullptr)
explicit DocumentFragment(already_AddRefed<dom::NodeInfo>&& aNodeInfo)
: FragmentOrElement(std::move(aNodeInfo)), mHost(nullptr)
{
Init();
}

View File

@ -27,13 +27,14 @@ NS_NewDOMDocumentType(nsNodeInfoManager* aNodeInfoManager,
{
MOZ_ASSERT(aName, "Must have a name");
already_AddRefed<mozilla::dom::NodeInfo> ni =
RefPtr<mozilla::dom::NodeInfo> ni =
aNodeInfoManager->GetNodeInfo(nsGkAtoms::documentTypeNodeName, nullptr,
kNameSpaceID_None,
nsINode::DOCUMENT_TYPE_NODE, aName);
RefPtr<mozilla::dom::DocumentType> docType =
new mozilla::dom::DocumentType(ni, aPublicId, aSystemId, aInternalSubset);
new mozilla::dom::DocumentType(ni.forget(), aPublicId, aSystemId,
aInternalSubset);
return docType.forget();
}
@ -46,11 +47,11 @@ DocumentType::WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
return DocumentType_Binding::Wrap(cx, this, aGivenProto);
}
DocumentType::DocumentType(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
DocumentType::DocumentType(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
const nsAString& aPublicId,
const nsAString& aSystemId,
const nsAString& aInternalSubset) :
CharacterData(aNodeInfo),
CharacterData(std::move(aNodeInfo)),
mPublicId(aPublicId),
mSystemId(aSystemId),
mInternalSubset(aInternalSubset)
@ -101,8 +102,8 @@ DocumentType::GetInternalSubset(nsAString& aInternalSubset) const
already_AddRefed<CharacterData>
DocumentType::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo, bool aCloneText) const
{
already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
return do_AddRef(new DocumentType(ni, mPublicId, mSystemId, mInternalSubset));
return do_AddRef(new DocumentType(do_AddRef(aNodeInfo), mPublicId, mSystemId,
mInternalSubset));
}
} // namespace dom

View File

@ -28,7 +28,7 @@ namespace dom {
class DocumentType final : public CharacterData
{
public:
DocumentType(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
DocumentType(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
const nsAString& aPublicId,
const nsAString& aSystemId,
const nsAString& aInternalSubset);

View File

@ -148,8 +148,8 @@ class Element : public FragmentOrElement
{
public:
#ifdef MOZILLA_INTERNAL_API
explicit Element(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo) :
FragmentOrElement(aNodeInfo),
explicit Element(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) :
FragmentOrElement(std::move(aNodeInfo)),
mState(NS_EVENT_STATE_MOZ_READONLY | NS_EVENT_STATE_DEFINED)
{
MOZ_ASSERT(mNodeInfo->NodeType() == ELEMENT_NODE,
@ -2101,9 +2101,8 @@ nsresult \
_elementName::Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const \
{ \
*aResult = nullptr; \
already_AddRefed<mozilla::dom::NodeInfo> ni = \
RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget(); \
_elementName *it = new _elementName(ni); \
RefPtr<mozilla::dom::NodeInfo> ni(aNodeInfo); \
_elementName *it = new _elementName(ni.forget()); \
if (!it) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \
@ -2124,9 +2123,8 @@ _elementName::Clone(mozilla::dom::NodeInfo* aNodeInfo, \
nsINode** aResult) const \
{ \
*aResult = nullptr; \
already_AddRefed<mozilla::dom::NodeInfo> ni = \
RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget(); \
_elementName *it = new _elementName(ni EXPAND extra_args_); \
RefPtr<mozilla::dom::NodeInfo> ni(aNodeInfo); \
_elementName *it = new _elementName(ni.forget() EXPAND extra_args_); \
if (!it) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \

View File

@ -857,13 +857,8 @@ FragmentOrElement::nsExtendedDOMSlots::SizeOfExcludingThis(MallocSizeOf aMallocS
return n;
}
FragmentOrElement::FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsIContent(aNodeInfo)
{
}
FragmentOrElement::FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsIContent(aNodeInfo)
: nsIContent(std::move(aNodeInfo))
{
}

View File

@ -28,14 +28,7 @@ GeneratedImageContent::Create(nsIDocument& aDocument, uint32_t aContentIndex)
kNameSpaceID_XHTML,
nsINode::ELEMENT_NODE);
// Work around not being able to bind a non-const lvalue reference
// to an rvalue of non-reference type by just creating an rvalue
// reference. And we can't change the constructor signature,
// because then the macro-generated Clone() method fails to compile.
already_AddRefed<dom::NodeInfo>&& rvalue = nodeInfo.forget();
auto image =
MakeRefPtr<GeneratedImageContent>(rvalue);
auto image = MakeRefPtr<GeneratedImageContent>(nodeInfo.forget());
image->mIndex = aContentIndex;
return image.forget();
}

View File

@ -26,8 +26,8 @@ public:
static already_AddRefed<GeneratedImageContent>
Create(nsIDocument&, uint32_t aContentIndex);
explicit GeneratedImageContent(already_AddRefed<dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit GeneratedImageContent(already_AddRefed<dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
MOZ_ASSERT(IsInNamespace(kNameSpaceID_XHTML), "Someone messed up our nodeinfo");
}

View File

@ -64,7 +64,7 @@ NS_IMPL_RELEASE_INHERITED(ShadowRoot, DocumentFragment)
ShadowRoot::ShadowRoot(Element* aElement, ShadowRootMode aMode,
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: DocumentFragment(aNodeInfo)
: DocumentFragment(std::move(aNodeInfo))
, DocumentOrShadowRoot(*this)
, mMode(aMode)
, mIsUAWidget(false)

View File

@ -18,12 +18,8 @@ class Text : public CharacterData
public:
NS_IMPL_FROMNODE_HELPER(Text, IsText())
explicit Text(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: CharacterData(aNodeInfo)
{}
explicit Text(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: CharacterData(aNodeInfo)
: CharacterData(std::move(aNodeInfo))
{}
// WebIDL API

View File

@ -1349,13 +1349,11 @@ struct nsIDocument::FrameRequest
int32_t mHandle;
};
static already_AddRefed<mozilla::dom::NodeInfo> nullNodeInfo;
// ==================================================================
// =
// ==================================================================
nsIDocument::nsIDocument()
: nsINode(nullNodeInfo),
: nsINode(nullptr),
DocumentOrShadowRoot(*this),
mReferrerPolicySet(false),
mReferrerPolicy(mozilla::net::RP_Unset),

View File

@ -61,8 +61,8 @@ public:
// If you're using the external API, the only thing you can know about
// nsIContent is that it exists with an IID
explicit nsIContent(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsINode(aNodeInfo)
explicit nsIContent(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsINode(std::move(aNodeInfo))
{
MOZ_ASSERT(mNodeInfo);
SetNodeIsContent();

View File

@ -152,8 +152,8 @@ nsINode::nsSlots::Unlink()
//----------------------------------------------------------------------
#ifdef MOZILLA_INTERNAL_API
nsINode::nsINode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: mNodeInfo(aNodeInfo)
nsINode::nsINode(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: mNodeInfo(std::move(aNodeInfo))
, mParent(nullptr)
#ifndef BOOL_FLAGS_ON_WRAPPER_CACHE
, mBoolFlags(0)

View File

@ -370,7 +370,7 @@ public:
friend class AttrArray;
#ifdef MOZILLA_INTERNAL_API
explicit nsINode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit nsINode(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
#endif
virtual ~nsINode();

View File

@ -32,8 +32,8 @@ class nsMappedAttributeElement : public nsMappedAttributeElementBase
protected:
explicit nsMappedAttributeElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsMappedAttributeElementBase(aNodeInfo)
explicit nsMappedAttributeElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsMappedAttributeElementBase(std::move(aNodeInfo))
{}
public:

View File

@ -33,8 +33,8 @@ class nsStyledElement : public nsStyledElementBase
protected:
inline explicit nsStyledElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsStyledElementBase(aNodeInfo)
inline explicit nsStyledElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsStyledElementBase(std::move(aNodeInfo))
{}
public:

View File

@ -34,10 +34,10 @@ class nsAttributeTextNode final : public nsTextNode,
public:
NS_DECL_ISUPPORTS_INHERITED
nsAttributeTextNode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
nsAttributeTextNode(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
int32_t aNameSpaceID,
nsAtom* aAttrName) :
nsTextNode(aNodeInfo),
nsTextNode(std::move(aNodeInfo)),
mGrandparent(nullptr),
mNameSpaceID(aNameSpaceID),
mAttrName(aAttrName)
@ -58,10 +58,8 @@ public:
CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
bool aCloneText) const override
{
already_AddRefed<mozilla::dom::NodeInfo> ni =
RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
RefPtr<nsAttributeTextNode> it =
new nsAttributeTextNode(ni, mNameSpaceID, mAttrName);
new nsAttributeTextNode(do_AddRef(aNodeInfo), mNameSpaceID, mAttrName);
if (aCloneText) {
it->mText = mText;
}
@ -115,8 +113,7 @@ nsTextNode::IsNodeOfType(uint32_t aFlags) const
already_AddRefed<CharacterData>
nsTextNode::CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo, bool aCloneText) const
{
already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
RefPtr<nsTextNode> it = new nsTextNode(ni);
RefPtr<nsTextNode> it = new nsTextNode(do_AddRef(aNodeInfo));
if (aCloneText) {
it->mText = mText;
}
@ -219,12 +216,12 @@ NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
*aResult = nullptr;
already_AddRefed<mozilla::dom::NodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
nsAttributeTextNode* textNode = new nsAttributeTextNode(ni,
aNameSpaceID,
aAttrName);
NS_ADDREF(*aResult = textNode);
RefPtr<nsAttributeTextNode> textNode = new nsAttributeTextNode(ni.forget(),
aNameSpaceID,
aAttrName);
textNode.forget(aResult);
return NS_OK;
}

View File

@ -30,8 +30,8 @@ private:
}
public:
explicit nsTextNode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: mozilla::dom::Text(aNodeInfo)
explicit nsTextNode(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: mozilla::dom::Text(std::move(aNodeInfo))
{
Init();
}

View File

@ -128,7 +128,7 @@ OffscreenCanvas::GetContext(JSContext* aCx,
return nullptr;
}
already_AddRefed<nsISupports> result =
RefPtr<nsISupports> result =
CanvasRenderingContextHelper::GetContext(aCx,
aContextId,
aContextOptions,
@ -166,7 +166,7 @@ OffscreenCanvas::GetContext(JSContext* aCx,
}
}
return result;
return result.forget();
}
already_AddRefed<nsICanvasRenderingContextInternal>

View File

@ -23,8 +23,8 @@ class HTMLAnchorElement final : public nsGenericHTMLElement,
public:
using Element::GetText;
explicit HTMLAnchorElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLAnchorElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
, Link(this)
{
}

View File

@ -19,8 +19,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Area)
namespace mozilla {
namespace dom {
HTMLAreaElement::HTMLAreaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLAreaElement::HTMLAreaElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
, Link(this)
{
}

View File

@ -24,7 +24,7 @@ class HTMLAreaElement final : public nsGenericHTMLElement,
public Link
{
public:
explicit HTMLAreaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLAreaElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

View File

@ -27,8 +27,8 @@ namespace dom {
NS_IMPL_ELEMENT_CLONE(HTMLAudioElement)
HTMLAudioElement::HTMLAudioElement(already_AddRefed<NodeInfo>& aNodeInfo)
: HTMLMediaElement(aNodeInfo)
HTMLAudioElement::HTMLAudioElement(already_AddRefed<NodeInfo>&& aNodeInfo)
: HTMLMediaElement(std::move(aNodeInfo))
{
DecoderDoctorLogger::LogConstruction(this);
}
@ -57,12 +57,12 @@ HTMLAudioElement::Audio(const GlobalObject& aGlobal,
return nullptr;
}
already_AddRefed<mozilla::dom::NodeInfo> nodeInfo =
RefPtr<mozilla::dom::NodeInfo> nodeInfo =
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::audio, nullptr,
kNameSpaceID_XHTML,
ELEMENT_NODE);
RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(nodeInfo);
RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(nodeInfo.forget());
audio->SetHTMLAttr(nsGkAtoms::preload, NS_LITERAL_STRING("auto"), aRv);
if (aRv.Failed()) {
return nullptr;

View File

@ -23,7 +23,7 @@ public:
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLAudioElement, audio)
explicit HTMLAudioElement(already_AddRefed<NodeInfo>& aNodeInfo);
explicit HTMLAudioElement(already_AddRefed<NodeInfo>&& aNodeInfo);
// Element
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const override;

View File

@ -17,8 +17,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(BR)
namespace mozilla {
namespace dom {
HTMLBRElement::HTMLBRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLBRElement::HTMLBRElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -17,7 +17,7 @@ namespace dom {
class HTMLBRElement final : public nsGenericHTMLElement
{
public:
explicit HTMLBRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLBRElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
virtual bool ParseAttribute(int32_t aNamespaceID,
nsAtom* aAttribute,

View File

@ -22,8 +22,8 @@ class HTMLBodyElement final : public nsGenericHTMLElement
public:
using Element::GetText;
explicit HTMLBodyElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLBodyElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -53,9 +53,9 @@ static const nsAttrValue::EnumTable* kButtonDefaultType = &kButtonTypeTable[2];
// Construction, destruction
HTMLButtonElement::HTMLButtonElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLButtonElement::HTMLButtonElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElementWithState(aNodeInfo, kButtonDefaultType->value),
: nsGenericHTMLFormElementWithState(std::move(aNodeInfo), kButtonDefaultType->value),
mDisabledChanged(false),
mInInternalActivate(false),
mInhibitStateRestoration(!!(aFromParser & FROM_PARSER_FRAGMENT))

View File

@ -22,7 +22,7 @@ class HTMLButtonElement final : public nsGenericHTMLFormElementWithState,
public:
using nsIConstraintValidation::GetValidationMessage;
explicit HTMLButtonElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
explicit HTMLButtonElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLButtonElement,

View File

@ -393,8 +393,8 @@ NS_IMPL_ISUPPORTS(HTMLCanvasElementObserver, nsIObserver)
// ---------------------------------------------------------------------------
HTMLCanvasElement::HTMLCanvasElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
HTMLCanvasElement::HTMLCanvasElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo)),
mResetLayer(true) ,
mWriteOnly(false)
{}

View File

@ -131,7 +131,7 @@ class HTMLCanvasElement final : public nsGenericHTMLElement,
typedef layers::WebRenderCanvasData WebRenderCanvasData;
public:
explicit HTMLCanvasElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLCanvasElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLCanvasElement, canvas)

View File

@ -13,8 +13,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Data)
namespace mozilla {
namespace dom {
HTMLDataElement::HTMLDataElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLDataElement::HTMLDataElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -17,7 +17,7 @@ namespace dom {
class HTMLDataElement final : public nsGenericHTMLElement
{
public:
explicit HTMLDataElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLDataElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
// HTMLDataElement WebIDL
void GetValue(DOMString& aValue)

View File

@ -16,8 +16,8 @@ namespace dom {
class HTMLDataListElement final : public nsGenericHTMLElement
{
public:
explicit HTMLDataListElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLDataListElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -24,8 +24,8 @@ class HTMLDetailsElement final : public nsGenericHTMLElement
public:
using NodeInfo = mozilla::dom::NodeInfo;
explicit HTMLDetailsElement(already_AddRefed<NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLDetailsElement(already_AddRefed<NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -15,10 +15,10 @@ NS_NewHTMLDialogElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
if (!mozilla::dom::HTMLDialogElement::IsDialogEnabled()) {
return new mozilla::dom::HTMLUnknownElement(aNodeInfo);
return new mozilla::dom::HTMLUnknownElement(std::move(aNodeInfo));
}
return new mozilla::dom::HTMLDialogElement(aNodeInfo);
return new mozilla::dom::HTMLDialogElement(std::move(aNodeInfo));
}
namespace mozilla {

View File

@ -18,7 +18,8 @@ namespace dom {
class HTMLDialogElement final : public nsGenericHTMLElement
{
public:
explicit HTMLDialogElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo) : nsGenericHTMLElement(aNodeInfo)
explicit HTMLDialogElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -15,8 +15,8 @@ namespace dom {
class HTMLDivElement final : public nsGenericHTMLElement
{
public:
explicit HTMLDivElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLDivElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -14,7 +14,7 @@ namespace dom {
class HTMLElement final : public nsGenericHTMLElement
{
public:
explicit HTMLElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
virtual ~HTMLElement();
nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
@ -23,8 +23,8 @@ protected:
JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
};
HTMLElement::HTMLElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLElement::HTMLElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
if (NodeInfo()->Equals(nsGkAtoms::bdi)) {
AddStatesSilently(NS_EVENT_STATE_DIR_ATTR_LIKE_AUTO);
@ -52,7 +52,7 @@ nsGenericHTMLElement*
NS_NewHTMLElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
return new mozilla::dom::HTMLElement(aNodeInfo);
return new mozilla::dom::HTMLElement(std::move(aNodeInfo));
}
// Distinct from the above in order to have function pointer that compared unequal
@ -61,5 +61,5 @@ nsGenericHTMLElement*
NS_NewCustomElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
return new mozilla::dom::HTMLElement(aNodeInfo);
return new mozilla::dom::HTMLElement(std::move(aNodeInfo));
}

View File

@ -27,9 +27,9 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Embed)
namespace mozilla {
namespace dom {
HTMLEmbedElement::HTMLEmbedElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLEmbedElement::HTMLEmbedElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLElement(aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
RegisterActivityObserver();
SetIsNetworkCreated(aFromParser == FROM_PARSER_NETWORK);

View File

@ -20,7 +20,7 @@ class HTMLEmbedElement final : public nsGenericHTMLElement
, public nsObjectLoadingContent
{
public:
explicit HTMLEmbedElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
explicit HTMLEmbedElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
// nsISupports

View File

@ -17,8 +17,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(FieldSet)
namespace mozilla {
namespace dom {
HTMLFieldSetElement::HTMLFieldSetElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLFormElement(aNodeInfo, NS_FORM_FIELDSET)
HTMLFieldSetElement::HTMLFieldSetElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLFormElement(std::move(aNodeInfo), NS_FORM_FIELDSET)
, mElements(nullptr)
, mFirstLegend(nullptr)
, mInvalidElementsCount(0)

View File

@ -25,7 +25,7 @@ public:
using nsIConstraintValidation::GetValidationMessage;
using nsIConstraintValidation::SetCustomValidity;
explicit HTMLFieldSetElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLFieldSetElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLFieldSetElement, fieldset)

View File

@ -15,8 +15,8 @@ namespace dom {
class HTMLFontElement final : public nsGenericHTMLElement
{
public:
explicit HTMLFontElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLFontElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -95,8 +95,8 @@ static const nsAttrValue::EnumTable* kFormDefaultAutocomplete = &kFormAutocomple
bool HTMLFormElement::gFirstFormSubmitted = false;
bool HTMLFormElement::gPasswordManagerInitialized = false;
HTMLFormElement::HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
HTMLFormElement::HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo)),
mControls(new HTMLFormControlsCollection(this)),
mSelectedRadioButtons(2),
mRequiredRadioButtonCounts(2),

View File

@ -44,7 +44,7 @@ class HTMLFormElement final : public nsGenericHTMLElement,
public:
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLFormElement, form)
explicit HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
enum {
FORM_CONTROL_LIST_HASHTABLE_LENGTH = 8

View File

@ -12,9 +12,9 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Frame)
namespace mozilla {
namespace dom {
HTMLFrameElement::HTMLFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLFrameElement::HTMLFrameElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
: nsGenericHTMLFrameElement(std::move(aNodeInfo), aFromParser)
{
}

View File

@ -19,7 +19,7 @@ class HTMLFrameElement final : public nsGenericHTMLFrameElement
public:
using nsGenericHTMLFrameElement::SwapFrameLoaders;
explicit HTMLFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
explicit HTMLFrameElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
// nsISupports

View File

@ -46,8 +46,8 @@ class OnBeforeUnloadEventHandlerNonNull;
class HTMLFrameSetElement final : public nsGenericHTMLElement
{
public:
explicit HTMLFrameSetElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
explicit HTMLFrameSetElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo)),
mNumRows(0),
mNumCols(0),
mCurrentRowColHint(NS_STYLE_HINT_REFLOW)

View File

@ -14,8 +14,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(HR)
namespace mozilla {
namespace dom {
HTMLHRElement::HTMLHRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLHRElement::HTMLHRElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -18,7 +18,7 @@ namespace dom {
class HTMLHRElement final : public nsGenericHTMLElement
{
public:
explicit HTMLHRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLHRElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
// nsISupports
NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLHRElement, nsGenericHTMLElement)

View File

@ -16,8 +16,8 @@ namespace dom {
class HTMLHeadingElement final : public nsGenericHTMLElement
{
public:
explicit HTMLHeadingElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLHeadingElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -27,9 +27,9 @@ const DOMTokenListSupportedToken HTMLIFrameElement::sSupportedSandboxTokens[] =
nullptr
};
HTMLIFrameElement::HTMLIFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLIFrameElement::HTMLIFrameElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
: nsGenericHTMLFrameElement(std::move(aNodeInfo), aFromParser)
{
}

View File

@ -17,7 +17,7 @@ namespace dom {
class HTMLIFrameElement final : public nsGenericHTMLFrameElement
{
public:
explicit HTMLIFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
explicit HTMLIFrameElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLIFrameElement, iframe)

View File

@ -117,8 +117,8 @@ private:
bool mUseUrgentStartForChannel;
};
HTMLImageElement::HTMLImageElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLImageElement::HTMLImageElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
, mForm(nullptr)
, mInDocResponsiveContent(false)
, mCurrentDensity(1.0)
@ -734,12 +734,12 @@ HTMLImageElement::Image(const GlobalObject& aGlobal,
return nullptr;
}
already_AddRefed<mozilla::dom::NodeInfo> nodeInfo =
RefPtr<mozilla::dom::NodeInfo> nodeInfo =
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::img, nullptr,
kNameSpaceID_XHTML,
ELEMENT_NODE);
RefPtr<HTMLImageElement> img = new HTMLImageElement(nodeInfo);
RefPtr<HTMLImageElement> img = new HTMLImageElement(nodeInfo.forget());
if (aWidth.WasPassed()) {
img->SetWidth(aWidth.Value(), aError);

View File

@ -27,7 +27,7 @@ class HTMLImageElement final : public nsGenericHTMLElement,
friend class HTMLPictureElement;
friend class ImageLoadTask;
public:
explicit HTMLImageElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLImageElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
static already_AddRefed<HTMLImageElement>
Image(const GlobalObject& aGlobal,

View File

@ -989,9 +989,9 @@ HTMLInputElement::Shutdown()
// construction, destruction
//
HTMLInputElement::HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLInputElement::HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser, FromClone aFromClone)
: nsGenericHTMLFormElementWithState(aNodeInfo, kInputDefaultType->value)
: nsGenericHTMLFormElementWithState(std::move(aNodeInfo), kInputDefaultType->value)
, mAutocompleteAttrState(nsContentUtils::eAutocompleteAttrState_Unknown)
, mAutocompleteInfoState(nsContentUtils::eAutocompleteAttrState_Unknown)
, mDisabledChanged(false)
@ -1131,8 +1131,8 @@ HTMLInputElement::Clone(dom::NodeInfo* aNodeInfo, nsINode** aResult) const
{
*aResult = nullptr;
already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
RefPtr<HTMLInputElement> it = new HTMLInputElement(ni, NOT_FROM_PARSER,
RefPtr<HTMLInputElement> it = new HTMLInputElement(do_AddRef(aNodeInfo),
NOT_FROM_PARSER,
FromClone::yes);
nsresult rv = const_cast<HTMLInputElement*>(this)->CopyInnerTo(it);

View File

@ -137,7 +137,7 @@ public:
enum class FromClone { no, yes };
HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser,
FromClone aFromClone = FromClone::no);

View File

@ -17,8 +17,8 @@ namespace dom {
class HTMLLIElement final : public nsGenericHTMLElement
{
public:
explicit HTMLLIElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLLIElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -20,8 +20,8 @@ namespace dom {
class HTMLLabelElement final : public nsGenericHTMLElement
{
public:
explicit HTMLLabelElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
explicit HTMLLabelElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo)),
mHandlingEvent(false)
{
}

View File

@ -17,8 +17,8 @@ namespace dom {
class HTMLLegendElement final : public nsGenericHTMLElement
{
public:
explicit HTMLLegendElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLLegendElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -58,8 +58,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Link)
namespace mozilla {
namespace dom {
HTMLLinkElement::HTMLLinkElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLLinkElement::HTMLLinkElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
, Link(this)
{
}

View File

@ -22,7 +22,7 @@ class HTMLLinkElement final : public nsGenericHTMLElement,
public Link
{
public:
explicit HTMLLinkElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLLinkElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

View File

@ -16,8 +16,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Map)
namespace mozilla {
namespace dom {
HTMLMapElement::HTMLMapElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLMapElement::HTMLMapElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -19,7 +19,7 @@ namespace dom {
class HTMLMapElement final : public nsGenericHTMLElement
{
public:
explicit HTMLMapElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLMapElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

View File

@ -3870,8 +3870,8 @@ private:
NS_IMPL_ISUPPORTS(HTMLMediaElement::ShutdownObserver, nsIObserver)
HTMLMediaElement::HTMLMediaElement(
already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
, mWatchManager(this, OwnerDoc()->AbstractMainThreadFor(TaskCategory::Other))
, mMainThreadEventTarget(OwnerDoc()->EventTargetFor(TaskCategory::Other))
, mAbstractMainThread(OwnerDoc()->AbstractMainThreadFor(TaskCategory::Other))

View File

@ -122,7 +122,7 @@ public:
return mCORSMode;
}
explicit HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
void ReportCanPlayTelemetry();

View File

@ -46,8 +46,8 @@ enum SeparatorType
HTMLMenuElement::HTMLMenuElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_TOOLBAR)
HTMLMenuElement::HTMLMenuElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo)), mType(MENU_TYPE_TOOLBAR)
{
}

View File

@ -18,7 +18,7 @@ namespace dom {
class HTMLMenuElement final : public nsGenericHTMLElement
{
public:
explicit HTMLMenuElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLMenuElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLMenuElement, menu)

View File

@ -157,8 +157,8 @@ protected:
HTMLMenuItemElement::HTMLMenuItemElement(
already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo, FromParser aFromParser)
: nsGenericHTMLElement(aNodeInfo),
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo, FromParser aFromParser)
: nsGenericHTMLElement(std::move(aNodeInfo)),
mType(kMenuItemDefaultType->value),
mParserCreating(false),
mShouldInitChecked(false),
@ -179,9 +179,8 @@ nsresult
HTMLMenuItemElement::Clone(dom::NodeInfo* aNodeInfo, nsINode** aResult) const
{
*aResult = nullptr;
already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
RefPtr<HTMLMenuItemElement> it =
new HTMLMenuItemElement(ni, NOT_FROM_PARSER);
new HTMLMenuItemElement(do_AddRef(aNodeInfo), NOT_FROM_PARSER);
nsresult rv = const_cast<HTMLMenuItemElement*>(this)->CopyInnerTo(it);
if (NS_SUCCEEDED(rv)) {
switch (mType) {

View File

@ -23,7 +23,7 @@ class HTMLMenuItemElement final : public nsGenericHTMLElement
public:
using mozilla::dom::Element::GetText;
HTMLMenuItemElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLMenuItemElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser);
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLMenuItemElement, menuitem)

View File

@ -22,8 +22,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Meta)
namespace mozilla {
namespace dom {
HTMLMetaElement::HTMLMetaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLMetaElement::HTMLMetaElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -16,7 +16,7 @@ namespace dom {
class HTMLMetaElement final : public nsGenericHTMLElement
{
public:
explicit HTMLMetaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLMetaElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
// nsISupports
NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLMetaElement, nsGenericHTMLElement)

View File

@ -18,8 +18,8 @@ const double HTMLMeterElement::kDefaultMin = 0.0;
const double HTMLMeterElement::kDefaultMax = 1.0;
HTMLMeterElement::HTMLMeterElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLMeterElement::HTMLMeterElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -20,7 +20,7 @@ namespace dom {
class HTMLMeterElement final : public nsGenericHTMLElement
{
public:
explicit HTMLMeterElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLMeterElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
virtual EventStates IntrinsicState() const override;

View File

@ -13,8 +13,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Mod)
namespace mozilla {
namespace dom {
HTMLModElement::HTMLModElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLModElement::HTMLModElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -17,7 +17,7 @@ namespace dom {
class HTMLModElement final : public nsGenericHTMLElement
{
public:
explicit HTMLModElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLModElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;

View File

@ -27,9 +27,9 @@
namespace mozilla {
namespace dom {
HTMLObjectElement::HTMLObjectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLObjectElement::HTMLObjectElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElement(aNodeInfo, NS_FORM_OBJECT),
: nsGenericHTMLFormElement(std::move(aNodeInfo), NS_FORM_OBJECT),
mIsDoneAddingChildren(!aFromParser)
{
RegisterActivityObserver();

View File

@ -22,7 +22,7 @@ class HTMLObjectElement final : public nsGenericHTMLFormElement
, public nsIConstraintValidation
{
public:
explicit HTMLObjectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
explicit HTMLObjectElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
// nsISupports

View File

@ -25,8 +25,8 @@ namespace dom {
HTMLOptGroupElement::HTMLOptGroupElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLOptGroupElement::HTMLOptGroupElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
// We start off enabled
AddStatesSilently(NS_EVENT_STATE_ENABLED);

View File

@ -17,7 +17,7 @@ namespace dom {
class HTMLOptGroupElement final : public nsGenericHTMLElement
{
public:
explicit HTMLOptGroupElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLOptGroupElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLOptGroupElement, optgroup)

View File

@ -32,8 +32,8 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Option)
namespace mozilla {
namespace dom {
HTMLOptionElement::HTMLOptionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
HTMLOptionElement::HTMLOptionElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo)),
mSelectedChanged(false),
mIsSelected(false),
mIsInSetDefaultSelected(false)
@ -341,12 +341,12 @@ HTMLOptionElement::Option(const GlobalObject& aGlobal,
return nullptr;
}
already_AddRefed<mozilla::dom::NodeInfo> nodeInfo =
RefPtr<mozilla::dom::NodeInfo> nodeInfo =
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::option, nullptr,
kNameSpaceID_XHTML,
ELEMENT_NODE);
RefPtr<HTMLOptionElement> option = new HTMLOptionElement(nodeInfo);
RefPtr<HTMLOptionElement> option = new HTMLOptionElement(nodeInfo.forget());
if (!aText.IsEmpty()) {
// Create a new text node and append it to the option

View File

@ -19,7 +19,7 @@ class HTMLSelectElement;
class HTMLOptionElement final : public nsGenericHTMLElement
{
public:
explicit HTMLOptionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLOptionElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
static already_AddRefed<HTMLOptionElement>
Option(const GlobalObject& aGlobal,

View File

@ -19,9 +19,9 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Output)
namespace mozilla {
namespace dom {
HTMLOutputElement::HTMLOutputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
HTMLOutputElement::HTMLOutputElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElement(aNodeInfo, NS_FORM_OUTPUT)
: nsGenericHTMLFormElement(std::move(aNodeInfo), NS_FORM_OUTPUT)
, mValueModeFlag(eModeDefault)
, mIsDoneAddingChildren(!aFromParser)
{

View File

@ -24,7 +24,7 @@ class HTMLOutputElement final : public nsGenericHTMLFormElement,
public:
using nsIConstraintValidation::GetValidationMessage;
explicit HTMLOutputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
explicit HTMLOutputElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
// nsISupports

View File

@ -17,8 +17,8 @@ namespace dom {
class HTMLParagraphElement final : public nsGenericHTMLElement
{
public:
explicit HTMLParagraphElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
explicit HTMLParagraphElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -13,14 +13,14 @@ nsGenericHTMLElement*
NS_NewHTMLPictureElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
return new mozilla::dom::HTMLPictureElement(aNodeInfo);
return new mozilla::dom::HTMLPictureElement(std::move(aNodeInfo));
}
namespace mozilla {
namespace dom {
HTMLPictureElement::HTMLPictureElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
HTMLPictureElement::HTMLPictureElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsGenericHTMLElement(std::move(aNodeInfo))
{
}

View File

@ -16,7 +16,7 @@ namespace dom {
class HTMLPictureElement final : public nsGenericHTMLElement
{
public:
explicit HTMLPictureElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
explicit HTMLPictureElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
// nsISupports
NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLPictureElement, nsGenericHTMLElement)

Some files were not shown because too many files have changed in this diff Show More