Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 19555002: Translate viewport related meta tags into @viewport descriptors as suggested by the CSS Device Adap… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 return String(); 946 return String();
947 } 947 }
948 Page* page = document->page(); 948 Page* page = document->page();
949 949
950 // Update initial viewport size. 950 // Update initial viewport size.
951 IntSize initialViewportSize(availableWidth, availableHeight); 951 IntSize initialViewportSize(availableWidth, availableHeight);
952 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero() , initialViewportSize)); 952 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero() , initialViewportSize));
953 document->styleResolver()->viewportStyleResolver()->resolve(); 953 document->styleResolver()->viewportStyleResolver()->resolve();
954 954
955 ViewportArguments arguments = page->viewportArguments(); 955 ViewportArguments arguments = page->viewportArguments();
956 PageScaleConstraints constraints = arguments.resolve(initialViewportSize, 98 0 /* defaultLayoutWidthForNonMobilePages */); 956 PageScaleConstraints constraints = arguments.resolve(initialViewportSize);
957 957
958 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt h); 958 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt h);
959 959
960 StringBuilder builder; 960 StringBuilder builder;
961 961
962 builder.appendLiteral("viewport size "); 962 builder.appendLiteral("viewport size ");
963 builder.append(String::number(constraints.layoutSize.width())); 963 builder.append(String::number(constraints.layoutSize.width()));
964 builder.append('x'); 964 builder.append('x');
965 builder.append(String::number(constraints.layoutSize.height())); 965 builder.append(String::number(constraints.layoutSize.height()));
966 966
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2147 return false; 2147 return false;
2148 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); 2148 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
2149 // To prevent tests that call loseSharedGraphicsContext3D from being 2149 // To prevent tests that call loseSharedGraphicsContext3D from being
2150 // flaky, we call finish so that the context is guaranteed to be lost 2150 // flaky, we call finish so that the context is guaranteed to be lost
2151 // synchronously (i.e. before returning). 2151 // synchronously (i.e. before returning).
2152 sharedContext->finish(); 2152 sharedContext->finish();
2153 return true; 2153 return true;
2154 } 2154 }
2155 2155
2156 } 2156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698