OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 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. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 LayoutRect RenderRegion::overflowRectForFlowThreadPortion(const LayoutRect& flow
ThreadPortionRect, bool isFirstPortion, bool isLastPortion) const | 74 LayoutRect RenderRegion::overflowRectForFlowThreadPortion(const LayoutRect& flow
ThreadPortionRect, bool isFirstPortion, bool isLastPortion) const |
75 { | 75 { |
76 ASSERT(isValid()); | 76 ASSERT(isValid()); |
77 | 77 |
78 if (hasOverflowClip()) | 78 if (hasOverflowClip()) |
79 return flowThreadPortionRect; | 79 return flowThreadPortionRect; |
80 | 80 |
81 LayoutRect flowThreadOverflow = m_flowThread->visualOverflowRect(); | 81 LayoutRect flowThreadOverflow = m_flowThread->visualOverflowRect(); |
82 | 82 |
83 // Only clip along the flow thread axis. | 83 // Only clip along the flow thread axis. |
84 LayoutUnit outlineSize = maximalOutlineSize(PaintPhaseOutline); | |
85 LayoutRect clipRect; | 84 LayoutRect clipRect; |
86 if (m_flowThread->isHorizontalWritingMode()) { | 85 if (m_flowThread->isHorizontalWritingMode()) { |
87 LayoutUnit minY = isFirstPortion ? (flowThreadOverflow.y() - outlineSize
) : flowThreadPortionRect.y(); | 86 LayoutUnit minY = isFirstPortion ? flowThreadOverflow.y() : flowThreadPo
rtionRect.y(); |
88 LayoutUnit maxY = isLastPortion ? max(flowThreadPortionRect.maxY(), flow
ThreadOverflow.maxY()) + outlineSize : flowThreadPortionRect.maxY(); | 87 LayoutUnit maxY = isLastPortion ? max(flowThreadPortionRect.maxY(), flow
ThreadOverflow.maxY()) : flowThreadPortionRect.maxY(); |
89 LayoutUnit minX = min(flowThreadPortionRect.x(), flowThreadOverflow.x()
- outlineSize); | 88 LayoutUnit minX = min(flowThreadPortionRect.x(), flowThreadOverflow.x())
; |
90 LayoutUnit maxX = max(flowThreadPortionRect.maxX(), (flowThreadOverflow.
maxX() + outlineSize)); | 89 LayoutUnit maxX = max(flowThreadPortionRect.maxX(), flowThreadOverflow.m
axX()); |
91 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); | 90 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); |
92 } else { | 91 } else { |
93 LayoutUnit minX = isFirstPortion ? (flowThreadOverflow.x() - outlineSize
) : flowThreadPortionRect.x(); | 92 LayoutUnit minX = isFirstPortion ? flowThreadOverflow.x() : flowThreadPo
rtionRect.x(); |
94 LayoutUnit maxX = isLastPortion ? max(flowThreadPortionRect.maxX(), flow
ThreadOverflow.maxX()) + outlineSize : flowThreadPortionRect.maxX(); | 93 LayoutUnit maxX = isLastPortion ? max(flowThreadPortionRect.maxX(), flow
ThreadOverflow.maxX()) : flowThreadPortionRect.maxX(); |
95 LayoutUnit minY = min(flowThreadPortionRect.y(), (flowThreadOverflow.y()
- outlineSize)); | 94 LayoutUnit minY = min(flowThreadPortionRect.y(), (flowThreadOverflow.y()
)); |
96 LayoutUnit maxY = max(flowThreadPortionRect.y(), (flowThreadOverflow.max
Y() + outlineSize)); | 95 LayoutUnit maxY = max(flowThreadPortionRect.y(), (flowThreadOverflow.max
Y())); |
97 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); | 96 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); |
98 } | 97 } |
99 | 98 |
100 return clipRect; | 99 return clipRect; |
101 } | 100 } |
102 | 101 |
103 LayoutUnit RenderRegion::pageLogicalTopForOffset(LayoutUnit /* offset */) const | 102 LayoutUnit RenderRegion::pageLogicalTopForOffset(LayoutUnit /* offset */) const |
104 { | 103 { |
105 return flowThread()->isHorizontalWritingMode() ? flowThreadPortionRect().y()
: flowThreadPortionRect().x(); | 104 return flowThread()->isHorizontalWritingMode() ? flowThreadPortionRect().y()
: flowThreadPortionRect().x(); |
106 } | 105 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 if (!isValid()) { | 216 if (!isValid()) { |
218 RenderBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth, maxLogic
alWidth); | 217 RenderBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth, maxLogic
alWidth); |
219 return; | 218 return; |
220 } | 219 } |
221 | 220 |
222 minLogicalWidth = m_flowThread->minPreferredLogicalWidth(); | 221 minLogicalWidth = m_flowThread->minPreferredLogicalWidth(); |
223 maxLogicalWidth = m_flowThread->maxPreferredLogicalWidth(); | 222 maxLogicalWidth = m_flowThread->maxPreferredLogicalWidth(); |
224 } | 223 } |
225 | 224 |
226 } // namespace WebCore | 225 } // namespace WebCore |
OLD | NEW |