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

Side by Side Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Issue 2842983002: [LayoutNG] Paint inlines from the fragment tree
Patch Set: Rebase w/HEAD 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/InlineTextBoxPainter.h" 5 #include "core/paint/InlineTextBoxPainter.h"
6 6
7 #include "core/editing/CompositionUnderline.h" 7 #include "core/editing/CompositionUnderline.h"
8 #include "core/editing/Editor.h" 8 #include "core/editing/Editor.h"
9 #include "core/editing/markers/DocumentMarkerController.h" 9 #include "core/editing/markers/DocumentMarkerController.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (!current) 60 if (!current)
61 return current; 61 return current;
62 62
63 if (Node* node = current.GetNode()) { 63 if (Node* node = current.GetNode()) {
64 if (isHTMLAnchorElement(node) || node->HasTagName(HTMLNames::fontTag)) 64 if (isHTMLAnchorElement(node) || node->HasTagName(HTMLNames::fontTag))
65 return current; 65 return current;
66 } 66 }
67 } 67 }
68 } 68 }
69 69
70 // TODO(eae): Move
71 // Needs offset for root baseline and and logical top for self
72 // and furthers position for underline
70 static int ComputeUnderlineOffsetForUnder( 73 static int ComputeUnderlineOffsetForUnder(
71 const ComputedStyle& style, 74 const ComputedStyle& style,
72 const InlineTextBox* inline_text_box, 75 const InlineTextBox* inline_text_box,
73 LineLayoutItem decorating_box, 76 LineLayoutItem decorating_box,
74 float text_decoration_thickness, 77 float text_decoration_thickness,
75 LineVerticalPositionType position_type) { 78 LineVerticalPositionType position_type) {
76 const RootInlineBox& root = inline_text_box->Root(); 79 const RootInlineBox& root = inline_text_box->Root();
77 FontBaseline baseline_type = root.BaselineType(); 80 FontBaseline baseline_type = root.BaselineType();
78 LayoutUnit offset = inline_text_box->OffsetTo(position_type, baseline_type); 81 LayoutUnit offset = inline_text_box->OffsetTo(position_type, baseline_type);
79 82
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 1184
1182 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), 1185 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(),
1183 inline_text_box_.LogicalHeight())); 1186 inline_text_box_.LogicalHeight()));
1184 context.Clip(FloatRect(box_rect)); 1187 context.Clip(FloatRect(box_rect));
1185 context.DrawHighlightForText(font, run, FloatPoint(box_origin), 1188 context.DrawHighlightForText(font, run, FloatPoint(box_origin),
1186 box_rect.Height().ToInt(), color, 1189 box_rect.Height().ToInt(), color,
1187 paint_offsets.first, paint_offsets.second); 1190 paint_offsets.first, paint_offsets.second);
1188 } 1191 }
1189 1192
1190 } // namespace blink 1193 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxDecorationData.cpp ('k') | third_party/WebKit/Source/core/paint/NGBlockFlowPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698