OLD | NEW |
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 if (shape == Unknown) { | 134 if (shape == Unknown) { |
135 if (m_coords.size() == 3) | 135 if (m_coords.size() == 3) |
136 shape = Circle; | 136 shape = Circle; |
137 else if (m_coords.size() == 4) | 137 else if (m_coords.size() == 4) |
138 shape = Rect; | 138 shape = Rect; |
139 else if (m_coords.size() >= 6) | 139 else if (m_coords.size() >= 6) |
140 shape = Poly; | 140 shape = Poly; |
141 } | 141 } |
142 | 142 |
143 Path path; | 143 Path path; |
144 RenderView* renderView = document().renderView(); | |
145 switch (shape) { | 144 switch (shape) { |
146 case Poly: | 145 case Poly: |
147 if (m_coords.size() >= 6) { | 146 if (m_coords.size() >= 6) { |
148 int numPoints = m_coords.size() / 2; | 147 int numPoints = m_coords.size() / 2; |
149 path.moveTo(FloatPoint(minimumValueForLength(m_coords[0], width,
renderView), minimumValueForLength(m_coords[1], height, renderView))); | 148 path.moveTo(FloatPoint(minimumValueForLength(m_coords[0], width)
, minimumValueForLength(m_coords[1], height))); |
150 for (int i = 1; i < numPoints; ++i) | 149 for (int i = 1; i < numPoints; ++i) |
151 path.addLineTo(FloatPoint(minimumValueForLength(m_coords[i *
2], width, renderView), minimumValueForLength(m_coords[i * 2 + 1], height, rend
erView))); | 150 path.addLineTo(FloatPoint(minimumValueForLength(m_coords[i *
2], width), minimumValueForLength(m_coords[i * 2 + 1], height))); |
152 path.closeSubpath(); | 151 path.closeSubpath(); |
153 } | 152 } |
154 break; | 153 break; |
155 case Circle: | 154 case Circle: |
156 if (m_coords.size() >= 3) { | 155 if (m_coords.size() >= 3) { |
157 Length radius = m_coords[2]; | 156 Length radius = m_coords[2]; |
158 int r = min(minimumValueForLength(radius, width, renderView), mi
nimumValueForLength(radius, height, renderView)); | 157 int r = min(minimumValueForLength(radius, width), minimumValueFo
rLength(radius, height)); |
159 path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], wid
th, renderView) - r, minimumValueForLength(m_coords[1], height, renderView) - r,
2 * r, 2 * r)); | 158 path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], wid
th) - r, minimumValueForLength(m_coords[1], height) - r, 2 * r, 2 * r)); |
160 } | 159 } |
161 break; | 160 break; |
162 case Rect: | 161 case Rect: |
163 if (m_coords.size() >= 4) { | 162 if (m_coords.size() >= 4) { |
164 int x0 = minimumValueForLength(m_coords[0], width, renderView); | 163 int x0 = minimumValueForLength(m_coords[0], width); |
165 int y0 = minimumValueForLength(m_coords[1], height, renderView); | 164 int y0 = minimumValueForLength(m_coords[1], height); |
166 int x1 = minimumValueForLength(m_coords[2], width, renderView); | 165 int x1 = minimumValueForLength(m_coords[2], width); |
167 int y1 = minimumValueForLength(m_coords[3], height, renderView); | 166 int y1 = minimumValueForLength(m_coords[3], height); |
168 path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0)); | 167 path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0)); |
169 } | 168 } |
170 break; | 169 break; |
171 case Default: | 170 case Default: |
172 path.addRect(FloatRect(0, 0, width, height)); | 171 path.addRect(FloatRect(0, 0, width, height)); |
173 break; | 172 break; |
174 case Unknown: | 173 case Unknown: |
175 break; | 174 break; |
176 } | 175 } |
177 | 176 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // FIXME: This means that an AREA that is not a link cannot be made focusabl
e through contenteditable or tabindex. Is it correct? | 244 // FIXME: This means that an AREA that is not a link cannot be made focusabl
e through contenteditable or tabindex. Is it correct? |
246 return isLink(); | 245 return isLink(); |
247 } | 246 } |
248 | 247 |
249 String HTMLAreaElement::target() const | 248 String HTMLAreaElement::target() const |
250 { | 249 { |
251 return getAttribute(targetAttr); | 250 return getAttribute(targetAttr); |
252 } | 251 } |
253 | 252 |
254 } | 253 } |
OLD | NEW |