| 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 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2419 | 2419 |
| 2420 RenderBox* documentRenderBox = documentElement->renderBox(); | 2420 RenderBox* documentRenderBox = documentElement->renderBox(); |
| 2421 if (!documentRenderBox) | 2421 if (!documentRenderBox) |
| 2422 return; | 2422 return; |
| 2423 | 2423 |
| 2424 // If this is the first time we run autosize, start from small height and | 2424 // If this is the first time we run autosize, start from small height and |
| 2425 // allow it to grow. | 2425 // allow it to grow. |
| 2426 if (!m_didRunAutosize) | 2426 if (!m_didRunAutosize) |
| 2427 resize(frameRect().width(), m_minAutoSize.height()); | 2427 resize(frameRect().width(), m_minAutoSize.height()); |
| 2428 | 2428 |
| 2429 IntSize size = frameRect().size(); |
| 2430 |
| 2429 // Do the resizing twice. The first time is basically a rough calculation us
ing the preferred width | 2431 // Do the resizing twice. The first time is basically a rough calculation us
ing the preferred width |
| 2430 // which may result in a height change during the second iteration. | 2432 // which may result in a height change during the second iteration. |
| 2431 for (int i = 0; i < 2; i++) { | 2433 for (int i = 0; i < 2; i++) { |
| 2432 // Update various sizes including contentsSize, scrollHeight, etc. | 2434 // Update various sizes including contentsSize, scrollHeight, etc. |
| 2433 document->updateLayoutIgnorePendingStylesheets(); | 2435 document->updateLayoutIgnorePendingStylesheets(); |
| 2434 IntSize size = frameRect().size(); | |
| 2435 int width = documentView->minPreferredLogicalWidth(); | 2436 int width = documentView->minPreferredLogicalWidth(); |
| 2436 int height = documentRenderBox->scrollHeight(); | 2437 int height = documentRenderBox->scrollHeight(); |
| 2437 IntSize newSize(width, height); | 2438 IntSize newSize(width, height); |
| 2438 | 2439 |
| 2439 // Check to see if a scrollbar is needed for a given dimension and | 2440 // Check to see if a scrollbar is needed for a given dimension and |
| 2440 // if so, increase the other dimension to account for the scrollbar. | 2441 // if so, increase the other dimension to account for the scrollbar. |
| 2441 // Since the dimensions are only for the view rectangle, once a | 2442 // Since the dimensions are only for the view rectangle, once a |
| 2442 // dimension exceeds the maximum, there is no need to increase it furthe
r. | 2443 // dimension exceeds the maximum, there is no need to increase it furthe
r. |
| 2443 if (newSize.width() > m_maxAutoSize.width()) { | 2444 if (newSize.width() > m_maxAutoSize.width()) { |
| 2444 RefPtr<Scrollbar> localHorizontalScrollbar = horizontalScrollbar(); | 2445 RefPtr<Scrollbar> localHorizontalScrollbar = horizontalScrollbar(); |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3488 } | 3489 } |
| 3489 | 3490 |
| 3490 AXObjectCache* FrameView::axObjectCache() const | 3491 AXObjectCache* FrameView::axObjectCache() const |
| 3491 { | 3492 { |
| 3492 if (frame() && frame()->document() && frame()->document()->axObjectCacheExis
ts()) | 3493 if (frame() && frame()->document() && frame()->document()->axObjectCacheExis
ts()) |
| 3493 return frame()->document()->axObjectCache(); | 3494 return frame()->document()->axObjectCache(); |
| 3494 return 0; | 3495 return 0; |
| 3495 } | 3496 } |
| 3496 | 3497 |
| 3497 } // namespace WebCore | 3498 } // namespace WebCore |
| OLD | NEW |