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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 if (!isnan(pendingChanges.x())) | 331 if (!isnan(pendingChanges.x())) |
332 window.setX(pendingChanges.x()); | 332 window.setX(pendingChanges.x()); |
333 if (!isnan(pendingChanges.y())) | 333 if (!isnan(pendingChanges.y())) |
334 window.setY(pendingChanges.y()); | 334 window.setY(pendingChanges.y()); |
335 if (!isnan(pendingChanges.width())) | 335 if (!isnan(pendingChanges.width())) |
336 window.setWidth(pendingChanges.width()); | 336 window.setWidth(pendingChanges.width()); |
337 if (!isnan(pendingChanges.height())) | 337 if (!isnan(pendingChanges.height())) |
338 window.setHeight(pendingChanges.height()); | 338 window.setHeight(pendingChanges.height()); |
339 | 339 |
340 FloatSize minimumSize = page->chrome()->client()->minimumWindowSize(); | 340 FloatSize minimumSize = page->chrome()->client()->minimumWindowSize(); |
341 window.setWidth(min(max(minimumSize.width(), window.width()), screen.width()
)); | 341 // Let size 0 pass through, since that indicates default size, not minimum s
ize. |
342 window.setHeight(min(max(minimumSize.height(), window.height()), screen.heig
ht())); | 342 if (window.width()) |
| 343 window.setWidth(min(max(minimumSize.width(), window.width()), screen.wid
th())); |
| 344 if (window.height()) |
| 345 window.setHeight(min(max(minimumSize.height(), window.height()), screen.
height())); |
343 | 346 |
344 // Constrain the window position within the valid screen area. | 347 // Constrain the window position within the valid screen area. |
345 window.setX(max(screen.x(), min(window.x(), screen.maxX() - window.width()))
); | 348 window.setX(max(screen.x(), min(window.x(), screen.maxX() - window.width()))
); |
346 window.setY(max(screen.y(), min(window.y(), screen.maxY() - window.height())
)); | 349 window.setY(max(screen.y(), min(window.y(), screen.maxY() - window.height())
)); |
347 | 350 |
348 return window; | 351 return window; |
349 } | 352 } |
350 | 353 |
351 // FIXME: We can remove this function once V8 showModalDialog is changed to use
DOMWindow. | 354 // FIXME: We can remove this function once V8 showModalDialog is changed to use
DOMWindow. |
352 void DOMWindow::parseModalDialogFeatures(const String& string, HashMap<String, S
tring>& map) | 355 void DOMWindow::parseModalDialogFeatures(const String& string, HashMap<String, S
tring>& map) |
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1953 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr
ame->view())); | 1956 WindowFeatures windowFeatures(dialogFeaturesString, screenAvailableRect(m_fr
ame->view())); |
1954 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, | 1957 Frame* dialogFrame = createWindow(urlString, emptyAtom, windowFeatures, |
1955 activeWindow, firstFrame, m_frame, function, functionContext); | 1958 activeWindow, firstFrame, m_frame, function, functionContext); |
1956 if (!dialogFrame) | 1959 if (!dialogFrame) |
1957 return; | 1960 return; |
1958 | 1961 |
1959 dialogFrame->page()->chrome()->runModal(); | 1962 dialogFrame->page()->chrome()->runModal(); |
1960 } | 1963 } |
1961 | 1964 |
1962 } // namespace WebCore | 1965 } // namespace WebCore |
OLD | NEW |