Title: [193940] trunk/Source/WebCore
Revision
193940
Author
[email protected]
Date
2015-12-10 18:24:09 -0800 (Thu, 10 Dec 2015)

Log Message

Mordernize viewport dumping
https://bugs.webkit.org/show_bug.cgi?id=152159

Reviewed by Zalan Bujtas.

Use groupings to simplify the viewport configuration dumping code.

* page/ViewportConfiguration.cpp:
(WebCore::operator<<):
(WebCore::ViewportConfiguration::description):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (193939 => 193940)


--- trunk/Source/WebCore/ChangeLog	2015-12-11 02:08:31 UTC (rev 193939)
+++ trunk/Source/WebCore/ChangeLog	2015-12-11 02:24:09 UTC (rev 193940)
@@ -1,3 +1,16 @@
+2015-12-10  Simon Fraser  <[email protected]>
+
+        Mordernize viewport dumping
+        https://bugs.webkit.org/show_bug.cgi?id=152159
+
+        Reviewed by Zalan Bujtas.
+
+        Use groupings to simplify the viewport configuration dumping code.
+
+        * page/ViewportConfiguration.cpp:
+        (WebCore::operator<<):
+        (WebCore::ViewportConfiguration::description):
+
 2015-12-10  Joseph Pecoraro  <[email protected]>
 
         Remote Inspector: Verify the identity of the other side of XPC connections

Modified: trunk/Source/WebCore/page/ViewportConfiguration.cpp (193939 => 193940)


--- trunk/Source/WebCore/page/ViewportConfiguration.cpp	2015-12-11 02:08:31 UTC (rev 193939)
+++ trunk/Source/WebCore/page/ViewportConfiguration.cpp	2015-12-11 02:24:09 UTC (rev 193940)
@@ -402,19 +402,17 @@
 
 TextStream& operator<<(TextStream& ts, const ViewportConfiguration::Parameters& parameters)
 {
-    ts.increaseIndent();
-    ts << "\n";
-    ts.writeIndent();
-    ts << "(width " << parameters.width << ", set: " << (parameters.widthIsSet ? "true" : "false") << ")";
+    ts.startGroup();
+    ts << "width " << parameters.width << ", set: " << (parameters.widthIsSet ? "true" : "false");
+    ts.endGroup();
 
-    ts << "\n";
-    ts.writeIndent();
-    ts << "(height " << parameters.height << ", set: " << (parameters.heightIsSet ? "true" : "false") << ")";
+    ts.startGroup();
+    ts << "height " << parameters.height << ", set: " << (parameters.heightIsSet ? "true" : "false");
+    ts.endGroup();
 
-    ts << "\n";
-    ts.writeIndent();
-    ts << "(initialScale " << parameters.initialScale << ", set: " << (parameters.initialScaleIsSet ? "true" : "false") << ")";
-    ts.decreaseIndent();
+    ts.startGroup();
+    ts << "initialScale " << parameters.initialScale << ", set: " << (parameters.initialScaleIsSet ? "true" : "false");
+    ts.endGroup();
 
     ts.dumpProperty("minimumScale", parameters.minimumScale);
     ts.dumpProperty("maximumScale", parameters.maximumScale);
@@ -428,50 +426,34 @@
 {
     TextStream ts;
 
-    ts << "(viewport-configuration " << (void*)this;
-    ts << "\n";
-    ts.increaseIndent();
-    ts.writeIndent();
-    ts << "(viewport arguments";
-    ts << m_viewportArguments;
-    ts << ")";
-    ts.decreaseIndent();
+    ts.startGroup();
+    ts << "viewport-configuration " << (void*)this;
+    {
+        TextStream::GroupScope scope(ts);
+        ts << "viewport arguments";
+        ts << m_viewportArguments;
+    }
+    {
+        TextStream::GroupScope scope(ts);
+        ts << "configuration";
+        ts << m_configuration;
+    }
+    {
+        TextStream::GroupScope scope(ts);
+        ts << "default configuration";
+        ts << m_defaultConfiguration;
+    }
 
-    ts << "\n";
-    ts.increaseIndent();
-    ts.writeIndent();
-    ts << "(configuration";
-    ts << m_configuration;
-    ts << ")";
-    ts.decreaseIndent();
-
-    ts << "\n";
-    ts.increaseIndent();
-    ts.writeIndent();
-    ts << "(default configuration";
-    ts << m_defaultConfiguration;
-    ts << ")";
-    ts.decreaseIndent();
-
     ts.dumpProperty("contentSize", m_contentSize);
     ts.dumpProperty("minimumLayoutSize", m_minimumLayoutSize);
+    ts.dumpProperty("computed initial scale", initialScale());
+    ts.dumpProperty("computed minimum scale", minimumScale());
+    ts.dumpProperty("computed layout size", layoutSize());
+    ts.dumpProperty("ignoring horizontal scaling constraints", shouldIgnoreHorizontalScalingConstraints() ? "true" : "false");
+    ts.dumpProperty("ignoring vertical scaling constraints", shouldIgnoreVerticalScalingConstraints() ? "true" : "false");
+    
+    ts.endGroup();
 
-    ts << "\n";
-    ts.increaseIndent();
-    ts.writeIndent();
-    ts << "(computed initial scale " << initialScale() << ")\n";
-    ts.writeIndent();
-    ts << "(computed minimum scale " << minimumScale() << ")\n";
-    ts.writeIndent();
-    ts << "(computed layout size " << layoutSize() << ")\n";
-    ts.writeIndent();
-    ts << "(ignoring horizontal scaling constraints " << (shouldIgnoreHorizontalScalingConstraints() ? "true" : "false") << ")\n";
-    ts.writeIndent();
-    ts << "(ignoring vertical scaling constraints " << (shouldIgnoreVerticalScalingConstraints() ? "true" : "false") << ")";
-    ts.decreaseIndent();
-
-    ts << ")\n";
-
     return ts.release().utf8();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to