Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ghostoy
Copy link
Member

@ghostoy ghostoy commented Feb 3, 2015

This CL is a revert of r175241 (which was landed 6 months ago), essentially.

Currently an event listener is fired in a ScriptState that installed the event listener, but this is wrong. An event listener must be fired in a ScriptState that is calculated based on the ExecutionContext that fired the event listener and the world that installed the event listener. This is what we had been doing before r175241, and this CL restores the behavior. See an added test case for more details. The new behavior aligns with the spec and Firefox.

One tricky part is how to handle a beforeunload event. A return value of a beforeunload event needs to be fired in a ScriptState that installed the beforeunload event listener. To achieve the behavior, this CL records the ScriptState onto V8AbstractEventListener::m_scriptStateForBeforeUnload.

BUG=422227
TEST=event-should-be-dispatched-for-correct-frame.html,before-unload-return-bad-value.html

Review URL: https://codereview.chromium.org/823263002

git-svn-id: svn://svn.chromium.org/blink/trunk@187861 bbb929c8-8fbe-4397-9dbb-9b2b20218538

This CL is a revert of r175241 (which was landed 6 months ago), essentially.

Currently an event listener is fired in a ScriptState that installed the event listener, but this is wrong. An event listener must be fired in a ScriptState that is calculated based on the ExecutionContext that fired the event listener and the world that installed the event listener. This is what we had been doing before r175241, and this CL restores the behavior. See an added test case for more details. The new behavior aligns with the spec and Firefox.

One tricky part is how to handle a beforeunload event. A return value of a beforeunload event needs to be fired in a ScriptState that installed the beforeunload event listener. To achieve the behavior, this CL records the ScriptState onto V8AbstractEventListener::m_scriptStateForBeforeUnload.

BUG=422227
TEST=event-should-be-dispatched-for-correct-frame.html,before-unload-return-bad-value.html

Review URL: https://codereview.chromium.org/823263002

git-svn-id: svn://svn.chromium.org/blink/trunk@187861 bbb929c8-8fbe-4397-9dbb-9b2b20218538

Conflicts:
	Source/bindings/core/v8/V8AbstractEventListener.cpp
	Source/bindings/core/v8/V8AbstractEventListener.h
	Source/bindings/core/v8/V8ErrorHandler.h
	Source/bindings/core/v8/V8EventListener.h
	Source/bindings/core/v8/V8LazyEventListener.cpp
	Source/bindings/core/v8/V8LazyEventListener.h
	Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp
	Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.h
	Source/core/xml/DocumentXSLT.cpp
@rogerwang rogerwang closed this Mar 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants