| OLD | NEW |
| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // Fall though. | 56 // Fall though. |
| 57 case kTextUnderlinePositionAuto: | 57 case kTextUnderlinePositionAuto: |
| 58 return ResolvedUnderlinePosition::kRoman; | 58 return ResolvedUnderlinePosition::kRoman; |
| 59 case kTextUnderlinePositionUnder: | 59 case kTextUnderlinePositionUnder: |
| 60 return ResolvedUnderlinePosition::kUnder; | 60 return ResolvedUnderlinePosition::kUnder; |
| 61 } | 61 } |
| 62 break; | 62 break; |
| 63 case kIdeographicBaseline: | 63 case kIdeographicBaseline: |
| 64 // Compute language-appropriate default underline position. | 64 // Compute language-appropriate default underline position. |
| 65 // https://drafts.csswg.org/css-text-decor-3/#default-stylesheet | 65 // https://drafts.csswg.org/css-text-decor-3/#default-stylesheet |
| 66 UScriptCode script = style.GetFontDescription().Script(); | 66 UScriptCode script = style.GetFontDescription().GetScript(); |
| 67 if (script == USCRIPT_KATAKANA_OR_HIRAGANA || script == USCRIPT_HANGUL) | 67 if (script == USCRIPT_KATAKANA_OR_HIRAGANA || script == USCRIPT_HANGUL) |
| 68 return ResolvedUnderlinePosition::kOver; | 68 return ResolvedUnderlinePosition::kOver; |
| 69 return ResolvedUnderlinePosition::kUnder; | 69 return ResolvedUnderlinePosition::kUnder; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 static LineLayoutItem EnclosingUnderlineObject( | 73 static LineLayoutItem EnclosingUnderlineObject( |
| 74 const InlineTextBox* inline_text_box) { | 74 const InlineTextBox* inline_text_box) { |
| 75 bool first_line = inline_text_box->IsFirstLineStyle(); | 75 bool first_line = inline_text_box->IsFirstLineStyle(); |
| 76 for (LineLayoutItem current = inline_text_box->Parent()->GetLineLayoutItem(); | 76 for (LineLayoutItem current = inline_text_box->Parent()->GetLineLayoutItem(); |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 | 1384 |
| 1385 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), | 1385 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), |
| 1386 inline_text_box_.LogicalHeight())); | 1386 inline_text_box_.LogicalHeight())); |
| 1387 context.Clip(FloatRect(box_rect)); | 1387 context.Clip(FloatRect(box_rect)); |
| 1388 context.DrawHighlightForText(font, run, FloatPoint(box_origin), | 1388 context.DrawHighlightForText(font, run, FloatPoint(box_origin), |
| 1389 box_rect.Height().ToInt(), color, | 1389 box_rect.Height().ToInt(), color, |
| 1390 paint_offsets.first, paint_offsets.second); | 1390 paint_offsets.first, paint_offsets.second); |
| 1391 } | 1391 } |
| 1392 | 1392 |
| 1393 } // namespace blink | 1393 } // namespace blink |
| OLD | NEW |