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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 942933003: Remove almost all clients of isHTMLElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Node.h » ('j') | 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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 PassRefPtr<Element> Element::cloneElementWithChildren() 166 PassRefPtr<Element> Element::cloneElementWithChildren()
167 { 167 {
168 RefPtr<Element> clone = cloneElementWithoutChildren(); 168 RefPtr<Element> clone = cloneElementWithoutChildren();
169 cloneChildNodes(clone.get()); 169 cloneChildNodes(clone.get());
170 return clone.release(); 170 return clone.release();
171 } 171 }
172 172
173 PassRefPtr<Element> Element::cloneElementWithoutChildren() 173 PassRefPtr<Element> Element::cloneElementWithoutChildren()
174 { 174 {
175 RefPtr<Element> clone = cloneElementWithoutAttributesAndChildren(); 175 RefPtr<Element> clone = cloneElementWithoutAttributesAndChildren();
176 // This will catch HTML elements in the wrong namespace that are not correct ly copied.
177 // This is a sanity check as HTML overloads some of the DOM methods.
178 ASSERT(isHTMLElement() == clone->isHTMLElement());
179
180 clone->cloneDataFromElement(*this); 176 clone->cloneDataFromElement(*this);
181 return clone.release(); 177 return clone.release();
182 } 178 }
183 179
184 PassRefPtr<Element> Element::cloneElementWithoutAttributesAndChildren() 180 PassRefPtr<Element> Element::cloneElementWithoutAttributesAndChildren()
185 { 181 {
186 return document().createElement(tagQName(), false); 182 return document().createElement(tagQName(), false);
187 } 183 }
188 184
189 void Element::removeAttribute(const QualifiedName& name) 185 void Element::removeAttribute(const QualifiedName& name)
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 return false; 1570 return false;
1575 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) 1571 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue))
1576 return true; 1572 return true;
1577 // Host rules could also have effects. 1573 // Host rules could also have effects.
1578 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1574 if (ShadowRoot* shadowRoot = this->shadowRoot())
1579 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); 1575 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue);
1580 return false; 1576 return false;
1581 } 1577 }
1582 1578
1583 } // namespace blink 1579 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698