Bug 1448774. r=dholbert, a=RyanVM
authorRobert Longson <longsonr@gmail.com>
Thu, 29 Mar 2018 03:12:05 +0100
changeset 462935 3784b22ec536b08ce95201d73ae8806340c18b8c
parent 462934 6aba449fa311122767e4797aa8e357353703c1d2
child 462936 3954e94774f97771c90bd3b31adc946a9b5222a4
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, RyanVM
bugs1448774
milestone60.0
Bug 1448774. r=dholbert, a=RyanVM
dom/svg/SVGTextContentElement.h
layout/svg/SVGTextFrame.cpp
--- a/dom/svg/SVGTextContentElement.h
+++ b/dom/svg/SVGTextContentElement.h
@@ -20,16 +20,17 @@ class nsISVGPoint;
 namespace dom {
 
 class SVGIRect;
 
 typedef SVGGraphicsElement SVGTextContentElementBase;
 
 class SVGTextContentElement : public SVGTextContentElementBase
 {
+  friend class ::SVGTextFrame;
 public:
   using FragmentOrElement::TextLength;
 
   // WebIDL
   already_AddRefed<SVGAnimatedLength> TextLength();
   already_AddRefed<SVGAnimatedEnumeration> LengthAdjust();
   MOZ_CAN_RUN_SCRIPT int32_t GetNumberOfChars();
   MOZ_CAN_RUN_SCRIPT float GetComputedTextLength();
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -5285,18 +5285,18 @@ SVGTextFrame::DoGlyphPositioning()
   double adjustment = 0.0;
   mLengthAdjustScaleFactor = 1.0f;
   if (adjustingTextLength) {
     nscoord frameLength = vertical ? PrincipalChildList().FirstChild()->GetRect().height
                                    : PrincipalChildList().FirstChild()->GetRect().width;
     float actualTextLength =
       static_cast<float>(presContext->AppUnitsToGfxUnits(frameLength) * factor);
 
-    RefPtr<SVGAnimatedEnumeration> lengthAdjustEnum = element->LengthAdjust();
-    uint16_t lengthAdjust = lengthAdjustEnum->AnimVal();
+    uint16_t lengthAdjust =
+      element->EnumAttributes()[SVGTextContentElement::LENGTHADJUST].GetAnimValue();
     switch (lengthAdjust) {
       case LENGTHADJUST_SPACINGANDGLYPHS:
         // Scale the glyphs and their positions.
         if (actualTextLength > 0) {
           mLengthAdjustScaleFactor = expectedTextLength / actualTextLength;
         }
         break;