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

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

Issue 185683003: Draw a single underline for text-decoration-style: [dashed, dotted]. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't modify rendering behavior of old decorations. 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 // Using computedFontSize should take care of zoom as well. 1095 // Using computedFontSize should take care of zoom as well.
1096 1096
1097 // Update Underline thickness, in case we have Faulty Font Metrics calculati ng underline thickness by old method. 1097 // Update Underline thickness, in case we have Faulty Font Metrics calculati ng underline thickness by old method.
1098 float textDecorationThickness = styleToUse->fontMetrics().underlineThickness (); 1098 float textDecorationThickness = styleToUse->fontMetrics().underlineThickness ();
1099 int fontHeightInt = (int)(styleToUse->fontMetrics().floatHeight() + 0.5); 1099 int fontHeightInt = (int)(styleToUse->fontMetrics().floatHeight() + 0.5);
1100 if ((textDecorationThickness == 0.f) || (textDecorationThickness >= (fontHei ghtInt >> 1))) 1100 if ((textDecorationThickness == 0.f) || (textDecorationThickness >= (fontHei ghtInt >> 1)))
1101 textDecorationThickness = std::max(1.f, styleToUse->computedFontSize() / 10.f); 1101 textDecorationThickness = std::max(1.f, styleToUse->computedFontSize() / 10.f);
1102 1102
1103 context->setStrokeThickness(textDecorationThickness); 1103 context->setStrokeThickness(textDecorationThickness);
1104 1104
1105 switch (decorationStyle) {
1106 case TextDecorationStyleDotted:
1107 case TextDecorationStyleDashed:
1108 context->setShouldAntialias(RenderBoxModelObject::shouldAntialiasLines(c ontext));
1109 break;
1110 case TextDecorationStyleSolid:
1111 case TextDecorationStyleDouble:
1112 case TextDecorationStyleWavy:
1113 break;
1114 }
1115
1105 float extraOffset = 0; 1116 float extraOffset = 0;
1106 if (!linesAreOpaque && shadowCount > 1) { 1117 if (!linesAreOpaque && shadowCount > 1) {
1107 FloatRect clipRect(localOrigin, FloatSize(width, baseline + 2)); 1118 FloatRect clipRect(localOrigin, FloatSize(width, baseline + 2));
1108 for (size_t i = shadowCount; i--; ) { 1119 for (size_t i = shadowCount; i--; ) {
1109 const ShadowData& s = shadowList->shadows()[i]; 1120 const ShadowData& s = shadowList->shadows()[i];
1110 FloatRect shadowRect(localOrigin, FloatSize(width, baseline + 2)); 1121 FloatRect shadowRect(localOrigin, FloatSize(width, baseline + 2));
1111 shadowRect.inflate(s.blur()); 1122 shadowRect.inflate(s.blur());
1112 float shadowX = isHorizontal() ? s.x() : s.y(); 1123 float shadowX = isHorizontal() ? s.x() : s.y();
1113 float shadowY = isHorizontal() ? s.y() : -s.x(); 1124 float shadowY = isHorizontal() ? s.y() : -s.x();
1114 shadowRect.move(shadowX, shadowY); 1125 shadowRect.move(shadowX, shadowY);
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); 1575 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj);
1565 const int rendererCharacterOffset = 24; 1576 const int rendererCharacterOffset = 24;
1566 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) 1577 for (; printedCharacters < rendererCharacterOffset; printedCharacters++)
1567 fputc(' ', stderr); 1578 fputc(' ', stderr);
1568 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); 1579 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata());
1569 } 1580 }
1570 1581
1571 #endif 1582 #endif
1572 1583
1573 } // namespace WebCore 1584 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698