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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLAreaElement.cpp

Issue 1631303002: Negative or zero radius for <area shape=circle> gives an empty shape (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/LayoutTests/fast/html/area-processing-expected.txt ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (m_coords.size() >= 6) { 153 if (m_coords.size() >= 6) {
154 int numPoints = m_coords.size() / 2; 154 int numPoints = m_coords.size() / 2;
155 path.moveTo(FloatPoint(clampCoordinate(m_coords[0]), clampCoordinate (m_coords[1]))); 155 path.moveTo(FloatPoint(clampCoordinate(m_coords[0]), clampCoordinate (m_coords[1])));
156 for (int i = 1; i < numPoints; ++i) 156 for (int i = 1; i < numPoints; ++i)
157 path.addLineTo(FloatPoint(clampCoordinate(m_coords[i * 2]), clam pCoordinate(m_coords[i * 2 + 1]))); 157 path.addLineTo(FloatPoint(clampCoordinate(m_coords[i * 2]), clam pCoordinate(m_coords[i * 2 + 1])));
158 path.closeSubpath(); 158 path.closeSubpath();
159 path.setWindRule(RULE_EVENODD); 159 path.setWindRule(RULE_EVENODD);
160 } 160 }
161 break; 161 break;
162 case Circle: 162 case Circle:
163 if (m_coords.size() >= 3) { 163 if (m_coords.size() >= 3 && m_coords[2].value() > 0) {
164 float r = clampCoordinate(m_coords[2]); 164 float r = clampCoordinate(m_coords[2]);
165 path.addEllipse(FloatRect(clampCoordinate(m_coords[0]) - r, clampCoo rdinate(m_coords[1]) - r, 2 * r, 2 * r)); 165 path.addEllipse(FloatRect(clampCoordinate(m_coords[0]) - r, clampCoo rdinate(m_coords[1]) - r, 2 * r, 2 * r));
166 } 166 }
167 break; 167 break;
168 case Rect: 168 case Rect:
169 if (m_coords.size() >= 4) { 169 if (m_coords.size() >= 4) {
170 float x0 = clampCoordinate(m_coords[0]); 170 float x0 = clampCoordinate(m_coords[0]);
171 float y0 = clampCoordinate(m_coords[1]); 171 float y0 = clampCoordinate(m_coords[1]);
172 float x1 = clampCoordinate(m_coords[2]); 172 float x1 = clampCoordinate(m_coords[2]);
173 float y1 = clampCoordinate(m_coords[3]); 173 float y1 = clampCoordinate(m_coords[3]);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 void HTMLAreaElement::updateFocusAppearance(SelectionBehaviorOnFocus selectionBe havior) 231 void HTMLAreaElement::updateFocusAppearance(SelectionBehaviorOnFocus selectionBe havior)
232 { 232 {
233 if (!isFocusable()) 233 if (!isFocusable())
234 return; 234 return;
235 235
236 if (HTMLImageElement* imageElement = this->imageElement()) 236 if (HTMLImageElement* imageElement = this->imageElement())
237 imageElement->updateFocusAppearance(selectionBehavior); 237 imageElement->updateFocusAppearance(selectionBehavior);
238 } 238 }
239 239
240 } // namespace blink 240 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/html/area-processing-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698