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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 1815093002: Canvas2d: fix event.region being null on mouseleave/out events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 HitRegion* hitRegion = hitRegionAtPoint(localPos); 598 HitRegion* hitRegion = hitRegionAtPoint(localPos);
599 if (hitRegion) { 599 if (hitRegion) {
600 Element* control = hitRegion->control(); 600 Element* control = hitRegion->control();
601 if (control && canvas()->isSupportedInteractiveCanvasFallback(*control)) 601 if (control && canvas()->isSupportedInteractiveCanvasFallback(*control))
602 return std::make_pair(hitRegion->control(), hitRegion->id()); 602 return std::make_pair(hitRegion->control(), hitRegion->id());
603 return std::make_pair(nullptr, hitRegion->id()); 603 return std::make_pair(nullptr, hitRegion->id());
604 } 604 }
605 return std::make_pair(nullptr, String()); 605 return std::make_pair(nullptr, String());
606 } 606 }
607 607
608 String CanvasRenderingContext2D::getIdFromControl(const Element* element)
609 {
610 if (hitRegionsCount() <= 0)
611 return String();
612
613 if (HitRegion* hitRegion = m_hitRegionManager->getHitRegionByControl(element ))
614 return hitRegion->id();
615 return String();
616 }
617
608 String CanvasRenderingContext2D::textAlign() const 618 String CanvasRenderingContext2D::textAlign() const
609 { 619 {
610 return textAlignName(state().getTextAlign()); 620 return textAlignName(state().getTextAlign());
611 } 621 }
612 622
613 void CanvasRenderingContext2D::setTextAlign(const String& s) 623 void CanvasRenderingContext2D::setTextAlign(const String& s)
614 { 624 {
615 TextAlign align; 625 TextAlign align;
616 if (!parseTextAlign(s, align)) 626 if (!parseTextAlign(s, align))
617 return; 627 return;
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 1052
1043 unsigned CanvasRenderingContext2D::hitRegionsCount() const 1053 unsigned CanvasRenderingContext2D::hitRegionsCount() const
1044 { 1054 {
1045 if (m_hitRegionManager) 1055 if (m_hitRegionManager)
1046 return m_hitRegionManager->getHitRegionsCount(); 1056 return m_hitRegionManager->getHitRegionsCount();
1047 1057
1048 return 0; 1058 return 0;
1049 } 1059 }
1050 1060
1051 } // namespace blink 1061 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698