diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp index 35917a9fd751..44c32bd16413 100644 --- a/layout/generic/nsIFrame.cpp +++ b/layout/generic/nsIFrame.cpp @@ -5853,7 +5853,8 @@ static bool UseFrameEdge(nsIFrame* aFrame) { return true; } const nsImageFrame* image = do_QueryFrame(aFrame); - if (image && !aFrame->GetContent()->IsEditable()) { + if ((image || aFrame->IsHTMLCanvasFrame()) && + !aFrame->GetContent()->IsEditable()) { // Editable images are a special-case because editing relies on clicking on // an editable image selecting it, for it to show resizers. return true; diff --git a/testing/web-platform/tests/selection/canvas-click.html b/testing/web-platform/tests/selection/canvas-click.html new file mode 100644 index 000000000000..a058a621a0e2 --- /dev/null +++ b/testing/web-platform/tests/selection/canvas-click.html @@ -0,0 +1,28 @@ + + +Clicking on a text-selectable canvas should not select it + + + + + + + + +Clicking the green square should not select it.
+ +