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: 2018-05-05 20:23 UTC
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: Not a bug Package: DOM XML related
PHP Version: 5.3.2 OS: all
Private report: No CVE-ID: None
 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-05 20:23 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2018-05-05 20:23 UTC] requinix@php.net
This would require backend work by the libxml folks that PHP could then use, and they don't even support HTML 5 yet.

So closing NAB. If they ever add DOM events then we can reopen this.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Jul 19 01:01:24 2018 UTC