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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/InlineFlowBox.cpp
diff --git a/Source/core/rendering/InlineFlowBox.cpp b/Source/core/rendering/InlineFlowBox.cpp
index 6816cf87d41d671f9a29b7cda76e02e17a64531e..52f5e33fe36a2faabd67ce8bcf7a6606c996ca49 100644
--- a/Source/core/rendering/InlineFlowBox.cpp
+++ b/Source/core/rendering/InlineFlowBox.cpp
@@ -1128,15 +1128,40 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
childInfo.phase = paintPhase;
childInfo.updatePaintingRootForChildren(&renderer());
- // Paint our children.
+ 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
+ float finalThickness = 0;
+ 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
+
+ // Paint our childrens and calculate underline thickness
if (paintPhase != PaintPhaseSelfOutline) {
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
- if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintingLayer())
+ if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) {
curr->paint(childInfo, paintOffset, lineTop, lineBottom);
+ curr->getPaintDecorationSyle(childInfo, paintOffset, &underlineThickness, &style);
+ if (finalThickness < underlineThickness)
+ finalThickness = underlineThickness;
+ }
+ }
+
+ // We have underline thickness now, let draw it
+ for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
+ if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) {
+ curr->paintDecorationStyle(childInfo, paintOffset, lineTop, lineBottom, finalThickness);
+ }
}
}
}
+void InlineFlowBox::paintDecorationStyle(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom)
+{
+ return;
+}
+
+void InlineFlowBox::getPaintDecorationSyle(PaintInfo& paintInfo, const LayoutPoint& paintOffset, float * underlineThickness, TextDecorationStyle * style)
+{
+ return;
+}
+
void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op)
{
if (!fillLayer)

Powered by Google App Engine
This is Rietveld 408576698