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

Unified Diff: WebCore/dom/Element.cpp

Issue 28077: WebKit side of merge from r41149 to r41181. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/WebKit/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/bridge/qt/qt_runtime.cpp ('k') | WebCore/dom/WorkerContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/dom/Element.cpp
===================================================================
--- WebCore/dom/Element.cpp (revision 10232)
+++ WebCore/dom/Element.cpp (working copy)
@@ -88,11 +88,12 @@
PassRefPtr<Node> Element::cloneNode(bool deep)
{
- ExceptionCode ec = 0;
- RefPtr<Element> clone = document()->createElementNS(namespaceURI(), nodeName(), ec);
- ASSERT(!ec);
-
- // clone attributes
+ RefPtr<Element> clone = document()->createElement(tagQName(), false);
+ // This will catch HTML elements in the wrong namespace that are not correctly copied.
+ // This is a sanity check as HTML overloads some of the DOM methods.
+ ASSERT(isHTMLElement() == clone->isHTMLElement());
+
+ // Clone attributes.
if (namedAttrMap)
clone->attributes()->setAttributes(*namedAttrMap);
« no previous file with comments | « WebCore/bridge/qt/qt_runtime.cpp ('k') | WebCore/dom/WorkerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698