OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 } | 271 } |
272 | 272 |
273 inline void dispatchEventsOnWindowAndFocusedElement(Document* document, bool foc
used) | 273 inline void dispatchEventsOnWindowAndFocusedElement(Document* document, bool foc
used) |
274 { | 274 { |
275 ASSERT(document); | 275 ASSERT(document); |
276 // If we have a focused element we should dispatch blur on it before we blur
the window. | 276 // If we have a focused element we should dispatch blur on it before we blur
the window. |
277 // If we have a focused element we should dispatch focus on it after we focu
s the window. | 277 // If we have a focused element we should dispatch focus on it after we focu
s the window. |
278 // https://bugs.webkit.org/show_bug.cgi?id=27105 | 278 // https://bugs.webkit.org/show_bug.cgi?id=27105 |
279 | 279 |
280 if (document->focusedElement() && isHTMLPlugInElement(document->focusedEleme
nt())) | |
281 toHTMLPlugInElement(document->focusedElement())->setPluginFocus(focused)
; | |
282 | |
283 // Do not fire events while modal dialogs are up. See https://bugs.webkit.o
rg/show_bug.cgi?id=33962 | 280 // Do not fire events while modal dialogs are up. See https://bugs.webkit.o
rg/show_bug.cgi?id=33962 |
284 if (Page* page = document->page()) { | 281 if (Page* page = document->page()) { |
285 if (page->defersLoading()) | 282 if (page->defersLoading()) |
286 return; | 283 return; |
287 } | 284 } |
288 | 285 |
289 if (!focused && document->focusedElement()) { | 286 if (!focused && document->focusedElement()) { |
290 RefPtrWillBeRawPtr<Element> focusedElement(document->focusedElement()); | 287 RefPtrWillBeRawPtr<Element> focusedElement(document->focusedElement()); |
291 focusedElement->setFocus(false); | 288 focusedElement->setFocus(false); |
292 dispatchBlurEvent(*document, *focusedElement); | 289 dispatchBlurEvent(*document, *focusedElement); |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 return consumed; | 1254 return consumed; |
1258 } | 1255 } |
1259 | 1256 |
1260 DEFINE_TRACE(FocusController) | 1257 DEFINE_TRACE(FocusController) |
1261 { | 1258 { |
1262 visitor->trace(m_page); | 1259 visitor->trace(m_page); |
1263 visitor->trace(m_focusedFrame); | 1260 visitor->trace(m_focusedFrame); |
1264 } | 1261 } |
1265 | 1262 |
1266 } // namespace blink | 1263 } // namespace blink |
OLD | NEW |