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

Unified Diff: Source/core/html/HTMLAreaElement.cpp

Issue 1186823007: Code cleanup in core/html/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLAppletElement.cpp ('k') | Source/core/html/HTMLBRElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAreaElement.cpp
diff --git a/Source/core/html/HTMLAreaElement.cpp b/Source/core/html/HTMLAreaElement.cpp
index 3a52f137ffc596e88593c7242a96f65f7950e2b7..ceaffe91dbe8929d226ff1697c612c16351e4e31 100644
--- a/Source/core/html/HTMLAreaElement.cpp
+++ b/Source/core/html/HTMLAreaElement.cpp
@@ -72,8 +72,9 @@ void HTMLAreaElement::parseAttribute(const QualifiedName& name, const AtomicStri
invalidateCachedRegion();
} else if (name == altAttr || name == accesskeyAttr) {
// Do nothing.
- } else
+ } else {
HTMLAnchorElement::parseAttribute(name, value);
+ }
}
void HTMLAreaElement::invalidateCachedRegion()
@@ -142,36 +143,36 @@ Path HTMLAreaElement::getRegion(const LayoutSize& size) const
Path path;
switch (shape) {
- case Poly:
- if (m_coords.size() >= 6) {
- int numPoints = m_coords.size() / 2;
- path.moveTo(FloatPoint(minimumValueForLength(m_coords[0], width).toFloat(), minimumValueForLength(m_coords[1], height).toFloat()));
- for (int i = 1; i < numPoints; ++i)
- path.addLineTo(FloatPoint(minimumValueForLength(m_coords[i * 2], width).toFloat(), minimumValueForLength(m_coords[i * 2 + 1], height).toFloat()));
- path.closeSubpath();
- }
- break;
- case Circle:
- if (m_coords.size() >= 3) {
- Length radius = m_coords[2];
- float r = std::min(minimumValueForLength(radius, width).toFloat(), minimumValueForLength(radius, height).toFloat());
- path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], width).toFloat() - r, minimumValueForLength(m_coords[1], height).toFloat() - r, 2 * r, 2 * r));
- }
- break;
- case Rect:
- if (m_coords.size() >= 4) {
- float x0 = minimumValueForLength(m_coords[0], width).toFloat();
- float y0 = minimumValueForLength(m_coords[1], height).toFloat();
- float x1 = minimumValueForLength(m_coords[2], width).toFloat();
- float y1 = minimumValueForLength(m_coords[3], height).toFloat();
- path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0));
- }
- break;
- case Default:
- path.addRect(FloatRect(0, 0, width.toFloat(), height.toFloat()));
- break;
- case Unknown:
- break;
+ case Poly:
+ if (m_coords.size() >= 6) {
+ int numPoints = m_coords.size() / 2;
+ path.moveTo(FloatPoint(minimumValueForLength(m_coords[0], width).toFloat(), minimumValueForLength(m_coords[1], height).toFloat()));
+ for (int i = 1; i < numPoints; ++i)
+ path.addLineTo(FloatPoint(minimumValueForLength(m_coords[i * 2], width).toFloat(), minimumValueForLength(m_coords[i * 2 + 1], height).toFloat()));
+ path.closeSubpath();
+ }
+ break;
+ case Circle:
+ if (m_coords.size() >= 3) {
+ Length radius = m_coords[2];
+ float r = std::min(minimumValueForLength(radius, width).toFloat(), minimumValueForLength(radius, height).toFloat());
+ path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], width).toFloat() - r, minimumValueForLength(m_coords[1], height).toFloat() - r, 2 * r, 2 * r));
+ }
+ break;
+ case Rect:
+ if (m_coords.size() >= 4) {
+ float x0 = minimumValueForLength(m_coords[0], width).toFloat();
+ float y0 = minimumValueForLength(m_coords[1], height).toFloat();
+ float x1 = minimumValueForLength(m_coords[2], width).toFloat();
+ float y1 = minimumValueForLength(m_coords[3], height).toFloat();
+ path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0));
+ }
+ break;
+ case Default:
+ path.addRect(FloatRect(0, 0, width.toFloat(), height.toFloat()));
+ break;
+ case Unknown:
+ break;
}
return path;
« no previous file with comments | « Source/core/html/HTMLAppletElement.cpp ('k') | Source/core/html/HTMLBRElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698