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

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

Issue 371413004: Fix for input/datalist failure when datalist is created outside document (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Another approach Created 6 years, 5 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 | « LayoutTests/fast/forms/datalist/datalist-inside-shadow-dom-expected.html ('k') | no next file » | 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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 26 matching lines...) Expand all
37 #include "core/dom/NodeRenderStyle.h" 37 #include "core/dom/NodeRenderStyle.h"
38 #include "core/dom/NodeTraversal.h" 38 #include "core/dom/NodeTraversal.h"
39 #include "core/dom/SelectorQuery.h" 39 #include "core/dom/SelectorQuery.h"
40 #include "core/dom/StaticNodeList.h" 40 #include "core/dom/StaticNodeList.h"
41 #include "core/dom/StyleEngine.h" 41 #include "core/dom/StyleEngine.h"
42 #include "core/dom/shadow/ElementShadow.h" 42 #include "core/dom/shadow/ElementShadow.h"
43 #include "core/dom/shadow/ShadowRoot.h" 43 #include "core/dom/shadow/ShadowRoot.h"
44 #include "core/events/MutationEvent.h" 44 #include "core/events/MutationEvent.h"
45 #include "core/html/HTMLCollection.h" 45 #include "core/html/HTMLCollection.h"
46 #include "core/html/HTMLFrameOwnerElement.h" 46 #include "core/html/HTMLFrameOwnerElement.h"
47 #include "core/html/HTMLInputElement.h"
47 #include "core/html/HTMLTagCollection.h" 48 #include "core/html/HTMLTagCollection.h"
48 #include "core/html/RadioNodeList.h" 49 #include "core/html/RadioNodeList.h"
49 #include "core/inspector/InspectorInstrumentation.h" 50 #include "core/inspector/InspectorInstrumentation.h"
50 #include "core/rendering/InlineTextBox.h" 51 #include "core/rendering/InlineTextBox.h"
51 #include "core/rendering/RenderText.h" 52 #include "core/rendering/RenderText.h"
52 #include "core/rendering/RenderTheme.h" 53 #include "core/rendering/RenderTheme.h"
53 #include "core/rendering/RenderView.h" 54 #include "core/rendering/RenderView.h"
54 #include "platform/ScriptForbiddenScope.h" 55 #include "platform/ScriptForbiddenScope.h"
55 56
56 namespace WebCore { 57 namespace WebCore {
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 774 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
774 775
775 InspectorInstrumentation::didInsertDOMNode(&root); 776 InspectorInstrumentation::didInsertDOMNode(&root);
776 777
777 RefPtrWillBeRawPtr<Node> protect(this); 778 RefPtrWillBeRawPtr<Node> protect(this);
778 RefPtrWillBeRawPtr<Node> protectNode(root); 779 RefPtrWillBeRawPtr<Node> protectNode(root);
779 780
780 NodeVector postInsertionNotificationTargets; 781 NodeVector postInsertionNotificationTargets;
781 notifyNodeInsertedInternal(root, postInsertionNotificationTargets); 782 notifyNodeInsertedInternal(root, postInsertionNotificationTargets);
782 783
784 if (isHTMLInputElement(root) && toHTMLInputElement(root).dataList())
785 toHTMLInputElement(root).listAttributeTargetChanged();
esprehn 2014/07/16 19:43:49 I think you might want to use didNotifySubtreeInse
786
783 for (size_t i = 0; i < postInsertionNotificationTargets.size(); ++i) { 787 for (size_t i = 0; i < postInsertionNotificationTargets.size(); ++i) {
784 Node* targetNode = postInsertionNotificationTargets[i].get(); 788 Node* targetNode = postInsertionNotificationTargets[i].get();
785 if (targetNode->inDocument()) 789 if (targetNode->inDocument())
786 targetNode->didNotifySubtreeInsertionsToDocument(); 790 targetNode->didNotifySubtreeInsertionsToDocument();
787 } 791 }
788 } 792 }
789 793
790 void ContainerNode::notifyNodeInsertedInternal(Node& root, NodeVector& postInser tionNotificationTargets) 794 void ContainerNode::notifyNodeInsertedInternal(Node& root, NodeVector& postInser tionNotificationTargets)
791 { 795 {
792 NoEventDispatchAssertion assertNoEventDispatch; 796 NoEventDispatchAssertion assertNoEventDispatch;
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 return true; 1391 return true;
1388 1392
1389 if (node->isElementNode() && toElement(node)->shadow()) 1393 if (node->isElementNode() && toElement(node)->shadow())
1390 return true; 1394 return true;
1391 1395
1392 return false; 1396 return false;
1393 } 1397 }
1394 #endif 1398 #endif
1395 1399
1396 } // namespace WebCore 1400 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/datalist/datalist-inside-shadow-dom-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698