Title: [230394] releases/WebKitGTK/webkit-2.20
Revision
230394
Author
carlo...@webkit.org
Date
2018-04-09 03:52:32 -0700 (Mon, 09 Apr 2018)

Log Message

Merge r229202 - Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
https://bugs.webkit.org/show_bug.cgi?id=183165

Patch by Said Abou-Hallawa <sabouhall...@apple.com> on 2018-03-03
Reviewed by Darin Adler.

Source/WebCore:

Some of the calls in SVGToOTFFontConversion.cpp were directed to the function
in MathExtras.h while the rest were directed to this local static function.
There should not be two versions with the same name while they are supposed
to do the same thing. Besides, the local version does not work correctly
if the type of the argument's max limit is less the max limit of the returned
type, e.g. char -> uint16_t.

* svg/SVGToOTFFontConversion.cpp:
(WebCore::clampTo): Deleted.

LayoutTests:

Re-baseline the results of these two tests since the local version of
clampTo() was not returning the expected results always.

* platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt:
* platform/ios/svg/text/text-altglyph-01-b-expected.txt:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog (230393 => 230394)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog	2018-04-09 10:52:25 UTC (rev 230393)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog	2018-04-09 10:52:32 UTC (rev 230394)
@@ -1,3 +1,16 @@
+2018-03-03  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=183165
+
+        Reviewed by Darin Adler.
+
+        Re-baseline the results of these two tests since the local version of
+        clampTo() was not returning the expected results always.
+
+        * platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt:
+        * platform/ios/svg/text/text-altglyph-01-b-expected.txt:
+
 2018-03-03  Zalan Bujtas  <za...@apple.com>
 
         [RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt (230393 => 230394)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt	2018-04-09 10:52:25 UTC (rev 230393)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt	2018-04-09 10:52:32 UTC (rev 230394)
@@ -11,26 +11,26 @@
           chunk 1 text run 1 at (5.00,90.00) startOffset 0 endOffset 32 width 460.21: "and many-to-many chars to glyphs"
       RenderSVGHiddenContainer {defs} at (0,0) size 0x0
       RenderSVGContainer {g} at (45,125) size 428x165
-        RenderSVGText {text} at (140,130) size 192x75 contains 1 chunk(s)
+        RenderSVGText {text} at (140,130) size 199x75 contains 1 chunk(s)
           RenderSVGTSpan {altGlyph} at (0,0) size 44x75
             RenderSVGInlineText {#text} at (0,0) size 44x75
-              chunk 1 text run 1 at (140.00,190.00) startOffset 0 endOffset 1 width 43.32: "H"
+              chunk 1 text run 1 at (140.00,190.00) startOffset 0 endOffset 1 width 43.33: "H"
           RenderSVGInlineText {#text} at (0,0) size 0x0
           RenderSVGTSpan {altGlyph} at (0,0) size 38x75
             RenderSVGInlineText {#text} at (43,0) size 38x75
-              chunk 1 text run 1 at (183.32,190.00) startOffset 0 endOffset 1 width 37.50: "A"
+              chunk 1 text run 1 at (183.33,190.00) startOffset 0 endOffset 1 width 37.50: "A"
           RenderSVGInlineText {#text} at (0,0) size 0x0
-          RenderSVGTSpan {altGlyph} at (0,0) size 38x75
-            RenderSVGInlineText {#text} at (80,0) size 37x75
-              chunk 1 text run 1 at (220.82,190.00) startOffset 0 endOffset 1 width 36.66: "P"
+          RenderSVGTSpan {altGlyph} at (0,0) size 41x75
+            RenderSVGInlineText {#text} at (80,0) size 41x75
+              chunk 1 text run 1 at (220.83,190.00) startOffset 0 endOffset 1 width 40.02: "P"
           RenderSVGInlineText {#text} at (0,0) size 0x0
-          RenderSVGTSpan {altGlyph} at (0,0) size 38x75
-            RenderSVGInlineText {#text} at (117,0) size 37x75
-              chunk 1 text run 1 at (257.48,190.00) startOffset 0 endOffset 1 width 36.66: "P"
+          RenderSVGTSpan {altGlyph} at (0,0) size 41x75
+            RenderSVGInlineText {#text} at (120,0) size 41x75
+              chunk 1 text run 1 at (260.85,190.00) startOffset 0 endOffset 1 width 40.02: "P"
           RenderSVGInlineText {#text} at (0,0) size 0x0
-          RenderSVGTSpan {altGlyph} at (0,0) size 38x75
-            RenderSVGInlineText {#text} at (154,0) size 38x75
-              chunk 1 text run 1 at (294.14,190.00) startOffset 0 endOffset 1 width 37.50: "Y"
+          RenderSVGTSpan {altGlyph} at (0,0) size 39x75
+            RenderSVGInlineText {#text} at (160,0) size 38x75
+              chunk 1 text run 1 at (300.87,190.00) startOffset 0 endOffset 1 width 37.50: "Y"
           RenderSVGInlineText {#text} at (0,0) size 0x0
         RenderSVGText {text} at (50,210) size 113x75 contains 1 chunk(s)
           RenderSVGTSpan {altGlyph} at (0,0) size 38x75

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/platform/ios/svg/text/text-altglyph-01-b-expected.txt (230393 => 230394)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/platform/ios/svg/text/text-altglyph-01-b-expected.txt	2018-04-09 10:52:25 UTC (rev 230393)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/platform/ios/svg/text/text-altglyph-01-b-expected.txt	2018-04-09 10:52:32 UTC (rev 230394)
@@ -11,26 +11,26 @@
           chunk 1 text run 1 at (5.00,90.00) startOffset 0 endOffset 32 width 460.21: "and many-to-many chars to glyphs"
       RenderSVGHiddenContainer {defs} at (0,0) size 0x0
       RenderSVGContainer {g} at (75,208) size 713x276
-        RenderSVGText {text} at (140,130) size 192x75 contains 1 chunk(s)
+        RenderSVGText {text} at (140,130) size 199x75 contains 1 chunk(s)
           RenderSVGTSpan {altGlyph} at (0,0) size 44x75
             RenderSVGInlineText {#text} at (0,0) size 44x75
-              chunk 1 text run 1 at (140.00,190.00) startOffset 0 endOffset 1 width 43.32: "H"
+              chunk 1 text run 1 at (140.00,190.00) startOffset 0 endOffset 1 width 43.33: "H"
           RenderSVGInlineText {#text} at (0,0) size 0x0
           RenderSVGTSpan {altGlyph} at (0,0) size 38x75
             RenderSVGInlineText {#text} at (43,0) size 38x75
-              chunk 1 text run 1 at (183.32,190.00) startOffset 0 endOffset 1 width 37.50: "A"
+              chunk 1 text run 1 at (183.33,190.00) startOffset 0 endOffset 1 width 37.50: "A"
           RenderSVGInlineText {#text} at (0,0) size 0x0
-          RenderSVGTSpan {altGlyph} at (0,0) size 38x75
-            RenderSVGInlineText {#text} at (80,0) size 37x75
-              chunk 1 text run 1 at (220.82,190.00) startOffset 0 endOffset 1 width 36.66: "P"
+          RenderSVGTSpan {altGlyph} at (0,0) size 41x75
+            RenderSVGInlineText {#text} at (80,0) size 41x75
+              chunk 1 text run 1 at (220.83,190.00) startOffset 0 endOffset 1 width 40.02: "P"
           RenderSVGInlineText {#text} at (0,0) size 0x0
-          RenderSVGTSpan {altGlyph} at (0,0) size 38x75
-            RenderSVGInlineText {#text} at (117,0) size 37x75
-              chunk 1 text run 1 at (257.48,190.00) startOffset 0 endOffset 1 width 36.66: "P"
+          RenderSVGTSpan {altGlyph} at (0,0) size 41x75
+            RenderSVGInlineText {#text} at (120,0) size 41x75
+              chunk 1 text run 1 at (260.85,190.00) startOffset 0 endOffset 1 width 40.02: "P"
           RenderSVGInlineText {#text} at (0,0) size 0x0
-          RenderSVGTSpan {altGlyph} at (0,0) size 38x75
-            RenderSVGInlineText {#text} at (154,0) size 38x75
-              chunk 1 text run 1 at (294.14,190.00) startOffset 0 endOffset 1 width 37.50: "Y"
+          RenderSVGTSpan {altGlyph} at (0,0) size 39x75
+            RenderSVGInlineText {#text} at (160,0) size 38x75
+              chunk 1 text run 1 at (300.87,190.00) startOffset 0 endOffset 1 width 37.50: "Y"
           RenderSVGInlineText {#text} at (0,0) size 0x0
         RenderSVGText {text} at (50,210) size 113x75 contains 1 chunk(s)
           RenderSVGTSpan {altGlyph} at (0,0) size 38x75

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog (230393 => 230394)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog	2018-04-09 10:52:25 UTC (rev 230393)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog	2018-04-09 10:52:32 UTC (rev 230394)
@@ -1,3 +1,20 @@
+2018-03-03  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=183165
+
+        Reviewed by Darin Adler.
+
+        Some of the calls in SVGToOTFFontConversion.cpp were directed to the function
+        in MathExtras.h while the rest were directed to this local static function.
+        There should not be two versions with the same name while they are supposed
+        to do the same thing. Besides, the local version does not work correctly
+        if the type of the argument's max limit is less the max limit of the returned
+        type, e.g. char -> uint16_t.
+
+        * svg/SVGToOTFFontConversion.cpp:
+        (WebCore::clampTo): Deleted.
+
 2018-03-03  Zalan Bujtas  <za...@apple.com>
 
         [RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/svg/SVGToOTFFontConversion.cpp (230393 => 230394)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/svg/SVGToOTFFontConversion.cpp	2018-04-09 10:52:25 UTC (rev 230393)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/svg/SVGToOTFFontConversion.cpp	2018-04-09 10:52:32 UTC (rev 230394)
@@ -421,14 +421,6 @@
     append16(0); // Glyph data format
 }
 
-// Assumption: T2 can hold every value that a T1 can hold.
-template<typename T1, typename T2> static inline T1 clampTo(T2 x)
-{
-    x = std::min(x, static_cast<T2>(std::numeric_limits<T1>::max()));
-    x = std::max(x, static_cast<T2>(std::numeric_limits<T1>::min()));
-    return static_cast<T1>(x);
-}
-
 void SVGToOTFFontConverter::appendHHEATable()
 {
     append32(0x00010000); // Version
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to