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

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

Issue 1309503004: Select elements should clear type-ahead session on blur. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after
2172 if (!node || !isHTMLSelectElement(*node)) 2172 if (!node || !isHTMLSelectElement(*node))
2173 return false; 2173 return false;
2174 2174
2175 HTMLSelectElement& select = toHTMLSelectElement(*node); 2175 HTMLSelectElement& select = toHTMLSelectElement(*node);
2176 if (itemIndex < 0 || static_cast<size_t>(itemIndex) >= select.listItems().si ze()) 2176 if (itemIndex < 0 || static_cast<size_t>(itemIndex) >= select.listItems().si ze())
2177 return false; 2177 return false;
2178 const ComputedStyle* itemStyle = select.itemComputedStyle(*select.listItems( )[itemIndex]); 2178 const ComputedStyle* itemStyle = select.itemComputedStyle(*select.listItems( )[itemIndex]);
2179 return itemStyle ? itemStyle->font().fontMetrics().height() : 0; 2179 return itemStyle ? itemStyle->font().fontMetrics().height() : 0;
2180 } 2180 }
2181 2181
2182 void Internals::resetTypeAheadSession(HTMLSelectElement* select)
2183 {
2184 ASSERT(select);
2185 select->resetTypeAheadSessionForTesting();
2186 }
2187
2182 bool Internals::loseSharedGraphicsContext3D() 2188 bool Internals::loseSharedGraphicsContext3D()
2183 { 2189 {
2184 OwnPtr<WebGraphicsContext3DProvider> sharedProvider = adoptPtr(Platform::cur rent()->createSharedOffscreenGraphicsContext3DProvider()); 2190 OwnPtr<WebGraphicsContext3DProvider> sharedProvider = adoptPtr(Platform::cur rent()->createSharedOffscreenGraphicsContext3DProvider());
2185 if (!sharedProvider) 2191 if (!sharedProvider)
2186 return false; 2192 return false;
2187 WebGraphicsContext3D* sharedContext = sharedProvider->context3d(); 2193 WebGraphicsContext3D* sharedContext = sharedProvider->context3d();
2188 sharedContext->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_EXT, GL_INNOCENT_ CONTEXT_RESET_EXT); 2194 sharedContext->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_EXT, GL_INNOCENT_ CONTEXT_RESET_EXT);
2189 // To prevent tests that call loseSharedGraphicsContext3D from being 2195 // To prevent tests that call loseSharedGraphicsContext3D from being
2190 // flaky, we call finish so that the context is guaranteed to be lost 2196 // flaky, we call finish so that the context is guaranteed to be lost
2191 // synchronously (i.e. before returning). 2197 // synchronously (i.e. before returning).
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 2485
2480 return animator->setScrollbarsVisibleForTesting(visible); 2486 return animator->setScrollbarsVisibleForTesting(visible);
2481 } 2487 }
2482 2488
2483 void Internals::forceRestrictIFramePermissions() 2489 void Internals::forceRestrictIFramePermissions()
2484 { 2490 {
2485 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); 2491 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true);
2486 } 2492 }
2487 2493
2488 } // namespace blink 2494 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698