OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 virtual LayerType layerTypeRequired() const OVERRIDE { return NormalLayer; } | 54 virtual LayerType layerTypeRequired() const OVERRIDE { return NormalLayer; } |
55 | 55 |
56 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE; | 56 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE; |
57 | 57 |
58 virtual void layout() OVERRIDE; | 58 virtual void layout() OVERRIDE; |
59 virtual void updateLogicalWidth() OVERRIDE; | 59 virtual void updateLogicalWidth() OVERRIDE; |
60 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; | 60 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; |
61 | 61 |
62 virtual bool supportsPartialLayout() const OVERRIDE { return true; } | 62 virtual bool supportsPartialLayout() const OVERRIDE { return true; } |
63 | 63 |
64 virtual LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const
OVERRIDE; | |
65 | |
66 // The same as the FrameView's layoutHeight/layoutWidth but with null check
guards. | 64 // The same as the FrameView's layoutHeight/layoutWidth but with null check
guards. |
67 int viewHeight(ScrollableArea::IncludeScrollbarsInRect scrollbarInclusion =
ScrollableArea::ExcludeScrollbars) const; | 65 int viewHeight(ScrollableArea::IncludeScrollbarsInRect scrollbarInclusion =
ScrollableArea::ExcludeScrollbars) const; |
68 int viewWidth(ScrollableArea::IncludeScrollbarsInRect scrollbarInclusion = S
crollableArea::ExcludeScrollbars) const; | 66 int viewWidth(ScrollableArea::IncludeScrollbarsInRect scrollbarInclusion = S
crollableArea::ExcludeScrollbars) const; |
69 int viewLogicalWidth(ScrollableArea::IncludeScrollbarsInRect scrollbarInclus
ion = ScrollableArea::ExcludeScrollbars) const | 67 int viewLogicalWidth(ScrollableArea::IncludeScrollbarsInRect scrollbarInclus
ion = ScrollableArea::ExcludeScrollbars) const |
70 { | 68 { |
71 return style()->isHorizontalWritingMode() ? viewWidth(scrollbarInclusion
) : viewHeight(scrollbarInclusion); | 69 return style()->isHorizontalWritingMode() ? viewWidth(scrollbarInclusion
) : viewHeight(scrollbarInclusion); |
72 } | 70 } |
73 int viewLogicalHeight(ScrollableArea::IncludeScrollbarsInRect scrollbarInclu
sion = ScrollableArea::ExcludeScrollbars) const; | 71 int viewLogicalHeight(ScrollableArea::IncludeScrollbarsInRect scrollbarInclu
sion = ScrollableArea::ExcludeScrollbars) const; |
74 | 72 |
75 float zoomFactor() const; | 73 float zoomFactor() const; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 200 |
203 private: | 201 private: |
204 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai
ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed =
0) const OVERRIDE; | 202 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai
ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed =
0) const OVERRIDE; |
205 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE; | 203 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE; |
206 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst OVERRIDE; | 204 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst OVERRIDE; |
207 virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE; | 205 virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE; |
208 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint&
layerOffset) const OVERRIDE; | 206 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint&
layerOffset) const OVERRIDE; |
209 | 207 |
210 void initializeLayoutState(LayoutState&); | 208 void initializeLayoutState(LayoutState&); |
211 | 209 |
212 virtual void calcColumnWidth() OVERRIDE; | |
213 virtual ColumnInfo::PaginationUnit paginationUnit() const OVERRIDE; | |
214 | |
215 bool shouldRepaint(const LayoutRect&) const; | 210 bool shouldRepaint(const LayoutRect&) const; |
216 | 211 |
217 // These functions may only be accessed by LayoutStateMaintainer. | 212 // These functions may only be accessed by LayoutStateMaintainer. |
218 bool pushLayoutState(RenderBox* renderer, const LayoutSize& offset, LayoutUn
it pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0) | 213 bool pushLayoutState(RenderBox* renderer, const LayoutSize& offset, LayoutUn
it pageHeight = 0, bool pageHeightChanged = false) |
219 { | 214 { |
220 // We push LayoutState even if layoutState is disabled because it stores
layoutDelta too. | 215 // We push LayoutState even if layoutState is disabled because it stores
layoutDelta too. |
221 if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer->has
Columns() || renderer->flowThreadContainingBlock() | 216 if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer->flo
wThreadContainingBlock() |
222 || m_layoutState->lineGrid() || (renderer->style()->lineGrid() != Re
nderStyle::initialLineGrid() && renderer->isRenderBlockFlow()) | 217 || m_layoutState->lineGrid() || (renderer->style()->lineGrid() != Re
nderStyle::initialLineGrid() && renderer->isRenderBlockFlow()) |
223 || (renderer->isRenderBlock() && toRenderBlock(renderer)->shapeInsid
eInfo()) | 218 || (renderer->isRenderBlock() && toRenderBlock(renderer)->shapeInsid
eInfo()) |
224 || (m_layoutState->shapeInsideInfo() && renderer->isRenderBlock() &&
!toRenderBlock(renderer)->allowsShapeInsideInfoSharing(m_layoutState->shapeInsi
deInfo()->owner())) | 219 || (m_layoutState->shapeInsideInfo() && renderer->isRenderBlock() &&
!toRenderBlock(renderer)->allowsShapeInsideInfoSharing(m_layoutState->shapeInsi
deInfo()->owner())) |
225 ) { | 220 ) { |
226 pushLayoutStateForCurrentFlowThread(renderer); | 221 pushLayoutStateForCurrentFlowThread(renderer); |
227 m_layoutState = new LayoutState(m_layoutState, renderer, offset, pag
eHeight, pageHeightChanged, colInfo); | 222 m_layoutState = new LayoutState(m_layoutState, renderer, offset, pag
eHeight, pageHeightChanged); |
228 return true; | 223 return true; |
229 } | 224 } |
230 return false; | 225 return false; |
231 } | 226 } |
232 | 227 |
233 void popLayoutState() | 228 void popLayoutState() |
234 { | 229 { |
235 LayoutState* state = m_layoutState; | 230 LayoutState* state = m_layoutState; |
236 m_layoutState = state->m_next; | 231 m_layoutState = state->m_next; |
237 delete state; | 232 delete state; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 unsigned m_renderCounterCount; | 281 unsigned m_renderCounterCount; |
287 }; | 282 }; |
288 | 283 |
289 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView()); | 284 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView()); |
290 | 285 |
291 // Stack-based class to assist with LayoutState push/pop | 286 // Stack-based class to assist with LayoutState push/pop |
292 class LayoutStateMaintainer { | 287 class LayoutStateMaintainer { |
293 WTF_MAKE_NONCOPYABLE(LayoutStateMaintainer); | 288 WTF_MAKE_NONCOPYABLE(LayoutStateMaintainer); |
294 public: | 289 public: |
295 // ctor to push now | 290 // ctor to push now |
296 LayoutStateMaintainer(RenderView* view, RenderBox* root, LayoutSize offset,
bool disableState = false, LayoutUnit pageHeight = 0, bool pageHeightChanged = f
alse, ColumnInfo* colInfo = 0) | 291 LayoutStateMaintainer(RenderView* view, RenderBox* root, LayoutSize offset,
bool disableState = false, LayoutUnit pageHeight = 0, bool pageHeightChanged = f
alse) |
297 : m_view(view) | 292 : m_view(view) |
298 , m_disabled(disableState) | 293 , m_disabled(disableState) |
299 , m_didStart(false) | 294 , m_didStart(false) |
300 , m_didEnd(false) | 295 , m_didEnd(false) |
301 , m_didCreateLayoutState(false) | 296 , m_didCreateLayoutState(false) |
302 { | 297 { |
303 push(root, offset, pageHeight, pageHeightChanged, colInfo); | 298 push(root, offset, pageHeight, pageHeightChanged); |
304 } | 299 } |
305 | 300 |
306 // ctor to maybe push later | 301 // ctor to maybe push later |
307 LayoutStateMaintainer(RenderView* view) | 302 LayoutStateMaintainer(RenderView* view) |
308 : m_view(view) | 303 : m_view(view) |
309 , m_disabled(false) | 304 , m_disabled(false) |
310 , m_didStart(false) | 305 , m_didStart(false) |
311 , m_didEnd(false) | 306 , m_didEnd(false) |
312 , m_didCreateLayoutState(false) | 307 , m_didCreateLayoutState(false) |
313 { | 308 { |
314 } | 309 } |
315 | 310 |
316 ~LayoutStateMaintainer() | 311 ~LayoutStateMaintainer() |
317 { | 312 { |
318 ASSERT(m_didStart == m_didEnd); // if this fires, it means that someon
e did a push(), but forgot to pop(). | 313 ASSERT(m_didStart == m_didEnd); // if this fires, it means that someon
e did a push(), but forgot to pop(). |
319 } | 314 } |
320 | 315 |
321 void push(RenderBox* root, LayoutSize offset, LayoutUnit pageHeight = 0, boo
l pageHeightChanged = false, ColumnInfo* colInfo = 0) | 316 void push(RenderBox* root, LayoutSize offset, LayoutUnit pageHeight = 0, boo
l pageHeightChanged = false) |
322 { | 317 { |
323 ASSERT(!m_didStart); | 318 ASSERT(!m_didStart); |
324 // We push state even if disabled, because we still need to store layout
Delta | 319 // We push state even if disabled, because we still need to store layout
Delta |
325 m_didCreateLayoutState = m_view->pushLayoutState(root, offset, pageHeigh
t, pageHeightChanged, colInfo); | 320 m_didCreateLayoutState = m_view->pushLayoutState(root, offset, pageHeigh
t, pageHeightChanged); |
326 if (m_disabled && m_didCreateLayoutState) | 321 if (m_disabled && m_didCreateLayoutState) |
327 m_view->disableLayoutState(); | 322 m_view->disableLayoutState(); |
328 m_didStart = true; | 323 m_didStart = true; |
329 } | 324 } |
330 | 325 |
331 void pop() | 326 void pop() |
332 { | 327 { |
333 if (m_didStart) { | 328 if (m_didStart) { |
334 ASSERT(!m_didEnd); | 329 ASSERT(!m_didEnd); |
335 if (m_didCreateLayoutState) { | 330 if (m_didCreateLayoutState) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 if (m_view) | 362 if (m_view) |
368 m_view->enableLayoutState(); | 363 m_view->enableLayoutState(); |
369 } | 364 } |
370 private: | 365 private: |
371 RenderView* m_view; | 366 RenderView* m_view; |
372 }; | 367 }; |
373 | 368 |
374 } // namespace WebCore | 369 } // namespace WebCore |
375 | 370 |
376 #endif // RenderView_h | 371 #endif // RenderView_h |
OLD | NEW |