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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 238863002: Implement drawFocusIfNeeded with Path2D parameter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 3529068fc8eb02e2a53845a328a82edda2395576..d408b49cf8a96242e77843f4fcb9afc5f1498fe8 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -2319,15 +2319,25 @@ PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttrib
void CanvasRenderingContext2D::drawFocusIfNeeded(Element* element)
{
- if (!focusRingCallIsValid(m_path, element))
+ drawFocusIfNeededInternal(m_path, element);
+}
+
+void CanvasRenderingContext2D::drawFocusIfNeeded(Path2D* path2d, Element* element)
+{
+ drawFocusIfNeededInternal(path2d->path(), element);
+}
+
+void CanvasRenderingContext2D::drawFocusIfNeededInternal(const Path& path, Element* element)
+{
+ if (!focusRingCallIsValid(path, element))
return;
- updateFocusRingAccessibility(m_path, element);
+ updateFocusRingAccessibility(path, element);
// Note: we need to check document->focusedElement() rather than just calling
// element->focused(), because element->focused() isn't updated until after
// focus events fire.
if (element->document().focusedElement() == element)
- drawFocusRing(m_path);
+ drawFocusRing(path);
}
bool CanvasRenderingContext2D::drawCustomFocusRing(Element* element)
@@ -2367,7 +2377,7 @@ void CanvasRenderingContext2D::updateFocusRingAccessibility(const Path& path, El
if (AXObjectCache* axObjectCache = element->document().existingAXObjectCache()) {
if (AXObject* obj = axObjectCache->getOrCreate(element)) {
// Get the bounding rect and apply transformations.
- FloatRect bounds = m_path.boundingRect();
+ FloatRect bounds = path.boundingRect();
AffineTransform ctm = state().m_transform;
FloatRect transformedBounds = ctm.mapRect(bounds);
LayoutRect elementRect = LayoutRect(transformedBounds);
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/core/html/canvas/CanvasRenderingContext2D.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698