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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 129462)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -3713,12 +3713,16 @@
{
if (!m_focusedNode || this->inPageCache()) // If the document is in the page cache, then we don't need to clear out the focused node.
return;
-
+
+ Node* focusedNode = node->treeScope()->focusedNode();
+ if (!focusedNode)
+ return;
+
bool nodeInSubtree = false;
if (amongChildrenOnly)
- nodeInSubtree = m_focusedNode->isDescendantOf(node);
+ nodeInSubtree = focusedNode->isDescendantOf(node);
else
- nodeInSubtree = (m_focusedNode == node) || m_focusedNode->isDescendantOf(node);
+ nodeInSubtree = (focusedNode == node) || focusedNode->isDescendantOf(node);
if (nodeInSubtree)
document()->focusedNodeRemoved();
« 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