~ubuntu-branches/ubuntu/karmic/webkit/karmic-proposed

« back to all changes in this revision

Viewing changes to WebCore/rendering/RenderSVGTSpan.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-05-15 18:30:58 UTC
  • mto: (4.4.1 sid) (1.2.2 upstream) (16.1.1 lucid)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20090515183058-35m5or0ufm5tutud
Tags: upstream-1.1.7
ImportĀ upstreamĀ versionĀ 1.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#if ENABLE(SVG)
27
27
#include "RenderSVGTSpan.h"
28
28
 
29
 
#include "FloatQuad.h"
30
 
#include "RenderBlock.h"
31
 
#include "SVGInlineTextBox.h"
32
 
#include "SVGRootInlineBox.h"
33
 
 
34
29
namespace WebCore {
35
30
 
36
31
RenderSVGTSpan::RenderSVGTSpan(Node* n)
38
33
{
39
34
}
40
35
 
41
 
void RenderSVGTSpan::absoluteRects(Vector<IntRect>& rects, int, int, bool)
42
 
{
43
 
    InlineRunBox* firstBox = firstLineBox();
44
 
 
45
 
    SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
46
 
    RenderBox* object = rootBox ? rootBox->block() : 0;
47
 
 
48
 
    if (!object)
49
 
        return;
50
 
 
51
 
    int xRef = object->x();
52
 
    int yRef = object->y();
53
 
 
54
 
    for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
55
 
        FloatRect rect(xRef + curr->x(), yRef + curr->y(), curr->width(), curr->height());
56
 
        // FIXME: broken with CSS transforms
57
 
        rects.append(enclosingIntRect(absoluteTransform().mapRect(rect)));
58
 
    }
59
 
}
60
 
 
61
 
void RenderSVGTSpan::absoluteQuads(Vector<FloatQuad>& quads, bool)
62
 
{
63
 
    InlineRunBox* firstBox = firstLineBox();
64
 
 
65
 
    SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
66
 
    RenderBox* object = rootBox ? rootBox->block() : 0;
67
 
 
68
 
    if (!object)
69
 
        return;
70
 
 
71
 
    int xRef = object->x();
72
 
    int yRef = object->y();
73
 
 
74
 
    for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
75
 
        FloatRect rect(xRef + curr->x(), yRef + curr->y(), curr->width(), curr->height());
76
 
        // FIXME: broken with CSS transforms
77
 
        quads.append(absoluteTransform().mapRect(rect));
78
 
    }
79
 
}
80
 
 
81
36
}
82
37
 
83
38
#endif // ENABLE(SVG)