OLD | NEW |
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 2318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2329 resetNeedsShadowTreeWalker(); | 2329 resetNeedsShadowTreeWalker(); |
2330 } | 2330 } |
2331 | 2331 |
2332 RenderObject* Element::pseudoElementRenderer(PseudoId pseudoId) const | 2332 RenderObject* Element::pseudoElementRenderer(PseudoId pseudoId) const |
2333 { | 2333 { |
2334 if (PseudoElement* element = pseudoElement(pseudoId)) | 2334 if (PseudoElement* element = pseudoElement(pseudoId)) |
2335 return element->renderer(); | 2335 return element->renderer(); |
2336 return 0; | 2336 return 0; |
2337 } | 2337 } |
2338 | 2338 |
2339 // ElementTraversal API | |
2340 Element* Element::firstElementChild() const | |
2341 { | |
2342 return ElementTraversal::firstWithin(this); | |
2343 } | |
2344 | |
2345 Element* Element::lastElementChild() const | |
2346 { | |
2347 Node* n = lastChild(); | |
2348 while (n && !n->isElementNode()) | |
2349 n = n->previousSibling(); | |
2350 return toElement(n); | |
2351 } | |
2352 | |
2353 unsigned Element::childElementCount() const | |
2354 { | |
2355 unsigned count = 0; | |
2356 Node* n = firstChild(); | |
2357 while (n) { | |
2358 count += n->isElementNode(); | |
2359 n = n->nextSibling(); | |
2360 } | |
2361 return count; | |
2362 } | |
2363 | |
2364 bool Element::matchesReadOnlyPseudoClass() const | 2339 bool Element::matchesReadOnlyPseudoClass() const |
2365 { | 2340 { |
2366 return false; | 2341 return false; |
2367 } | 2342 } |
2368 | 2343 |
2369 bool Element::matchesReadWritePseudoClass() const | 2344 bool Element::matchesReadWritePseudoClass() const |
2370 { | 2345 { |
2371 return false; | 2346 return false; |
2372 } | 2347 } |
2373 | 2348 |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3141 return 0; | 3116 return 0; |
3142 } | 3117 } |
3143 | 3118 |
3144 Attribute* UniqueElementData::attributeItem(unsigned index) | 3119 Attribute* UniqueElementData::attributeItem(unsigned index) |
3145 { | 3120 { |
3146 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); | 3121 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); |
3147 return &m_attributeVector.at(index); | 3122 return &m_attributeVector.at(index); |
3148 } | 3123 } |
3149 | 3124 |
3150 } // namespace WebCore | 3125 } // namespace WebCore |
OLD | NEW |