111
|
1 // { dg-do compile }
|
131
|
2 // { dg-additional-options "-Wno-return-type" }
|
111
|
3
|
|
4 class IntSize {
|
|
5 public:
|
|
6 IntSize(int width, int height) : m_width(width), m_height(height) { }
|
|
7 int m_width, m_height;
|
|
8 };
|
|
9 class IntPoint {
|
|
10 public:
|
|
11 IntPoint(int x, int y) : m_x(x), m_y(y) { }
|
|
12 int m_x, m_y;
|
|
13 };
|
|
14 class IntRect {
|
|
15 public:
|
|
16 IntRect(int x, int y, int width, int height)
|
|
17 : m_location(IntPoint(x, y)), m_size(IntSize(width, height)) { }
|
|
18 void intersect(const IntRect&);
|
|
19 IntPoint m_location;
|
|
20 IntSize m_size;
|
|
21 };
|
|
22 inline IntRect intersection(const IntRect& a, const IntRect& b) {
|
|
23 IntRect c = a;
|
|
24 c.intersect(b);
|
|
25 return c;
|
|
26 }
|
|
27 class RenderObject {
|
|
28 public:
|
|
29 int contentWidth() const { }
|
|
30 int contentHeight() const { }
|
|
31 virtual int xPos() const { }
|
|
32 virtual int yPos() const { }
|
|
33 virtual int paddingTop() const;
|
|
34 virtual int paddingLeft() const;
|
|
35 virtual int borderTop() const { }
|
|
36 virtual int borderLeft() const { }
|
|
37 };
|
|
38 class RenderMenuList : public RenderObject {
|
|
39 virtual IntRect controlClipRect(int tx, int ty) const;
|
|
40 RenderObject* m_innerBlock;
|
|
41 };
|
|
42 IntRect RenderMenuList::controlClipRect(int tx, int ty) const {
|
|
43 IntRect outerBox(tx + borderLeft() + paddingLeft(),
|
|
44 ty + borderTop() + paddingTop(),
|
|
45 contentWidth(), contentHeight());
|
|
46 IntRect innerBox(tx + m_innerBlock->xPos() + m_innerBlock->paddingLeft(),
|
|
47 ty + m_innerBlock->yPos() + m_innerBlock->paddingTop(),
|
|
48 m_innerBlock->contentWidth(),
|
|
49 m_innerBlock->contentHeight());
|
|
50 return intersection(outerBox, innerBox);
|
|
51 }
|
|
52
|