OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 { | 973 { |
974 if (!document || !document->page()) { | 974 if (!document || !document->page()) { |
975 es.throwDOMException(InvalidAccessError); | 975 es.throwDOMException(InvalidAccessError); |
976 return String(); | 976 return String(); |
977 } | 977 } |
978 Page* page = document->page(); | 978 Page* page = document->page(); |
979 | 979 |
980 // Update initial viewport size. | 980 // Update initial viewport size. |
981 IntSize initialViewportSize(availableWidth, availableHeight); | 981 IntSize initialViewportSize(availableWidth, availableHeight); |
982 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero()
, initialViewportSize)); | 982 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero()
, initialViewportSize)); |
983 document->styleResolver()->viewportStyleResolver()->resolve(); | |
984 | 983 |
985 ViewportArguments arguments = page->viewportArguments(); | 984 ViewportArguments arguments = page->viewportArguments(); |
986 PageScaleConstraints constraints = arguments.resolve(initialViewportSize, 98
0 /* defaultLayoutWidthForNonMobilePages */); | 985 PageScaleConstraints constraints = arguments.resolve(initialViewportSize, 98
0 /* defaultLayoutWidthForNonMobilePages */); |
987 | 986 |
988 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt
h); | 987 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt
h); |
989 | 988 |
990 StringBuilder builder; | 989 StringBuilder builder; |
991 | 990 |
992 builder.appendLiteral("viewport size "); | 991 builder.appendLiteral("viewport size "); |
993 builder.append(String::number(constraints.layoutSize.width())); | 992 builder.append(String::number(constraints.layoutSize.width())); |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2177 return false; | 2176 return false; |
2178 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON
TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); | 2177 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON
TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); |
2179 // To prevent tests that call loseSharedGraphicsContext3D from being | 2178 // To prevent tests that call loseSharedGraphicsContext3D from being |
2180 // flaky, we call finish so that the context is guaranteed to be lost | 2179 // flaky, we call finish so that the context is guaranteed to be lost |
2181 // synchronously (i.e. before returning). | 2180 // synchronously (i.e. before returning). |
2182 sharedContext->finish(); | 2181 sharedContext->finish(); |
2183 return true; | 2182 return true; |
2184 } | 2183 } |
2185 | 2184 |
2186 } | 2185 } |
OLD | NEW |