Commit 11e3e4dc authored by tkent@chromium.org's avatar tkent@chromium.org

New SELECT popup: Delay change event dispatching when an option is selected.

This is a speculative fix for crbug.com/515899.  If a JavaScript dialog is
opened while a SELECT popup is shown, and the SELECT popup is hidden before the
dialog is hidden, window focus is not correctly restored.  So, we guess delaying
change events solves the problem.

BUG=515899

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

git-svn-id: svn://svn.chromium.org/blink/trunk@201952 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent fd0384db
......@@ -31,6 +31,7 @@
#ifndef ScopedEventQueue_h
#define ScopedEventQueue_h
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "wtf/Noncopyable.h"
#include "wtf/PassRefPtr.h"
......@@ -41,7 +42,7 @@ namespace blink {
class EventDispatchMediator;
class ScopedEventQueue {
class CORE_EXPORT ScopedEventQueue {
WTF_MAKE_NONCOPYABLE(ScopedEventQueue); WTF_MAKE_FAST_ALLOCATED(ScopedEventQueue);
public:
~ScopedEventQueue();
......
......@@ -11,6 +11,7 @@
#include "core/dom/ExecutionContextTask.h"
#include "core/dom/NodeComputedStyle.h"
#include "core/dom/StyleEngine.h"
#include "core/events/ScopedEventQueue.h"
#include "core/frame/FrameView.h"
#include "core/html/HTMLHRElement.h"
#include "core/html/HTMLOptGroupElement.h"
......@@ -404,6 +405,7 @@ void PopupMenuImpl::setValueAndClosePopup(int numValue, const String& stringValu
{
ASSERT(m_popup);
ASSERT(m_ownerElement);
EventQueueScope scope;
RefPtrWillBeRawPtr<PopupMenuImpl> protector(this);
bool success;
int listIndex = stringValue.toInt(&success);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment