Remove LayoutUnit dependency in TextStream
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Aug 2017 02:37:53 +0000 (02:37 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Aug 2017 02:37:53 +0000 (02:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175110

Reviewed by Zalan Bujtas.

No new tests. No change in behavior.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/LayoutUnit.cpp: Added.
(WebCore::operator<<):
* platform/LayoutUnit.h:
* platform/text/TextStream.cpp:
* platform/text/TextStream.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220249 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/LayoutUnit.cpp [new file with mode: 0644]
Source/WebCore/platform/LayoutUnit.h
Source/WebCore/platform/text/TextStream.cpp
Source/WebCore/platform/text/TextStream.h

index 5fdbd66..3cc9688 100644 (file)
@@ -2219,6 +2219,7 @@ set(WebCore_SOURCES
     platform/FileSystem.cpp
     platform/GenericTaskQueue.cpp
     platform/Language.cpp
+    platform/LayoutUnit.cpp
     platform/Length.cpp
     platform/LengthBox.cpp
     platform/LengthPoint.cpp
index 72273c7..47eb531 100644 (file)
@@ -1,3 +1,20 @@
+2017-08-03  Don Olmstead  <don.olmstead@sony.com>
+
+        Remove LayoutUnit dependency in TextStream
+        https://bugs.webkit.org/show_bug.cgi?id=175110
+
+        Reviewed by Zalan Bujtas.
+
+        No new tests. No change in behavior.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/LayoutUnit.cpp: Added.
+        (WebCore::operator<<):
+        * platform/LayoutUnit.h:
+        * platform/text/TextStream.cpp:
+        * platform/text/TextStream.h:
+
 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
 
         Improve WebKitLegacy video fullscreen animation begin and end rects.
index 38fd21d..ace9854 100644 (file)
                A31C4E4F16E02AB4002F7957 /* OESTextureHalfFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = A31C4E4E16E02AB4002F7957 /* OESTextureHalfFloat.h */; };
                A31C4E5216E02B08002F7957 /* JSOESTextureHalfFloat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A31C4E5116E02B08002F7957 /* JSOESTextureHalfFloat.cpp */; };
                A31C4E5416E02B40002F7957 /* JSOESTextureHalfFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = A31C4E5316E02B40002F7957 /* JSOESTextureHalfFloat.h */; };
+               A36DF6611F33C25C00DC6741 /* LayoutUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3D42A841F33BA3600A64B62 /* LayoutUnit.cpp */; };
                A3BB59F31457A40D00AC56FE /* DocumentEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3BB59F11457A40D00AC56FE /* DocumentEventQueue.cpp */; };
                A3BB59F41457A40D00AC56FE /* DocumentEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A3BB59F21457A40D00AC56FE /* DocumentEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A3E2643014748991005A8588 /* WorkerEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3E2642E14748991005A8588 /* WorkerEventQueue.cpp */; };
                A31C4E5316E02B40002F7957 /* JSOESTextureHalfFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESTextureHalfFloat.h; sourceTree = "<group>"; };
                A3BB59F11457A40D00AC56FE /* DocumentEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentEventQueue.cpp; sourceTree = "<group>"; };
                A3BB59F21457A40D00AC56FE /* DocumentEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentEventQueue.h; sourceTree = "<group>"; };
+               A3D42A841F33BA3600A64B62 /* LayoutUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutUnit.cpp; sourceTree = "<group>"; };
                A3E2642E14748991005A8588 /* WorkerEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerEventQueue.cpp; sourceTree = "<group>"; };
                A3E2642F14748991005A8588 /* WorkerEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerEventQueue.h; sourceTree = "<group>"; };
                A409C982116D0DDD007197BD /* AccessibilityProgressIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityProgressIndicator.cpp; sourceTree = "<group>"; };
                                E15FF7D418C9553800FE4C87 /* KeypressCommand.h */,
                                E18772F0126E2629003DD586 /* Language.cpp */,
                                85EC9AF90A71A2C600EEEAED /* Language.h */,
+                               A3D42A841F33BA3600A64B62 /* LayoutUnit.cpp */,
                                141DC0471648348F00371E5A /* LayoutUnit.h */,
                                BCE65BE80EACDF16007E4533 /* Length.cpp */,
                                BCE65BE90EACDF16007E4533 /* Length.h */,
                                E19AC3EE1824DC7900349426 /* CryptoAlgorithmSHA224.cpp in Sources */,
                                E19AC3F01824DC7900349426 /* CryptoAlgorithmSHA256.cpp in Sources */,
                                E19AC3F21824DC7900349426 /* CryptoAlgorithmSHA384.cpp in Sources */,
+                               A36DF6611F33C25C00DC6741 /* LayoutUnit.cpp in Sources */,
                                E19AC3F41824DC7900349426 /* CryptoAlgorithmSHA512.cpp in Sources */,
                                E157A8E418173A3A009F821D /* CryptoKey.cpp in Sources */,
                                E125F84D1824289D00D84CD9 /* CryptoKeyAES.cpp in Sources */,
diff --git a/Source/WebCore/platform/LayoutUnit.cpp b/Source/WebCore/platform/LayoutUnit.cpp
new file mode 100644 (file)
index 0000000..185694e
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "LayoutUnit.h"
+
+#include "TextStream.h"
+
+namespace WebCore {
+
+TextStream& operator<<(TextStream& ts, const LayoutUnit& v)
+{
+    return ts << TextStream::FormatNumberRespectingIntegers(v.toFloat());
+}
+
+} // namespace WebCore
index e47cfbe..79bc3d3 100644 (file)
@@ -28,8 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef LayoutUnit_h
-#define LayoutUnit_h
+#pragma once
 
 #include "ValueToString.h"
 #include <limits.h>
@@ -41,6 +40,8 @@
 
 namespace WebCore {
 
+class TextStream;
+
 #ifdef NDEBUG
 
 #define REPORT_OVERFLOW(doesOverflow) ((void)0)
@@ -775,6 +776,8 @@ inline float& operator/=(float& a, const LayoutUnit& b)
     return a;
 }
 
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const LayoutUnit&);
+
 inline int roundToInt(LayoutUnit value)
 {
     return value.round();
@@ -830,5 +833,3 @@ struct ValueToString<LayoutUnit> {
 #endif
 
 } // namespace WebCore
-
-#endif // LayoutUnit_h
index 1c1e217..16b492a 100644 (file)
 #include "config.h"
 #include "TextStream.h"
 
-#include "FloatPoint.h"
-#include "IntPoint.h"
-#include "LayoutRect.h"
-#include "LayoutUnit.h"
 #include <wtf/MathExtras.h>
 #include <wtf/StringExtras.h>
 #include <wtf/text/WTFString.h>
@@ -135,11 +131,6 @@ TextStream& TextStream::operator<<(const FormatNumberRespectingIntegers& numberT
     return *this;
 }
 
-TextStream& TextStream::operator<<(LayoutUnit v)
-{
-    return *this << TextStream::FormatNumberRespectingIntegers(v.toFloat());
-}
-
 String TextStream::release()
 {
     String result = m_text.toString();
index be9f5d1..01aac47 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef TextStream_h
-#define TextStream_h
+#pragma once
 
 #include <wtf/Forward.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
-class LayoutUnit;
-
 class TextStream {
 public:
     struct FormatNumberRespectingIntegers {
@@ -61,7 +58,6 @@ public:
     WEBCORE_EXPORT TextStream& operator<<(long);
     WEBCORE_EXPORT TextStream& operator<<(unsigned long);
     WEBCORE_EXPORT TextStream& operator<<(long long);
-    WEBCORE_EXPORT TextStream& operator<<(LayoutUnit);
 
     WEBCORE_EXPORT TextStream& operator<<(unsigned long long);
     WEBCORE_EXPORT TextStream& operator<<(float);
@@ -137,6 +133,4 @@ TextStream& operator<<(TextStream& ts, const Vector<Item>& vector)
 
 void writeIndent(TextStream&, int indent);
 
-}
-
-#endif
+} // namespace WebCore