Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp |
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp |
index 3c4d22d77d64dfeea4888b54bcb968b0bb3e4ae2..906002445120ea876aa4f6a536fea58f73442dfe 100644 |
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp |
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp |
@@ -605,6 +605,16 @@ std::pair<Element*, String> CanvasRenderingContext2D::getControlAndIdIfHitRegion |
return std::make_pair(nullptr, String()); |
} |
+String CanvasRenderingContext2D::getIdFromControl(const Element* element) |
+{ |
+ if (hitRegionsCount() <= 0) |
+ return String(); |
+ |
+ if (HitRegion* hitRegion = m_hitRegionManager->getHitRegionByControl(element)) |
+ return hitRegion->id(); |
+ return String(); |
+} |
+ |
String CanvasRenderingContext2D::textAlign() const |
{ |
return textAlignName(state().getTextAlign()); |