Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: Source/core/dom/Document.cpp

Issue 137833018: Remove form control related virtual methods from Element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add HTMLFormControlElement.setFocus as suggested Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/dom/Element.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 3344 matching lines...) Expand 10 before | Expand all | Expand 10 after
3355 3355
3356 // Remove focus from the existing focus node (if any) 3356 // Remove focus from the existing focus node (if any)
3357 if (oldFocusedElement) { 3357 if (oldFocusedElement) {
3358 ASSERT(!oldFocusedElement->inDetach()); 3358 ASSERT(!oldFocusedElement->inDetach());
3359 3359
3360 if (oldFocusedElement->active()) 3360 if (oldFocusedElement->active())
3361 oldFocusedElement->setActive(false); 3361 oldFocusedElement->setActive(false);
3362 3362
3363 oldFocusedElement->setFocus(false); 3363 oldFocusedElement->setFocus(false);
3364 3364
3365 // Dispatch a change event for text fields or textareas that have been e dited
3366 if (oldFocusedElement->wasChangedSinceLastFormControlChangeEvent())
3367 oldFocusedElement->dispatchFormControlChangeEvent();
3368
3369 // Dispatch the blur event and let the node do any other blur related ac tivities (important for text fields) 3365 // Dispatch the blur event and let the node do any other blur related ac tivities (important for text fields)
3370 // If page lost focus, blur event will have already been dispatched 3366 // If page lost focus, blur event will have already been dispatched
3371 if (page() && (page()->focusController().isFocused())) { 3367 if (page() && (page()->focusController().isFocused())) {
3372 oldFocusedElement->dispatchBlurEvent(newFocusedElement.get()); 3368 oldFocusedElement->dispatchBlurEvent(newFocusedElement.get());
3373 3369
3374 if (m_focusedElement) { 3370 if (m_focusedElement) {
3375 // handler shifted focus 3371 // handler shifted focus
3376 focusChangeBlocked = true; 3372 focusChangeBlocked = true;
3377 newFocusedElement = 0; 3373 newFocusedElement = 0;
3378 } 3374 }
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after
5319 if (!page->focusController().isActive() || !page->focusController().isFocuse d()) 5315 if (!page->focusController().isActive() || !page->focusController().isFocuse d())
5320 return false; 5316 return false;
5321 if (Frame* focusedFrame = page->focusController().focusedFrame()) { 5317 if (Frame* focusedFrame = page->focusController().focusedFrame()) {
5322 if (focusedFrame->tree().isDescendantOf(frame())) 5318 if (focusedFrame->tree().isDescendantOf(frame()))
5323 return true; 5319 return true;
5324 } 5320 }
5325 return false; 5321 return false;
5326 } 5322 }
5327 5323
5328 } // namespace WebCore 5324 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698