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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #include "RenderView.h" | 72 #include "RenderView.h" |
73 #include "RenderWidget.h" | 73 #include "RenderWidget.h" |
74 #include "SelectorQuery.h" | 74 #include "SelectorQuery.h" |
75 #include "Settings.h" | 75 #include "Settings.h" |
76 #include "ShadowRoot.h" | 76 #include "ShadowRoot.h" |
77 #include "StylePropertySet.h" | 77 #include "StylePropertySet.h" |
78 #include "StyleResolver.h" | 78 #include "StyleResolver.h" |
79 #include "Text.h" | 79 #include "Text.h" |
80 #include "TextIterator.h" | 80 #include "TextIterator.h" |
81 #include "VoidCallback.h" | 81 #include "VoidCallback.h" |
82 #include "WebCoreMemoryInstrumentation.h" | |
83 #include "XMLNSNames.h" | 82 #include "XMLNSNames.h" |
84 #include "XMLNames.h" | 83 #include "XMLNames.h" |
85 #include "htmlediting.h" | 84 #include "htmlediting.h" |
86 #include <wtf/BitVector.h> | 85 #include <wtf/BitVector.h> |
87 #include <wtf/MemoryInstrumentationVector.h> | |
88 #include <wtf/text/CString.h> | 86 #include <wtf/text/CString.h> |
89 | 87 |
90 #if ENABLE(SVG) | 88 #if ENABLE(SVG) |
91 #include "SVGDocumentExtensions.h" | 89 #include "SVGDocumentExtensions.h" |
92 #include "SVGElement.h" | 90 #include "SVGElement.h" |
93 #include "SVGNames.h" | 91 #include "SVGNames.h" |
94 #endif | 92 #endif |
95 | 93 |
96 namespace WebCore { | 94 namespace WebCore { |
97 | 95 |
(...skipping 2775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2873 void Element::createUniqueElementData() | 2871 void Element::createUniqueElementData() |
2874 { | 2872 { |
2875 if (!m_elementData) | 2873 if (!m_elementData) |
2876 m_elementData = UniqueElementData::create(); | 2874 m_elementData = UniqueElementData::create(); |
2877 else { | 2875 else { |
2878 ASSERT(!m_elementData->isUnique()); | 2876 ASSERT(!m_elementData->isUnique()); |
2879 m_elementData = static_cast<ShareableElementData*>(m_elementData.get())-
>makeUniqueCopy(); | 2877 m_elementData = static_cast<ShareableElementData*>(m_elementData.get())-
>makeUniqueCopy(); |
2880 } | 2878 } |
2881 } | 2879 } |
2882 | 2880 |
2883 void Element::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
2884 { | |
2885 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | |
2886 ContainerNode::reportMemoryUsage(memoryObjectInfo); | |
2887 info.addMember(m_tagName, "tagName"); | |
2888 info.addMember(m_elementData, "elementData"); | |
2889 } | |
2890 | |
2891 #if ENABLE(SVG) | 2881 #if ENABLE(SVG) |
2892 bool Element::hasPendingResources() const | 2882 bool Element::hasPendingResources() const |
2893 { | 2883 { |
2894 return hasRareData() && elementRareData()->hasPendingResources(); | 2884 return hasRareData() && elementRareData()->hasPendingResources(); |
2895 } | 2885 } |
2896 | 2886 |
2897 void Element::setHasPendingResources() | 2887 void Element::setHasPendingResources() |
2898 { | 2888 { |
2899 ensureElementRareData()->setHasPendingResources(true); | 2889 ensureElementRareData()->setHasPendingResources(true); |
2900 } | 2890 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3062 for (unsigned i = 0; i < len; i++) { | 3052 for (unsigned i = 0; i < len; i++) { |
3063 const Attribute* attribute = attributeItem(i); | 3053 const Attribute* attribute = attributeItem(i); |
3064 const Attribute* otherAttr = other->getAttributeItem(attribute->name()); | 3054 const Attribute* otherAttr = other->getAttributeItem(attribute->name()); |
3065 if (!otherAttr || attribute->value() != otherAttr->value()) | 3055 if (!otherAttr || attribute->value() != otherAttr->value()) |
3066 return false; | 3056 return false; |
3067 } | 3057 } |
3068 | 3058 |
3069 return true; | 3059 return true; |
3070 } | 3060 } |
3071 | 3061 |
3072 void ElementData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
3073 { | |
3074 size_t actualSize = m_isUnique ? sizeof(ElementData) : sizeForShareableEleme
ntDataWithAttributeCount(m_arraySize); | |
3075 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM, actual
Size); | |
3076 info.addMember(m_inlineStyle, "inlineStyle"); | |
3077 info.addMember(m_classNames, "classNames"); | |
3078 info.addMember(m_idForStyleResolution, "idForStyleResolution"); | |
3079 if (m_isUnique) { | |
3080 const UniqueElementData* uniqueThis = static_cast<const UniqueElementDat
a*>(this); | |
3081 info.addMember(uniqueThis->m_presentationAttributeStyle, "presentationAt
tributeStyle"); | |
3082 info.addMember(uniqueThis->m_attributeVector, "attributeVector"); | |
3083 } | |
3084 for (unsigned i = 0, len = length(); i < len; i++) | |
3085 info.addMember(*attributeItem(i), "*attributeItem"); | |
3086 } | |
3087 | |
3088 size_t ElementData::getAttributeItemIndexSlowCase(const AtomicString& name, bool
shouldIgnoreAttributeCase) const | 3062 size_t ElementData::getAttributeItemIndexSlowCase(const AtomicString& name, bool
shouldIgnoreAttributeCase) const |
3089 { | 3063 { |
3090 // Continue to checking case-insensitively and/or full namespaced names if n
ecessary: | 3064 // Continue to checking case-insensitively and/or full namespaced names if n
ecessary: |
3091 for (unsigned i = 0; i < length(); ++i) { | 3065 for (unsigned i = 0; i < length(); ++i) { |
3092 const Attribute* attribute = attributeItem(i); | 3066 const Attribute* attribute = attributeItem(i); |
3093 if (!attribute->name().hasPrefix()) { | 3067 if (!attribute->name().hasPrefix()) { |
3094 if (shouldIgnoreAttributeCase && equalIgnoringCase(name, attribute->
localName())) | 3068 if (shouldIgnoreAttributeCase && equalIgnoringCase(name, attribute->
localName())) |
3095 return i; | 3069 return i; |
3096 } else { | 3070 } else { |
3097 // FIXME: Would be faster to do this comparison without calling toSt
ring, which | 3071 // FIXME: Would be faster to do this comparison without calling toSt
ring, which |
(...skipping 15 matching lines...) Expand all Loading... |
3113 return 0; | 3087 return 0; |
3114 } | 3088 } |
3115 | 3089 |
3116 Attribute* UniqueElementData::attributeItem(unsigned index) | 3090 Attribute* UniqueElementData::attributeItem(unsigned index) |
3117 { | 3091 { |
3118 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); | 3092 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); |
3119 return &m_attributeVector.at(index); | 3093 return &m_attributeVector.at(index); |
3120 } | 3094 } |
3121 | 3095 |
3122 } // namespace WebCore | 3096 } // namespace WebCore |
OLD | NEW |