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

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

Issue 2842983002: [LayoutNG] Paint inlines from the fragment tree
Patch Set: Basic box painting support Created 3 years, 7 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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 1183
1181 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), 1184 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(),
1182 inline_text_box_.LogicalHeight())); 1185 inline_text_box_.LogicalHeight()));
1183 context.Clip(FloatRect(box_rect)); 1186 context.Clip(FloatRect(box_rect));
1184 context.DrawHighlightForText(font, run, FloatPoint(box_origin), 1187 context.DrawHighlightForText(font, run, FloatPoint(box_origin),
1185 box_rect.Height().ToInt(), color, 1188 box_rect.Height().ToInt(), color,
1186 paint_offsets.first, paint_offsets.second); 1189 paint_offsets.first, paint_offsets.second);
1187 } 1190 }
1188 1191
1189 } // namespace blink 1192 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698