blob: 52a93b6bcba47329e0e6dd98fa843a970e5a3bf8 [file] [log] [blame] [edit]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "modules/canvas2d/TouchHitRegion.h"
#include "core/dom/Touch.h"
#include "core/html/HTMLCanvasElement.h"
namespace blink {
String TouchHitRegion::region(Touch& touch)
{
if (!touch.target() || !isHTMLCanvasElement(touch.target()->toNode()))
return String();
HTMLCanvasElement* canvas = toHTMLCanvasElement(touch.target()->toNode());
return regionIdFromAbsoluteLocation(*canvas, touch.absoluteLocation());
}
} // namespace blink