Diff
Modified: trunk/LayoutTests/ChangeLog (229201 => 229202)
--- trunk/LayoutTests/ChangeLog 2018-03-03 23:27:18 UTC (rev 229201)
+++ trunk/LayoutTests/ChangeLog 2018-03-04 05:19:13 UTC (rev 229202)
@@ -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: trunk/LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt (229201 => 229202)
--- trunk/LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt 2018-03-03 23:27:18 UTC (rev 229201)
+++ trunk/LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt 2018-03-04 05:19:13 UTC (rev 229202)
@@ -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: trunk/LayoutTests/platform/ios/svg/text/text-altglyph-01-b-expected.txt (229201 => 229202)
--- trunk/LayoutTests/platform/ios/svg/text/text-altglyph-01-b-expected.txt 2018-03-03 23:27:18 UTC (rev 229201)
+++ trunk/LayoutTests/platform/ios/svg/text/text-altglyph-01-b-expected.txt 2018-03-04 05:19:13 UTC (rev 229202)
@@ -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: trunk/Source/WebCore/ChangeLog (229201 => 229202)
--- trunk/Source/WebCore/ChangeLog 2018-03-03 23:27:18 UTC (rev 229201)
+++ trunk/Source/WebCore/ChangeLog 2018-03-04 05:19:13 UTC (rev 229202)
@@ -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: trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp (229201 => 229202)
--- trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp 2018-03-03 23:27:18 UTC (rev 229201)
+++ trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp 2018-03-04 05:19:13 UTC (rev 229202)
@@ -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