OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/rendering/RenderBlockFlow.h" | 32 #include "core/rendering/RenderBlockFlow.h" |
33 | 33 |
34 #include "core/frame/FrameView.h" | 34 #include "core/frame/FrameView.h" |
| 35 #include "core/rendering/FastTextAutosizer.h" |
35 #include "core/rendering/HitTestLocation.h" | 36 #include "core/rendering/HitTestLocation.h" |
36 #include "core/rendering/LayoutRectRecorder.h" | 37 #include "core/rendering/LayoutRectRecorder.h" |
37 #include "core/rendering/LayoutRepainter.h" | 38 #include "core/rendering/LayoutRepainter.h" |
38 #include "core/rendering/RenderLayer.h" | 39 #include "core/rendering/RenderLayer.h" |
39 #include "core/rendering/RenderNamedFlowFragment.h" | 40 #include "core/rendering/RenderNamedFlowFragment.h" |
40 #include "core/rendering/RenderNamedFlowThread.h" | 41 #include "core/rendering/RenderNamedFlowThread.h" |
41 #include "core/rendering/RenderText.h" | 42 #include "core/rendering/RenderText.h" |
42 #include "core/rendering/RenderView.h" | 43 #include "core/rendering/RenderView.h" |
43 #include "core/rendering/line/LineWidth.h" | 44 #include "core/rendering/line/LineWidth.h" |
44 #include "core/rendering/svg/SVGTextRunRenderingContext.h" | 45 #include "core/rendering/svg/SVGTextRunRenderingContext.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 setPaginationStrut(0); | 286 setPaginationStrut(0); |
286 } | 287 } |
287 | 288 |
288 SubtreeLayoutScope layoutScope(this); | 289 SubtreeLayoutScope layoutScope(this); |
289 | 290 |
290 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); | 291 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); |
291 LayoutUnit afterEdge = borderAfter() + paddingAfter() + scrollbarLogicalHeig
ht(); | 292 LayoutUnit afterEdge = borderAfter() + paddingAfter() + scrollbarLogicalHeig
ht(); |
292 LayoutUnit previousHeight = logicalHeight(); | 293 LayoutUnit previousHeight = logicalHeight(); |
293 setLogicalHeight(beforeEdge); | 294 setLogicalHeight(beforeEdge); |
294 | 295 |
| 296 FastTextAutosizer* textAutosizer = document().fastTextAutosizer(); |
| 297 if (textAutosizer) |
| 298 textAutosizer->beginLayout(this); |
| 299 |
295 m_repaintLogicalTop = 0; | 300 m_repaintLogicalTop = 0; |
296 m_repaintLogicalBottom = 0; | 301 m_repaintLogicalBottom = 0; |
297 LayoutUnit maxFloatLogicalBottom = 0; | 302 LayoutUnit maxFloatLogicalBottom = 0; |
298 if (!firstChild() && !isAnonymousBlock()) | 303 if (!firstChild() && !isAnonymousBlock()) |
299 setChildrenInline(true); | 304 setChildrenInline(true); |
300 if (childrenInline()) | 305 if (childrenInline()) |
301 layoutInlineChildren(relayoutChildren, m_repaintLogicalTop, m_repaintLog
icalBottom, afterEdge); | 306 layoutInlineChildren(relayoutChildren, m_repaintLogicalTop, m_repaintLog
icalBottom, afterEdge); |
302 else | 307 else |
303 layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom, layoutScope
, beforeEdge, afterEdge); | 308 layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom, layoutScope
, beforeEdge, afterEdge); |
304 | 309 |
| 310 if (textAutosizer) |
| 311 textAutosizer->endLayout(this); |
| 312 |
305 if (frameView()->partialLayout().isStopping()) { | 313 if (frameView()->partialLayout().isStopping()) { |
306 statePusher.pop(); | 314 statePusher.pop(); |
307 return; | 315 return; |
308 } | 316 } |
309 | 317 |
310 // Expand our intrinsic height to encompass floats. | 318 // Expand our intrinsic height to encompass floats. |
311 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && expandsToE
ncloseOverhangingFloats()) | 319 if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && expandsToE
ncloseOverhangingFloats()) |
312 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); | 320 setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); |
313 | 321 |
314 if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight,
statePusher) || relayoutToAvoidWidows(statePusher)) { | 322 if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight,
statePusher) || relayoutToAvoidWidows(statePusher)) { |
(...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2611 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
2604 { | 2612 { |
2605 if (m_rareData) | 2613 if (m_rareData) |
2606 return *m_rareData; | 2614 return *m_rareData; |
2607 | 2615 |
2608 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2616 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
2609 return *m_rareData; | 2617 return *m_rareData; |
2610 } | 2618 } |
2611 | 2619 |
2612 } // namespace WebCore | 2620 } // namespace WebCore |
OLD | NEW |