void AppendToString(std::stringstream& aStream, const ScrollMetadata& m, const char* pfx, const char* sfx) { aStream << pfx; AppendToString(aStream, m.GetMetrics(), "{ [metrics="); AppendToString(aStream, m.GetBackgroundColor(), "] [color="); if (m.GetScrollParentId() != FrameMetrics::NULL_SCROLL_ID) { AppendToString(aStream, m.GetScrollParentId(), "] [scrollParent="); } if (m.HasScrollClip()) { AppendToString(aStream, m.ScrollClip().GetClipRect(), "] [clip="); } if (m.HasMaskLayer()) { AppendToString(aStream, m.ScrollClip().GetMaskLayerIndex().value(), "] [mask="); } OverscrollBehavior overscrollX = m.GetOverscrollBehavior().mBehaviorX; OverscrollBehavior overscrollY = m.GetOverscrollBehavior().mBehaviorY; if (overscrollX == overscrollY && overscrollX != OverscrollBehavior::Auto) { AppendToString(aStream, overscrollX, "] [overscroll="); } else { if (overscrollX != OverscrollBehavior::Auto) { AppendToString(aStream, overscrollX, "] [overscroll-x="); } if (overscrollY != OverscrollBehavior::Auto) { AppendToString(aStream, overscrollY, "] [overscroll-y="); } } aStream << "] }" << sfx; }
void AppendToString(std::stringstream& aStream, const ScrollMetadata& m, const char* pfx, const char* sfx) { aStream << pfx; AppendToString(aStream, m.GetMetrics(), "{ [metrics="); AppendToString(aStream, m.GetBackgroundColor(), "] [color="); if (m.GetScrollParentId() != FrameMetrics::NULL_SCROLL_ID) { AppendToString(aStream, m.GetScrollParentId(), "] [scrollParent="); } if (m.HasScrollClip()) { AppendToString(aStream, m.ScrollClip().GetClipRect(), "] [clip="); } aStream << "] }" << sfx; }