Make the BoxModelHighlighter compatible with Fission
Categories
(DevTools :: Inspector, task, P1)
Tracking
(Fission Milestone:M6c, firefox82 fixed)
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: rcaliman, Assigned: rcaliman)
References
(Blocks 1 open bug)
Details
(Whiteboard: dt-fission-m2-mvp)
Attachments
(9 files, 2 obsolete files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Depends on D81528
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D81528
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D81525
Introduced a centralized way in HighlightersOverlay
to invoke highlighters by type, automatically managing previously active highlighters.
First some context.
HighlightersOverlay
is a bit of a misnomer. It already does a few things:
- provides methods to manually invoke some highlighters (Flex/Grid/Shapes/BoxModel)
- provides a way to delegate mouse events from Rules view / Computed view / Markup and invoke highlighters based on the event's target node
- manages state of Flex/Grid highlighters to be able to restore them on page refresh
- exposes the node that is highlighted by a particular highlighter
- misc handlers for events that require hiding highlighters by type (ex mutation events)
The changes in this patch add the core functionality which will automatically manage the visibility of highlighters regardless of their node's host frame:
this._activeHighlighters
is a Map which maps a highlighter type to the currently visible highlighter instance and its correspondingNodeFront
showHighlighterTypeForNode(type, nodeFront, options)
invokes a highlighter type for a givenNodeFront
while toggling off any existing highlighter for that type. For situations where multiple highlighters of the same type can be visible at the same time (ex: Grid), this is where we could manage their visibility.hideHighlighterType(type)
hides all highlighters of a given type; can be followed-up with a more specifichideHighlighterTypeForNode()
when neededgetNodeForActiveHighlighter(type)
returns theNodeFront
currently highlighted by a highlighter type. This is an abstracted replacement forflexboxHighlighterShown
,geometryEditorHighlighterShown
, etc.
Accommodation for tests
To mitigate the fact that many tests and some consumers expect exact event names to be fired, like "box-model-highlighter-shown", instead of generic shown/hidden events with the highlighter type property as event data, we introduce a temporary map, HIGHLIGHTER_EVENTS
, from which we pick the event to fire according to the highlighter type. As we progress in refactoring, the intent is for this map to slowly go away.
Intent for refactoring
The intent is for all client-side consumers to invoke highlighters via these methods. For example:
this.inspector.highlighters.showHighlighterTypeForNode(
"BoxModelHighlighter",
nodeFront
)
See another example of this in the migration of FlexboxHighligther
in D79694.
Future plans
In the medium-term, it's likely we'll move this part of HighligthersOverlay
from inspector to toolbox and rename it HighlightersManager
. This way, other consumers, like Debugger and Console can also use it instead of the existing approach. Haven't attempted this yet. Pending updates to the Flexbox, Grid, Shapes and CSS Transform highlighters so when we migrate paths from inspector.highlighters
to ⭐️ toolbox.highlighters
is done in one go for all tests and consumers.
Assignee | ||
Comment 4•4 years ago
|
||
Depends on D81526
This patch updates tests pertaining only to node picker behavior. Run one-by-one, they're all expected to pass.
However, running the whole Inspector test suite at this point in the commit series will fail some other tests because:
- we're updating shared test helpers here without also updating the other tests;
- there is inter-dependence in the other tests between node picker and markup view which is being migrated to the new highlighters approach in D81530
The rest of the tests are getting updated in D81529 (blocked on D81530).
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D81528
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D85858
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D85859
Assignee | ||
Comment 8•4 years ago
|
||
Depends on D85860
Assignee | ||
Comment 9•4 years ago
|
||
Depends on D85861
Assignee | ||
Comment 10•4 years ago
|
||
Depends on D85862
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 11•4 years ago
|
||
Depends on D85863
Follow-up for code review https://phabricator.services.mozilla.com/D81526#inline-471516
Renaming existing events emitted on behalf of CssTransformHighlighter
to avoid conflict and confusion with the generic show/hide highlighter events introduced in HighlightersOverlay. When migrating the CssTransformHighlighter to the Fission-ready highlighters approach, these event names will go away completely.
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b8d122ab6cca
https://hg.mozilla.org/mozilla-central/rev/41f041e761d2
https://hg.mozilla.org/mozilla-central/rev/1a827ef694de
https://hg.mozilla.org/mozilla-central/rev/6faaa43b8581
https://hg.mozilla.org/mozilla-central/rev/ea3f6fd17ccf
https://hg.mozilla.org/mozilla-central/rev/f244dea69b4b
https://hg.mozilla.org/mozilla-central/rev/42e5958e33dd
https://hg.mozilla.org/mozilla-central/rev/75a8335648a8
https://hg.mozilla.org/mozilla-central/rev/19e4fcbb39f6
Description
•