OLD | NEW |
---|---|
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 Loading... | |
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(Element* element) | |
609 { | |
610 if (hitRegionsCount() <= 0) | |
611 return String(); | |
612 | |
613 HitRegion* hitRegion = m_hitRegionManager->getHitRegionByControl(element); | |
dtapuska
2016/04/05 15:57:28
I'd make this all one line.
if (HitRegion* hitReg
zino
2016/04/06 11:08:20
Done.
| |
614 if (hitRegion) | |
615 return hitRegion->id(); | |
616 return String(); | |
617 } | |
618 | |
608 String CanvasRenderingContext2D::textAlign() const | 619 String CanvasRenderingContext2D::textAlign() const |
609 { | 620 { |
610 return textAlignName(state().getTextAlign()); | 621 return textAlignName(state().getTextAlign()); |
611 } | 622 } |
612 | 623 |
613 void CanvasRenderingContext2D::setTextAlign(const String& s) | 624 void CanvasRenderingContext2D::setTextAlign(const String& s) |
614 { | 625 { |
615 TextAlign align; | 626 TextAlign align; |
616 if (!parseTextAlign(s, align)) | 627 if (!parseTextAlign(s, align)) |
617 return; | 628 return; |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1042 | 1053 |
1043 unsigned CanvasRenderingContext2D::hitRegionsCount() const | 1054 unsigned CanvasRenderingContext2D::hitRegionsCount() const |
1044 { | 1055 { |
1045 if (m_hitRegionManager) | 1056 if (m_hitRegionManager) |
1046 return m_hitRegionManager->getHitRegionsCount(); | 1057 return m_hitRegionManager->getHitRegionsCount(); |
1047 | 1058 |
1048 return 0; | 1059 return 0; |
1049 } | 1060 } |
1050 | 1061 |
1051 } // namespace blink | 1062 } // namespace blink |
OLD | NEW |