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

Side by Side Diff: Source/core/css/CSSGradientValue.cpp

Issue 101763008: Fix some problems reported by clang static analyzer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « no previous file | Source/core/dom/ContainerNode.cpp » ('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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // We can't just push this logic down into the platform-specific Gradient co de, 255 // We can't just push this logic down into the platform-specific Gradient co de,
256 // because we have to know the extent of the gradient, and possible move the end points. 256 // because we have to know the extent of the gradient, and possible move the end points.
257 if (m_repeating && numStops > 1) { 257 if (m_repeating && numStops > 1) {
258 // If the difference in the positions of the first and last color-stops is 0, 258 // If the difference in the positions of the first and last color-stops is 0,
259 // the gradient defines a solid-color image with the color of the last c olor-stop in the rule. 259 // the gradient defines a solid-color image with the color of the last c olor-stop in the rule.
260 float gradientRange = stops[numStops - 1].offset - stops[0].offset; 260 float gradientRange = stops[numStops - 1].offset - stops[0].offset;
261 if (!gradientRange) { 261 if (!gradientRange) {
262 stops.first().offset = 0; 262 stops.first().offset = 0;
263 stops.first().color = stops.last().color; 263 stops.first().color = stops.last().color;
264 stops.shrink(1); 264 stops.shrink(1);
265 numStops = 1;
266 } else { 265 } else {
267 float maxExtent = 1; 266 float maxExtent = 1;
268 267
269 // Radial gradients may need to extend further than the endpoints, b ecause they have 268 // Radial gradients may need to extend further than the endpoints, b ecause they have
270 // to repeat out to the corners of the box. 269 // to repeat out to the corners of the box.
271 if (isRadialGradientValue()) { 270 if (isRadialGradientValue()) {
272 if (!computedGradientLength) { 271 if (!computedGradientLength) {
273 FloatSize gradientSize(gradientStart - gradientEnd); 272 FloatSize gradientSize(gradientStart - gradientEnd);
274 gradientLength = gradientSize.diagonalLength(); 273 gradientLength = gradientSize.diagonalLength();
275 } 274 }
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 equalHorizontalAndVerticalSize = compareCSSValuePtr(m_endHorizontalSize, other.m_endHorizontalSize) && compareCSSValuePtr(m_endVerticalSize, other.m_end VerticalSize); 1154 equalHorizontalAndVerticalSize = compareCSSValuePtr(m_endHorizontalSize, other.m_endHorizontalSize) && compareCSSValuePtr(m_endVerticalSize, other.m_end VerticalSize);
1156 else { 1155 else {
1157 equalShape = !other.m_shape; 1156 equalShape = !other.m_shape;
1158 equalSizingBehavior = !other.m_sizingBehavior; 1157 equalSizingBehavior = !other.m_sizingBehavior;
1159 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_ endVerticalSize; 1158 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_ endVerticalSize;
1160 } 1159 }
1161 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize & & m_stops == other.m_stops; 1160 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize & & m_stops == other.m_stops;
1162 } 1161 }
1163 1162
1164 } // namespace WebCore 1163 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698