| OLD | NEW |
| 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 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
| 17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 * | 20 * |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #include "config.h" | 23 #include "config.h" |
| 24 #include "core/rendering/InlineTextBox.h" | 24 #include "core/rendering/InlineTextBox.h" |
| 25 | 25 |
| 26 #include "core/dom/Document.h" | 26 #include "core/dom/Document.h" |
| 27 #include "core/dom/DocumentMarkerController.h" | 27 #include "core/dom/DocumentMarkerController.h" |
| 28 #include "core/dom/RenderedDocumentMarker.h" | 28 #include "core/dom/RenderedDocumentMarker.h" |
| 29 #include "core/dom/Text.h" | 29 #include "core/dom/Text.h" |
| 30 #include "core/editing/CompositionUnderline.h" |
| 31 #include "core/editing/CompositionUnderlineRangeFilter.h" |
| 30 #include "core/editing/Editor.h" | 32 #include "core/editing/Editor.h" |
| 31 #include "core/editing/InputMethodController.h" | 33 #include "core/editing/InputMethodController.h" |
| 32 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
| 33 #include "core/page/Page.h" | 35 #include "core/page/Page.h" |
| 34 #include "core/frame/Settings.h" | 36 #include "core/frame/Settings.h" |
| 35 #include "core/rendering/AbstractInlineTextBox.h" | 37 #include "core/rendering/AbstractInlineTextBox.h" |
| 36 #include "core/rendering/EllipsisBox.h" | 38 #include "core/rendering/EllipsisBox.h" |
| 37 #include "core/rendering/HitTestResult.h" | 39 #include "core/rendering/HitTestResult.h" |
| 38 #include "core/rendering/PaintInfo.h" | 40 #include "core/rendering/PaintInfo.h" |
| 39 #include "core/rendering/RenderBR.h" | 41 #include "core/rendering/RenderBR.h" |
| 40 #include "core/rendering/RenderBlock.h" | 42 #include "core/rendering/RenderBlock.h" |
| 41 #include "core/rendering/RenderCombineText.h" | 43 #include "core/rendering/RenderCombineText.h" |
| 42 #include "core/rendering/RenderRubyRun.h" | 44 #include "core/rendering/RenderRubyRun.h" |
| 43 #include "core/rendering/RenderRubyText.h" | 45 #include "core/rendering/RenderRubyText.h" |
| 44 #include "core/rendering/RenderTheme.h" | 46 #include "core/rendering/RenderTheme.h" |
| 45 #include "core/rendering/style/ShadowList.h" | 47 #include "core/rendering/style/ShadowList.h" |
| 46 #include "core/rendering/svg/SVGTextRunRenderingContext.h" | 48 #include "core/rendering/svg/SVGTextRunRenderingContext.h" |
| 47 #include "platform/fonts/FontCache.h" | 49 #include "platform/fonts/FontCache.h" |
| 48 #include "platform/fonts/WidthIterator.h" | 50 #include "platform/fonts/WidthIterator.h" |
| 49 #include "platform/graphics/DrawLooperBuilder.h" | 51 #include "platform/graphics/DrawLooperBuilder.h" |
| 50 #include "platform/graphics/GraphicsContextStateSaver.h" | 52 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 51 #include "wtf/Vector.h" | 53 #include "wtf/Vector.h" |
| 52 #include "wtf/text/CString.h" | 54 #include "wtf/text/CString.h" |
| 53 #include "wtf/text/StringBuilder.h" | 55 #include "wtf/text/StringBuilder.h" |
| 54 | 56 |
| 57 #include <algorithm> |
| 58 |
| 55 using namespace std; | 59 using namespace std; |
| 56 | 60 |
| 57 namespace WebCore { | 61 namespace WebCore { |
| 58 | 62 |
| 59 struct SameSizeAsInlineTextBox : public InlineBox { | 63 struct SameSizeAsInlineTextBox : public InlineBox { |
| 60 unsigned variables[1]; | 64 unsigned variables[1]; |
| 61 unsigned short variables2[2]; | 65 unsigned short variables2[2]; |
| 62 void* pointers[2]; | 66 void* pointers[2]; |
| 63 }; | 67 }; |
| 64 | 68 |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 | 632 |
| 629 // Set our font. | 633 // Set our font. |
| 630 const Font& font = styleToUse->font(); | 634 const Font& font = styleToUse->font(); |
| 631 | 635 |
| 632 FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontM
etrics().ascent()); | 636 FloatPoint textOrigin = FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontM
etrics().ascent()); |
| 633 | 637 |
| 634 if (combinedText) | 638 if (combinedText) |
| 635 combinedText->adjustTextOrigin(textOrigin, boxRect); | 639 combinedText->adjustTextOrigin(textOrigin, boxRect); |
| 636 | 640 |
| 637 // 1. Paint backgrounds behind text if needed. Examples of such backgrounds
include selection | 641 // 1. Paint backgrounds behind text if needed. Examples of such backgrounds
include selection |
| 638 // and composition underlines. | 642 // and composition highlights. |
| 639 if (paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseT
extClip && !isPrinting) { | 643 if (paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseT
extClip && !isPrinting) { |
| 640 | 644 if (containsComposition) { |
| 641 if (containsComposition && !useCustomUnderlines) { | 645 paintCompositionBackgrounds(context, boxOrigin, styleToUse, font, us
eCustomUnderlines); |
| 642 paintCompositionBackground(context, boxOrigin, styleToUse, font, | |
| 643 renderer().frame()->inputMethodController().compositionStart(), | |
| 644 renderer().frame()->inputMethodController().compositionEnd()); | |
| 645 } | 646 } |
| 646 | 647 |
| 647 paintDocumentMarkers(context, boxOrigin, styleToUse, font, true); | 648 paintDocumentMarkers(context, boxOrigin, styleToUse, font, true); |
| 648 | 649 |
| 649 if (haveSelection && !useCustomUnderlines) | 650 if (haveSelection && !useCustomUnderlines) |
| 650 paintSelection(context, boxOrigin, styleToUse, font, selectionFillCo
lor); | 651 paintSelection(context, boxOrigin, styleToUse, font, selectionFillCo
lor); |
| 651 } | 652 } |
| 652 | 653 |
| 653 // 2. Now paint the foreground, including text and decorations like underlin
e/overline (in quirks mode only). | 654 // 2. Now paint the foreground, including text and decorations like underlin
e/overline (in quirks mode only). |
| 654 int length = m_len; | 655 int length = m_len; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 if (combinedText) | 761 if (combinedText) |
| 761 context->concatCTM(rotation(boxRect, Clockwise)); | 762 context->concatCTM(rotation(boxRect, Clockwise)); |
| 762 paintDecoration(context, boxOrigin, textDecorations, textShadow); | 763 paintDecoration(context, boxOrigin, textDecorations, textShadow); |
| 763 if (combinedText) | 764 if (combinedText) |
| 764 context->concatCTM(rotation(boxRect, Counterclockwise)); | 765 context->concatCTM(rotation(boxRect, Counterclockwise)); |
| 765 } | 766 } |
| 766 | 767 |
| 767 if (paintInfo.phase == PaintPhaseForeground) { | 768 if (paintInfo.phase == PaintPhaseForeground) { |
| 768 paintDocumentMarkers(context, boxOrigin, styleToUse, font, false); | 769 paintDocumentMarkers(context, boxOrigin, styleToUse, font, false); |
| 769 | 770 |
| 771 // Paint custom underlines for compositions. |
| 770 if (useCustomUnderlines) { | 772 if (useCustomUnderlines) { |
| 771 const Vector<CompositionUnderline>& underlines = renderer().frame()-
>inputMethodController().customCompositionUnderlines(); | 773 const Vector<CompositionUnderline>& underlines = renderer().frame()-
>inputMethodController().customCompositionUnderlines(); |
| 772 size_t numUnderlines = underlines.size(); | 774 CompositionUnderlineRangeFilter filter(underlines, start(), end()); |
| 773 | 775 for (CompositionUnderlineRangeFilter::ConstIterator it = filter.begi
n(); it != filter.end(); ++it) { |
| 774 for (size_t index = 0; index < numUnderlines; ++index) { | 776 if (it->color == Color::transparent) |
| 775 const CompositionUnderline& underline = underlines[index]; | |
| 776 | |
| 777 if (underline.endOffset <= start()) | |
| 778 // underline is completely before this run. This might be a
n underline that sits | |
| 779 // before the first run we draw, or underlines that were wit
hin runs we skipped | |
| 780 // due to truncation. | |
| 781 continue; | 777 continue; |
| 782 | 778 paintCompositionUnderline(context, boxOrigin, *it); |
| 783 if (underline.startOffset <= end()) { | |
| 784 // underline intersects this run. Paint it. | |
| 785 paintCompositionUnderline(context, boxOrigin, underline); | |
| 786 if (underline.endOffset > end() + 1) | |
| 787 // underline also runs into the next run. Bail now, no m
ore marker advancement. | |
| 788 break; | |
| 789 } else | |
| 790 // underline is completely after this run, bail. A later ru
n will paint it. | |
| 791 break; | |
| 792 } | 779 } |
| 793 } | 780 } |
| 794 } | 781 } |
| 795 | 782 |
| 796 if (shouldRotate) | 783 if (shouldRotate) |
| 797 context->concatCTM(rotation(boxRect, Counterclockwise)); | 784 context->concatCTM(rotation(boxRect, Counterclockwise)); |
| 798 } | 785 } |
| 799 | 786 |
| 800 void InlineTextBox::selectionStartEnd(int& sPos, int& ePos) | 787 void InlineTextBox::selectionStartEnd(int& sPos, int& ePos) |
| 801 { | 788 { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 | 854 |
| 868 FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); | 855 FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); |
| 869 FloatRect clipRect(localOrigin, FloatSize(m_logicalWidth, selHeight)); | 856 FloatRect clipRect(localOrigin, FloatSize(m_logicalWidth, selHeight)); |
| 870 alignSelectionRectToDevicePixels(clipRect); | 857 alignSelectionRectToDevicePixels(clipRect); |
| 871 | 858 |
| 872 context->clip(clipRect); | 859 context->clip(clipRect); |
| 873 | 860 |
| 874 context->drawHighlightForText(font, textRun, localOrigin, selHeight, c, sPos
, ePos); | 861 context->drawHighlightForText(font, textRun, localOrigin, selHeight, c, sPos
, ePos); |
| 875 } | 862 } |
| 876 | 863 |
| 877 void InlineTextBox::paintCompositionBackground(GraphicsContext* context, const F
loatPoint& boxOrigin, RenderStyle* style, const Font& font, int startPos, int en
dPos) | 864 unsigned InlineTextBox::underlinePaintStart(const CompositionUnderline& underlin
e) |
| 878 { | 865 { |
| 879 int offset = m_start; | 866 return std::max(static_cast<unsigned>(m_start), underline.startOffset); |
| 880 int sPos = max(startPos - offset, 0); | 867 } |
| 881 int ePos = min(endPos - offset, (int)m_len); | |
| 882 | 868 |
| 869 unsigned InlineTextBox::underlinePaintEnd(const CompositionUnderline& underline) |
| 870 { |
| 871 unsigned paintEnd = std::min(end() + 1, underline.endOffset); // end() point
s at the last char, not past it. |
| 872 if (m_truncation != cNoTruncation) |
| 873 paintEnd = std::min(paintEnd, static_cast<unsigned>(m_start + m_truncati
on)); |
| 874 return paintEnd; |
| 875 } |
| 876 |
| 877 void InlineTextBox::paintSingleCompositionBackgroundRun(GraphicsContext* context
, const FloatPoint& boxOrigin, RenderStyle* style, const Font& font, Color backg
roundColor, int startPos, int endPos) |
| 878 { |
| 879 int sPos = std::max(startPos - m_start, 0); |
| 880 int ePos = std::min(endPos - m_start, static_cast<int>(m_len)); |
| 883 if (sPos >= ePos) | 881 if (sPos >= ePos) |
| 884 return; | 882 return; |
| 885 | 883 |
| 886 GraphicsContextStateSaver stateSaver(*context); | 884 GraphicsContextStateSaver stateSaver(*context); |
| 887 | 885 |
| 888 Color c = Color(225, 221, 85); | 886 updateGraphicsContext(context, backgroundColor, backgroundColor, 0); // Don'
t draw text at all! |
| 889 | |
| 890 updateGraphicsContext(context, c, c, 0); // Don't draw text at all! | |
| 891 | 887 |
| 892 int deltaY = renderer().style()->isFlippedLinesWritingMode() ? selectionBott
om() - logicalBottom() : logicalTop() - selectionTop(); | 888 int deltaY = renderer().style()->isFlippedLinesWritingMode() ? selectionBott
om() - logicalBottom() : logicalTop() - selectionTop(); |
| 893 int selHeight = selectionHeight(); | 889 int selHeight = selectionHeight(); |
| 894 FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); | 890 FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); |
| 895 context->drawHighlightForText(font, constructTextRun(style, font), localOrig
in, selHeight, c, sPos, ePos); | 891 context->drawHighlightForText(font, constructTextRun(style, font), localOrig
in, selHeight, backgroundColor, sPos, ePos); |
| 896 } | 892 } |
| 897 | 893 |
| 898 static StrokeStyle textDecorationStyleToStrokeStyle(TextDecorationStyle decorati
onStyle) | 894 static StrokeStyle textDecorationStyleToStrokeStyle(TextDecorationStyle decorati
onStyle) |
| 899 { | 895 { |
| 900 StrokeStyle strokeStyle = SolidStroke; | 896 StrokeStyle strokeStyle = SolidStroke; |
| 901 switch (decorationStyle) { | 897 switch (decorationStyle) { |
| 902 case TextDecorationStyleSolid: | 898 case TextDecorationStyleSolid: |
| 903 strokeStyle = SolidStroke; | 899 strokeStyle = SolidStroke; |
| 904 break; | 900 break; |
| 905 case TextDecorationStyleDouble: | 901 case TextDecorationStyleDouble: |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 Color color = marker->activeMatch() ? | 1300 Color color = marker->activeMatch() ? |
| 1305 RenderTheme::theme().platformActiveTextSearchHighlightColor() : | 1301 RenderTheme::theme().platformActiveTextSearchHighlightColor() : |
| 1306 RenderTheme::theme().platformInactiveTextSearchHighlightColor(); | 1302 RenderTheme::theme().platformInactiveTextSearchHighlightColor(); |
| 1307 GraphicsContextStateSaver stateSaver(*pt); | 1303 GraphicsContextStateSaver stateSaver(*pt); |
| 1308 updateGraphicsContext(pt, color, color, 0); // Don't draw text at all! | 1304 updateGraphicsContext(pt, color, color, 0); // Don't draw text at all! |
| 1309 pt->clip(FloatRect(boxOrigin.x(), boxOrigin.y() - deltaY, m_logicalWidth
, selHeight)); | 1305 pt->clip(FloatRect(boxOrigin.x(), boxOrigin.y() - deltaY, m_logicalWidth
, selHeight)); |
| 1310 pt->drawHighlightForText(font, run, FloatPoint(boxOrigin.x(), boxOrigin.
y() - deltaY), selHeight, color, sPos, ePos); | 1306 pt->drawHighlightForText(font, run, FloatPoint(boxOrigin.x(), boxOrigin.
y() - deltaY), selHeight, color, sPos, ePos); |
| 1311 } | 1307 } |
| 1312 } | 1308 } |
| 1313 | 1309 |
| 1310 void InlineTextBox::paintCompositionBackgrounds(GraphicsContext* pt, const Float
Point& boxOrigin, RenderStyle* style, const Font& font, bool useCustomUnderlines
) |
| 1311 { |
| 1312 if (useCustomUnderlines) { |
| 1313 // Paint custom background highlights for compositions. |
| 1314 const Vector<CompositionUnderline>& underlines = renderer().frame()->inp
utMethodController().customCompositionUnderlines(); |
| 1315 CompositionUnderlineRangeFilter filter(underlines, start(), end()); |
| 1316 for (CompositionUnderlineRangeFilter::ConstIterator it = filter.begin();
it != filter.end(); ++it) { |
| 1317 if (it->backgroundColor == Color::transparent) |
| 1318 continue; |
| 1319 paintSingleCompositionBackgroundRun(pt, boxOrigin, style, font, it->
backgroundColor, underlinePaintStart(*it), underlinePaintEnd(*it)); |
| 1320 } |
| 1321 |
| 1322 } else { |
| 1323 paintSingleCompositionBackgroundRun(pt, boxOrigin, style, font, RenderTh
eme::theme().platformDefaultCompositionBackgroundColor(), |
| 1324 renderer().frame()->inputMethodController().compositionStart(), |
| 1325 renderer().frame()->inputMethodController().compositionEnd()); |
| 1326 } |
| 1327 } |
| 1328 |
| 1314 void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, const FloatPoint&
boxOrigin, RenderStyle* style, const Font& font, bool background) | 1329 void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, const FloatPoint&
boxOrigin, RenderStyle* style, const Font& font, bool background) |
| 1315 { | 1330 { |
| 1316 if (!renderer().node()) | 1331 if (!renderer().node()) |
| 1317 return; | 1332 return; |
| 1318 | 1333 |
| 1319 WillBeHeapVector<DocumentMarker*> markers = renderer().document().markers().
markersFor(renderer().node()); | 1334 WillBeHeapVector<DocumentMarker*> markers = renderer().document().markers().
markersFor(renderer().node()); |
| 1320 WillBeHeapVector<DocumentMarker*>::const_iterator markerIt = markers.begin()
; | 1335 WillBeHeapVector<DocumentMarker*>::const_iterator markerIt = markers.begin()
; |
| 1321 | 1336 |
| 1322 // Give any document markers that touch this run a chance to draw before the
text has been drawn. | 1337 // Give any document markers that touch this run a chance to draw before the
text has been drawn. |
| 1323 // Note end() points at the last char, not one past it like endOffset and ra
nges do. | 1338 // Note end() points at the last char, not one past it like endOffset and ra
nges do. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 } | 1379 } |
| 1365 | 1380 |
| 1366 } | 1381 } |
| 1367 } | 1382 } |
| 1368 | 1383 |
| 1369 void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, const FloatP
oint& boxOrigin, const CompositionUnderline& underline) | 1384 void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, const FloatP
oint& boxOrigin, const CompositionUnderline& underline) |
| 1370 { | 1385 { |
| 1371 if (m_truncation == cFullTruncation) | 1386 if (m_truncation == cFullTruncation) |
| 1372 return; | 1387 return; |
| 1373 | 1388 |
| 1374 float start = 0; // start of line to draw, relative to tx | 1389 unsigned paintStart = underlinePaintStart(underline); |
| 1375 float width = m_logicalWidth; // how much line to draw | 1390 unsigned paintEnd = underlinePaintEnd(underline); |
| 1376 bool useWholeWidth = true; | 1391 |
| 1377 unsigned paintStart = m_start; | 1392 // start of line to draw, relative to paintOffset. |
| 1378 unsigned paintEnd = end() + 1; // end points at the last char, not past it | 1393 float start = paintStart == static_cast<unsigned>(m_start) ? 0 : |
| 1379 if (paintStart <= underline.startOffset) { | 1394 toRenderText(renderer()).width(m_start, paintStart - m_start, textPos(),
isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); |
| 1380 paintStart = underline.startOffset; | 1395 // how much line to draw |
| 1381 useWholeWidth = false; | 1396 float width = (paintStart == static_cast<unsigned>(m_start) && paintEnd == s
tatic_cast<unsigned>(end()) + 1) ? m_logicalWidth : |
| 1382 start = toRenderText(renderer()).width(m_start, paintStart - m_start, te
xtPos(), isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); | 1397 toRenderText(renderer()).width(paintStart, paintEnd - paintStart, textPo
s() + start, isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); |
| 1383 } | |
| 1384 if (paintEnd != underline.endOffset) { // end points at the last char,
not past it | |
| 1385 paintEnd = min(paintEnd, (unsigned)underline.endOffset); | |
| 1386 useWholeWidth = false; | |
| 1387 } | |
| 1388 if (m_truncation != cNoTruncation) { | |
| 1389 paintEnd = min(paintEnd, (unsigned)m_start + m_truncation); | |
| 1390 useWholeWidth = false; | |
| 1391 } | |
| 1392 if (!useWholeWidth) { | |
| 1393 width = toRenderText(renderer()).width(paintStart, paintEnd - paintStart
, textPos() + start, isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); | |
| 1394 } | |
| 1395 | 1398 |
| 1396 // Thick marked text underlines are 2px thick as long as there is room for t
he 2px line under the baseline. | 1399 // Thick marked text underlines are 2px thick as long as there is room for t
he 2px line under the baseline. |
| 1397 // All other marked text underlines are 1px thick. | 1400 // All other marked text underlines are 1px thick. |
| 1398 // If there's not enough space the underline will touch or overlap character
s. | 1401 // If there's not enough space the underline will touch or overlap character
s. |
| 1399 int lineThickness = 1; | 1402 int lineThickness = 1; |
| 1400 int baseline = renderer().style(isFirstLineStyle())->fontMetrics().ascent(); | 1403 int baseline = renderer().style(isFirstLineStyle())->fontMetrics().ascent(); |
| 1401 if (underline.thick && logicalHeight() - baseline >= 2) | 1404 if (underline.thick && logicalHeight() - baseline >= 2) |
| 1402 lineThickness = 2; | 1405 lineThickness = 2; |
| 1403 | 1406 |
| 1404 // We need to have some space between underlines of subsequent clauses, beca
use some input methods do not use different underline styles for those. | 1407 // We need to have some space between underlines of subsequent clauses, beca
use some input methods do not use different underline styles for those. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); | 1582 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); |
| 1580 const int rendererCharacterOffset = 24; | 1583 const int rendererCharacterOffset = 24; |
| 1581 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) | 1584 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) |
| 1582 fputc(' ', stderr); | 1585 fputc(' ', stderr); |
| 1583 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); | 1586 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); |
| 1584 } | 1587 } |
| 1585 | 1588 |
| 1586 #endif | 1589 #endif |
| 1587 | 1590 |
| 1588 } // namespace WebCore | 1591 } // namespace WebCore |
| OLD | NEW |