OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 using namespace HTMLNames; | 81 using namespace HTMLNames; |
82 | 82 |
83 struct SameSizeAsLayoutBlock : public LayoutBox { | 83 struct SameSizeAsLayoutBlock : public LayoutBox { |
84 LayoutObjectChildList children; | 84 LayoutObjectChildList children; |
85 LineBoxList lineBoxes; | 85 LineBoxList lineBoxes; |
86 uint32_t bitfields; | 86 uint32_t bitfields; |
87 }; | 87 }; |
88 | 88 |
89 static_assert(sizeof(LayoutBlock) == sizeof(SameSizeAsLayoutBlock), "LayoutBlock
should stay small"); | 89 static_assert(sizeof(LayoutBlock) == sizeof(SameSizeAsLayoutBlock), "LayoutBlock
should stay small"); |
90 | 90 |
| 91 // This map keeps track of the positioned objects associated with a containing |
| 92 // block. |
| 93 // |
| 94 // This map is populated during layout. It is kept across layouts to handle |
| 95 // that we skip unchanged sub-trees during layout, in such a way that we are |
| 96 // able to lay out deeply nested out-of-flow descendants if their containing |
| 97 // block got laid out. The map could be invalidated during style change but |
| 98 // keeping track of containing blocks at that time is complicated (we are in |
| 99 // the middle of recomputing the style so we can't rely on any of its |
| 100 // information), which is why it's easier to just update it for every layout. |
91 static TrackedDescendantsMap* gPositionedDescendantsMap = nullptr; | 101 static TrackedDescendantsMap* gPositionedDescendantsMap = nullptr; |
| 102 |
| 103 // This map keeps track of the descendants whose 'height' is percentage associat
ed |
| 104 // with a containing block. Like |gPositionedDescendantsMap|, it is also recompu
ted |
| 105 // for every layout (see the comment above about why). |
92 static TrackedDescendantsMap* gPercentHeightDescendantsMap = nullptr; | 106 static TrackedDescendantsMap* gPercentHeightDescendantsMap = nullptr; |
93 | 107 |
94 static TrackedContainerMap* gPositionedContainerMap = nullptr; | 108 static TrackedContainerMap* gPositionedContainerMap = nullptr; |
95 static TrackedContainerMap* gPercentHeightContainerMap = nullptr; | 109 static TrackedContainerMap* gPercentHeightContainerMap = nullptr; |
96 | 110 |
97 typedef WTF::HashSet<LayoutBlock*> DelayedUpdateScrollInfoSet; | 111 typedef WTF::HashSet<LayoutBlock*> DelayedUpdateScrollInfoSet; |
98 static int gDelayUpdateScrollInfo = 0; | 112 static int gDelayUpdateScrollInfo = 0; |
99 static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = nullptr; | 113 static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = nullptr; |
100 | 114 |
101 LayoutBlock::LayoutBlock(ContainerNode* node) | 115 LayoutBlock::LayoutBlock(ContainerNode* node) |
(...skipping 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2871 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const | 2885 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const |
2872 { | 2886 { |
2873 showLayoutObject(); | 2887 showLayoutObject(); |
2874 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 2888 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
2875 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 2889 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
2876 } | 2890 } |
2877 | 2891 |
2878 #endif | 2892 #endif |
2879 | 2893 |
2880 } // namespace blink | 2894 } // namespace blink |
OLD | NEW |