Changeset 251158 in webkit
- Timestamp:
- Oct 15, 2019 2:18:37 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r251156 r251158 1 2019-10-15 Simon Fraser <simon.fraser@apple.com> 2 3 Add dumping for Animation and AnimationList 4 https://bugs.webkit.org/show_bug.cgi?id=202973 5 6 Reviewed by Dean Jackson. 7 8 Make Animation, AnimationList and related enums dumpable. 9 10 * platform/animation/Animation.cpp: 11 (WebCore::operator<<): 12 * platform/animation/Animation.h: 13 * platform/animation/AnimationList.cpp: 14 (WebCore::operator<<): 15 * platform/animation/AnimationList.h: 16 1 17 2019-10-15 Simon Fraser <simon.fraser@apple.com> 2 18 -
trunk/Source/WebCore/platform/animation/Animation.cpp
r236750 r251158 24 24 25 25 #include <wtf/NeverDestroyed.h> 26 #include <wtf/text/TextStream.h> 26 27 27 28 namespace WebCore { … … 139 140 } 140 141 142 TextStream& operator<<(TextStream& ts, Animation::AnimationMode mode) 143 { 144 switch (mode) { 145 case Animation::AnimateAll: ts << "all"; break; 146 case Animation::AnimateNone: ts << "none"; break; 147 case Animation::AnimateSingleProperty: ts << "single property"; break; 148 case Animation::AnimateUnknownProperty: ts << "unknown property"; break; 149 } 150 return ts; 151 } 152 153 TextStream& operator<<(TextStream& ts, Animation::AnimationDirection direction) 154 { 155 switch (direction) { 156 case Animation::AnimationDirectionNormal: ts << "normal"; break; 157 case Animation::AnimationDirectionAlternate: ts << "alternate"; break; 158 case Animation::AnimationDirectionReverse: ts << "reverse"; break; 159 case Animation::AnimationDirectionAlternateReverse: ts << "alternate-reverse"; break; 160 } 161 return ts; 162 } 163 164 TextStream& operator<<(TextStream& ts, const Animation& animation) 165 { 166 ts.dumpProperty("property", getPropertyName(animation.property())); 167 ts.dumpProperty("name", animation.name()); 168 ts.dumpProperty("iteration count", animation.iterationCount()); 169 ts.dumpProperty("delay", animation.iterationCount()); 170 ts.dumpProperty("duration", animation.duration()); 171 if (animation.timingFunction()) 172 ts.dumpProperty("timing function", *animation.timingFunction()); 173 ts.dumpProperty("mode", animation.animationMode()); 174 ts.dumpProperty("direction", animation.direction()); 175 ts.dumpProperty("fill-mode", animation.fillMode()); 176 ts.dumpProperty("play-state", animation.playState()); 177 178 return ts; 179 } 180 141 181 } // namespace WebCore -
trunk/Source/WebCore/platform/animation/Animation.h
r236750 r251158 200 200 }; 201 201 202 WTF::TextStream& operator<<(WTF::TextStream&, AnimationPlayState); 203 WTF::TextStream& operator<<(WTF::TextStream&, Animation::AnimationMode); 204 WTF::TextStream& operator<<(WTF::TextStream&, Animation::AnimationDirection); 205 WTF::TextStream& operator<<(WTF::TextStream&, const Animation&); 206 202 207 } // namespace WebCore -
trunk/Source/WebCore/platform/animation/AnimationList.cpp
r210758 r251158 22 22 #include "config.h" 23 23 #include "AnimationList.h" 24 25 #include <wtf/text/TextStream.h> 24 26 25 27 namespace WebCore { … … 64 66 } 65 67 68 TextStream& operator<<(TextStream& ts, const AnimationList& animationList) 69 { 70 ts << "["; 71 for (size_t i = 0; i < animationList.size(); ++i) { 72 if (i > 0) 73 ts << ", "; 74 ts << animationList.animation(i); 75 } 76 ts << "]"; 77 return ts; 78 } 79 66 80 } // namespace WebCore -
trunk/Source/WebCore/platform/animation/AnimationList.h
r233020 r251158 61 61 }; 62 62 63 WTF::TextStream& operator<<(WTF::TextStream&, const AnimationList&); 63 64 64 65 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.