Shapes highlighter handles cannot be clicked outside of an iframe

VERIFIED FIXED in Firefox 58

Status

defect
VERIFIED FIXED
2 years ago
Last year

People

(Reporter: mpark, Assigned: mpark)

Tracking

unspecified
Firefox 58
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

When the shapes highlighter is highlighting an element inside an iframe, it does not handle mouse events properly when the mouse is outside the iframe. This means that point handles that lie outside the iframe cannot be clicked or dragged.
Comment on attachment 8918420 [details]
Bug 1408468 - Shapes highlighter handles for shapes in iframe cannot be clicked outside iframe.

https://reviewboard.mozilla.org/r/189244/#review194958

Clearing review for unit test
Attachment #8918420 - Flags: review?(gl)
Comment on attachment 8918420 [details]
Bug 1408468 - Shapes highlighter handles for shapes in iframe cannot be clicked outside iframe.

https://reviewboard.mozilla.org/r/189244/#review194998

::: devtools/server/actors/highlighters/shapes.js:216
(Diff revision 2)
> +    // adjust pageX/pageY to be relative to the iframe rather than the parent.
> +    if (target.ownerDocument !== this.currentNode.ownerDocument) {
> +      let [xOffset, yOffset] = getFrameOffsets(target.ownerGlobal, this.currentNode);
> +      // xOffset/yOffset are relative to the viewport, so first find the top/left
> +      // edges of the viewport relative to the page.
> +      let viewportTop = pageY - event.clientY;

Swap the order of the lines for viewportTop and viewportLeft so it is consistent with the order of pageX and pageY.
Attachment #8918420 - Flags: review?(gl) → review+
Pushed by gabriel.luong@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3df6520e217f
Shapes highlighter handles for shapes in iframe cannot be clicked outside iframe. r=gl
Pushed by gabriel.luong@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d9ab5b748c99
Part 2: Fix eslint errors in shapes.js and doc_inspector_highlighter_csshapes_iframes.html. r=me CLOSED TREE
Backed out for failing shape highlighter related tests, e.g. xpcshell's devtools/server/tests/unit/test_shapes_highlighter_helpers.js:

https://hg.mozilla.org/integration/mozilla-inbound/rev/5fba46194dd2cf7d0b7aacfbc399176847c8b327
https://hg.mozilla.org/integration/mozilla-inbound/rev/d8ad697a9d3415b5a106e17df03dcd5c1eaf6403

Push which ran many failing tests: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=53e535e09300f296159e21e695b43ae31b11b25d&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception
Failure log xpcshell: https://treeherder.mozilla.org/logviewer.html#?job_id=137310202&repo=mozilla-inbound

[task 2017-10-16T22:25:09.767Z] 22:25:09     INFO -  TEST-START | devtools/server/tests/unit/test_shapes_highlighter_helpers.js
[task 2017-10-16T22:25:10.633Z] 22:25:10  WARNING -  TEST-UNEXPECTED-FAIL | devtools/server/tests/unit/test_shapes_highlighter_helpers.js | xpcshell return code: 0
[task 2017-10-16T22:25:10.634Z] 22:25:10     INFO -  TEST-INFO took 866ms
[task 2017-10-16T22:25:10.637Z] 22:25:10     INFO -  >>>>>>>
[task 2017-10-16T22:25:10.639Z] 22:25:10     INFO -  PID 5784 | [5784, Main Thread] WARNING: Couldn't get the user appdata directory. Crash events may not be produced.: file /builds/worker/workspace/build/src/toolkit/crashreporter/nsExceptionHandler.cpp, line 2872
[task 2017-10-16T22:25:10.639Z] 22:25:10     INFO -  PID 5784 | JavaScript strict warning: resource://devtools/shared/base-loader.js, line 92: ReferenceError: reference to undefined property "columnNumber"
[task 2017-10-16T22:25:10.640Z] 22:25:10     INFO -  SyntaxError: missing : after property id at resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/highlighters/shapes.js:23
[task 2017-10-16T22:25:10.640Z] 22:25:10     INFO -  @resource://devtools/server/actors/highlighters/shapes.js:23:undefined
[task 2017-10-16T22:25:10.640Z] 22:25:10     INFO -  requireHook@resource://devtools/shared/Loader.jsm:71:16
[task 2017-10-16T22:25:10.646Z] 22:25:10     INFO -  require@resource://devtools/shared/Loader.jsm:131:12
[task 2017-10-16T22:25:10.646Z] 22:25:10     INFO -  @/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/unit/test_shapes_highlighter_helpers.js:17:5
[task 2017-10-16T22:25:10.647Z] 22:25:10     INFO -  load_file@/builds/worker/workspace/build/tests/xpcshell/head.js:648:7
[task 2017-10-16T22:25:10.648Z] 22:25:10     INFO -  _load_files@/builds/worker/workspace/build/tests/xpcshell/head.js:660:3
[task 2017-10-16T22:25:10.648Z] 22:25:10     INFO -  _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:524:3
[task 2017-10-16T22:25:10.649Z] 22:25:10     INFO -  @-e:1:1
[task 2017-10-16T22:25:10.650Z] 22:25:10     INFO -  (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2017-10-16T22:25:10.651Z] 22:25:10     INFO -  ReferenceError: can't access lexical declaration `splitCoords' before initialization at /builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/unit/test_shapes_highlighter_helpers.js:41
[task 2017-10-16T22:25:10.653Z] 22:25:10     INFO -  test_split_coords@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/unit/test_shapes_highlighter_helpers.js:41:5
[task 2017-10-16T22:25:10.654Z] 22:25:10     INFO -  run_test@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/unit/test_shapes_highlighter_helpers.js:20:3
[task 2017-10-16T22:25:10.655Z] 22:25:10     INFO -  _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:538:7
[task 2017-10-16T22:25:10.656Z] 22:25:10     INFO -  @-e:1:1
Flags: needinfo?(mpark)
Pushed by gabriel.luong@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8c7e214c7a5c
Shapes highlighter handles for shapes in iframe cannot be clicked outside iframe. r=gl
https://hg.mozilla.org/mozilla-central/rev/8c7e214c7a5c
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/mozilla-central/rev/097044f71d4a
Shapes highlighter handles for shapes in iframe cannot be clicked outside iframe. Follow-up: Add new line at end to make eslint happy. r=eslint-fix a=eslint-fix
Flags: needinfo?(mpark)
Product: Firefox → DevTools
I have reproduced this issue using Firefox 58.0a1 (2017.10.13) on Windows 10 x64.
I can confirm this issue is fixed, I verified using Firefox 62.0b8 on Ubuntu 16.04 x64, Windows 10 x64 and Mac OS X 10.13.5.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.