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

Unified Diff: Source/core/html/canvas/MouseEventHitRegion.h

Issue 338843005: IDL: For DOMString? attribute getters, use null string to represent null (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
Index: Source/core/html/canvas/MouseEventHitRegion.h
diff --git a/Source/core/html/canvas/MouseEventHitRegion.h b/Source/core/html/canvas/MouseEventHitRegion.h
index acb074aedeec2cffd2beadc1493cbfce29736c6d..1c5016f8c4e934f470b0eb0f7df43bd7d4033fb3 100644
--- a/Source/core/html/canvas/MouseEventHitRegion.h
+++ b/Source/core/html/canvas/MouseEventHitRegion.h
@@ -14,28 +14,25 @@ namespace WebCore {
class MouseEventHitRegion {
public:
- static String region(MouseEvent& event, bool& isNull)
+ static String region(MouseEvent& event)
{
- if (!event.target() || !isHTMLCanvasElement(event.target()->toNode())) {
- isNull = true;
+ if (!event.target() || !isHTMLCanvasElement(event.target()->toNode()))
return String();
- }
HTMLCanvasElement* canvas = toHTMLCanvasElement(event.target()->toNode());
CanvasRenderingContext* context = canvas->renderingContext();
- if (!context || !context->is2d()) {
- isNull = true;
+ if (!context || !context->is2d())
return String();
- }
HitRegion* hitRegion = toCanvasRenderingContext2D(context)->
hitRegionAtPoint(LayoutPoint(event.offsetX(), event.offsetY()));
- String id;
- if (hitRegion)
- id = hitRegion->id();
+ if (!hitRegion)
+ return String();
- isNull = id.isEmpty();
+ String id = hitRegion->id();
+ if (id.isEmpty())
+ return String();
return id;
}
« Source/bindings/tests/results/V8TestObject.cpp ('K') | « Source/core/frame/NavigatorLanguage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698