Changeset 77231 in webkit
- Timestamp:
- Feb 1, 2011 1:32:28 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/Android.mk
r77229 r77231 122 122 dom/DocumentMarkerController.cpp \ 123 123 dom/DocumentParser.cpp \ 124 dom/DocumentOrderedMap.cpp \125 124 dom/DocumentType.cpp \ 126 125 dom/DynamicNodeList.cpp \ -
trunk/Source/WebCore/CMakeLists.txt
r77229 r77231 839 839 dom/DocumentFragment.cpp 840 840 dom/DocumentParser.cpp 841 dom/DocumentOrderedMap.cpp842 841 dom/DocumentType.cpp 843 842 dom/DOMImplementation.cpp -
trunk/Source/WebCore/ChangeLog
r77230 r77231 1 2011-02-01 Roland Steiner <rolandsteiner@chromium.org> 2 3 Unreviewed, rolling out r77229. 4 http://trac.webkit.org/changeset/77229 5 https://bugs.webkit.org/show_bug.cgi?id=53289 6 7 revert mysterious build breakage 8 9 * Android.mk: 10 * CMakeLists.txt: 11 * GNUmakefile.am: 12 * WebCore.gypi: 13 * WebCore.pro: 14 * WebCore.vcproj/WebCore.vcproj: 15 * WebCore.xcodeproj/project.pbxproj: 16 * dom/DOMAllInOne.cpp: 17 * dom/Document.cpp: 18 (WebCore::Document::DocumentOrderedMap::clear): 19 (WebCore::Document::DocumentOrderedMap::add): 20 (WebCore::Document::DocumentOrderedMap::remove): 21 (WebCore::Document::DocumentOrderedMap::get): 22 (WebCore::keyMatchesId): 23 (WebCore::Document::getElementById): 24 (WebCore::keyMatchesMapName): 25 (WebCore::keyMatchesLowercasedMapName): 26 (WebCore::Document::getImageMap): 27 * dom/Document.h: 28 (WebCore::Document::DocumentOrderedMap::contains): 29 (WebCore::Document::DocumentOrderedMap::containsMultiple): 30 * dom/DocumentOrderedMap.cpp: Removed. 31 * dom/DocumentOrderedMap.h: Removed. 32 1 33 2011-02-01 Mihai Parparita <mihaip@chromium.org> 2 34 -
trunk/Source/WebCore/GNUmakefile.am
r77229 r77231 1168 1168 Source/WebCore/dom/DocumentMarkerController.h \ 1169 1169 Source/WebCore/dom/DocumentMarker.h \ 1170 Source/WebCore/dom/DocumentOrderedMap.cpp \1171 Source/WebCore/dom/DocumentOrderedMap.h \1172 1170 Source/WebCore/dom/DocumentParser.cpp \ 1173 1171 Source/WebCore/dom/DocumentParser.h \ -
trunk/Source/WebCore/WebCore.gypi
r77229 r77231 1221 1221 'dom/DocumentMarkerController.cpp', 1222 1222 'dom/DocumentMarkerController.h', 1223 'dom/DocumentOrderedMap.cpp',1224 'dom/DocumentOrderedMap.h',1225 1223 'dom/DocumentParser.cpp', 1226 1224 'dom/DocumentParser.h', -
trunk/Source/WebCore/WebCore.pro
r77229 r77231 731 731 dom/DocumentFragment.cpp \ 732 732 dom/DocumentMarkerController.cpp \ 733 dom/DocumentOrderedMap.cpp \734 733 dom/DocumentParser.cpp \ 735 734 dom/DocumentType.cpp \ … … 1666 1665 dom/DocumentMarker.h \ 1667 1666 dom/DocumentMarkerController.h \ 1668 dom/DocumentOrderedMap.h \1669 1667 dom/DocumentType.h \ 1670 1668 dom/DOMImplementation.h \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r77229 r77231 43079 43079 </File> 43080 43080 <File 43081 RelativePath="..\dom\DocumentOrderedMap.cpp"43082 >43083 <FileConfiguration43084 Name="Debug|Win32"43085 ExcludedFromBuild="true"43086 >43087 <Tool43088 Name="VCCLCompilerTool"43089 />43090 </FileConfiguration>43091 <FileConfiguration43092 Name="Release|Win32"43093 ExcludedFromBuild="true"43094 >43095 <Tool43096 Name="VCCLCompilerTool"43097 />43098 </FileConfiguration>43099 <FileConfiguration43100 Name="Debug_Cairo_CFLite|Win32"43101 ExcludedFromBuild="true"43102 >43103 <Tool43104 Name="VCCLCompilerTool"43105 />43106 </FileConfiguration>43107 <FileConfiguration43108 Name="Release_Cairo_CFLite|Win32"43109 ExcludedFromBuild="true"43110 >43111 <Tool43112 Name="VCCLCompilerTool"43113 />43114 </FileConfiguration>43115 <FileConfiguration43116 Name="Debug_All|Win32"43117 ExcludedFromBuild="true"43118 >43119 <Tool43120 Name="VCCLCompilerTool"43121 />43122 </FileConfiguration>43123 <FileConfiguration43124 Name="Release_LTCG|Win32"43125 ExcludedFromBuild="true"43126 >43127 <Tool43128 Name="VCCLCompilerTool"43129 />43130 </FileConfiguration>43131 </File>43132 <File43133 RelativePath="..\dom\DocumentOrderedMap.h"43134 >43135 </File>43136 <File43137 43081 RelativePath="..\dom\DocumentParser.cpp" 43138 43082 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r77229 r77231 303 303 1432E8470C51493800B1500F /* GCController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1432E8460C51493800B1500F /* GCController.h */; settings = {ATTRIBUTES = (Private, ); }; }; 304 304 1432E8490C51493F00B1500F /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1432E8480C51493F00B1500F /* GCController.cpp */; }; 305 143C890812F7C15E0052FFD0 /* DocumentOrderedMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143C890612F7C15E0052FFD0 /* DocumentOrderedMap.cpp */; };306 143C890912F7C15E0052FFD0 /* DocumentOrderedMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 143C890712F7C15E0052FFD0 /* DocumentOrderedMap.h */; settings = {ATTRIBUTES = (Private, ); }; };307 305 1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1449E24A107D4A8400B5793F /* JSCallbackData.h */; }; 308 306 1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1449E286107D4DB400B5793F /* JSCallbackData.cpp */; }; … … 5209 5207 BCE3BEC20D222B1D007E06E4 /* TagNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */; }; 5210 5208 BCE3BEC30D222B1D007E06E4 /* TagNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE3BEC10D222B1D007E06E4 /* TagNodeList.h */; }; 5209 BCE4413312F748E2009B84B8 /* RenderCombineText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */; }; 5210 BCE4413412F748E2009B84B8 /* RenderCombineText.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE4413212F748E2009B84B8 /* RenderCombineText.h */; }; 5211 BCE4413612F7490B009B84B8 /* FontWidthVariant.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE4413512F7490B009B84B8 /* FontWidthVariant.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5211 5212 BCE658FF0EA9248A007E4533 /* Theme.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE658FE0EA9248A007E4533 /* Theme.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5212 5213 BCE659A90EA927B9007E4533 /* ThemeTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE659A80EA927B9007E4533 /* ThemeTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6627 6628 1432E8460C51493800B1500F /* GCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GCController.h; sourceTree = "<group>"; }; 6628 6629 1432E8480C51493F00B1500F /* GCController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GCController.cpp; sourceTree = "<group>"; }; 6629 143C890612F7C15E0052FFD0 /* DocumentOrderedMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentOrderedMap.cpp; sourceTree = "<group>"; };6630 143C890712F7C15E0052FFD0 /* DocumentOrderedMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentOrderedMap.h; sourceTree = "<group>"; };6631 6630 1449E24A107D4A8400B5793F /* JSCallbackData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackData.h; sourceTree = "<group>"; }; 6632 6631 1449E286107D4DB400B5793F /* JSCallbackData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCallbackData.cpp; sourceTree = "<group>"; }; … … 11542 11541 BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagNodeList.cpp; sourceTree = "<group>"; }; 11543 11542 BCE3BEC10D222B1D007E06E4 /* TagNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagNodeList.h; sourceTree = "<group>"; }; 11543 BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderCombineText.cpp; sourceTree = "<group>"; }; 11544 BCE4413212F748E2009B84B8 /* RenderCombineText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderCombineText.h; sourceTree = "<group>"; }; 11545 BCE4413512F7490B009B84B8 /* FontWidthVariant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontWidthVariant.h; sourceTree = "<group>"; }; 11544 11546 BCE658FE0EA9248A007E4533 /* Theme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Theme.h; sourceTree = "<group>"; }; 11545 11547 BCE659A80EA927B9007E4533 /* ThemeTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThemeTypes.h; sourceTree = "<group>"; }; … … 17502 17504 37202198106213C600F25C4B /* FontSmoothingMode.h */, 17503 17505 3784C34A0E11AA34007D8D48 /* FontTraitsMask.h */, 17506 BCE4413512F7490B009B84B8 /* FontWidthVariant.h */, 17504 17507 BCE04C930DAFF902007A0F41 /* GeneratedImage.cpp */, 17505 17508 BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */, … … 18757 18760 BCEA4826097D93020094C9E4 /* RenderButton.cpp */, 18758 18761 BCEA4827097D93020094C9E4 /* RenderButton.h */, 18762 BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */, 18763 BCE4413212F748E2009B84B8 /* RenderCombineText.h */, 18759 18764 9392F1430AD185FE00691BD4 /* RenderCounter.cpp */, 18760 18765 9392F1410AD185F400691BD4 /* RenderCounter.h */, … … 18995 19000 A8C2280D11D4A59700D5A7D3 /* DocumentParser.cpp */, 18996 19001 BCCFBAE70B5152ED0001F1D7 /* DocumentParser.h */, 18997 143C890612F7C15E0052FFD0 /* DocumentOrderedMap.cpp */,18998 143C890712F7C15E0052FFD0 /* DocumentOrderedMap.h */,18999 19002 86D982F6125C154000AD9E3D /* DocumentTiming.h */, 19000 19003 A8185F3209765765005826D9 /* DocumentType.cpp */, … … 22465 22468 977E2E0F12F0FC9C00C13379 /* XSSFilter.h in Headers */, 22466 22469 0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */, 22467 143C890912F7C15E0052FFD0 /* DocumentOrderedMap.h in Headers */, 22470 BCE4413412F748E2009B84B8 /* RenderCombineText.h in Headers */, 22471 BCE4413612F7490B009B84B8 /* FontWidthVariant.h in Headers */, 22468 22472 ); 22469 22473 runOnlyForDeploymentPostprocessing = 0; … … 25164 25168 977E2E0E12F0FC9C00C13379 /* XSSFilter.cpp in Sources */, 25165 25169 0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */, 25166 143C890812F7C15E0052FFD0 /* DocumentOrderedMap.cpp in Sources */,25170 BCE4413312F748E2009B84B8 /* RenderCombineText.cpp in Sources */, 25167 25171 ); 25168 25172 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/dom/DOMAllInOne.cpp
r77229 r77231 61 61 #include "DocumentFragment.cpp" 62 62 #include "DocumentMarkerController.cpp" 63 #include "DocumentOrderedMap.cpp"64 63 #include "DocumentParser.cpp" 65 64 #include "DocumentType.cpp" -
trunk/Source/WebCore/dom/Document.cpp
r77230 r77231 227 227 static const int cLayoutScheduleThreshold = 250; 228 228 229 // These functions can't have internal linkage because they are used as template arguments. 230 bool keyMatchesId(AtomicStringImpl*, Element*); 231 bool keyMatchesMapName(AtomicStringImpl*, Element*); 232 bool keyMatchesLowercasedMapName(AtomicStringImpl*, Element*); 233 229 234 // DOM Level 2 says (letters added): 230 235 // … … 503 508 } 504 509 510 inline void Document::DocumentOrderedMap::clear() 511 { 512 m_map.clear(); 513 m_duplicateCounts.clear(); 514 } 515 505 516 void Document::removedLastRef() 506 517 { … … 985 996 } 986 997 998 inline void Document::DocumentOrderedMap::add(AtomicStringImpl* key, Element* element) 999 { 1000 ASSERT(key); 1001 ASSERT(element); 1002 1003 if (!m_duplicateCounts.contains(key)) { 1004 // Fast path. The key is not already in m_duplicateCounts, so we assume that it's 1005 // also not already in m_map and try to add it. If that add succeeds, we're done. 1006 pair<Map::iterator, bool> addResult = m_map.add(key, element); 1007 if (addResult.second) 1008 return; 1009 1010 // The add failed, so this key was already cached in m_map. 1011 // There are multiple elements with this key. Remove the m_map 1012 // cache for this key so get searches for it next time it is called. 1013 m_map.remove(addResult.first); 1014 m_duplicateCounts.add(key); 1015 } else { 1016 // There are multiple elements with this key. Remove the m_map 1017 // cache for this key so get will search for it next time it is called. 1018 Map::iterator cachedItem = m_map.find(key); 1019 if (cachedItem != m_map.end()) { 1020 m_map.remove(cachedItem); 1021 m_duplicateCounts.add(key); 1022 } 1023 } 1024 1025 m_duplicateCounts.add(key); 1026 } 1027 1028 inline void Document::DocumentOrderedMap::remove(AtomicStringImpl* key, Element* element) 1029 { 1030 ASSERT(key); 1031 ASSERT(element); 1032 1033 m_map.checkConsistency(); 1034 Map::iterator cachedItem = m_map.find(key); 1035 if (cachedItem != m_map.end() && cachedItem->second == element) 1036 m_map.remove(cachedItem); 1037 else 1038 m_duplicateCounts.remove(key); 1039 } 1040 1041 template<bool keyMatches(AtomicStringImpl*, Element*)> inline Element* Document::DocumentOrderedMap::get(AtomicStringImpl* key, const Document* document) const 1042 { 1043 ASSERT(key); 1044 1045 m_map.checkConsistency(); 1046 1047 Element* element = m_map.get(key); 1048 if (element) 1049 return element; 1050 1051 if (m_duplicateCounts.contains(key)) { 1052 // We know there's at least one node that matches; iterate to find the first one. 1053 for (Node* node = document->firstChild(); node; node = node->traverseNextNode()) { 1054 if (!node->isElementNode()) 1055 continue; 1056 element = static_cast<Element*>(node); 1057 if (!keyMatches(key, element)) 1058 continue; 1059 m_duplicateCounts.remove(key); 1060 m_map.set(key, element); 1061 return element; 1062 } 1063 ASSERT_NOT_REACHED(); 1064 } 1065 1066 return 0; 1067 } 1068 1069 inline bool keyMatchesId(AtomicStringImpl* key, Element* element) 1070 { 1071 return element->hasID() && element->getIdAttribute().impl() == key; 1072 } 1073 987 1074 Element* Document::getElementById(const AtomicString& elementId) const 988 1075 { 989 1076 if (elementId.isEmpty()) 990 1077 return 0; 991 return m_elementsById.get ElementById(elementId.impl(), this);1078 return m_elementsById.get<keyMatchesId>(elementId.impl(), this); 992 1079 } 993 1080 … … 3814 3901 } 3815 3902 3903 inline bool keyMatchesMapName(AtomicStringImpl* key, Element* element) 3904 { 3905 return element->hasTagName(mapTag) && static_cast<HTMLMapElement*>(element)->getName().impl() == key; 3906 } 3907 3908 inline bool keyMatchesLowercasedMapName(AtomicStringImpl* key, Element* element) 3909 { 3910 return element->hasTagName(mapTag) && static_cast<HTMLMapElement*>(element)->getName().lower().impl() == key; 3911 } 3912 3816 3913 HTMLMapElement* Document::getImageMap(const String& url) const 3817 3914 { … … 3821 3918 String name = (hashPos == notFound ? url : url.substring(hashPos + 1)).impl(); 3822 3919 if (isHTMLDocument()) 3823 return static_cast<HTMLMapElement*>(m_imageMapsByName.get ElementByLowercasedMapName(AtomicString(name.lower()).impl(), this));3824 return static_cast<HTMLMapElement*>(m_imageMapsByName.get ElementByMapName(AtomicString(name).impl(), this));3920 return static_cast<HTMLMapElement*>(m_imageMapsByName.get<keyMatchesLowercasedMapName>(AtomicString(name.lower()).impl(), this)); 3921 return static_cast<HTMLMapElement*>(m_imageMapsByName.get<keyMatchesMapName>(AtomicString(name).impl(), this)); 3825 3922 } 3826 3923 -
trunk/Source/WebCore/dom/Document.h
r77229 r77231 34 34 #include "ContainerNode.h" 35 35 #include "DOMTimeStamp.h" 36 #include "DocumentOrderedMap.h"37 36 #include "DocumentTiming.h" 38 37 #include "QualifiedName.h" … … 41 40 #include "ViewportArguments.h" 42 41 #include <wtf/FixedArray.h> 42 #include <wtf/HashCountedSet.h> 43 43 #include <wtf/OwnPtr.h> 44 44 #include <wtf/PassOwnPtr.h> 45 #include <wtf/PassRefPtr.h>46 45 47 46 #if USE(JSC) … … 1096 1095 1097 1096 private: 1097 class DocumentOrderedMap { 1098 public: 1099 void add(AtomicStringImpl*, Element*); 1100 void remove(AtomicStringImpl*, Element*); 1101 void clear(); 1102 1103 bool contains(AtomicStringImpl*) const; 1104 bool containsMultiple(AtomicStringImpl*) const; 1105 template<bool keyMatches(AtomicStringImpl*, Element*)> Element* get(AtomicStringImpl*, const Document*) const; 1106 1107 void checkConsistency() const; 1108 1109 private: 1110 typedef HashMap<AtomicStringImpl*, Element*> Map; 1111 1112 // We maintain the invariant that m_duplicateCounts is the count of all elements with a given key 1113 // excluding the one referenced in m_map, if any. This means it one less than the total count 1114 // when the first node with a given key is cached, otherwise the same as the total count. 1115 mutable Map m_map; 1116 mutable HashCountedSet<AtomicStringImpl*> m_duplicateCounts; 1117 }; 1118 1098 1119 friend class IgnoreDestructiveWriteCountIncrementer; 1099 1120 … … 1391 1412 }; 1392 1413 1414 inline bool Document::DocumentOrderedMap::contains(AtomicStringImpl* id) const 1415 { 1416 return m_map.contains(id) || m_duplicateCounts.contains(id); 1417 } 1418 1419 inline bool Document::DocumentOrderedMap::containsMultiple(AtomicStringImpl* id) const 1420 { 1421 return m_duplicateCounts.contains(id); 1422 } 1423 1393 1424 inline bool Document::hasElementWithId(AtomicStringImpl* id) const 1394 1425 {
Note: See TracChangeset
for help on using the changeset viewer.