#include "config.h"
#include "core/html/HTMLAreaElement.h"
-#include "HTMLNames.h"
+#include "core/HTMLNames.h"
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLMapElement.h"
#include "core/rendering/HitTestResult.h"
#include "platform/graphics/Path.h"
#include "platform/transforms/AffineTransform.h"
-using namespace std;
-
-namespace WebCore {
+namespace blink {
using namespace HTMLNames;
, m_lastSize(-1, -1)
, m_shape(Unknown)
{
- ScriptWrappable::init(this);
}
-PassRefPtrWillBeRawPtr<HTMLAreaElement> HTMLAreaElement::create(Document& document)
-{
- return adoptRefWillBeRefCountedGarbageCollected(new HTMLAreaElement(document));
-}
+DEFINE_NODE_FACTORY(HTMLAreaElement)
void HTMLAreaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
case Circle:
if (m_coords.size() >= 3) {
Length radius = m_coords[2];
- float r = min(minimumValueForLength(radius, width).toFloat(), minimumValueForLength(radius, height).toFloat());
+ 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;
HTMLImageElement* HTMLAreaElement::imageElement() const
{
- Element* mapElement = parentElement();
- while (mapElement && !isHTMLMapElement(*mapElement))
- mapElement = mapElement->parentElement();
-
- if (!mapElement)
- return 0;
-
- return toHTMLMapElement(*mapElement).imageElement();
+ if (HTMLMapElement* mapElement = Traversal<HTMLMapElement>::firstAncestor(*this))
+ return mapElement->imageElement();
+ return nullptr;
}
bool HTMLAreaElement::isKeyboardFocusable() const