Title: [97949] trunk/Source/WebCore
Revision
97949
Author
apav...@chromium.org
Date
2011-10-20 01:15:40 -0700 (Thu, 20 Oct 2011)

Log Message

Web Inspector: The "x" in "980px x 36px" looks weird in the inspector node callout
https://bugs.webkit.org/show_bug.cgi?id=69857

Reviewed by Pavel Feldman.

* inspector/DOMNodeHighlighter.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (97948 => 97949)


--- trunk/Source/WebCore/ChangeLog	2011-10-20 08:00:13 UTC (rev 97948)
+++ trunk/Source/WebCore/ChangeLog	2011-10-20 08:15:40 UTC (rev 97949)
@@ -1,3 +1,12 @@
+2011-10-19  Alexander Pavlov  <apav...@chromium.org>
+
+        Web Inspector: The "x" in "980px x 36px" looks weird in the inspector node callout
+        https://bugs.webkit.org/show_bug.cgi?id=69857
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/DOMNodeHighlighter.cpp:
+
 2011-10-20  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r97917.

Modified: trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp (97948 => 97949)


--- trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp	2011-10-20 08:00:13 UTC (rev 97948)
+++ trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp	2011-10-20 08:15:40 UTC (rev 97949)
@@ -47,6 +47,7 @@
 #include "Settings.h"
 #include "StyledElement.h"
 #include "TextRun.h"
+#include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
@@ -230,22 +231,23 @@
     DEFINE_STATIC_LOCAL(Color, pxAndBorderColor, (128, 128, 128));
 
     DEFINE_STATIC_LOCAL(String, pxString, ("px"));
-    const static UChar timesUChar[] = { 0x00D7, 0 };
+    const static UChar timesUChar[] = { 0x0020, 0x00D7, 0x0020, 0 };
     DEFINE_STATIC_LOCAL(String, timesString, (timesUChar)); // &times; string
 
     FontCachePurgePreventer fontCachePurgePreventer;
 
     Element* element = static_cast<Element*>(node);
     bool isXHTML = element->document()->isXHTMLDocument();
-    String nodeTitle(isXHTML ? element->nodeName() : element->nodeName().lower());
+    StringBuilder nodeTitle;
+    nodeTitle.append(isXHTML ? element->nodeName() : element->nodeName().lower());
     unsigned tagNameLength = nodeTitle.length();
 
     const AtomicString& idValue = element->getIdAttribute();
     unsigned idStringLength = 0;
     String idString;
     if (!idValue.isNull() && !idValue.isEmpty()) {
-        nodeTitle += "#";
-        nodeTitle += idValue;
+        nodeTitle.append("#");
+        nodeTitle.append(idValue);
         idStringLength = 1 + idValue.length();
     }
 
@@ -259,8 +261,8 @@
             if (usedClassNames.contains(className))
                 continue;
             usedClassNames.add(className);
-            nodeTitle += ".";
-            nodeTitle += className;
+            nodeTitle.append(".");
+            nodeTitle.append(className);
             classesStringLength += 1 + className.length();
         }
     }
@@ -268,17 +270,19 @@
     RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderBoxModelObject(renderer) : 0;
 
     String widthNumberPart = " " + String::number(modelObject ? adjustForAbsoluteZoom(modelObject->offsetWidth(), modelObject) : boundingBox.width());
-    nodeTitle += widthNumberPart + pxString;
-    nodeTitle += timesString;
+    nodeTitle.append(widthNumberPart);
+    nodeTitle.append(pxString);
+    nodeTitle.append(timesString);
     String heightNumberPart = String::number(modelObject ? adjustForAbsoluteZoom(modelObject->offsetHeight(), modelObject) : boundingBox.height());
-    nodeTitle += heightNumberPart + pxString;
+    nodeTitle.append(heightNumberPart);
+    nodeTitle.append(pxString);
 
     FontDescription desc;
     setUpFontDescription(desc, settings);
     Font font = Font(desc, 0, 0);
     font.update(0);
 
-    TextRun nodeTitleRun(nodeTitle);
+    TextRun nodeTitleRun(nodeTitle.toString());
     LayoutPoint titleBasePoint = LayoutPoint(anchorBox.x(), anchorBox.maxY() - 1);
     titleBasePoint.move(rectInflatePx, rectInflatePx);
     LayoutRect titleRect = enclosingLayoutRect(font.selectionRectForText(nodeTitleRun, titleBasePoint, fontHeightPx));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to