This adds a new highlighter in devtools/server/actors/highlighters.
For now this highlighter isn't used and can only display grid lines
as provided by node.getGridFragments().
Pages defining CSP response headers used to be a problem for the eyedropper.
Indeed, the eyedropper would take a screenshot of the window with
canvas.drawWindow and then load the resulting data as an Image. But in order
to access the Image() constructor, it would use the content window:
new window.Image(), and that wasn't possible with CSP headers.
With this change, the eyedropper creates an ImageBitmap with
window.createImageBitmap() and that doesn't cause CSP errors, and still works
fine because ImageBitmap are consumable by the eyedropper.
This change also adds a new test to prevent this bug from coming back.
MozReview-Commit-ID: 7f3HCXJtTiv
This adds a few new CSS selectors that are used to move the label to the
top and/or left/right of the eyedropper canvas.
The CSS rules use transform and a quick transition.
The eyedropper highlighter then just makes use of this by adding top, left,
right attributes to the DOM depending on its position.
This also adds a test for this, and while testing, I discovered a bug in
shared/layout/utils.js that I fixed here too. Sometimes, the node passed is
actually a DOCUMENT_NODE and so we must account for this in a couple of places
in this file to avoid JS errors.
MozReview-Commit-ID: H969k3mEDJE
MozReview-Commit-ID: 9qOCYVp4mld
Watch for browser swap events and update the message manager as necessary for
each of the actors that use the `setupInParent` multiprocess functionality.
MozReview-Commit-ID: HPibSONSYk4
It is now possible keep the toolbox open while toggling RDM open and closed.
The toolbox will follow the frame as it moves and update the message manager it
uses internally with each move.
MozReview-Commit-ID: DvLzCmOXfnb
Even though the pseudo :-moz-native-anonymous is only available for chrome content, elements
such as INPUT tags were impacted by the reset styles defined with the selector ":-moz-native-anonymous"
The selector has to be specialized in order to make sure it only impacts devtools elements.
MozReview-Commit-ID: HeHx9i6RJiq
--HG--
extra : rebase_source : e341a991c7583b855c66cdf2700b9ee9ed4c64a6
In ThreadActor._getAllEventListeners, we construct a list of handler functions
for each target in the event target chain of a given event target. If a handler
is an event handler object, we obtain the handler function from its handleEvent
property. Otherwise, the handler function is assumed to be the handler itself.
To detect whether a handler is an event handler object, we would check its class
name property. This approach is fragile for several reasons: if the handler is
a proxy, accessing its class name may cause the debuggee to run. Moreover,
since accessing a proxy's class name requires us to enter the compartment of the
proxy's handler, if the latter is a security wrapper, accessing its class name
will cause security warnings in debug mode.
Since a handler is either an event handler object or a function, it should be
safe to assume that a handler is an event handler object if and only if it is
not callable. Checking whether a proxy is callable cannot cause the debuggee to
run. Moreover, it does not require us to enter the compartment of the proxy's
handler, thus avoiding the security warnings we mentioned earlier.