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 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2012 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2012 Apple Inc. All rights
reserved. |
7 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). | 7 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "CSSParser.h" | 30 #include "CSSParser.h" |
31 #include "CSSStyleSheet.h" | 31 #include "CSSStyleSheet.h" |
32 #include "StyledElement.h" | 32 #include "StyledElement.h" |
33 #include "WebCoreMemoryInstrumentation.h" | 33 #include "WebCoreMemoryInstrumentation.h" |
34 #include <wtf/MemoryInstrumentationVector.h> | 34 #include <wtf/MemoryInstrumentationVector.h> |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 static size_t immutableElementAttributeDataSize(unsigned count) | 38 static size_t immutableElementAttributeDataSize(unsigned count) |
39 { | 39 { |
40 return sizeof(ElementAttributeData) + sizeof(Attribute) * count; | 40 return sizeof(ImmutableElementAttributeData) + sizeof(Attribute) * count; |
41 } | 41 } |
42 | 42 |
43 PassRefPtr<ElementAttributeData> ElementAttributeData::createImmutable(const Vec
tor<Attribute>& attributes) | 43 PassRefPtr<ElementAttributeData> ElementAttributeData::createImmutable(const Vec
tor<Attribute>& attributes) |
44 { | 44 { |
45 void* slot = WTF::fastMalloc(immutableElementAttributeDataSize(attributes.si
ze())); | 45 void* slot = WTF::fastMalloc(immutableElementAttributeDataSize(attributes.si
ze())); |
46 return adoptRef(new (slot) ImmutableElementAttributeData(attributes)); | 46 return adoptRef(new (slot) ImmutableElementAttributeData(attributes)); |
47 } | 47 } |
48 | 48 |
49 PassRefPtr<ElementAttributeData> ElementAttributeData::create() | 49 PassRefPtr<ElementAttributeData> ElementAttributeData::create() |
50 { | 50 { |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 PassRefPtr<Attr> ElementAttributeData::getAttributeNode(const QualifiedName& nam
e, Element* element) const | 370 PassRefPtr<Attr> ElementAttributeData::getAttributeNode(const QualifiedName& nam
e, Element* element) const |
371 { | 371 { |
372 ASSERT(element); | 372 ASSERT(element); |
373 const Attribute* attribute = getAttributeItem(name); | 373 const Attribute* attribute = getAttributeItem(name); |
374 if (!attribute) | 374 if (!attribute) |
375 return 0; | 375 return 0; |
376 return ensureAttr(element, attribute->name()); | 376 return ensureAttr(element, attribute->name()); |
377 } | 377 } |
378 | 378 |
379 } | 379 } |
OLD | NEW |