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

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

Issue 2929763002: Introduce InlineTextBoxesOf() for ease of loop over InlineTextBox of LayoutText (Closed)
Patch Set: 2017-06-08T17:21:30 Revise variable name in ComputeInlineBoxPositionTempalte to make patch size smaller Created 3 years, 6 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
Index: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index eddcc1cc1440e6ab4311e0054587ed65907e2db9..ddfcd0be92cf631cd5af0728958ad025438f2792 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -1168,8 +1168,7 @@ void InspectorCSSAgent::CollectPlatformFontsForLayoutObject(
FontCachePurgePreventer preventer;
LayoutText* layout_text = ToLayoutText(layout_object);
- for (InlineTextBox* box = layout_text->FirstTextBox(); box;
- box = box->NextTextBox()) {
+ for (InlineTextBox* box : InlineTextBoxesOf(*layout_text)) {
const ComputedStyle& style = layout_text->StyleRef(box->IsFirstLineStyle());
const Font& font = style.GetFont();
TextRun run = box->ConstructTextRunForInspector(style);
@@ -2461,8 +2460,7 @@ void InspectorCSSAgent::VisitLayoutTreeNodes(
std::unique_ptr<protocol::Array<protocol::CSS::InlineTextBox>>
inline_text_nodes =
protocol::Array<protocol::CSS::InlineTextBox>::create();
- for (const InlineTextBox* text_box = layout_text->FirstTextBox();
- text_box; text_box = text_box->NextTextBox()) {
+ for (const InlineTextBox* text_box : InlineTextBoxesOf(*layout_text)) {
FloatRect local_coords_text_box_rect(text_box->FrameRect());
FloatRect absolute_coords_text_box_rect =
layout_object->LocalToAbsoluteQuad(local_coords_text_box_rect)

Powered by Google App Engine
This is Rietveld 408576698