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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2606143002: Fix RGBA alpha parsing and serialization to adhere to W3 standard. (Closed)
Patch Set: fixes to address reviewer comments Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Color.cpp ('k') | no next file » | 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 "html>", 387 "html>",
388 baseURL); 388 baseURL);
389 EXPECT_EQ(kDarkCyan, webView->backgroundColor()); 389 EXPECT_EQ(kDarkCyan, webView->backgroundColor());
390 390
391 FrameTestHelpers::loadHTMLString(webView->mainFrame(), 391 FrameTestHelpers::loadHTMLString(webView->mainFrame(),
392 "<html><head><style>body " 392 "<html><head><style>body "
393 "{background-color:rgba(255,0,0,0.5)}</" 393 "{background-color:rgba(255,0,0,0.5)}</"
394 "style></head></html>", 394 "style></head></html>",
395 baseURL); 395 baseURL);
396 // Expected: red (50% alpha) blended atop base of kBlue. 396 // Expected: red (50% alpha) blended atop base of kBlue.
397 EXPECT_EQ(0xFF7F0080, webView->backgroundColor()); 397 EXPECT_EQ(0xFF80007F, webView->backgroundColor());
398 398
399 webView->setBaseBackgroundColor(kTranslucentPutty); 399 webView->setBaseBackgroundColor(kTranslucentPutty);
400 // Expected: red (50% alpha) blended atop kTranslucentPutty. Note the alpha. 400 // Expected: red (50% alpha) blended atop kTranslucentPutty. Note the alpha.
401 EXPECT_EQ(0xBFE93B32, webView->backgroundColor()); 401 EXPECT_EQ(0xBFE93A31, webView->backgroundColor());
402 402
403 webView->setBaseBackgroundColor(kTransparent); 403 webView->setBaseBackgroundColor(kTransparent);
404 FrameTestHelpers::loadHTMLString(webView->mainFrame(), 404 FrameTestHelpers::loadHTMLString(webView->mainFrame(),
405 "<html><head><style>body " 405 "<html><head><style>body "
406 "{background-color:transparent}</style></" 406 "{background-color:transparent}</style></"
407 "head></html>", 407 "head></html>",
408 baseURL); 408 baseURL);
409 // Expected: transparent on top of kTransparent will still be transparent. 409 // Expected: transparent on top of kTransparent will still be transparent.
410 EXPECT_EQ(kTransparent, webView->backgroundColor()); 410 EXPECT_EQ(kTransparent, webView->backgroundColor());
411 411
(...skipping 3865 matching lines...) Expand 10 before | Expand all | Expand 10 after
4277 .translate(50, 55) 4277 .translate(50, 55)
4278 .scale(1. / 2.f); 4278 .scale(1. / 2.f);
4279 EXPECT_EQ(expectedMatrix, 4279 EXPECT_EQ(expectedMatrix,
4280 webViewImpl->getDeviceEmulationTransformForTesting()); 4280 webViewImpl->getDeviceEmulationTransformForTesting());
4281 // visibleContentRect doesn't change. 4281 // visibleContentRect doesn't change.
4282 EXPECT_EQ(IntRect(50, 55, 50, 75), 4282 EXPECT_EQ(IntRect(50, 55, 50, 75),
4283 *devToolsEmulator->visibleContentRectForPainting()); 4283 *devToolsEmulator->visibleContentRectForPainting());
4284 } 4284 }
4285 4285
4286 } // namespace blink 4286 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Color.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698