| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 if (!isnan(pendingChanges.x())) | 333 if (!isnan(pendingChanges.x())) |
| 334 window.setX(pendingChanges.x()); | 334 window.setX(pendingChanges.x()); |
| 335 if (!isnan(pendingChanges.y())) | 335 if (!isnan(pendingChanges.y())) |
| 336 window.setY(pendingChanges.y()); | 336 window.setY(pendingChanges.y()); |
| 337 if (!isnan(pendingChanges.width())) | 337 if (!isnan(pendingChanges.width())) |
| 338 window.setWidth(pendingChanges.width()); | 338 window.setWidth(pendingChanges.width()); |
| 339 if (!isnan(pendingChanges.height())) | 339 if (!isnan(pendingChanges.height())) |
| 340 window.setHeight(pendingChanges.height()); | 340 window.setHeight(pendingChanges.height()); |
| 341 | 341 |
| 342 FloatSize minimumSize = page->chrome()->client()->minimumWindowSize(); | 342 FloatSize minimumSize = page->chrome()->client()->minimumWindowSize(); |
| 343 window.setWidth(min(max(minimumSize.width(), window.width()), screen.width()
)); | 343 // Let size 0 pass through, since that indicates default size, not minimum s
ize. |
| 344 window.setHeight(min(max(minimumSize.height(), window.height()), screen.heig
ht())); | 344 if (window.width()) |
| 345 window.setWidth(min(max(minimumSize.width(), window.width()), screen.wid
th())); |
| 346 if (window.height()) |
| 347 window.setHeight(min(max(minimumSize.height(), window.height()), screen.
height())); |
| 345 | 348 |
| 346 // Constrain the window position within the valid screen area. | 349 // Constrain the window position within the valid screen area. |
| 347 window.setX(max(screen.x(), min(window.x(), screen.maxX() - window.width()))
); | 350 window.setX(max(screen.x(), min(window.x(), screen.maxX() - window.width()))
); |
| 348 window.setY(max(screen.y(), min(window.y(), screen.maxY() - window.height())
)); | 351 window.setY(max(screen.y(), min(window.y(), screen.maxY() - window.height())
)); |
| 349 | 352 |
| 350 return window; | 353 return window; |
| 351 } | 354 } |
| 352 | 355 |
| 353 bool DOMWindow::allowPopUp(Frame* firstFrame) | 356 bool DOMWindow::allowPopUp(Frame* firstFrame) |
| 354 { | 357 { |
| (...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr
ame->view())); | 1970 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr
ame->view())); |
| 1968 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, | 1971 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, |
| 1969 activeWindow, firstFrame, m_frame, function, functionContext); | 1972 activeWindow, firstFrame, m_frame, function, functionContext); |
| 1970 if (!dialogFrame) | 1973 if (!dialogFrame) |
| 1971 return; | 1974 return; |
| 1972 | 1975 |
| 1973 dialogFrame->page()->chrome()->runModal(); | 1976 dialogFrame->page()->chrome()->runModal(); |
| 1974 } | 1977 } |
| 1975 | 1978 |
| 1976 } // namespace WebCore | 1979 } // namespace WebCore |
| OLD | NEW |