| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 RenderObject* root = subtree ? m_layoutRoot : document->renderer(); | 1000 RenderObject* root = subtree ? m_layoutRoot : document->renderer(); |
| 1001 if (!root) { | 1001 if (!root) { |
| 1002 // FIXME: Do we need to set m_size here? | 1002 // FIXME: Do we need to set m_size here? |
| 1003 m_layoutSchedulingEnabled = true; | 1003 m_layoutSchedulingEnabled = true; |
| 1004 return; | 1004 return; |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 FontCachePurgePreventer fontCachePurgePreventer; | 1007 FontCachePurgePreventer fontCachePurgePreventer; |
| 1008 | 1008 |
| 1009 m_nestedLayoutCount++; | 1009 m_nestedLayoutCount++; |
| 1010 | |
| 1011 if (!m_layoutRoot) { | 1010 if (!m_layoutRoot) { |
| 1012 Document* document = m_frame->document(); | 1011 Document* document = m_frame->document(); |
| 1013 Node* body = document->body(); | 1012 Node* body = document->body(); |
| 1014 if (body && body->renderer()) { | 1013 if (body && body->renderer()) { |
| 1015 if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame
->settings()->frameFlatteningEnabled()) { | 1014 if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame
->settings()->frameFlatteningEnabled()) { |
| 1016 body->renderer()->setChildNeedsLayout(true); | 1015 body->renderer()->setChildNeedsLayout(true); |
| 1017 } else if (body->hasTagName(bodyTag)) { | 1016 } else if (body->hasTagName(bodyTag)) { |
| 1018 if (!m_firstLayout && m_size.height() != layoutHeight() && body-
>renderer()->enclosingBox()->stretchesToViewport()) | 1017 if (!m_firstLayout && m_size.height() != layoutHeight() && body-
>renderer()->enclosingBox()->stretchesToViewport()) |
| 1019 body->renderer()->setChildNeedsLayout(true); | 1018 body->renderer()->setChildNeedsLayout(true); |
| 1020 } | 1019 } |
| 1021 } | 1020 } |
| 1022 | 1021 |
| 1023 #ifdef INSTRUMENT_LAYOUT_SCHEDULING | 1022 #ifdef INSTRUMENT_LAYOUT_SCHEDULING |
| 1024 if (m_firstLayout && !m_frame->ownerElement()) | 1023 if (m_firstLayout && !m_frame->ownerElement()) |
| 1025 printf("Elapsed time before first layout: %d\n", document->elapsedTi
me()); | 1024 printf("Elapsed time before first layout: %d\n", document->elapsedTi
me()); |
| 1026 #endif | 1025 #endif |
| 1027 } | 1026 } |
| 1028 | 1027 |
| 1028 Page* page = m_frame ? m_frame->page() : 0; |
| 1029 if (page) |
| 1030 page->chrome()->client()->layoutBeforeScrollbarUpdate(m_frame.get()); |
| 1031 |
| 1029 ScrollbarMode hMode; | 1032 ScrollbarMode hMode; |
| 1030 ScrollbarMode vMode; | 1033 ScrollbarMode vMode; |
| 1031 calculateScrollbarModesForLayout(hMode, vMode); | 1034 calculateScrollbarModesForLayout(hMode, vMode); |
| 1032 | 1035 |
| 1033 m_doFullRepaint = !subtree && (m_firstLayout || toRenderView(root)->printing
()); | 1036 m_doFullRepaint = !subtree && (m_firstLayout || toRenderView(root)->printing
()); |
| 1034 | 1037 |
| 1035 if (!subtree) { | 1038 if (!subtree) { |
| 1036 // Now set our scrollbar state for the layout. | 1039 // Now set our scrollbar state for the layout. |
| 1037 ScrollbarMode currentHMode = horizontalScrollbarMode(); | 1040 ScrollbarMode currentHMode = horizontalScrollbarMode(); |
| 1038 ScrollbarMode currentVMode = verticalScrollbarMode(); | 1041 ScrollbarMode currentVMode = verticalScrollbarMode(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 bool disableLayoutState = false; | 1087 bool disableLayoutState = false; |
| 1085 if (subtree) { | 1088 if (subtree) { |
| 1086 RenderView* view = root->view(); | 1089 RenderView* view = root->view(); |
| 1087 disableLayoutState = view->shouldDisableLayoutStateForSubtree(root); | 1090 disableLayoutState = view->shouldDisableLayoutStateForSubtree(root); |
| 1088 view->pushLayoutState(root); | 1091 view->pushLayoutState(root); |
| 1089 } | 1092 } |
| 1090 LayoutStateDisabler layoutStateDisabler(disableLayoutState ? root->view(
) : 0); | 1093 LayoutStateDisabler layoutStateDisabler(disableLayoutState ? root->view(
) : 0); |
| 1091 | 1094 |
| 1092 m_inLayout = true; | 1095 m_inLayout = true; |
| 1093 beginDeferredRepaints(); | 1096 beginDeferredRepaints(); |
| 1094 root->layout(); | 1097 // If an intermediate step has already done the layout, then skip it. |
| 1098 if (root->needsLayout()) |
| 1099 root->layout(); |
| 1095 endDeferredRepaints(); | 1100 endDeferredRepaints(); |
| 1096 m_inLayout = false; | 1101 m_inLayout = false; |
| 1097 | 1102 |
| 1098 if (subtree) | 1103 if (subtree) |
| 1099 root->view()->popLayoutState(root); | 1104 root->view()->popLayoutState(root); |
| 1100 } | 1105 } |
| 1101 m_layoutRoot = 0; | 1106 m_layoutRoot = 0; |
| 1102 | 1107 if (m_nestedLayoutCount == 1) |
| 1103 m_layoutSchedulingEnabled = true; | 1108 m_layoutSchedulingEnabled = true; |
| 1104 | 1109 |
| 1105 if (!subtree && !toRenderView(root)->printing()) | 1110 if (!subtree && !toRenderView(root)->printing()) |
| 1106 adjustViewSize(); | 1111 adjustViewSize(); |
| 1107 | 1112 |
| 1108 // Now update the positions of all layers. | 1113 // Now update the positions of all layers. |
| 1109 beginDeferredRepaints(); | 1114 beginDeferredRepaints(); |
| 1110 bool hasLayerOffset; | 1115 bool hasLayerOffset; |
| 1111 LayoutPoint offsetFromRoot = layer->computeOffsetFromRoot(hasLayerOffset); | 1116 LayoutPoint offsetFromRoot = layer->computeOffsetFromRoot(hasLayerOffset); |
| 1112 if (m_doFullRepaint) | 1117 if (m_doFullRepaint) |
| 1113 root->view()->repaint(); // FIXME: This isn't really right, since the Re
nderView doesn't fully encompass the visibleContentRect(). It just happens | 1118 root->view()->repaint(); // FIXME: This isn't really right, since the Re
nderView doesn't fully encompass the visibleContentRect(). It just happens |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 } else { | 1173 } else { |
| 1169 m_actionScheduler->resume(); | 1174 m_actionScheduler->resume(); |
| 1170 } | 1175 } |
| 1171 | 1176 |
| 1172 InspectorInstrumentation::didLayout(cookie); | 1177 InspectorInstrumentation::didLayout(cookie); |
| 1173 | 1178 |
| 1174 m_nestedLayoutCount--; | 1179 m_nestedLayoutCount--; |
| 1175 if (m_nestedLayoutCount) | 1180 if (m_nestedLayoutCount) |
| 1176 return; | 1181 return; |
| 1177 | 1182 |
| 1178 Page* page = frame() ? frame()->page() : 0; | 1183 page = m_frame ? m_frame->page() : 0; |
| 1179 if (!page) | 1184 if (!page) |
| 1180 return; | 1185 return; |
| 1181 | 1186 |
| 1182 page->chrome()->client()->layoutUpdated(frame()); | 1187 page->chrome()->client()->layoutUpdated(frame()); |
| 1183 forceLayoutParentViewIfNeeded(); | 1188 forceLayoutParentViewIfNeeded(); |
| 1184 } | 1189 } |
| 1185 | 1190 |
| 1186 RenderBox* FrameView::embeddedContentBox() const | 1191 RenderBox* FrameView::embeddedContentBox() const |
| 1187 { | 1192 { |
| 1188 #if ENABLE(SVG) | 1193 #if ENABLE(SVG) |
| (...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3145 } | 3150 } |
| 3146 | 3151 |
| 3147 AXObjectCache* FrameView::axObjectCache() const | 3152 AXObjectCache* FrameView::axObjectCache() const |
| 3148 { | 3153 { |
| 3149 if (frame() && frame()->document() && frame()->document()->axObjectCacheExis
ts()) | 3154 if (frame() && frame()->document() && frame()->document()->axObjectCacheExis
ts()) |
| 3150 return frame()->document()->axObjectCache(); | 3155 return frame()->document()->axObjectCache(); |
| 3151 return 0; | 3156 return 0; |
| 3152 } | 3157 } |
| 3153 | 3158 |
| 3154 } // namespace WebCore | 3159 } // namespace WebCore |
| OLD | NEW |