OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 // doesn't cause compositing | 2051 // doesn't cause compositing |
2052 webViewHelper.webView()->settings()->setViewportEnabled(true); | 2052 webViewHelper.webView()->settings()->setViewportEnabled(true); |
2053 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); | 2053 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); |
2054 webViewHelper.webView()->layout(); | 2054 webViewHelper.webView()->layout(); |
2055 | 2055 |
2056 // Set <1 page scale so that the clip rect should be larger than | 2056 // Set <1 page scale so that the clip rect should be larger than |
2057 // the viewport size as passed into resize(). | 2057 // the viewport size as passed into resize(). |
2058 webViewHelper.webView()->setPageScaleFactor(0.5, WebPoint()); | 2058 webViewHelper.webView()->setPageScaleFactor(0.5, WebPoint()); |
2059 | 2059 |
2060 SkBitmap bitmap; | 2060 SkBitmap bitmap; |
2061 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200); | 2061 ASSERT_TRUE(bitmap.allocN32Pixels(200, 200)); |
2062 bitmap.allocPixels(); | |
2063 bitmap.eraseColor(0); | 2062 bitmap.eraseColor(0); |
2064 SkCanvas canvas(bitmap); | 2063 SkCanvas canvas(bitmap); |
2065 | 2064 |
2066 WebCore::GraphicsContext context(&canvas); | 2065 WebCore::GraphicsContext context(&canvas); |
2067 context.setTrackOpaqueRegion(true); | 2066 context.setTrackOpaqueRegion(true); |
2068 | 2067 |
2069 EXPECT_EQ_RECT(WebCore::IntRect(0, 0, 0, 0), context.opaqueRegion().asRect()
); | 2068 EXPECT_EQ_RECT(WebCore::IntRect(0, 0, 0, 0), context.opaqueRegion().asRect()
); |
2070 | 2069 |
2071 WebCore::FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->fra
meView(); | 2070 WebCore::FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->fra
meView(); |
2072 WebCore::IntRect paintRect(0, 0, 200, 200); | 2071 WebCore::IntRect paintRect(0, 0, 200, 200); |
(...skipping 3284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5357 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); | 5356 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); |
5358 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA
nonymous)); | 5357 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA
nonymous)); |
5359 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir
ectChild)); | 5358 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir
ectChild)); |
5360 | 5359 |
5361 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB
lock(); | 5360 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB
lock(); |
5362 EXPECT_TRUE(anonymousBlock->isAnonymous()); | 5361 EXPECT_TRUE(anonymousBlock->isAnonymous()); |
5363 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); | 5362 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); |
5364 } | 5363 } |
5365 | 5364 |
5366 } // namespace | 5365 } // namespace |
OLD | NEW |