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

Issue 1668553003: Fix server-side image map click location with "Open link in new tab"

Created:
4 years, 10 months ago by JakeYoon
Modified:
4 years, 9 months ago
Reviewers:
tkent, limasdf, zino, lazyboy
CC:
blink-reviews, cbiesinger, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews_chromium.org, tyoshino+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix server-side image map click location with "Open link in new tab" http://web.mit.edu/keithw/www/mapbug.html Following a link that is part of a server-side image-map should include the click coordinates in the query string, whether the user (1) clicks normally, (2) middle-clicks, (3) selects "open link in new tab" from the context menu. But (3) choosing "open link in new tab" from the context menu does not include the click location. So I expanded ContextMenuClient::showContextMenu() function to include Event. And then I made URL of context include mouse location information. Last I made appendServerMapMousePosition function in HTMLAnchorElement to static. for use this function instead of copying the code into two places R=tkent@chromium.org,jinho.bang@samsung.com,limasdf@gmail.com, lazyboy@chromium.org BUG=424721

Patch Set 1 #

Patch Set 2 : appendServerMapMousePosition function made static #

Total comments: 10

Patch Set 3 : Change some logics for server-side image click location #

Patch Set 4 : Add Test Case for Issue. #

Patch Set 5 : Remove body margin for testing. #

Patch Set 6 : Add Test for HTMLAnchorElement #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -49 lines) Patch
M chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc View 1 2 3 4 2 chunks +50 lines, -0 lines 0 comments Download
A + chrome/test/data/webui/test_image.png View 1 2 3 Binary file 0 comments Download
M third_party/WebKit/Source/core/core.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLAnchorElement.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp View 1 2 3 4 5 3 chunks +25 lines, -9 lines 1 comment Download
A third_party/WebKit/Source/core/html/HTMLAnchorElementTest.cpp View 1 2 3 4 5 1 chunk +38 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/loader/EmptyClients.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/page/ContextMenuClient.h View 2 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/page/ContextMenuController.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/ContextMenuClientImpl.h View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/ContextMenuClientImpl.cpp View 1 2 3 4 5 3 chunks +51 lines, -36 lines 0 comments Download

Messages

Total messages: 23 (6 generated)
JakeYoon
Please review @cbiesiner, @zino, @limasdf, @tkent
4 years, 10 months ago (2016-02-04 14:14:34 UTC) #1
JakeYoon
4 years, 10 months ago (2016-02-04 14:16:33 UTC) #4
cbiesinger
I'm not an owner of this code, but it really seems like this function should ...
4 years, 10 months ago (2016-02-04 14:35:45 UTC) #5
limasdf
Couple of comments. Thanks for the patch. We love it! However, There're a few rules ...
4 years, 10 months ago (2016-02-04 14:55:51 UTC) #6
JakeYoon
Thanks cbiesinger@, limasdf@. I try to keep in mind. I updated patch. !!
4 years, 10 months ago (2016-02-04 21:05:10 UTC) #8
tkent
This change needs a test. Do you support showContentMenu() call from ContextMenuController::showContextMenuAtPoint()? https://codereview.chromium.org/1668553003/diff/20001/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp File third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp ...
4 years, 10 months ago (2016-02-05 02:05:47 UTC) #9
JakeYoon
Thanks. I will add a test for this change. And I have some question. https://codereview.chromium.org/1668553003/diff/20001/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp ...
4 years, 10 months ago (2016-02-05 04:04:50 UTC) #10
zino
https://codereview.chromium.org/1668553003/diff/20001/third_party/WebKit/Source/core/page/ContextMenuController.cpp File third_party/WebKit/Source/core/page/ContextMenuController.cpp (right): https://codereview.chromium.org/1668553003/diff/20001/third_party/WebKit/Source/core/page/ContextMenuController.cpp#newcode176 third_party/WebKit/Source/core/page/ContextMenuController.cpp:176: m_client->showContextMenu(m_contextMenu.get(), event); On 2016/02/05 04:04:49, JakeYoon wrote: > On ...
4 years, 10 months ago (2016-02-05 05:47:34 UTC) #11
tkent
https://codereview.chromium.org/1668553003/diff/20001/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp File third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp (right): https://codereview.chromium.org/1668553003/diff/20001/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp#newcode110 third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp:110: void HTMLAnchorElement::appendServerMapMousePosition(StringBuilder& url, Event* event) On 2016/02/05 at 04:04:49, ...
4 years, 10 months ago (2016-02-05 06:00:45 UTC) #12
JakeYoon
I change some logics for server-side image click location. 1) Change event parameter of appendServerMapMousePosition ...
4 years, 10 months ago (2016-02-05 07:28:34 UTC) #13
limasdf
Great. However, you still need a test.
4 years, 10 months ago (2016-02-09 04:36:11 UTC) #14
JakeYoon
Finally, I added test case for this issue. But I have some question, #1. I ...
4 years, 10 months ago (2016-02-21 12:35:23 UTC) #18
tkent
On 2016/02/21 at 12:35:23, yjaeseok wrote: > Finally, I added test case for this issue. ...
4 years, 10 months ago (2016-02-22 02:06:19 UTC) #19
JakeYoon
I updated test to remove margin of <body>. But, I do not add unit test ...
4 years, 9 months ago (2016-03-07 14:43:45 UTC) #20
tkent
On 2016/03/07 at 14:43:45, yjaeseok wrote: > I updated test to remove margin of <body>. ...
4 years, 9 months ago (2016-03-07 23:50:02 UTC) #21
JakeYoon
Hello, @tkent. I added unit test for HTMLAnchorElement. And I added static setupMenuData function like ...
4 years, 9 months ago (2016-03-13 14:32:35 UTC) #22
tkent
4 years, 9 months ago (2016-03-14 00:06:34 UTC) #23
On 2016/03/13 at 14:32:35, yjaeseok wrote:
> because I don't know how to make HitTestResult, Event params.

HitTestResult doesn't have normal |new|.  However you should be able to make it
on stack.

HitTestResult hitTestResult;
hitTestResult.setInnerNode(...);
ContextMenuImpl::setupContextMenuData(hitTestResult, ...)

MouseEvent has setTarget() and setAbsolutePosition().

The HTMLAnchorElement logic needs layoutObject of an element.  So you'll need
DummyPageHolder too.

https://codereview.chromium.org/1668553003/diff/100001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp (right):

https://codereview.chromium.org/1668553003/diff/100001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp:155: void
HTMLAnchorElement::appendServerMapMousePosition(StringBuilder& url, IntPoint&
clampedPoint)
IntPoint& -> const IntPoint&

https://codereview.chromium.org/1668553003/diff/100001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/html/HTMLAnchorElementTest.cpp (right):

https://codereview.chromium.org/1668553003/diff/100001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/html/HTMLAnchorElementTest.cpp:1: // Copyright
2014 The Chromium Authors. All rights reserved.
2014 -> 2016

Powered by Google App Engine
This is Rietveld 408576698