[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mrowe at apple.com mrowe at apple.com
Wed Dec 22 11:43:04 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 89a9099a509708d6d1fcc4bbb05ad658dbf286f6
Author: mrowe at apple.com <mrowe at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 4 21:32:29 2010 +0000

    Don't leak FontDescription objects inside MathML.
    
    Reviewed by Sam Weinig.
    
    * mathml/RenderMathMLOperator.cpp:
    (WebCore::RenderMathMLOperator::updateFromElement): Don't unnecessarily allocate the FontDescription on the heap.
    (WebCore::RenderMathMLOperator::createStackableStyle): Ditto.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64681 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 91f0b46..df26668 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-04  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Don't leak FontDescription objects inside MathML.
+
+        * mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::updateFromElement): Don't unnecessarily allocate the FontDescription on the heap.
+        (WebCore::RenderMathMLOperator::createStackableStyle): Ditto.
+
 2010-08-04  Kenneth Russell  <kbr at google.com>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebCore/mathml/RenderMathMLOperator.cpp b/WebCore/mathml/RenderMathMLOperator.cpp
index 570e2fc..3ee48cd 100644
--- a/WebCore/mathml/RenderMathMLOperator.cpp
+++ b/WebCore/mathml/RenderMathMLOperator.cpp
@@ -180,17 +180,17 @@ void RenderMathMLOperator::updateFromElement()
         // font size to adjust the glyph size.
         int currentFontSize = style()->fontSize();
         if (!stretchDisabled && isStretchy && m_stretchHeight > 0 && m_stretchHeight <= gMinimumStretchHeight  && m_stretchHeight > currentFontSize) {
-            FontDescription* desc = new FontDescription();
-            desc->setIsAbsoluteSize(true);
-            desc->setSpecifiedSize(m_stretchHeight);
-            desc->setComputedSize(m_stretchHeight);
-            newStyle->setFontDescription(*desc);
+            FontDescription desc;
+            desc.setIsAbsoluteSize(true);
+            desc.setSpecifiedSize(m_stretchHeight);
+            desc.setComputedSize(m_stretchHeight);
+            newStyle->setFontDescription(desc);
             newStyle->font().update(newStyle->font().fontSelector());
             newStyle->setVerticalAlign(BASELINE);
             m_isCentered = false;
         } else {
             int topPad = (m_stretchHeight - currentFontSize) / 2;
-            
+
             if (topPad / static_cast<float>(m_stretchHeight) > gMinimumRatioForStretch) {
                 newStyle->setVerticalAlign(TOP);
                 newStyle->setPaddingTop(Length(topPad, Fixed));
@@ -199,11 +199,11 @@ void RenderMathMLOperator::updateFromElement()
                 newStyle->setVerticalAlign(BASELINE);
             }
         }
-        
+
         container->setStyle(newStyle.release());
         addChild(container);
-     
-        // Build the text of the operator.  
+
+        // Build the text of the operator.
         RenderText* text = 0;
         if (m_operator) 
             text = new (renderArena()) RenderText(node(), StringImpl::create(&m_operator, 1));
@@ -290,25 +290,25 @@ RefPtr<RenderStyle> RenderMathMLOperator::createStackableStyle(int size, int top
     newStyle->inheritFrom(style());
     newStyle->setDisplay(BLOCK);
 
-    FontDescription* desc = new FontDescription();
-    desc->setIsAbsoluteSize(true);
-    desc->setSpecifiedSize(gGlyphFontSize);
-    desc->setComputedSize(gGlyphFontSize);
-    newStyle->setFontDescription(*desc);
+    FontDescription desc;
+    desc.setIsAbsoluteSize(true);
+    desc.setSpecifiedSize(gGlyphFontSize);
+    desc.setComputedSize(gGlyphFontSize);
+    newStyle->setFontDescription(desc);
     newStyle->font().update(newStyle->font().fontSelector());
     newStyle->setLineHeight(Length(gGlyphLineHeight, Fixed));
     newStyle->setVerticalAlign(TOP);
-    
+
     if (size > 0)
         newStyle->setMaxHeight(Length(size, Fixed));
-        
+
     newStyle->setOverflowY(OHIDDEN);
     newStyle->setOverflowX(OHIDDEN);
     if (topRelative) {
         newStyle->setTop(Length(topRelative, Fixed));
         newStyle->setPosition(RelativePosition);
     }
-    
+
     return newStyle;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list