Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: Source/core/inspector/InspectorCSSAgent.cpp

Issue 414863002: Minimize RenderObject* casting to RenderText* (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/page/TouchAdjustment.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp
index cac901661f4b71e8a0146402c2b5c4430c0bfc41..952b6dd5101690275611e71b54cdbb52666f4b14 100644
--- a/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/Source/core/inspector/InspectorCSSAgent.cpp
@@ -49,6 +49,7 @@
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/Node.h"
#include "core/dom/StyleEngine.h"
+#include "core/dom/Text.h"
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLHeadElement.h"
#include "core/html/VoidCallback.h"
@@ -737,20 +738,20 @@ void InspectorCSSAgent::getPlatformFontsForNode(ErrorString* errorString, int no
RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSComputedStyleDeclaration::create(node, true);
*cssFamilyName = computedStyleInfo->getPropertyValue(CSSPropertyFontFamily);
- WillBeHeapVector<RawPtrWillBeMember<Node> > textNodes;
+ WillBeHeapVector<RawPtrWillBeMember<Text> > textNodes;
if (node->nodeType() == Node::TEXT_NODE) {
if (node->renderer())
- textNodes.append(node);
+ textNodes.append(toText(node));
} else {
for (Node* child = node->firstChild(); child; child = child->nextSibling()) {
if (child->nodeType() == Node::TEXT_NODE && child->renderer())
- textNodes.append(child);
+ textNodes.append(toText(child));
}
}
HashCountedSet<String> fontStats;
for (size_t i = 0; i < textNodes.size(); ++i) {
- RenderText* renderer = toRenderText(textNodes[i]->renderer());
+ RenderText* renderer = textNodes[i]->renderer();
collectPlatformFontsForRenderer(renderer, &fontStats);
if (renderer->isTextFragment()) {
RenderTextFragment* textFragment = toRenderTextFragment(renderer);
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/page/TouchAdjustment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698