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

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

Issue 10980011: Merge 129448 - Document::adoptNode for multiple fields time input UI should not crash (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 3 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
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 3695 matching lines...) Expand 10 before | Expand all | Expand 10 after
3706 3706
3707 void Document::focusedNodeRemoved() 3707 void Document::focusedNodeRemoved()
3708 { 3708 {
3709 setFocusedNode(0); 3709 setFocusedNode(0);
3710 } 3710 }
3711 3711
3712 void Document::removeFocusedNodeOfSubtree(Node* node, bool amongChildrenOnly) 3712 void Document::removeFocusedNodeOfSubtree(Node* node, bool amongChildrenOnly)
3713 { 3713 {
3714 if (!m_focusedNode || this->inPageCache()) // If the document is in the page cache, then we don't need to clear out the focused node. 3714 if (!m_focusedNode || this->inPageCache()) // If the document is in the page cache, then we don't need to clear out the focused node.
3715 return; 3715 return;
3716 3716
3717 Node* focusedNode = node->treeScope()->focusedNode();
3718 if (!focusedNode)
3719 return;
3720
3717 bool nodeInSubtree = false; 3721 bool nodeInSubtree = false;
3718 if (amongChildrenOnly) 3722 if (amongChildrenOnly)
3719 nodeInSubtree = m_focusedNode->isDescendantOf(node); 3723 nodeInSubtree = focusedNode->isDescendantOf(node);
3720 else 3724 else
3721 nodeInSubtree = (m_focusedNode == node) || m_focusedNode->isDescendantOf (node); 3725 nodeInSubtree = (focusedNode == node) || focusedNode->isDescendantOf(nod e);
3722 3726
3723 if (nodeInSubtree) 3727 if (nodeInSubtree)
3724 document()->focusedNodeRemoved(); 3728 document()->focusedNodeRemoved();
3725 } 3729 }
3726 3730
3727 void Document::hoveredNodeDetached(Node* node) 3731 void Document::hoveredNodeDetached(Node* node)
3728 { 3732 {
3729 if (!m_hoverNode || (node != m_hoverNode && (!m_hoverNode->isTextNode() || n ode != m_hoverNode->parentNode()))) 3733 if (!m_hoverNode || (node != m_hoverNode && (!m_hoverNode->isTextNode() || n ode != m_hoverNode->parentNode())))
3730 return; 3734 return;
3731 3735
(...skipping 2656 matching lines...) Expand 10 before | Expand all | Expand 10 after
6388 AtomicString localeKey = locale; 6392 AtomicString localeKey = locale;
6389 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr olUIEnabled()) 6393 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr olUIEnabled())
6390 localeKey = defaultLanguage(); 6394 localeKey = defaultLanguage();
6391 LocaleToLocalizerMap::AddResult result = m_localizerCache.add(localeKey, nul lptr); 6395 LocaleToLocalizerMap::AddResult result = m_localizerCache.add(localeKey, nul lptr);
6392 if (result.isNewEntry) 6396 if (result.isNewEntry)
6393 result.iterator->second = Localizer::create(localeKey); 6397 result.iterator->second = Localizer::create(localeKey);
6394 return *(result.iterator->second); 6398 return *(result.iterator->second);
6395 } 6399 }
6396 6400
6397 } // namespace WebCore 6401 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-state-change-on-focus-or-blur-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698