OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 David Smith (catfish.man@gmail.com) | 3 * Copyright (C) 2007 David Smith (catfish.man@gmail.com) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 }; | 58 }; |
59 | 59 |
60 DEFINE_TYPE_CASTS(ClassCollection, LiveNodeListBase, collection, collection->typ
e() == ClassCollectionType, collection.type() == ClassCollectionType); | 60 DEFINE_TYPE_CASTS(ClassCollection, LiveNodeListBase, collection, collection->typ
e() == ClassCollectionType, collection.type() == ClassCollectionType); |
61 | 61 |
62 inline bool ClassCollection::elementMatches(const Element& testElement) const | 62 inline bool ClassCollection::elementMatches(const Element& testElement) const |
63 { | 63 { |
64 if (!testElement.hasClass()) | 64 if (!testElement.hasClass()) |
65 return false; | 65 return false; |
66 if (!m_classNames.size()) | 66 if (!m_classNames.size()) |
67 return false; | 67 return false; |
68 // FIXME: DOM4 allows getElementsByClassName to return non StyledElement. | |
69 // https://bugs.webkit.org/show_bug.cgi?id=94718 | |
70 if (!testElement.isStyledElement()) | |
71 return false; | |
72 return testElement.classNames().containsAll(m_classNames); | 68 return testElement.classNames().containsAll(m_classNames); |
73 } | 69 } |
74 | 70 |
75 } // namespace blink | 71 } // namespace blink |
76 | 72 |
77 #endif // ClassCollection_h | 73 #endif // ClassCollection_h |
OLD | NEW |