Title: [126716] trunk/Source/WebCore
Revision
126716
Author
[email protected]
Date
2012-08-26 15:38:31 -0700 (Sun, 26 Aug 2012)

Log Message

Avoid pointless string/number round-trip in applyRelativeFontStyleChange().
<http://webkit.org/b/95031>

Reviewed by Dan Bernstein.

Create a CSS_PX primitive value directly instead of passing String::number(foo) + "px" to the CSS parser.

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126715 => 126716)


--- trunk/Source/WebCore/ChangeLog	2012-08-26 22:35:26 UTC (rev 126715)
+++ trunk/Source/WebCore/ChangeLog	2012-08-26 22:38:31 UTC (rev 126716)
@@ -1,3 +1,15 @@
+2012-08-26  Andreas Kling  <[email protected]>
+
+        Avoid pointless string/number round-trip in applyRelativeFontStyleChange().
+        <http://webkit.org/b/95031>
+
+        Reviewed by Dan Bernstein.
+
+        Create a CSS_PX primitive value directly instead of passing String::number(foo) + "px" to the CSS parser.
+
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
+
 2012-08-26  Gavin Peters  <[email protected]>
 
         Prerenderering should gracefully handle no PrerendererClient or PrerenderingPlatform being provided.

Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (126715 => 126716)


--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp	2012-08-26 22:35:26 UTC (rev 126715)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp	2012-08-26 22:38:31 UTC (rev 126716)
@@ -31,7 +31,7 @@
 #include "CSSProperty.h"
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
-#include "CSSValueList.h"
+#include "CSSValuePool.h"
 #include "Document.h"
 #include "EditingStyle.h"
 #include "Editor.h"
@@ -399,7 +399,7 @@
             currentFontSize = computedFontSize(node);
         }
         if (currentFontSize != desiredFontSize) {
-            inlineStyleDecl->setProperty(CSSPropertyFontSize, String::number(desiredFontSize) + "px", false);
+            inlineStyleDecl->setProperty(CSSPropertyFontSize, cssValuePool().createValue(desiredFontSize, CSSPrimitiveValue::CSS_PX), false);
             setNodeAttribute(element.get(), styleAttr, inlineStyleDecl->asText());
         }
         if (inlineStyleDecl->isEmpty()) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to