php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52151 implement DOM3 events
Submitted: 2010-06-23 05:40 UTC Modified: -
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: giorgio dot liscio at email dot it Assigned:
Status: Open Package: DOM XML related
PHP Version: 5.3.2 OS: all
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-06-23 05:40 UTC] giorgio dot liscio at email dot it
Description:
------------
hi, why not extend DOM classes with addEventListener and removeEventListener methods. In php they are useful as observer pattern

the propagation with two models (capturing / bubbling)
http://www.quirksmode.org/js/events_order.html

mutation events in dom3 events:
http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationevents
http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationnameevents

for example i can monitor a subtree with

$mysel->addEventListener("DOMSubtreeModified", array($this,'mycallback'), false);

public function mycallback($event)
{
      echo "subtree changed at " . (string)$event->relatedNodeArg;
}

list of events:

DOMSubtreeModified
DOMNodeInserted
DOMNodeRemoved
DOMNodeRemovedFromDocument
DOMNodeInsertedIntoDocument
DOMAttrModified
DOMElementNameChanged
DOMCharacterDataModified
DOMElementNameChanged
DOMAttributeNameChanged

thank you


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC