Chromium Code Reviews| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 RenderLayer::UpdateLayerPositionsFlags flags = RenderLayer::defaultFlags; | 124 RenderLayer::UpdateLayerPositionsFlags flags = RenderLayer::defaultFlags; |
| 125 if (didFullRepaint) { | 125 if (didFullRepaint) { |
| 126 flags &= ~RenderLayer::CheckForRepaint; | 126 flags &= ~RenderLayer::CheckForRepaint; |
| 127 flags |= RenderLayer::NeedsFullRepaintInBacking; | 127 flags |= RenderLayer::NeedsFullRepaintInBacking; |
| 128 } | 128 } |
| 129 if (isRelayoutingSubtree && layer->isPaginated()) | 129 if (isRelayoutingSubtree && layer->isPaginated()) |
| 130 flags |= RenderLayer::UpdatePagination; | 130 flags |= RenderLayer::UpdatePagination; |
| 131 return flags; | 131 return flags; |
| 132 } | 132 } |
| 133 | 133 |
| 134 // The spec DOM Level 2 Events states that the resize event occurs when document view size (a.k.a layout size) is changed. Refer to http://www.w3.org/TR/DOM-Lev el-2-Events/events.html | |
| 135 // However, showing/hiding scrollbars shouldn't be considered a layout size chan ge. Refer to webkit.org/b/80242 | |
| 136 // viewportSize() is used to compare layout sizes between before and after to em it a resize event. | |
| 137 static inline IntSize viewportSize(const FrameView* view) | |
|
aelias_OOO_until_Jul13
2013/05/29 18:47:28
I suggest not having this static method and just c
| |
| 138 { | |
| 139 return view->layoutSize(ScrollView::IncludeScrollbars); | |
| 140 } | |
| 141 | |
| 134 Pagination::Mode paginationModeForRenderStyle(RenderStyle* style) | 142 Pagination::Mode paginationModeForRenderStyle(RenderStyle* style) |
| 135 { | 143 { |
| 136 EOverflow overflow = style->overflowY(); | 144 EOverflow overflow = style->overflowY(); |
| 137 if (overflow != OPAGEDX && overflow != OPAGEDY) | 145 if (overflow != OPAGEDX && overflow != OPAGEDY) |
| 138 return Pagination::Unpaginated; | 146 return Pagination::Unpaginated; |
| 139 | 147 |
| 140 bool isHorizontalWritingMode = style->isHorizontalWritingMode(); | 148 bool isHorizontalWritingMode = style->isHorizontalWritingMode(); |
| 141 TextDirection textDirection = style->direction(); | 149 TextDirection textDirection = style->direction(); |
| 142 WritingMode writingMode = style->writingMode(); | 150 WritingMode writingMode = style->writingMode(); |
| 143 | 151 |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 979 // Now set our scrollbar state for the layout. | 987 // Now set our scrollbar state for the layout. |
| 980 ScrollbarMode currentHMode = horizontalScrollbarMode(); | 988 ScrollbarMode currentHMode = horizontalScrollbarMode(); |
| 981 ScrollbarMode currentVMode = verticalScrollbarMode(); | 989 ScrollbarMode currentVMode = verticalScrollbarMode(); |
| 982 | 990 |
| 983 if (m_firstLayout || (hMode != currentHMode || vMode != currentVMode )) { | 991 if (m_firstLayout || (hMode != currentHMode || vMode != currentVMode )) { |
| 984 if (m_firstLayout) { | 992 if (m_firstLayout) { |
| 985 setScrollbarsSuppressed(true); | 993 setScrollbarsSuppressed(true); |
| 986 | 994 |
| 987 m_firstLayout = false; | 995 m_firstLayout = false; |
| 988 m_firstLayoutCallbackPending = true; | 996 m_firstLayoutCallbackPending = true; |
| 989 m_lastViewportSize = visibleContentRect(IncludeScrollbars).s ize(); | 997 m_lastViewportSize = viewportSize(this); |
| 990 m_lastZoomFactor = root->style()->zoom(); | 998 m_lastZoomFactor = root->style()->zoom(); |
| 991 | 999 |
| 992 // Set the initial vMode to AlwaysOn if we're auto. | 1000 // Set the initial vMode to AlwaysOn if we're auto. |
| 993 if (vMode == ScrollbarAuto) | 1001 if (vMode == ScrollbarAuto) |
| 994 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This cau ses a vertical scrollbar to appear. | 1002 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This cau ses a vertical scrollbar to appear. |
| 995 // Set the initial hMode to AlwaysOff if we're auto. | 1003 // Set the initial hMode to AlwaysOff if we're auto. |
| 996 if (hMode == ScrollbarAuto) | 1004 if (hMode == ScrollbarAuto) |
| 997 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear. | 1005 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear. |
| 998 | 1006 |
| 999 setScrollbarModes(hMode, vMode); | 1007 setScrollbarModes(hMode, vMode); |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2279 | 2287 |
| 2280 // Viewport-dependent media queries may cause us to need completely differen t style information. | 2288 // Viewport-dependent media queries may cause us to need completely differen t style information. |
| 2281 if (m_frame->document()->styleResolver()->affectedByViewportChange()) { | 2289 if (m_frame->document()->styleResolver()->affectedByViewportChange()) { |
| 2282 m_frame->document()->styleResolverChanged(DeferRecalcStyle); | 2290 m_frame->document()->styleResolverChanged(DeferRecalcStyle); |
| 2283 InspectorInstrumentation::mediaQueryResultChanged(m_frame->document()); | 2291 InspectorInstrumentation::mediaQueryResultChanged(m_frame->document()); |
| 2284 } | 2292 } |
| 2285 | 2293 |
| 2286 // Refetch render view since it can be destroyed by updateWidget() call abov e. | 2294 // Refetch render view since it can be destroyed by updateWidget() call abov e. |
| 2287 renderView = this->renderView(); | 2295 renderView = this->renderView(); |
| 2288 if (renderView && !renderView->printing()) { | 2296 if (renderView && !renderView->printing()) { |
| 2289 IntSize currentSize; | 2297 IntSize currentSize = viewportSize(this); |
| 2290 currentSize = visibleContentRect(IncludeScrollbars).size(); | |
| 2291 float currentZoomFactor = renderView->style()->zoom(); | 2298 float currentZoomFactor = renderView->style()->zoom(); |
| 2292 bool resized = !m_firstLayout && (currentSize != m_lastViewportSize || c urrentZoomFactor != m_lastZoomFactor); | 2299 bool resized = !m_firstLayout && (currentSize != m_lastViewportSize || c urrentZoomFactor != m_lastZoomFactor); |
| 2293 m_lastViewportSize = currentSize; | 2300 m_lastViewportSize = currentSize; |
| 2294 m_lastZoomFactor = currentZoomFactor; | 2301 m_lastZoomFactor = currentZoomFactor; |
| 2295 if (resized) { | 2302 if (resized) { |
| 2296 m_frame->eventHandler()->sendResizeEvent(); | 2303 m_frame->eventHandler()->sendResizeEvent(); |
| 2297 if (page && page->mainFrame() == m_frame) | 2304 if (page && page->mainFrame() == m_frame) |
| 2298 InspectorInstrumentation::didResizeMainFrame(page); | 2305 InspectorInstrumentation::didResizeMainFrame(page); |
| 2299 } | 2306 } |
| 2300 } | 2307 } |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3403 } | 3410 } |
| 3404 | 3411 |
| 3405 AXObjectCache* FrameView::axObjectCache() const | 3412 AXObjectCache* FrameView::axObjectCache() const |
| 3406 { | 3413 { |
| 3407 if (frame() && frame()->document()) | 3414 if (frame() && frame()->document()) |
| 3408 return frame()->document()->existingAXObjectCache(); | 3415 return frame()->document()->existingAXObjectCache(); |
| 3409 return 0; | 3416 return 0; |
| 3410 } | 3417 } |
| 3411 | 3418 |
| 3412 } // namespace WebCore | 3419 } // namespace WebCore |
| OLD | NEW |