As part of the dark mode migration we are adding
`enableLegacyPatching:true` to all call sites of `appendStyle` (and
related methods). If a user passes `false` for that flag, no CSS colour
patching will occur.
This CL is therefore a no-op from a user's perspective as we pass `true`
on every call to maintain existing behaviour, but once we start
migrating we will turn the option to `false`. Long term, once all code
is migrated and the old patching is removed, we will remove this flag
entirely once again.
Bug: 1122511
Change-Id: I76b818e83b7d5ee0175e1548759373f53481e0ab
No-Presubmit: True
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2516345
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
We should not be parsing our own JSON. Instead, we should be using
`JSON.parse`. However, `JSON.parse` is of course spec-compliant and
not "relaxed". Thus, it would fail on invalid JSON. But, we do show
invalid JSON as plain text. E.g., if you were to inspect an invalid
JSON response in the network tab and it is actually not valid JSON,
we don't show the fancy object-tree-view, but instead the raw content.
Given that having our own JSON parser is not ideal and we still
gracefully fall back to a usable JSON preview, we should remove the
RelaxedJSONParser.
After this change, we can handle valid JSON, valid JSONP and show a text
preview for invalid JSON(P).
R=aerotwist@chromium.org
Bug: 1098730
Change-Id: I3c0513518e36b29f35124b2810a119fd3828ff93
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2264560
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.
This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.
Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
This is a reland of 58040a832bb68a52529638518de36be17c65547f
The failing aXe tests were removed and will be added again after
invesigation
Original change's description:
> DevTools: Make Preview Pane Accessible
>
> The preview pane previously lacked keyboard controls for navigating
> through the JSON and XML views, the Font view unnecessarily read out the
> content of the view (the alphabet) when accessed via screen reader, and
> the Image view did not allow a screen reader user to access the size and
> mime type of the image.
>
> This patch fixes these issues by making the JSON and XML treeOutlines
> selectable so they can be accessed via keyboard and by displaying
> keyboard focus within the treeOutline. In the Font view, the element
> containing the sample text is marked so that a screen reader will not
> read the contents, but rather will read the source url of the font. In
> the Image view, a tab stop was moved from a parent element to the image
> itself and a label was added that reads the source url of the image.
>
> JSON view before: https://imgur.com/BWczsAL
> JSON view after, without keyboard focus: (same as before)
> JSON view after, with keyboard focus: https://imgur.com/gD0rNSB
>
> XML view before: https://imgur.com/Ec9b5kf
> XML view after, without focus: https://imgur.com/NEqUgpt
> XML view after, with focus: https://imgur.com/0csIpQ3
>
> Change-Id: Id8bacdc593a5b562069fddb70452902ebad934e0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1551384
> Commit-Queue: Amanda Baker <ambake@microsoft.com>
> Reviewed-by: Erik Luo <luoe@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#663263}
Change-Id: If544cc7a83d031c42cb538f6e89b9df9d3ec1dc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1633989
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Amanda Baker <ambake@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#666949}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ffc8de5717812a6e5803c9f005a4159a58ff0824
The preview pane previously lacked keyboard controls for navigating
through the JSON and XML views, the Font view unnecessarily read out the
content of the view (the alphabet) when accessed via screen reader, and
the Image view did not allow a screen reader user to access the size and
mime type of the image.
This patch fixes these issues by making the JSON and XML treeOutlines
selectable so they can be accessed via keyboard and by displaying
keyboard focus within the treeOutline. In the Font view, the element
containing the sample text is marked so that a screen reader will not
read the contents, but rather will read the source url of the font. In
the Image view, a tab stop was moved from a parent element to the image
itself and a label was added that reads the source url of the image.
JSON view before: https://imgur.com/BWczsAL
JSON view after, without keyboard focus: (same as before)
JSON view after, with keyboard focus: https://imgur.com/gD0rNSB
XML view before: https://imgur.com/Ec9b5kf
XML view after, without focus: https://imgur.com/NEqUgpt
XML view after, with focus: https://imgur.com/0csIpQ3
Change-Id: Id8bacdc593a5b562069fddb70452902ebad934e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1551384
Commit-Queue: Amanda Baker <ambake@microsoft.com>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#663263}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 58040a832bb68a52529638518de36be17c65547f
All ObjectPropertiesSections call 'hideOverflow()', to avoid overflow
in the OPS's title (to adress crbugs 571759,571767).
However, hideOverflow does not hide overflow due to children, which
causes horizontal scrolling in Console. This CL makes hide overflow
in properties for all OPS except JSONView.
Screenshot: https://imgur.com/a/x51xJNJ
Bug: none
Change-Id: Ie78f48cd873fd1d61b27c17e76683a4f7031aee8
Reviewed-on: https://chromium-review.googlesource.com/1162913
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#580726}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ae67481a95eded5fc4e09cb4befebc71a4443ef4