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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 LayoutView::LayoutView(Document* document) | 51 LayoutView::LayoutView(Document* document) |
52 : LayoutBlockFlow(document) | 52 : LayoutBlockFlow(document) |
53 , m_frameView(document->view()) | 53 , m_frameView(document->view()) |
54 , m_selectionStart(nullptr) | 54 , m_selectionStart(nullptr) |
55 , m_selectionEnd(nullptr) | 55 , m_selectionEnd(nullptr) |
56 , m_selectionStartPos(-1) | 56 , m_selectionStartPos(-1) |
57 , m_selectionEndPos(-1) | 57 , m_selectionEndPos(-1) |
58 , m_pageLogicalHeight(0) | 58 , m_pageLogicalHeight(0) |
59 , m_pageLogicalHeightChanged(false) | 59 , m_pageLogicalHeightChanged(false) |
60 , m_layoutState(0) | 60 , m_layoutState(nullptr) |
61 , m_layoutQuoteHead(nullptr) | 61 , m_layoutQuoteHead(nullptr) |
62 , m_layoutCounterCount(0) | 62 , m_layoutCounterCount(0) |
63 , m_hitTestCount(0) | 63 , m_hitTestCount(0) |
64 , m_pendingSelection(PendingSelection::create()) | 64 , m_pendingSelection(PendingSelection::create()) |
65 { | 65 { |
66 // init LayoutObject attributes | 66 // init LayoutObject attributes |
67 setInline(false); | 67 setInline(false); |
68 | 68 |
69 m_minPreferredLogicalWidth = 0; | 69 m_minPreferredLogicalWidth = 0; |
70 m_maxPreferredLogicalWidth = 0; | 70 m_maxPreferredLogicalWidth = 0; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 parentDocLayoutObject->mapLocalToContainer(paintInvalidationContaine
r, transformState, mode, wasFixed, paintInvalidationState); | 299 parentDocLayoutObject->mapLocalToContainer(paintInvalidationContaine
r, transformState, mode, wasFixed, paintInvalidationState); |
300 return; | 300 return; |
301 } | 301 } |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 const LayoutObject* LayoutView::pushMappingToContainer(const LayoutBoxModelObjec
t* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 305 const LayoutObject* LayoutView::pushMappingToContainer(const LayoutBoxModelObjec
t* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
306 { | 306 { |
307 LayoutSize offsetForFixedPosition; | 307 LayoutSize offsetForFixedPosition; |
308 LayoutSize offset; | 308 LayoutSize offset; |
309 LayoutObject* container = 0; | 309 LayoutObject* container = nullptr; |
310 | 310 |
311 if (m_frameView) { | 311 if (m_frameView) { |
312 offsetForFixedPosition = LayoutSize(toIntSize(m_frameView->scrollPositio
n())); | 312 offsetForFixedPosition = LayoutSize(toIntSize(m_frameView->scrollPositio
n())); |
313 if (hasOverflowClip()) | 313 if (hasOverflowClip()) |
314 offsetForFixedPosition = LayoutSize(scrolledContentOffset()); | 314 offsetForFixedPosition = LayoutSize(scrolledContentOffset()); |
315 } | 315 } |
316 | 316 |
317 if (geometryMap.mapCoordinatesFlags() & TraverseDocumentBoundaries) { | 317 if (geometryMap.mapCoordinatesFlags() & TraverseDocumentBoundaries) { |
318 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { | 318 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { |
319 offset = -LayoutSize(m_frameView->scrollOffset()); | 319 offset = -LayoutSize(m_frameView->scrollOffset()); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 void LayoutView::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const | 485 void LayoutView::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const |
486 { | 486 { |
487 if (wasFixed) | 487 if (wasFixed) |
488 *wasFixed = false; | 488 *wasFixed = false; |
489 quads.append(FloatRect(FloatPoint(), layer()->size())); | 489 quads.append(FloatRect(FloatPoint(), layer()->size())); |
490 } | 490 } |
491 | 491 |
492 static LayoutObject* layoutObjectAfterPosition(LayoutObject* object, unsigned of
fset) | 492 static LayoutObject* layoutObjectAfterPosition(LayoutObject* object, unsigned of
fset) |
493 { | 493 { |
494 if (!object) | 494 if (!object) |
495 return 0; | 495 return nullptr; |
496 | 496 |
497 LayoutObject* child = object->childAt(offset); | 497 LayoutObject* child = object->childAt(offset); |
498 return child ? child : object->nextInPreOrderAfterChildren(); | 498 return child ? child : object->nextInPreOrderAfterChildren(); |
499 } | 499 } |
500 | 500 |
501 static LayoutRect selectionRectForLayoutObject(const LayoutObject* object) | 501 static LayoutRect selectionRectForLayoutObject(const LayoutObject* object) |
502 { | 502 { |
503 if (!object->isRooted()) | 503 if (!object->isRooted()) |
504 return LayoutRect(); | 504 return LayoutRect(); |
505 | 505 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 return backgroundLayoutObject->style()->hasEntirelyFixedBackground(); | 848 return backgroundLayoutObject->style()->hasEntirelyFixedBackground(); |
849 return false; | 849 return false; |
850 } | 850 } |
851 | 851 |
852 LayoutObject* LayoutView::backgroundLayoutObject() const | 852 LayoutObject* LayoutView::backgroundLayoutObject() const |
853 { | 853 { |
854 if (Element* documentElement = document().documentElement()) { | 854 if (Element* documentElement = document().documentElement()) { |
855 if (LayoutObject* rootObject = documentElement->layoutObject()) | 855 if (LayoutObject* rootObject = documentElement->layoutObject()) |
856 return rootObject->layoutObjectForRootBackground(); | 856 return rootObject->layoutObjectForRootBackground(); |
857 } | 857 } |
858 return 0; | 858 return nullptr; |
859 } | 859 } |
860 | 860 |
861 LayoutRect LayoutView::backgroundRect(LayoutBox* backgroundLayoutObject) const | 861 LayoutRect LayoutView::backgroundRect(LayoutBox* backgroundLayoutObject) const |
862 { | 862 { |
863 return LayoutRect(unscaledDocumentRect()); | 863 return LayoutRect(unscaledDocumentRect()); |
864 } | 864 } |
865 | 865 |
866 IntRect LayoutView::documentRect() const | 866 IntRect LayoutView::documentRect() const |
867 { | 867 { |
868 FloatRect overflowRect(unscaledDocumentRect()); | 868 FloatRect overflowRect(unscaledDocumentRect()); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 return viewHeight(IncludeScrollbars) / scale; | 974 return viewHeight(IncludeScrollbars) / scale; |
975 } | 975 } |
976 | 976 |
977 void LayoutView::willBeDestroyed() | 977 void LayoutView::willBeDestroyed() |
978 { | 978 { |
979 LayoutBlockFlow::willBeDestroyed(); | 979 LayoutBlockFlow::willBeDestroyed(); |
980 m_compositor.clear(); | 980 m_compositor.clear(); |
981 } | 981 } |
982 | 982 |
983 } // namespace blink | 983 } // namespace blink |
OLD | NEW |