mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-22 20:33:10 +09:00
Bug 1409976 - Add slotchange event
* Add support for `slotchange` event * Signal `slotchange` when slot's assigned nodes changes Tag #1375
This commit is contained in:
parent
907e210445
commit
af22b5cba5
9 changed files with 174 additions and 160 deletions
|
|
@ -4,6 +4,7 @@
|
|||
* 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 "mozilla/dom/DocGroup.h"
|
||||
#include "mozilla/dom/HTMLSlotElement.h"
|
||||
#include "mozilla/dom/HTMLSlotElementBinding.h"
|
||||
#include "mozilla/dom/HTMLUnknownElement.h"
|
||||
|
|
@ -204,6 +205,26 @@ HTMLSlotElement::ClearAssignedNodes()
|
|||
mAssignedNodes.Clear();
|
||||
}
|
||||
|
||||
void
|
||||
HTMLSlotElement::EnqueueSlotChangeEvent() const
|
||||
{
|
||||
DocGroup* docGroup = OwnerDoc()->GetDocGroup();
|
||||
if (!docGroup) {
|
||||
return;
|
||||
}
|
||||
|
||||
docGroup->SignalSlotChange(this);
|
||||
}
|
||||
|
||||
void
|
||||
HTMLSlotElement::FireSlotChangeEvent()
|
||||
{
|
||||
nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
|
||||
static_cast<nsIContent*>(this),
|
||||
NS_LITERAL_STRING("slotchange"), true,
|
||||
false);
|
||||
}
|
||||
|
||||
JSObject*
|
||||
HTMLSlotElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue