| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Adobe Systems Incorporated. All Rights Reserved. | 2 * Copyright 2011 Adobe Systems Incorporated. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| 11 * 2. Redistributions in binary form must reproduce the above | 11 * 2. Redistributions in binary form must reproduce the above |
| 12 * copyright notice, this list of conditions and the following | 12 * copyright notice, this list of conditions and the following |
| 13 * disclaimer in the documentation and/or other materials | 13 * disclaimer in the documentation and/or other materials |
| 14 * provided with the distribution. | 14 * provided with the distribution. |
| 15 * | 15 * |
| 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY | 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY |
| 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE | 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE |
| 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, | 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, |
| 21 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 21 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| (...skipping 13 matching lines...) Expand all Loading... |
| 40 #include "RenderView.h" | 40 #include "RenderView.h" |
| 41 | 41 |
| 42 namespace WebCore { | 42 namespace WebCore { |
| 43 | 43 |
| 44 RenderRegion::RenderRegion(Node* node, RenderFlowThread* flowThread) | 44 RenderRegion::RenderRegion(Node* node, RenderFlowThread* flowThread) |
| 45 : RenderReplaced(node, IntSize()) | 45 : RenderReplaced(node, IntSize()) |
| 46 , m_flowThread(flowThread) | 46 , m_flowThread(flowThread) |
| 47 , m_parentFlowThread(0) | 47 , m_parentFlowThread(0) |
| 48 , m_isValid(false) | 48 , m_isValid(false) |
| 49 , m_hasCustomRegionStyle(false) | 49 , m_hasCustomRegionStyle(false) |
| 50 #ifndef NDEBUG | |
| 51 , m_insideRegionPaint(false) | |
| 52 #endif | |
| 53 { | 50 { |
| 54 } | 51 } |
| 55 | 52 |
| 56 LayoutRect RenderRegion::regionOverflowRect() const | 53 LayoutRect RenderRegion::regionOverflowRect() const |
| 57 { | 54 { |
| 58 // FIXME: Would like to just use hasOverflowClip() but we aren't a block yet
. When RenderRegion is eliminated and | 55 // FIXME: Would like to just use hasOverflowClip() but we aren't a block yet
. When RenderRegion is eliminated and |
| 59 // folded into RenderBlock, switch to hasOverflowClip(). | 56 // folded into RenderBlock, switch to hasOverflowClip(). |
| 60 bool clipX = style()->overflowX() != OVISIBLE; | 57 bool clipX = style()->overflowX() != OVISIBLE; |
| 61 bool clipY = style()->overflowY() != OVISIBLE; | 58 bool clipY = style()->overflowY() != OVISIBLE; |
| 62 if ((clipX && clipY) || !isValid() || !m_flowThread) | 59 if ((clipX && clipY) || !isValid() || !m_flowThread) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 m_renderBoxRegionStyle.set(box, boxRegionStyle); | 124 m_renderBoxRegionStyle.set(box, boxRegionStyle); |
| 128 } | 125 } |
| 129 } | 126 } |
| 130 | 127 |
| 131 void RenderRegion::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) | 128 void RenderRegion::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) |
| 132 { | 129 { |
| 133 // Delegate painting of content in region to RenderFlowThread. | 130 // Delegate painting of content in region to RenderFlowThread. |
| 134 if (!m_flowThread || !isValid()) | 131 if (!m_flowThread || !isValid()) |
| 135 return; | 132 return; |
| 136 | 133 |
| 137 #ifndef NDEBUG | |
| 138 m_insideRegionPaint = true; | |
| 139 #endif | |
| 140 | |
| 141 setRegionBoxesRegionStyle(); | 134 setRegionBoxesRegionStyle(); |
| 142 m_flowThread->paintIntoRegion(paintInfo, this, LayoutPoint(paintOffset.x() +
borderLeft() + paddingLeft(), paintOffset.y() + borderTop() + paddingTop())); | 135 m_flowThread->paintIntoRegion(paintInfo, this, LayoutPoint(paintOffset.x() +
borderLeft() + paddingLeft(), paintOffset.y() + borderTop() + paddingTop())); |
| 143 restoreRegionBoxesOriginalStyle(); | 136 restoreRegionBoxesOriginalStyle(); |
| 144 | |
| 145 #ifndef NDEBUG | |
| 146 m_insideRegionPaint = false; | |
| 147 #endif | |
| 148 } | 137 } |
| 149 | 138 |
| 150 // Hit Testing | 139 // Hit Testing |
| 151 bool RenderRegion::nodeAtPoint(const HitTestRequest& request, HitTestResult& res
ult, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset,
HitTestAction action) | 140 bool RenderRegion::nodeAtPoint(const HitTestRequest& request, HitTestResult& res
ult, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset,
HitTestAction action) |
| 152 { | 141 { |
| 153 if (!isValid()) | 142 if (!isValid()) |
| 154 return false; | 143 return false; |
| 155 | 144 |
| 156 LayoutPoint adjustedLocation = accumulatedOffset + location(); | 145 LayoutPoint adjustedLocation = accumulatedOffset + location(); |
| 157 | 146 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 return renderBoxRegionStyle.release(); | 301 return renderBoxRegionStyle.release(); |
| 313 } | 302 } |
| 314 | 303 |
| 315 void RenderRegion::clearBoxStyleInRegion(const RenderBox* box) | 304 void RenderRegion::clearBoxStyleInRegion(const RenderBox* box) |
| 316 { | 305 { |
| 317 ASSERT(box); | 306 ASSERT(box); |
| 318 m_renderBoxRegionStyle.remove(box); | 307 m_renderBoxRegionStyle.remove(box); |
| 319 } | 308 } |
| 320 | 309 |
| 321 } // namespace WebCore | 310 } // namespace WebCore |
| OLD | NEW |