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 3021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3032 ensureElementRareData()->setHasPendingResources(true); | 3032 ensureElementRareData()->setHasPendingResources(true); |
3033 } | 3033 } |
3034 | 3034 |
3035 void Element::clearHasPendingResources() | 3035 void Element::clearHasPendingResources() |
3036 { | 3036 { |
3037 ensureElementRareData()->setHasPendingResources(false); | 3037 ensureElementRareData()->setHasPendingResources(false); |
3038 } | 3038 } |
3039 | 3039 |
3040 struct PresentationAttributeCacheKey { | 3040 struct PresentationAttributeCacheKey { |
3041 PresentationAttributeCacheKey() : tagName(0) { } | 3041 PresentationAttributeCacheKey() : tagName(0) { } |
3042 AtomicStringImpl* tagName; | 3042 StringImpl* tagName; |
3043 // Only the values need refcounting. | 3043 // Only the values need refcounting. |
3044 Vector<pair<AtomicStringImpl*, AtomicString>, 3> attributesAndValues; | 3044 Vector<pair<StringImpl*, AtomicString>, 3> attributesAndValues; |
3045 }; | 3045 }; |
3046 | 3046 |
3047 struct PresentationAttributeCacheEntry { | 3047 struct PresentationAttributeCacheEntry { |
3048 WTF_MAKE_FAST_ALLOCATED; | 3048 WTF_MAKE_FAST_ALLOCATED; |
3049 public: | 3049 public: |
3050 PresentationAttributeCacheKey key; | 3050 PresentationAttributeCacheKey key; |
3051 RefPtr<StylePropertySet> value; | 3051 RefPtr<StylePropertySet> value; |
3052 }; | 3052 }; |
3053 | 3053 |
3054 typedef HashMap<unsigned, OwnPtr<PresentationAttributeCacheEntry>, AlreadyHashed
> PresentationAttributeCache; | 3054 typedef HashMap<unsigned, OwnPtr<PresentationAttributeCacheEntry>, AlreadyHashed
> PresentationAttributeCache; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3254 inlineStyleChanged(); | 3254 inlineStyleChanged(); |
3255 } | 3255 } |
3256 | 3256 |
3257 void Element::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const | 3257 void Element::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const |
3258 { | 3258 { |
3259 ASSERT(isStyledElement()); | 3259 ASSERT(isStyledElement()); |
3260 if (const StylePropertySet* inlineStyle = elementData() ? elementData()->inl
ineStyle() : 0) | 3260 if (const StylePropertySet* inlineStyle = elementData() ? elementData()->inl
ineStyle() : 0) |
3261 inlineStyle->addSubresourceStyleURLs(urls, document()->elementSheet()->c
ontents()); | 3261 inlineStyle->addSubresourceStyleURLs(urls, document()->elementSheet()->c
ontents()); |
3262 } | 3262 } |
3263 | 3263 |
3264 static inline bool attributeNameSort(const pair<AtomicStringImpl*, AtomicString>
& p1, const pair<AtomicStringImpl*, AtomicString>& p2) | 3264 static inline bool attributeNameSort(const pair<StringImpl*, AtomicString>& p1,
const pair<StringImpl*, AtomicString>& p2) |
3265 { | 3265 { |
3266 // Sort based on the attribute name pointers. It doesn't matter what the ord
er is as long as it is always the same. | 3266 // Sort based on the attribute name pointers. It doesn't matter what the ord
er is as long as it is always the same. |
3267 return p1.first < p2.first; | 3267 return p1.first < p2.first; |
3268 } | 3268 } |
3269 | 3269 |
3270 void Element::makePresentationAttributeCacheKey(PresentationAttributeCacheKey& r
esult) const | 3270 void Element::makePresentationAttributeCacheKey(PresentationAttributeCacheKey& r
esult) const |
3271 { | 3271 { |
3272 ASSERT(isStyledElement()); | 3272 ASSERT(isStyledElement()); |
3273 // FIXME: Enable for SVG. | 3273 // FIXME: Enable for SVG. |
3274 if (namespaceURI() != xhtmlNamespaceURI) | 3274 if (namespaceURI() != xhtmlNamespaceURI) |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3572 return 0; | 3572 return 0; |
3573 } | 3573 } |
3574 | 3574 |
3575 Attribute* UniqueElementData::attributeItem(unsigned index) | 3575 Attribute* UniqueElementData::attributeItem(unsigned index) |
3576 { | 3576 { |
3577 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); | 3577 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); |
3578 return &m_attributeVector.at(index); | 3578 return &m_attributeVector.at(index); |
3579 } | 3579 } |
3580 | 3580 |
3581 } // namespace WebCore | 3581 } // namespace WebCore |
OLD | NEW |