This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;
MozReview-Commit-ID: AzhtdwJwVNg
We were always opening the debugger when clicking on the location link,
which could be wrong since we can have CSS warnings, or logs coming from Scratchpad.
So we add the function to open in StyleEditor and Scratchpad, and copy some mochitests
that where testing the interaction with those links.
MozReview-Commit-ID: 73mQNfy199m
Sometimes (e.g. for window.applicationCache), Reps was shown with a negative number
before the "more..." label. This was due to displaying the children of safeGeterValues
property but not taking them into account for the total number of properties in the object
when displaying the "more..." label.
We fix this and add a test case to make sure we won't have this bug later
MozReview-Commit-ID: 1qBCvehV0Jc
Add a target property and show the event name (and modifiers if any) in the title.
Minor edit in GripRep to allow to pass a title as a prop.
Edit tests accordingly, and add some to test node highlighting.
MozReview-Commit-ID: JmMidejKS6m
On elementNodeRep, we have different outputs for tiny and short modes, and
short and long modes are the same.
Since the current long mode of textNodeRep aren't used anywhere, we can do the
same, i.e. have a really small representation for tiny mode, and then the same
rendering for short and long modes.
Modify tests to adapt them to the new rendering.
MozReview-Commit-ID: BRA7iADkn1C
Add in serviceContainer highlight and unhighlight utils function so they can
be accessible in components.
Fix EvaluationResult component to pass the serviceContainer to the MessageBody.
Modify ElementNodeRep and TextNodeRep to allow passing them function properties
`onDOMNodeMouseOver` and `onDOMNodeMouseOut` that will be called respectively
on mouseOver and mouseOut.
Add a mochitest in the webconsole to make sure we indeed highlight and unhighlight
node as expected, and add tests in Reps to make sure the passed functions get called
as expected.
MozReview-Commit-ID: 8o8WM7vBfMM
Handle the different kind of error objects.
Allow to pass a className to the objectLink component.
Add test to make sure we handle those objects as expected.
MozReview-Commit-ID: IC7ruV9odw1
Display a longString with what is available on the grip.
Straight from the server, a longString grip has a "initial"
property, which contains the first 10000 chars of the string.
The grip can also contains a "fullText" property that should
be set when the user want to display the full text of the string.
For example, in the DOM Panel, it would be when the user click on
the expand arrow.
The fullText needs to be computed with the result of the
LongStringClient.substring function, but it's not the responsability
of the Reps to do such thing.
In rep-utils, we extract the logic that replace non-printable
characters in its own function and export it, so we can use it outside
the cropString function.
Add some test to make sure LongString are displayed as expected in the
several modes.
MozReview-Commit-ID: 3P9fPBixm2v
In the GripRep, we were using the root property `ownPropertyLength` to
retrieve additionnal uninterresting props on the Grip. For Proxy
objects, we don't have this property, but a `preview.ownPropertiesLength`.
This adds a test case similar to the one for Proxy in browser_webconsole_output_05.js.
MozReview-Commit-ID: 652cfTlW7Sg
Handle object created from a constructor function, like `new Boolean(true)`,
`new Number(42)` or `new String("foo")`.
It displays the wrapped value using Rep so the primitives are displayed like
expected.
MozReview-Commit-ID: JrJVeV0C0wO
For CSS files which were used via both chrome:// and resource://, I converted
all usages to resource:// and removed the chrome:// copy to reduce file
duplication.
I believe most DevTools CSS could be using resource:// throughout, but that's
left as follow up work for now.
MozReview-Commit-ID: G7oxZqjodwv
Add reps and test for it.
Edit Number rep's `supportsObject` function because there was
an error for `-0` object, due to some change in the function which
detect which rep to use.
MozReview-Commit-ID: 8Dz40E7LBb0
Some object has properties in the safeGetterValues property, like ArrayBuffer
for example.
We now evaluate this property too when building the Rep. A function was created
to retrieve the property value since in safeGetterValues, the value is a wrapper
object with a getterValue property holding the actual value.
We add some tests to make sure we handle those grips as expected.
MozReview-Commit-ID: JqnTXnnAZpd
The problem is that we are checking the computed props against `object.ownPropertyLength` to see if there's more to show.
But, if an object has a non-enumerable property (like `prototype`), `ownPropertyLength` counts it,
but it does not appear `object.preview`.
To fix that, we do a simple check : if there is more item in the preview object than `max`, then we show the "more..." label.
Adds a test to ensure the problem is fixed.
In the same time, I did a little refactor on how we deal with the last object delimiter when we get the props, so we don't have
to go back to the last object and remove the comma.
MozReview-Commit-ID: 1drpuUOsLNI
Add a GripMap rep which handles both map and weakmap objects.
Make it possible to pass an object as the `name` property to PropRep,
in order to handle WeakMap keys.
Add a mochitest to make sure everything is displayed correctly.
MozReview-Commit-ID: ABBy2FT4rmE
If we happen to pass the current scope (`this`), the browser-loader codebase fails
when passing it as sandboxPrototype. It only works when passing an xray wrapper.
The document scope happen to not be an xray when using the addon, whereas `window`
always is no matter if we are using the addon or not.
MozReview-Commit-ID: GjYHkaCGBDd