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

Side by Side Diff: Source/core/rendering/InlineFlowBox.cpp

Issue 203273003: Underline Thickness is not uniform (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 } 1121 }
1122 1122
1123 if (paintInfo.phase == PaintPhaseMask) 1123 if (paintInfo.phase == PaintPhaseMask)
1124 return; 1124 return;
1125 1125
1126 PaintPhase paintPhase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPh aseOutline : paintInfo.phase; 1126 PaintPhase paintPhase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPh aseOutline : paintInfo.phase;
1127 PaintInfo childInfo(paintInfo); 1127 PaintInfo childInfo(paintInfo);
1128 childInfo.phase = paintPhase; 1128 childInfo.phase = paintPhase;
1129 childInfo.updatePaintingRootForChildren(&renderer()); 1129 childInfo.updatePaintingRootForChildren(&renderer());
1130 1130
1131 // Paint our children. 1131 float underlineThickness = 0;
andersr 2014/03/19 13:18:12 It should probably be called decorationThickness,
h.joshi 2014/03/19 13:59:54 Will make required changes. On 2014/03/19 13:18:1
1132 float finalThickness = 0;
1133 TextDecorationStyle style = TextDecorationStyleNone;
andersr 2014/03/19 13:18:12 Is TextDecorationStyle used for anything?
h.joshi 2014/03/19 13:59:54 It is not used for now, but added for future refer
andersr 2014/03/19 14:39:44 I'm not sure it's wise to add things just because
1134
1135 // Paint our childrens and calculate underline thickness
1132 if (paintPhase != PaintPhaseSelfOutline) { 1136 if (paintPhase != PaintPhaseSelfOutline) {
1133 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { 1137 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
1134 if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPai ntingLayer()) 1138 if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPai ntingLayer()) {
1135 curr->paint(childInfo, paintOffset, lineTop, lineBottom); 1139 curr->paint(childInfo, paintOffset, lineTop, lineBottom);
1140 curr->getPaintDecorationSyle(childInfo, paintOffset, &underlineT hickness, &style);
1141 if (finalThickness < underlineThickness)
1142 finalThickness = underlineThickness;
1143 }
1144 }
1145
1146 // We have underline thickness now, let draw it
1147 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
1148 if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPai ntingLayer()) {
1149 curr->paintDecorationStyle(childInfo, paintOffset, lineTop, line Bottom, finalThickness);
1150 }
1136 } 1151 }
1137 } 1152 }
1138 } 1153 }
1139 1154
1155 void InlineFlowBox::paintDecorationStyle(PaintInfo& paintInfo, const LayoutPoint & paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom)
1156 {
1157 return;
1158 }
1159
1160 void InlineFlowBox::getPaintDecorationSyle(PaintInfo& paintInfo, const LayoutPoi nt& paintOffset, float * underlineThickness, TextDecorationStyle * style)
1161 {
1162 return;
1163 }
1164
1140 void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op) 1165 void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op)
1141 { 1166 {
1142 if (!fillLayer) 1167 if (!fillLayer)
1143 return; 1168 return;
1144 paintFillLayers(paintInfo, c, fillLayer->next(), rect, op); 1169 paintFillLayers(paintInfo, c, fillLayer->next(), rect, op);
1145 paintFillLayer(paintInfo, c, fillLayer, rect, op); 1170 paintFillLayer(paintInfo, c, fillLayer, rect, op);
1146 } 1171 }
1147 1172
1148 bool InlineFlowBox::boxShadowCanBeAppliedToBackground(const FillLayer& lastBackg roundLayer) const 1173 bool InlineFlowBox::boxShadowCanBeAppliedToBackground(const FillLayer& lastBackg roundLayer) const
1149 { 1174 {
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 ASSERT(child->prevOnLine() == prev); 1663 ASSERT(child->prevOnLine() == prev);
1639 prev = child; 1664 prev = child;
1640 } 1665 }
1641 ASSERT(prev == m_lastChild); 1666 ASSERT(prev == m_lastChild);
1642 #endif 1667 #endif
1643 } 1668 }
1644 1669
1645 #endif 1670 #endif
1646 1671
1647 } // namespace WebCore 1672 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698