Commit Graph
71 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez ff179a858e Bug 1596800 - Remove document.getBindingParent usage from devtools. r=jdescottes
This removes the concept of shadowAnonymous, which doesn't make a lot of sense,
and re-enables the shadow dom tests which were disabled when we removed the old
style system (as stylo didn't supported shadow DOM yet by then).

This is a change in behavior as you can now remove nodes from shadow DOM (no
reason you weren't able to, before).

Differential Revision: https://phabricator.services.mozilla.com/D53340
2019-11-18 20:54:10 +00:00
Gabriel Luong b73aff6dd9 Bug 1587789 - Remove isXBLAnonymous functions defined and used in the inspector. r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D50517
2019-10-24 21:05:44 +00:00
Razvan Caliman 3001fe3f31 Bug 1572651 - (Part 3) Add option for highlighters to get node position without scroll offsets. r=pbro
Depends on D47092

Given that the highlighter rendering surface is sized to the viewport of the inspected page (as opposed to the whole document), we need a way to ignore scroll offsets when getting data about the node position so the highlighter doesn't get drawn off-screen.

Differential Revision: https://phabricator.services.mozilla.com/D47094
2019-10-10 21:51:43 +00:00
Daniel Varga 6d6e829c75 Backed out 3 changesets (bug 1572651) for devtools failure at devtools/client/inspector/test/browser_inspector_highlighter-by-type.js. On a CLOSED TREE
Backed out changeset 71db1896c459 (bug 1572651)
Backed out changeset fb5863ee4d37 (bug 1572651)
Backed out changeset 5ef33867cacb (bug 1572651)
2019-10-10 18:51:17 +03:00
Razvan Caliman e21a9a1676 Bug 1572651 - (Part 3) Add option for highlighters to get node position without scroll offsets. r=pbro
Depends on D47092

Given that the highlighter rendering surface is sized to the viewport of the inspected page (as opposed to the whole document), we need a way to ignore scroll offsets when getting data about the node position so the highlighter doesn't get drawn off-screen.

Differential Revision: https://phabricator.services.mozilla.com/D47094
2019-10-10 14:15:03 +00:00
Patrick Brosset 23017b8864 Bug 1574401 - Multi-target node-picker in the browser toolbox r=rcaliman,gl,ochameau
The original plan for the node-picker to work with multiple targets was introduced in D41598 (in bug 1568825). The idea was that, because we can have multiple independent inspectable targets, and because the client is the one doing the orchestration between them, to let the client start the node picker in all targets at once.
At the time of this first change, the code was create with this in mind, but there was really just one target (the top-level one).

So, this revision introduces the real code for this. First of all, I removed the now obsolete `getAllInspectorFronts` in `node-picker.js` because we now have a similar function on the inspector front directly.

Then the main code changes to look for are on the actor side, in the `HighlighterActor`. This is where the picking actually happens.
You have to remember that several targets will be picking at the same time, and therefore several `HighlighterActor` instances will be in pick mode at the same time.
The way they allow users to pick is by listening to mouse events (mousemove and clicks essentially).
Because these actors can't see or talk to each other, one can't tell the others that the mouse is now over its content and the other pickers should pause somewhat.

So, when one of them sees that the mouse event is happening on a remote frame, then it bails out and lets events through without handling them. This is so that the embedded document (which also has a picker running) can get a chance to receive the mouse events too.

The other aspect is that each `HighlighterActor`, when picking, does its own highlighting. So if there are 3 remote frames, then there really are 3 highlighters.
So the trick is to make sure only one of them ever appears at any given time. Again, these actors can't talk to each other directly, so the client is responsible for doing this when receiving events that a node was hovered.

This is not perfect, but should normally get far better when the new fission-compatible highlighter is in place. Indeed, when that happens, we won't have to care about this anymore, there will be only one `HighlighterRenderer` for the entire tab. So even if there are multiple `HighlighterActor` instances picking, they will all be sending events to the same renderer.

The only exception is in the browser toolbox where you can inspect both the browser UI and the content UI. In this case, there will be 2 renderers: one over the entire browser window, and one over the <browser> area. So we'll still have to do the dance of hiding one when the other is shown.

Differential Revision: https://phabricator.services.mozilla.com/D42640
2019-10-08 13:47:18 +00:00
Julian Descottes 2e0e8cfcc7 Bug 1583444 - Stop using win.top in devtools/shared/layout/utils.js r=pbro
Depends on D46957

We are updating three call sites that were still relying on window.top to get the topmost window.

For `getFrameOffsets` and `getRect`, they are currently only called with a non-null `boundaryWindow` argument.
That's why this didn't trigger any regression.

For `getFrameElement`, I could only find STRs that don't have any user impact.
For instance, when the BrowserToolbox debugs a page where you open DevTools, this will load the toolbox in an iframe.
This load will trigger `onFrameLoad` in the walker actor. And because we were using `win.top`, getFrameElement would return null, and onFrameLoad will not emit mutations.
But I couldn't see any scenario where this had an actual impact for users.

Differential Revision: https://phabricator.services.mozilla.com/D46958
2019-09-30 09:53:15 +00:00
Brad Werth d2a197b2f5 Bug 1567310 Part 3: Make all devtools callers of getBoxQuads include option to suppress whitespace frames. r=gl
Differential Revision: https://phabricator.services.mozilla.com/D45120
2019-09-12 19:05:52 +00:00
Victor Porof 435f7b056d Bug 1561435 - Format remaining devtools/, a=automatic-formatting, CLOSED TREE
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35894
2019-07-05 11:29:32 +02:00
Patrick Brosset 74f4a4add4 Bug 1559257 - Removing getSameTypeRootTreeItemIgnoreBrowserBoundaries and getSameTypeParentIgnoreBrowserBoundaries usage; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D34940
2019-06-18 15:59:29 +00:00
Brian Hackett b92f8a68f7 Bug 1497393 Part 7 - Server side changes for inspector support while replaying, r=pbro.
Differential Revision: https://phabricator.services.mozilla.com/D22863
2019-03-09 16:45:50 -10:00
Ian Moody 1d50d55bb8 Bug 1539265 - Add a few optimisations for ::marker pseudos. r=jdescottes
Where there is existing for ::before and ::after.

Differential Revision: https://phabricator.services.mozilla.com/D25107
2019-04-02 07:45:53 +00:00
Ian Moody 43a3bc171c Bug 1539265 - Add isMarkerPseudoElement function to layout/utils.js. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D25105
2019-04-02 07:45:38 +00:00
arthur.iakab 215148fa05 Backed out 11 changesets (bug 1539265) for causing debugger failures CLOSED TREE
Backed out changeset 8206b880f9ec (bug 1539265)
Backed out changeset be9f5f73bdfe (bug 1539265)
Backed out changeset f78146b8aa17 (bug 1539265)
Backed out changeset 18fa7e971a0d (bug 1539265)
Backed out changeset 6eaf5bdd945c (bug 1539265)
Backed out changeset 3add7d4d4853 (bug 1539265)
Backed out changeset 8015aeb5279d (bug 1539265)
Backed out changeset 19c8e404ac5f (bug 1539265)
Backed out changeset 637a9d6af0f3 (bug 1539265)
Backed out changeset 72bbb4b28932 (bug 1539265)
Backed out changeset 931e98129878 (bug 1539265)
2019-04-02 02:44:43 +03:00
Ian Moody 581674cc19 Bug 1539265 - Add a few optimisations for ::marker pseudos. r=jdescottes
Where there is existing for ::before and ::after.

Differential Revision: https://phabricator.services.mozilla.com/D25107
2019-04-01 21:45:44 +00:00
Ian Moody ad58f26914 Bug 1539265 - Add isMarkerPseudoElement function to layout/utils.js. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D25105
2019-04-01 21:45:33 +00:00
Michael Ratcliffe 259577378d Bug 1523335 - Make use of parentFlexElement in Flexbox inspector r=pbro
This gives a very noticable increase in speed. When Brad finishes https://bugzil.la/1523336 we can stop walking the DOM and simply use `parentFlexElement` and `parentGridElement`.

#### Try

https://treeherder.mozilla.org/#/jobs?repo=try&revision=47d38f2c7dca6ca764862c8b00921644a974a975&group_state=expanded

Differential Revision: https://phabricator.services.mozilla.com/D18674
2019-02-06 17:35:20 +00:00
Cosmin Sabou ded266fd70 Backed out changeset 8a5155bd8809 (bug 1523335) for devtools failures on browser_rules_gridline-names-autocomplete. CLOSED TREE 2019-02-05 20:45:03 +02:00
Michael Ratcliffe 7eadf249ca Bug 1523335 - Make use of parentFlexElement in Flexbox inspector r=pbro
This gives a very noticable increase in speed. When Brad finishes https://bugzil.la/1523336 we can stop walking the DOM and simply use `parentFlexElement` and `parentGridElement`.

Differential Revision: https://phabricator.services.mozilla.com/D18674
2019-02-05 16:53:22 +00:00
Michael Ratcliffe 8cab598fc4 Bug 1521026 - Flex highlighter shouldn't scroll for position:fixed elements r=gl
This fixes the issue but because of our virtual canvas implementation and the
fact that reflow events are batched there is quite a bit of flicker and some
drag (see attached video).

Unfortunately, until bug 1509071 is implemented (full screen canvas using
`position:fixed`) we can't really do anything about the flicker... I suppose we
could stop batching reflow events but that would make all of our highlighters
unusably slow.

Differential Revision: https://phabricator.services.mozilla.com/D16988
2019-01-21 16:49:24 +00:00
Michael Ratcliffe fbdb660a6b Bug 1504743 - Combine the box-model highlighter and the flexbox highlighter when highlighting flex containers/items r=gl
Differential Revision: https://phabricator.services.mozilla.com/D12046
2019-01-17 17:42:04 +00:00
Julian Descottes 115ad8c90d Bug 1483663 - Support element picker for UA widgets with NAC;r=ladybenko
Depends on D14700

Differential Revision: https://phabricator.services.mozilla.com/D14701
2018-12-19 21:40:41 +00:00
Andreea Pavel b91e4c3a21 Backed out 2 changesets (bug 1483663) for failing dt at devtools/client/inspector/markup/test/browser_markup_shadowdom_ua_widgets_with_nac.js on a CLOSED TREE
Backed out changeset 6e9f11aeac28 (bug 1483663)
Backed out changeset 2ffa90b738a1 (bug 1483663)
2018-12-19 23:24:33 +02:00
Julian Descottes 4839a64c59 Bug 1483663 - Support element picker for UA widgets with NAC;r=ladybenko
Depends on D14700

Differential Revision: https://phabricator.services.mozilla.com/D14701
2018-12-19 20:12:02 +00:00
Michael Ratcliffe 5b30e0d380 Bug 1499630 - Text nodes that are flex items aren't highlighted correctly in the flexbox highlighter when they wrap r=gl
Depends on D11654 and D12307

Differential Revision: https://phabricator.services.mozilla.com/D12313
2018-11-21 14:20:30 +00:00
Michael Ratcliffe b8554c5c0f Bug 1505578 - Flexbox highlighter is offset when container contains padding r=gl
Differential Revision: https://phabricator.services.mozilla.com/D11654
2018-11-21 17:04:35 +00:00
Mark Banner 3d6aaad3f5 Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D8389
2018-10-19 12:55:39 +00:00
Michael Ratcliffe 07d88d54d2 Bug 1478481 - Flexbox highlighter overlay is wrong size, in page with full-page-zoom applied r=gl
- Added AutoRefreshHighlighter flag to AutoRefreshHighlighter. This ensures that getQuads() ignores the zoom factor.

Differential Revision: https://phabricator.services.mozilla.com/D7599
2018-10-10 23:59:45 +00:00
Boris Zbarsky c3b43a0bda Bug 1446940 part 3. Stop getting docshells from windows via getInterface in devtools. r=bgrins 2018-08-01 13:07:10 -04:00
Boris Zbarsky 3af9dccacb Bug 1476145 part 4. Stop using getInterface(nsIDOMWindowUtils) in devtools. r=bgrins 2018-07-24 19:47:41 -04:00
Julian Descottes 8f21c42a4a Bug 1441535 - Remove unnecessary shadowdom check in isXBLAnonymous;r=bgrins
doc.getAnonymousNodes no longer returns shadow dom nodes, so no need
to filter them out in isXBLAnonymous.

This feature is tested in browser_markup_anonymous_02.js so reenabling
this test.

toolbarbutton has 4 children now, but since our tests are no longer
running in non-e10s, the regression was missed!

MozReview-Commit-ID: BHYb5ufyQjg
2018-07-24 15:56:35 +02:00
Belén Albeza eec05e72ba Bug 1473901 - show shadow root mode. r=bgrins
MozReview-Commit-ID: Axt9W0uX4FB
2018-07-11 14:53:51 +02:00
Julian Descottes 1953d4c5ab Bug 1465873 - part3: Move generic node utils from Node actor to layout/utils helper;r=bgrins
MozReview-Commit-ID: ASB5m4Eyrck
2018-06-28 11:22:12 +02:00
Julian Descottes d92b7e96c4 Bug 1449333 - Display closed shadow roots in the inspector;r=bgrins
MozReview-Commit-ID: GIA5A4kOYFX
2018-06-15 15:35:28 -07:00
Blake Kaplan bd5cecf60f Bug 1186265 - Move devtools over to getBounds(). r=pbro
This leaves getAdjustedQuads alone because it lives in its own world and its
result gets sent over IPC. That leaves things in a bit of an intermediate
state, but that should be OK for now.

MozReview-Commit-ID: DH6eGqCFhPr
2018-06-04 16:41:43 -07:00
Julian Descottes 82711b9a8f Bug 1454696 - Run eslint --fix for prefer-const;r=yulia
MozReview-Commit-ID: F6xUXCgdRE4
2018-06-01 12:36:09 +02:00
Boris Zbarsky 8a166e6246 Bug 1455676 part 17. Stop using nsIDOMNode in devtools/. r=jdescottes 2018-05-29 22:58:50 -04:00
Kris Maglione b3990a2d91 Bug 1456686: Part 1 - Fix unused and shadowed explicit imports. r=standard8
These issues were previously ignored due to the nature of our global import
rules. They need to be fixed before that rule can be updated.

MozReview-Commit-ID: DCChktTc5TW
2018-04-24 20:18:09 -07:00
Patrick Brosset 4f6f554ca0 Bug 1351081 - Always retrieve quads relatively to the top window, correctly; r=gl
Use the getBoxQuads's relativeTo option to avoid having to calculate the offset
due to frames.

Also reduce the precision of numbers used when checking if the highlighter is
correctly displayed.

Finally, for some strange reasons, this patch seems to cause a totally unrelated
events mutation event to be sent during the test. This polutes the mutations
received and made the test fail. So I filtered the list of mutations to only
preserve the ones we care about here.
I could not reproduce this extra mutation when running Firefox. Only during the
test. So I did not investigate further.

MozReview-Commit-ID: 1ZQ6FGULjHG
2018-03-30 11:24:45 +02:00
Julian Descottes 250b4cd667 Bug 1434543 - removed unused getElementFromPoint from devtools layout/utils;r=ochameau
MozReview-Commit-ID: FHy6Dv5Q5l3
2018-01-31 13:12:10 +01:00
Kyle Machulis 90bec39eec Bug 1405792 - Remove nsIDOMHTMLIFrameElement r=bz
MozReview-Commit-ID: 1u9C66X8j59
2017-10-04 20:41:24 -07:00
Kyle Machulis ec8a7dce22 Bug 1404079 - Remove nsIDOMHTMLFrameElement; r=bz
MozReview-Commit-ID: GSvMwRpl7g4
2017-09-28 19:06:14 -07:00
Wes Kocher 7fcb6ce623 Backed out changeset 0d8711590ab0 (bug 1351081) for mac dt bustage in browser_inspector_highlighter-iframes_01.js a=backout
MozReview-Commit-ID: DLEjbTPrAD9
2017-09-26 11:39:58 -07:00
ZER0 faa559b7bd Bug 1351081 - added relativeTo to getBoxQuads; r=pbro
Now the quads are always relative to the boundary window.
I also reduce a bit the maths to check if the quads are different.

MozReview-Commit-ID: 93zXH0Um3Ck
2017-09-22 10:36:13 +02:00
Wes Kocher 178756c885 Backed out changeset 2a69de9c73c6 (bug 1351081) for dt failures in browser_inspector_highlighter-cssshape_03.js a=backout
MozReview-Commit-ID: FYdGE6c4LLh
2017-08-31 11:23:52 -07:00
ZER0 905f44cb5c Bug 1351081 - added relativeTo to getBoxQuads, improved scrolling with fixed nodes; r=pbro
Now the quads are always relative to the boundary window; I also forced the
update during the scrolling for the box-model, since for element with position
fixed this is still needed.
I also reduce a bit the maths to check if the quads are different.

MozReview-Commit-ID: 93zXH0Um3Ck
2017-08-29 14:45:15 +02:00
Matteo Ferretti 0c8cdab39b Bug 1297072 - added support for matrices to handle CSS 2D transformation on grid inspector; r=pbro
- Fixed a bug on `getNodeBounds` that would makes the calculation wrong in case
  of nested frames.
- Centralized all the transformation in `updateCurrentMatrix` function,
  including the scaling due the zoom and display's pixel ratio, and the
  translation to the top left corner of the node inspected.
- Added the transformation from the inspected node to the `currentMatrix`.
- Added `drawLine` and `drawRect` functions, that takes a matrix as argument.
- Position the line's number to the grid itself even when we've infinite lines
  (it's not a regression, it is intended since if a grid is transformed, we
  could have weird results otherwise, so we decided to uniform the behaviors).

MozReview-Commit-ID: 7OUfb6u63Qj
2017-05-03 19:19:19 +02:00
Matteo Ferretti 199353dcee Bug 1359028 - added encodeURIComponent and fixed css class typo; r=pbro
The patch of bug 1353005 removed by mistake a leading dot in a css class, and
the `encodeURIComponent` calls (so the # in the color definition was considered
the hash part in the url).
Also, it appears autoland rejected the last commit from Bug 1353005, so this
patch includes those changes as well.

MozReview-Commit-ID: 2aVW3hYHhSr
2017-04-25 16:35:08 +02:00
Matteo Ferretti e36bf2991f Bug 1353005 - removed sdk/content/mod and replaced with DOMWindowUtils calls; r=pbro pbro
MozReview-Commit-ID: 7aj8C0zYr6C
2017-04-10 21:47:39 +02:00
Matteo Ferretti c75591f4c5 Bug 1345434 - Implementation of a virtual canvas technique for grid highlighter; r=pbro
A virtual canvas is basically a canvas that seems bigger than is actually is.
The technique consists in moving a fixed sized canvas during the scrolling, when
is needed, to give the illusion that it always covers the entire document.

MozReview-Commit-ID: Hp4cUZaBdm8
2017-04-04 15:11:04 +02:00