OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #ifndef RenderObject_h | 25 #ifndef RenderObject_h |
26 #define RenderObject_h | 26 #define RenderObject_h |
27 | 27 |
28 #include "CachedResourceClient.h" | 28 #include "CachedResourceClient.h" |
29 #include "Document.h" | 29 #include "Document.h" |
| 30 #include "FloatQuad.h" |
30 #include "RenderStyle.h" | 31 #include "RenderStyle.h" |
31 #include "ScrollTypes.h" | 32 #include "ScrollTypes.h" |
32 #include "VisiblePosition.h" | 33 #include "VisiblePosition.h" |
33 #include <wtf/HashMap.h> | 34 #include <wtf/HashMap.h> |
34 | 35 |
35 namespace WebCore { | 36 namespace WebCore { |
36 | 37 |
37 class AffineTransform; | 38 class AffineTransform; |
38 class AnimationController; | 39 class AnimationController; |
39 class Color; | 40 class Color; |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 // returns the containing block level element for this element. | 555 // returns the containing block level element for this element. |
555 RenderBlock* containingBlock() const; | 556 RenderBlock* containingBlock() const; |
556 | 557 |
557 // return just the width of the containing block | 558 // return just the width of the containing block |
558 virtual int containingBlockWidth() const; | 559 virtual int containingBlockWidth() const; |
559 // return just the height of the containing block | 560 // return just the height of the containing block |
560 virtual int containingBlockHeight() const; | 561 virtual int containingBlockHeight() const; |
561 | 562 |
562 // content area (box minus padding/border) | 563 // content area (box minus padding/border) |
563 IntRect contentBox() const; | 564 IntRect contentBox() const; |
| 565 // absolute coords of content area. Ignores transforms. |
564 IntRect absoluteContentBox() const; | 566 IntRect absoluteContentBox() const; |
| 567 // content rect converted to absolute coords, taking transforms into account |
| 568 FloatQuad absoluteContentQuad() const; |
| 569 |
565 int contentWidth() const { return clientWidth() - paddingLeft() - paddingRig
ht(); } | 570 int contentWidth() const { return clientWidth() - paddingLeft() - paddingRig
ht(); } |
566 int contentHeight() const { return clientHeight() - paddingTop() - paddingBo
ttom(); } | 571 int contentHeight() const { return clientHeight() - paddingTop() - paddingBo
ttom(); } |
567 | 572 |
568 // used by flexible boxes to impose a flexed width/height override | 573 // used by flexible boxes to impose a flexed width/height override |
569 virtual int overrideSize() const { return 0; } | 574 virtual int overrideSize() const { return 0; } |
570 virtual int overrideWidth() const { return 0; } | 575 virtual int overrideWidth() const { return 0; } |
571 virtual int overrideHeight() const { return 0; } | 576 virtual int overrideHeight() const { return 0; } |
572 virtual void setOverrideSize(int /*overrideSize*/) { } | 577 virtual void setOverrideSize(int /*overrideSize*/) { } |
573 | 578 |
574 // relative to parent node | 579 // relative to parent node |
(...skipping 12 matching lines...) Expand all Loading... |
587 | 592 |
588 // This function is used to deal with the extra top space that can occur in
table cells (called borderTopExtra). | 593 // This function is used to deal with the extra top space that can occur in
table cells (called borderTopExtra). |
589 // The children of the cell do not factor this space in, so we have to add i
t in. Any code that wants to | 594 // The children of the cell do not factor this space in, so we have to add i
t in. Any code that wants to |
590 // accurately deal with the contents of a cell must call this function insta
d of absolutePosition. | 595 // accurately deal with the contents of a cell must call this function insta
d of absolutePosition. |
591 FloatPoint localToAbsoluteForContent(FloatPoint localPoint = FloatPoint(), b
ool fixed = false, bool useTransforms = false) const | 596 FloatPoint localToAbsoluteForContent(FloatPoint localPoint = FloatPoint(), b
ool fixed = false, bool useTransforms = false) const |
592 { | 597 { |
593 localPoint.move(0.0f, static_cast<float>(borderTopExtra())); | 598 localPoint.move(0.0f, static_cast<float>(borderTopExtra())); |
594 return localToAbsolute(localPoint, fixed, useTransforms); | 599 return localToAbsolute(localPoint, fixed, useTransforms); |
595 } | 600 } |
596 | 601 |
| 602 // Convert a local quad to an absolute quad, taking transforms into account. |
| 603 virtual FloatQuad localToAbsoluteQuad(const FloatQuad&, bool fixed = false)
const; |
| 604 |
597 // width and height are without margins but include paddings and borders | 605 // width and height are without margins but include paddings and borders |
598 virtual int width() const { return 0; } | 606 virtual int width() const { return 0; } |
599 virtual int height() const { return 0; } | 607 virtual int height() const { return 0; } |
600 | 608 |
601 virtual IntRect borderBox() const { return IntRect(0, 0, width(), height());
} | 609 virtual IntRect borderBox() const { return IntRect(0, 0, width(), height());
} |
602 IntRect absoluteOutlineBox() const; | 610 IntRect absoluteOutlineBox() const; |
603 | 611 |
604 // The height of a block when you include normal flow overflow spillage out
of the bottom | 612 // The height of a block when you include normal flow overflow spillage out
of the bottom |
605 // of the block (e.g., a <div style="height:25px"> that has a 100px tall ima
ge inside | 613 // of the block (e.g., a <div style="height:25px"> that has a 100px tall ima
ge inside |
606 // it would have an overflow height of borderTop() + paddingTop() + 100px. | 614 // it would have an overflow height of borderTop() + paddingTop() + 100px. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 virtual int borderTop() const { return style()->borderTopWidth(); } | 688 virtual int borderTop() const { return style()->borderTopWidth(); } |
681 virtual int borderBottom() const { return style()->borderBottomWidth(); } | 689 virtual int borderBottom() const { return style()->borderBottomWidth(); } |
682 virtual int borderTopExtra() const { return 0; } | 690 virtual int borderTopExtra() const { return 0; } |
683 virtual int borderBottomExtra() const { return 0; } | 691 virtual int borderBottomExtra() const { return 0; } |
684 virtual int borderLeft() const { return style()->borderLeftWidth(); } | 692 virtual int borderLeft() const { return style()->borderLeftWidth(); } |
685 virtual int borderRight() const { return style()->borderRightWidth(); } | 693 virtual int borderRight() const { return style()->borderRightWidth(); } |
686 | 694 |
687 virtual void addLineBoxRects(Vector<IntRect>&, unsigned startOffset = 0, uns
igned endOffset = UINT_MAX, bool useSelectionHeight = false); | 695 virtual void addLineBoxRects(Vector<IntRect>&, unsigned startOffset = 0, uns
igned endOffset = UINT_MAX, bool useSelectionHeight = false); |
688 | 696 |
689 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel =
true); | 697 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel =
true); |
690 IntRect absoluteBoundingBoxRect(); | 698 // FIXME: useTransforms should go away eventually |
| 699 IntRect absoluteBoundingBoxRect(bool useTransforms = false); |
| 700 |
| 701 // Build an array of quads in absolute coords for line boxes |
| 702 virtual void collectAbsoluteLineBoxQuads(Vector<FloatQuad>&, unsigned startO
ffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false); |
| 703 virtual void absoluteQuads(Vector<FloatQuad>&, bool topLevel = true); |
691 | 704 |
692 // the rect that will be painted if this object is passed as the paintingRoo
t | 705 // the rect that will be painted if this object is passed as the paintingRoo
t |
693 IntRect paintingRootRect(IntRect& topLevelRect); | 706 IntRect paintingRootRect(IntRect& topLevelRect); |
694 | 707 |
695 void addPDFURLRect(GraphicsContext*, const IntRect&); | 708 void addPDFURLRect(GraphicsContext*, const IntRect&); |
696 | 709 |
697 virtual void addFocusRingRects(GraphicsContext*, int tx, int ty); | 710 virtual void addFocusRingRects(GraphicsContext*, int tx, int ty); |
698 | 711 |
699 virtual int minPrefWidth() const { return 0; } | 712 virtual int minPrefWidth() const { return 0; } |
700 virtual int maxPrefWidth() const { return 0; } | 713 virtual int maxPrefWidth() const { return 0; } |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 }; | 976 }; |
964 | 977 |
965 } // namespace WebCore | 978 } // namespace WebCore |
966 | 979 |
967 #ifndef NDEBUG | 980 #ifndef NDEBUG |
968 // Outside the WebCore namespace for ease of invocation from gdb. | 981 // Outside the WebCore namespace for ease of invocation from gdb. |
969 void showTree(const WebCore::RenderObject*); | 982 void showTree(const WebCore::RenderObject*); |
970 #endif | 983 #endif |
971 | 984 |
972 #endif // RenderObject_h | 985 #endif // RenderObject_h |
OLD | NEW |