OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/style/StyleDifference.h" |
| 6 |
| 7 namespace blink { |
| 8 |
| 9 std::ostream& operator<<(std::ostream& out, const StyleDifference& diff) { |
| 10 out << "StyleDifference{layoutType="; |
| 11 |
| 12 switch (diff.m_layoutType) { |
| 13 case StyleDifference::NoLayout: |
| 14 out << "NoLayout"; |
| 15 break; |
| 16 case StyleDifference::PositionedMovement: |
| 17 out << "PositionedMovement"; |
| 18 break; |
| 19 case StyleDifference::FullLayout: |
| 20 out << "FullLayout"; |
| 21 break; |
| 22 default: |
| 23 NOTREACHED(); |
| 24 break; |
| 25 } |
| 26 |
| 27 out << ", paintInvalidationType="; |
| 28 switch (diff.m_paintInvalidationType) { |
| 29 case StyleDifference::NoPaintInvalidation: |
| 30 out << "NoPaintInvalidation"; |
| 31 break; |
| 32 case StyleDifference::PaintInvalidationObject: |
| 33 out << "PaintInvalidationObject"; |
| 34 break; |
| 35 case StyleDifference::PaintInvalidationSubtree: |
| 36 out << "PaintInvalidationSubtree"; |
| 37 break; |
| 38 default: |
| 39 NOTREACHED(); |
| 40 break; |
| 41 } |
| 42 |
| 43 out << ", recomputeOverflow=" << diff.m_recomputeOverflow; |
| 44 |
| 45 out << ", propertySpecificDifferences="; |
| 46 int diffCount = 0; |
| 47 for (int i = 0; i < StyleDifference::kPropertyDifferenceCount; i++) { |
| 48 unsigned bitTest = 1 << i; |
| 49 if (diff.m_propertySpecificDifferences & bitTest) { |
| 50 if (diffCount++ > 0) |
| 51 out << "|"; |
| 52 switch (bitTest) { |
| 53 case StyleDifference::TransformChanged: |
| 54 out << "TransformChanged"; |
| 55 break; |
| 56 case StyleDifference::OpacityChanged: |
| 57 out << "OpacityChanged"; |
| 58 break; |
| 59 case StyleDifference::ZIndexChanged: |
| 60 out << "ZIndexChanged"; |
| 61 break; |
| 62 case StyleDifference::FilterChanged: |
| 63 out << "FilterChanged"; |
| 64 break; |
| 65 case StyleDifference::BackdropFilterChanged: |
| 66 out << "BackdropFilterChanged"; |
| 67 break; |
| 68 case StyleDifference::CSSClipChanged: |
| 69 out << "CSSClipChanged"; |
| 70 break; |
| 71 case StyleDifference::TextDecorationOrColorChanged: |
| 72 out << "TextDecorationOrColorChanged"; |
| 73 break; |
| 74 default: |
| 75 NOTREACHED(); |
| 76 break; |
| 77 } |
| 78 } |
| 79 } |
| 80 |
| 81 out << ", scrollAnchorDisablingPropertyChanged=" |
| 82 << diff.m_scrollAnchorDisablingPropertyChanged; |
| 83 |
| 84 return out << "}"; |
| 85 } |
| 86 |
| 87 } // namespace blink |
OLD | NEW |