зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1559077 - Implement Element.part. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D48707 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
39e0d5dc32
Коммит
e7e8c1f792
|
@ -539,6 +539,16 @@ nsDOMTokenList* Element::ClassList() {
|
|||
return slots->mClassList;
|
||||
}
|
||||
|
||||
nsDOMTokenList* Element::Part() {
|
||||
Element::nsDOMSlots* slots = DOMSlots();
|
||||
|
||||
if (!slots->mPart) {
|
||||
slots->mPart = new nsDOMTokenList(this, nsGkAtoms::part);
|
||||
}
|
||||
|
||||
return slots->mPart;
|
||||
}
|
||||
|
||||
void Element::GetAttributeNames(nsTArray<nsString>& aResult) {
|
||||
uint32_t count = mAttrs.AttrCount();
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
|
|
|
@ -1030,6 +1030,8 @@ class Element : public FragmentOrElement {
|
|||
}
|
||||
|
||||
nsDOMTokenList* ClassList();
|
||||
nsDOMTokenList* Part();
|
||||
|
||||
nsDOMAttributeMap* Attributes() {
|
||||
nsDOMSlots* slots = DOMSlots();
|
||||
if (!slots->mAttributeMap) {
|
||||
|
|
|
@ -597,6 +597,9 @@ void FragmentOrElement::nsDOMSlots::Traverse(
|
|||
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCb, "mSlots->mClassList");
|
||||
aCb.NoteXPCOMChild(mClassList.get());
|
||||
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCb, "mSlots->mPart");
|
||||
aCb.NoteXPCOMChild(mPart.get());
|
||||
}
|
||||
|
||||
void FragmentOrElement::nsDOMSlots::Unlink() {
|
||||
|
@ -608,6 +611,7 @@ void FragmentOrElement::nsDOMSlots::Unlink() {
|
|||
}
|
||||
mChildrenList = nullptr;
|
||||
mClassList = nullptr;
|
||||
mPart = nullptr;
|
||||
}
|
||||
|
||||
size_t FragmentOrElement::nsDOMSlots::SizeOfIncludingThis(
|
||||
|
|
|
@ -247,6 +247,11 @@ class FragmentOrElement : public nsIContent {
|
|||
* An object implementing the .classList property for this element.
|
||||
*/
|
||||
RefPtr<nsDOMTokenList> mClassList;
|
||||
|
||||
/**
|
||||
* An object implementing the .part property for this element.
|
||||
*/
|
||||
RefPtr<nsDOMTokenList> mPart;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,6 +33,10 @@ interface Element : Node {
|
|||
[Constant, PutForwards=value]
|
||||
readonly attribute DOMTokenList classList;
|
||||
|
||||
// https://drafts.csswg.org/css-shadow-parts/#idl
|
||||
[SameObject, PutForwards=value, Pref="layout.css.shadow-parts.enabled"]
|
||||
readonly attribute DOMTokenList part;
|
||||
|
||||
[SameObject]
|
||||
readonly attribute NamedNodeMap attributes;
|
||||
[Pure]
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[invalidation-change-part-name-idl-domtokenlist.html]
|
||||
[Part in selected host changed color via part IDL DOMTokenList attribute.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[invalidation-change-part-name-idl-setter.html]
|
||||
[Part in selected host changed color via part IDL attribute setter.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
[part-name-idl.html]
|
||||
[Access to .part returns an empty DOMTokenList.]
|
||||
expected: FAIL
|
||||
|
||||
[Changes in DOMTokenList are refected in attribute.]
|
||||
expected: FAIL
|
||||
|
||||
[DOMTokenList created by access is persisted.]
|
||||
expected: FAIL
|
||||
|
||||
[Multiple names give a DOMTokenList with multiple entries.]
|
||||
expected: FAIL
|
||||
|
Загрузка…
Ссылка в новой задаче