| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 WTF_MAKE_NONCOPYABLE(RenderOverflow); WTF_MAKE_FAST_ALLOCATED; | 41 WTF_MAKE_NONCOPYABLE(RenderOverflow); WTF_MAKE_FAST_ALLOCATED; |
| 42 public: | 42 public: |
| 43 RenderOverflow(const LayoutRect& layoutRect, const LayoutRect& visualRect) | 43 RenderOverflow(const LayoutRect& layoutRect, const LayoutRect& visualRect) |
| 44 : m_layoutOverflow(layoutRect) | 44 : m_layoutOverflow(layoutRect) |
| 45 , m_visualOverflow(visualRect) | 45 , m_visualOverflow(visualRect) |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 const LayoutRect layoutOverflowRect() const { return m_layoutOverflow; } | 49 const LayoutRect layoutOverflowRect() const { return m_layoutOverflow; } |
| 50 const LayoutRect visualOverflowRect() const { return m_visualOverflow; } | 50 const LayoutRect visualOverflowRect() const { return m_visualOverflow; } |
| 51 LayoutRect contentsVisualOverflowRect() const { return m_contentsVisualOverf
low; } |
| 51 | 52 |
| 52 void setMinYLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setY(over
flow); } | 53 void setMinYLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setY(over
flow); } |
| 53 void setMaxYLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setHeight
(overflow - m_layoutOverflow.y()); } | 54 void setMaxYLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setHeight
(overflow - m_layoutOverflow.y()); } |
| 54 void setMinXLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setX(over
flow); } | 55 void setMinXLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setX(over
flow); } |
| 55 void setMaxXLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setWidth(
overflow - m_layoutOverflow.x()); } | 56 void setMaxXLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setWidth(
overflow - m_layoutOverflow.x()); } |
| 56 | 57 |
| 57 void setMinYVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setY(over
flow); } | 58 void setMinYVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setY(over
flow); } |
| 58 void setMaxYVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setHeight
(overflow - m_layoutOverflow.y()); } | 59 void setMaxYVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setHeight
(overflow - m_layoutOverflow.y()); } |
| 59 void setMinXVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setX(over
flow); } | 60 void setMinXVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setX(over
flow); } |
| 60 void setMaxXVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setWidth(
overflow - m_layoutOverflow.x()); } | 61 void setMaxXVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setWidth(
overflow - m_layoutOverflow.x()); } |
| 61 | 62 |
| 62 void move(LayoutUnit dx, LayoutUnit dy); | 63 void move(LayoutUnit dx, LayoutUnit dy); |
| 63 | 64 |
| 64 void addLayoutOverflow(const LayoutRect&); | 65 void addLayoutOverflow(const LayoutRect&); |
| 65 void addVisualOverflow(const LayoutRect&); | 66 void addVisualOverflow(const LayoutRect&); |
| 67 void addContentsVisualOverflow(const LayoutRect& rect) { m_contentsVisualOve
rflow.unite(rect); } |
| 66 | 68 |
| 67 void setLayoutOverflow(const LayoutRect&); | 69 void setLayoutOverflow(const LayoutRect&); |
| 68 void setVisualOverflow(const LayoutRect&); | 70 void setVisualOverflow(const LayoutRect&); |
| 69 | 71 |
| 70 LayoutUnit layoutClientAfterEdge() const { return m_layoutClientAfterEdge; } | 72 LayoutUnit layoutClientAfterEdge() const { return m_layoutClientAfterEdge; } |
| 71 void setLayoutClientAfterEdge(LayoutUnit clientAfterEdge) { m_layoutClientAf
terEdge = clientAfterEdge; } | 73 void setLayoutClientAfterEdge(LayoutUnit clientAfterEdge) { m_layoutClientAf
terEdge = clientAfterEdge; } |
| 72 | 74 |
| 73 private: | 75 private: |
| 74 LayoutRect m_layoutOverflow; | 76 LayoutRect m_layoutOverflow; |
| 75 LayoutRect m_visualOverflow; | 77 LayoutRect m_visualOverflow; |
| 78 LayoutRect m_contentsVisualOverflow; |
| 76 | 79 |
| 77 LayoutUnit m_layoutClientAfterEdge; | 80 LayoutUnit m_layoutClientAfterEdge; |
| 78 }; | 81 }; |
| 79 | 82 |
| 80 inline void RenderOverflow::move(LayoutUnit dx, LayoutUnit dy) | 83 inline void RenderOverflow::move(LayoutUnit dx, LayoutUnit dy) |
| 81 { | 84 { |
| 82 m_layoutOverflow.move(dx, dy); | 85 m_layoutOverflow.move(dx, dy); |
| 83 m_visualOverflow.move(dx, dy); | 86 m_visualOverflow.move(dx, dy); |
| 87 m_contentsVisualOverflow.move(dx, dy); |
| 84 } | 88 } |
| 85 | 89 |
| 86 inline void RenderOverflow::addLayoutOverflow(const LayoutRect& rect) | 90 inline void RenderOverflow::addLayoutOverflow(const LayoutRect& rect) |
| 87 { | 91 { |
| 88 LayoutUnit maxX = std::max(rect.maxX(), m_layoutOverflow.maxX()); | 92 LayoutUnit maxX = std::max(rect.maxX(), m_layoutOverflow.maxX()); |
| 89 LayoutUnit maxY = std::max(rect.maxY(), m_layoutOverflow.maxY()); | 93 LayoutUnit maxY = std::max(rect.maxY(), m_layoutOverflow.maxY()); |
| 90 m_layoutOverflow.setX(std::min(rect.x(), m_layoutOverflow.x())); | 94 m_layoutOverflow.setX(std::min(rect.x(), m_layoutOverflow.x())); |
| 91 m_layoutOverflow.setY(std::min(rect.y(), m_layoutOverflow.y())); | 95 m_layoutOverflow.setY(std::min(rect.y(), m_layoutOverflow.y())); |
| 92 m_layoutOverflow.setWidth(maxX - m_layoutOverflow.x()); | 96 m_layoutOverflow.setWidth(maxX - m_layoutOverflow.x()); |
| 93 m_layoutOverflow.setHeight(maxY - m_layoutOverflow.y()); | 97 m_layoutOverflow.setHeight(maxY - m_layoutOverflow.y()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 109 } | 113 } |
| 110 | 114 |
| 111 inline void RenderOverflow::setVisualOverflow(const LayoutRect& rect) | 115 inline void RenderOverflow::setVisualOverflow(const LayoutRect& rect) |
| 112 { | 116 { |
| 113 m_visualOverflow = rect; | 117 m_visualOverflow = rect; |
| 114 } | 118 } |
| 115 | 119 |
| 116 } // namespace WebCore | 120 } // namespace WebCore |
| 117 | 121 |
| 118 #endif // RenderOverflow_h | 122 #endif // RenderOverflow_h |
| OLD | NEW |