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 3161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3172 setLayoutSizeInternal(frameRect().size()); | 3172 setLayoutSizeInternal(frameRect().size()); |
3173 | 3173 |
3174 ScrollView::frameRectsChanged(); | 3174 ScrollView::frameRectsChanged(); |
3175 } | 3175 } |
3176 | 3176 |
3177 void FrameView::setLayoutSizeInternal(const IntSize& size) | 3177 void FrameView::setLayoutSizeInternal(const IntSize& size) |
3178 { | 3178 { |
3179 if (m_layoutSize == size) | 3179 if (m_layoutSize == size) |
3180 return; | 3180 return; |
3181 | 3181 |
3182 bool widthChanged = m_layoutSize.width() != size.width(); | |
3182 m_layoutSize = size; | 3183 m_layoutSize = size; |
3183 contentsResized(); | 3184 |
3185 // Update scrollbars. Not calling this->contentsResized() to avoid setNeedsL ayout. | |
3186 ScrollView::contentsResized(); | |
Julien - ping for review
2014/03/11 01:23:37
Wouldn't it be possible to remove FrameView::conte
Xianzhu
2014/03/11 19:05:13
Agreed. Need to carefully check all callsites of i
| |
3187 | |
3188 if (widthChanged) { | |
3189 setNeedsLayout(); | |
3190 return; | |
3191 } | |
3192 | |
3193 if (RenderView* renderView = this->renderView()) { | |
Julien - ping for review
2014/03/11 01:23:37
This would be better with an early return, especia
Xianzhu
2014/03/11 19:05:13
Done.
| |
3194 // If needsLayout, the next layout will do all the things required on la youtSize change. | |
3195 if (renderView->needsLayout()) | |
3196 return; | |
3197 | |
3198 performPreLayoutTasks(); | |
3199 | |
3200 // During pre-layout tasks, viewport media queries, viewport sizes and o thers may cause | |
3201 // style update and set needsLayout flag. | |
3202 if (renderView->needsLayout()) | |
3203 return; | |
3204 | |
3205 if (!renderView->trySimplifiedLayoutOnHeightChange()) { | |
3206 setNeedsLayout(); | |
3207 return; | |
3208 } | |
3209 | |
3210 // RenderView has finished a simplified layout for the height change. We need to perform | |
3211 // necessary post-layout tasks for the simplified layout. | |
3212 scheduleOrPerformPostLayoutTasks(); | |
3213 if (frame().page()) | |
3214 frame().page()->chrome().client().layoutUpdated(m_frame.get()); | |
3215 } | |
3184 } | 3216 } |
3185 | 3217 |
3186 void FrameView::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orien tation) | 3218 void FrameView::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orien tation) |
3187 { | 3219 { |
3188 ScrollableArea::didAddScrollbar(scrollbar, orientation); | 3220 ScrollableArea::didAddScrollbar(scrollbar, orientation); |
3189 if (AXObjectCache* cache = axObjectCache()) | 3221 if (AXObjectCache* cache = axObjectCache()) |
3190 cache->handleScrollbarUpdate(this); | 3222 cache->handleScrollbarUpdate(this); |
3191 } | 3223 } |
3192 | 3224 |
3193 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) | 3225 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) |
3194 { | 3226 { |
3195 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 3227 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
3196 if (AXObjectCache* cache = axObjectCache()) { | 3228 if (AXObjectCache* cache = axObjectCache()) { |
3197 cache->remove(scrollbar); | 3229 cache->remove(scrollbar); |
3198 cache->handleScrollbarUpdate(this); | 3230 cache->handleScrollbarUpdate(this); |
3199 } | 3231 } |
3200 } | 3232 } |
3201 | 3233 |
3202 } // namespace WebCore | 3234 } // namespace WebCore |
OLD | NEW |