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

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

Issue 26237004: Remove unused editing related member functions from WebViewClient (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-10-09T17:59:14 Created 7 years, 2 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 | Annotate | Revision Log
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (!renderer || !renderer->isWidget()) 297 if (!renderer || !renderer->isWidget())
298 return 0; 298 return 0;
299 return toRenderWidget(renderer)->widget(); 299 return toRenderWidget(renderer)->widget();
300 } 300 }
301 301
302 static bool acceptsEditingFocus(Element* element) 302 static bool acceptsEditingFocus(Element* element)
303 { 303 {
304 ASSERT(element); 304 ASSERT(element);
305 ASSERT(element->rendererIsEditable()); 305 ASSERT(element->rendererIsEditable());
306 306
307 Element* root = element->rootEditableElement(); 307 return element->document().frame() && element->rootEditableElement();
308 Frame* frame = element->document().frame();
309 if (!frame || !root)
310 return false;
311
312 return frame->editor().shouldBeginEditing(rangeOfContents(root).get());
313 } 308 }
314 309
315 static bool canAccessAncestor(const SecurityOrigin* activeSecurityOrigin, Frame* targetFrame) 310 static bool canAccessAncestor(const SecurityOrigin* activeSecurityOrigin, Frame* targetFrame)
316 { 311 {
317 // targetFrame can be 0 when we're trying to navigate a top-level frame 312 // targetFrame can be 0 when we're trying to navigate a top-level frame
318 // that has a 0 opener. 313 // that has a 0 opener.
319 if (!targetFrame) 314 if (!targetFrame)
320 return false; 315 return false;
321 316
322 const bool isLocalActiveOrigin = activeSecurityOrigin->isLocal(); 317 const bool isLocalActiveOrigin = activeSecurityOrigin->isLocal();
(...skipping 2982 matching lines...) Expand 10 before | Expand all | Expand 10 after
3305 // FIXME: We should remove firing DOMFocusOutEvent event when we are sur e no content depends 3300 // FIXME: We should remove firing DOMFocusOutEvent event when we are sur e no content depends
3306 // on it, probably when <rdar://problem/8503958> is resolved. 3301 // on it, probably when <rdar://problem/8503958> is resolved.
3307 oldFocusedElement->dispatchFocusOutEvent(EventNames::DOMFocusOut, newFoc usedElement.get()); // DOM level 2 name for compatibility. 3302 oldFocusedElement->dispatchFocusOutEvent(EventNames::DOMFocusOut, newFoc usedElement.get()); // DOM level 2 name for compatibility.
3308 3303
3309 if (m_focusedElement) { 3304 if (m_focusedElement) {
3310 // handler shifted focus 3305 // handler shifted focus
3311 focusChangeBlocked = true; 3306 focusChangeBlocked = true;
3312 newFocusedElement = 0; 3307 newFocusedElement = 0;
3313 } 3308 }
3314 3309
3315 if (oldFocusedElement->isRootEditableElement())
3316 frame()->editor().didEndEditing();
3317
3318 if (view()) { 3310 if (view()) {
3319 Widget* oldWidget = widgetForElement(oldFocusedElement.get()); 3311 Widget* oldWidget = widgetForElement(oldFocusedElement.get());
3320 if (oldWidget) 3312 if (oldWidget)
3321 oldWidget->setFocus(false); 3313 oldWidget->setFocus(false);
3322 else 3314 else
3323 view()->setFocus(false); 3315 view()->setFocus(false);
3324 } 3316 }
3325 3317
3326 // Autofill client may have modified the value of newFocusedElement, thu s require 3318 // Autofill client may have modified the value of newFocusedElement, thu s require
3327 // a layout update here, otherwise it will assert at newFocusedElement-> isFocusable(). 3319 // a layout update here, otherwise it will assert at newFocusedElement-> isFocusable().
(...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after
5301 { 5293 {
5302 return DocumentLifecycleNotifier::create(this); 5294 return DocumentLifecycleNotifier::create(this);
5303 } 5295 }
5304 5296
5305 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5297 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5306 { 5298 {
5307 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5299 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5308 } 5300 }
5309 5301
5310 } // namespace WebCore 5302 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/platform/win/fast/forms/focus-selection-textarea-expected.txt ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698