| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 if (!fragmentTransform.isIdentity()) | 318 if (!fragmentTransform.isIdentity()) |
| 319 paintInfo.context->concatCTM(fragmentTransform); | 319 paintInfo.context->concatCTM(fragmentTransform); |
| 320 | 320 |
| 321 // Spec: All text decorations except line-through should be drawn before
the text is filled and stroked; thus, the text is rendered on top of these deco
rations. | 321 // Spec: All text decorations except line-through should be drawn before
the text is filled and stroked; thus, the text is rendered on top of these deco
rations. |
| 322 int decorations = style->textDecorationsInEffect(); | 322 int decorations = style->textDecorationsInEffect(); |
| 323 if (decorations & TextDecorationUnderline) | 323 if (decorations & TextDecorationUnderline) |
| 324 paintDecoration(paintInfo.context, TextDecorationUnderline, fragment
); | 324 paintDecoration(paintInfo.context, TextDecorationUnderline, fragment
); |
| 325 if (decorations & TextDecorationOverline) | 325 if (decorations & TextDecorationOverline) |
| 326 paintDecoration(paintInfo.context, TextDecorationOverline, fragment)
; | 326 paintDecoration(paintInfo.context, TextDecorationOverline, fragment)
; |
| 327 | 327 |
| 328 // Fill text | 328 for (int i = 0; i < 3; i++) { |
| 329 if (hasFill) { | 329 switch (svgStyle->paintOrderType(i)) { |
| 330 m_paintingResourceMode = ApplyToFillMode | ApplyToTextMode; | 330 case PT_FILL: |
| 331 paintText(paintInfo.context, style, selectionStyle, fragment, hasSel
ection, paintSelectedTextOnly); | 331 // Fill text |
| 332 } | 332 if (hasFill) { |
| 333 | 333 m_paintingResourceMode = ApplyToFillMode | ApplyToTextMode; |
| 334 // Stroke text | 334 paintText(paintInfo.context, style, selectionStyle, fragment
, hasSelection, paintSelectedTextOnly); |
| 335 if (hasVisibleStroke) { | 335 } |
| 336 m_paintingResourceMode = ApplyToStrokeMode | ApplyToTextMode; | 336 break; |
| 337 paintText(paintInfo.context, style, selectionStyle, fragment, hasSel
ection, paintSelectedTextOnly); | 337 case PT_STROKE: |
| 338 // Stroke text |
| 339 if (hasVisibleStroke) { |
| 340 m_paintingResourceMode = ApplyToStrokeMode | ApplyToTextMode
; |
| 341 paintText(paintInfo.context, style, selectionStyle, fragment
, hasSelection, paintSelectedTextOnly); |
| 342 } |
| 343 break; |
| 344 case PT_MARKERS: |
| 345 // Markers don't apply to text |
| 346 break; |
| 347 default: |
| 348 ASSERT_NOT_REACHED(); |
| 349 break; |
| 350 } |
| 338 } | 351 } |
| 339 | 352 |
| 340 // Spec: Line-through should be drawn after the text is filled and strok
ed; thus, the line-through is rendered on top of the text. | 353 // Spec: Line-through should be drawn after the text is filled and strok
ed; thus, the line-through is rendered on top of the text. |
| 341 if (decorations & TextDecorationLineThrough) | 354 if (decorations & TextDecorationLineThrough) |
| 342 paintDecoration(paintInfo.context, TextDecorationLineThrough, fragme
nt); | 355 paintDecoration(paintInfo.context, TextDecorationLineThrough, fragme
nt); |
| 343 | 356 |
| 344 m_paintingResourceMode = ApplyToDefaultMode; | 357 m_paintingResourceMode = ApplyToDefaultMode; |
| 345 } | 358 } |
| 346 | 359 |
| 347 ASSERT(!m_paintingResource); | 360 ASSERT(!m_paintingResource); |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); | 737 renderer()->updateHitTestResult(result, locationInContainer.poin
t() - toLayoutSize(accumulatedOffset)); |
| 725 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) | 738 if (!result.addNodeToRectBasedTestResult(renderer()->node(), req
uest, locationInContainer, rect)) |
| 726 return true; | 739 return true; |
| 727 } | 740 } |
| 728 } | 741 } |
| 729 } | 742 } |
| 730 return false; | 743 return false; |
| 731 } | 744 } |
| 732 | 745 |
| 733 } // namespace WebCore | 746 } // namespace WebCore |
| OLD | NEW |