Chromium Code Reviews| 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 RenderObject* decorationRenderer = findRenderObjectDefininingTextDecoration( parent()); | 536 RenderObject* decorationRenderer = findRenderObjectDefininingTextDecoration( parent()); |
| 537 RenderStyle* decorationStyle = decorationRenderer->style(); | 537 RenderStyle* decorationStyle = decorationRenderer->style(); |
| 538 ASSERT(decorationStyle); | 538 ASSERT(decorationStyle); |
| 539 | 539 |
| 540 if (decorationStyle->visibility() == HIDDEN) | 540 if (decorationStyle->visibility() == HIDDEN) |
| 541 return; | 541 return; |
| 542 | 542 |
| 543 const SVGRenderStyle* svgDecorationStyle = decorationStyle->svgStyle(); | 543 const SVGRenderStyle* svgDecorationStyle = decorationStyle->svgStyle(); |
| 544 ASSERT(svgDecorationStyle); | 544 ASSERT(svgDecorationStyle); |
| 545 | 545 |
| 546 bool hasDecorationFill = svgDecorationStyle->hasFill(); | 546 for (int i = 0; i < 3; i++) { |
|
pdr.
2014/04/08 14:20:57
Question: can we share this with the loop above (i
fs
2014/04/08 15:50:24
No, not as long as the stroke+fill for the decorat
| |
| 547 bool hasVisibleDecorationStroke = svgDecorationStyle->hasVisibleStroke(); | 547 switch (svgDecorationStyle->paintOrderType(i)) { |
| 548 | 548 case PT_FILL: |
| 549 if (hasDecorationFill) { | 549 if (svgDecorationStyle->hasFill()) { |
| 550 m_paintingResourceMode = ApplyToFillMode; | 550 m_paintingResourceMode = ApplyToFillMode; |
| 551 paintDecorationWithStyle(context, decoration, fragment, decorationRender er); | 551 paintDecorationWithStyle(context, decoration, fragment, decorati onRenderer); |
| 552 } | 552 } |
| 553 | 553 break; |
| 554 if (hasVisibleDecorationStroke) { | 554 case PT_STROKE: |
| 555 m_paintingResourceMode = ApplyToStrokeMode; | 555 if (svgDecorationStyle->hasVisibleStroke()) { |
| 556 paintDecorationWithStyle(context, decoration, fragment, decorationRender er); | 556 m_paintingResourceMode = ApplyToStrokeMode; |
| 557 paintDecorationWithStyle(context, decoration, fragment, decorati onRenderer); | |
| 558 } | |
| 559 break; | |
| 560 case PT_MARKERS: | |
| 561 break; | |
| 562 default: | |
| 563 ASSERT_NOT_REACHED(); | |
| 564 } | |
| 557 } | 565 } |
| 558 } | 566 } |
| 559 | 567 |
| 560 void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, TextDe coration decoration, const SVGTextFragment& fragment, RenderObject* decorationRe nderer) | 568 void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, TextDe coration decoration, const SVGTextFragment& fragment, RenderObject* decorationRe nderer) |
| 561 { | 569 { |
| 562 ASSERT(!m_paintingResource); | 570 ASSERT(!m_paintingResource); |
| 563 ASSERT(m_paintingResourceMode != ApplyToDefaultMode); | 571 ASSERT(m_paintingResourceMode != ApplyToDefaultMode); |
| 564 | 572 |
| 565 RenderStyle* decorationStyle = decorationRenderer->style(); | 573 RenderStyle* decorationStyle = decorationRenderer->style(); |
| 566 ASSERT(decorationStyle); | 574 ASSERT(decorationStyle); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 790 renderer().updateHitTestResult(result, locationInContainer.point () - toLayoutSize(accumulatedOffset)); | 798 renderer().updateHitTestResult(result, locationInContainer.point () - toLayoutSize(accumulatedOffset)); |
| 791 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ est, locationInContainer, rect)) | 799 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ est, locationInContainer, rect)) |
| 792 return true; | 800 return true; |
| 793 } | 801 } |
| 794 } | 802 } |
| 795 } | 803 } |
| 796 return false; | 804 return false; |
| 797 } | 805 } |
| 798 | 806 |
| 799 } // namespace WebCore | 807 } // namespace WebCore |
| OLD | NEW |