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

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: Fixing comments and adding new test case 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 b1814adbde2b702cb8ea74996232465335de648e..65234efa0cd2d18497994deaaf1a99532050ca32 100644
--- a/Source/core/rendering/InlineFlowBox.cpp
+++ b/Source/core/rendering/InlineFlowBox.cpp
@@ -1133,11 +1133,25 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
childInfo.phase = paintPhase;
childInfo.updatePaintingRootForChildren(&renderer());
- // Paint our children.
+ float decorationThickness = 0;
leviw_travelin_and_unemployed 2014/03/21 20:43:08 These should be scoped inside the if.
+ float finalThickness = 0;
+
+ // Paint our childrens and calculate underline thickness
leviw_travelin_and_unemployed 2014/03/21 20:43:08 s/childrens/children/, but I don't think this comm
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, &decorationThickness);
leviw_travelin_and_unemployed 2014/03/21 20:43:08 Why not have this method return decorationThicknes
+ if (finalThickness < decorationThickness)
+ finalThickness = decorationThickness;
+ }
+ }
+
+ // We have underline thickness now, let draw it
leviw_travelin_and_unemployed 2014/03/21 20:43:08 s/let/lets/, but again I don't think this comment
+ for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
+ if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) {
+ curr->paintDecorationStyle(childInfo, paintOffset, lineTop, lineBottom, finalThickness);
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698