[Bug 25683] New: Document "unsafe to dispatch events" in D3E if it's possible

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25683

            Bug ID: 25683
           Summary: Document "unsafe to dispatch events" in D3E if it's
                    possible
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DOM3 Events
          Assignee: travil@microsoft.com
          Reporter: masayuki@d-toybox.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: bugs@pettay.fi, garykac@gmail.com, mike@w3.org,
                    www-dom@w3.org
            Blocks: 23913

I've commented about "unsafe to dispatch events" case in bug 23913.

Similar issue as bug 23913 exists with focusin, focusout and DOMNodeRemoved
since they and beforeinput are defined the timing to be dispatched by D3E.

According to Olli, while content is changing, it's unsafe to dispatch DOM
events because rendering engine cannot handle changes at random times. An event
listener may change DOM or close windows or whatever.

"unsafe" means that no unexpected DOM tree or layout changes (or other changes,
like new page loads etc). In general it means that if scripts would run during
that time, it would most probably leads to sec-critical bugs.

So, I'd like to suggest that unloading document, changing DOM tree or changing
editor content should be defined as "may be unsafe". If a browser needs to
dispatch an event but it's impossible due to unsafe state, D3E should allow
browsers to dispatch events immediately after becoming safe. Then, cancelable
event may not be able to prevent default action.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Tuesday, 13 May 2014 12:26:18 UTC