Changeset 275558 in webkit


Ignore:
Timestamp:
Apr 6, 2021 3:09:10 PM (3 years ago)
Author:
Patrick Angle
Message:

Web Inspector: Grid overlay line numbers should not include implicit tracks in negative line number calculations.
https://bugs.webkit.org/show_bug.cgi?id=224200

Reviewed by BJ Burg.

Use the authoredTrackColumnSizes/authoredTrackRowSizes to determine if the line is an explicit grid line or
implicit grid line (starting with the patch for bug 224199 those vectors will only contain the explicit lines).
Only explicit lines should have a negative number for addressing the line, and those numbers should start with
the last explicit line. Because each track is bounded by two lines, there will always be one more explicit line
than there is explicit track, including the case where there are no explicit tracks, which will still have a
single explicit line numbered -1.

Additionally, line numbers are now separated by an em-space to improve legibility, where previously the bullet
looked like a multiplication symbol between two numbers.

  • inspector/InspectorOverlay.cpp:

(WebCore::InspectorOverlay::buildGridOverlay):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275557 r275558  
     12021-04-06  Patrick Angle  <pangle@apple.com>
     2
     3        Web Inspector: Grid overlay line numbers should not include implicit tracks in negative line number calculations.
     4        https://bugs.webkit.org/show_bug.cgi?id=224200
     5
     6        Reviewed by BJ Burg.
     7
     8        Use the `authoredTrackColumnSizes`/`authoredTrackRowSizes` to determine if the line is an explicit grid line or
     9        implicit grid line (starting with the patch for bug 224199 those vectors will only contain the explicit lines).
     10        Only explicit lines should have a negative number for addressing the line, and those numbers should start with
     11        the last explicit line. Because each track is bounded by two lines, there will always be one more explicit line
     12        than there is explicit track, including the case where there are no explicit tracks, which will still have a
     13        single explicit line numbered `-1`.
     14
     15        Additionally, line numbers are now separated by an em-space to improve legibility, where previously the bullet
     16        looked like a multiplication symbol between two numbers.
     17
     18        * inspector/InspectorOverlay.cpp:
     19        (WebCore::InspectorOverlay::buildGridOverlay):
     20
    1212021-04-06  Mike Gorse  <mgorse@suse.com>
    222
  • trunk/Source/WebCore/inspector/InspectorOverlay.cpp

    r275529 r275558  
    9393static constexpr UChar multiplicationSign = 0x00D7;
    9494static constexpr UChar thinSpace = 0x2009;
     95static constexpr UChar emSpace = 0x2003;
    9596
    9697static void truncateWithEllipsis(String& string, size_t length)
     
    18071808
    18081809        StringBuilder lineLabel;
    1809         if (gridOverlay.config.showLineNumbers)
    1810             lineLabel.append(i + 1, thinSpace, bullet, thinSpace, -static_cast<int>(columnPositions.size() - i));
     1810        if (gridOverlay.config.showLineNumbers) {
     1811            lineLabel.append(i + 1);
     1812            if (i <= authoredTrackColumnSizes.size())
     1813                lineLabel.append(emSpace, -static_cast<int>(authoredTrackColumnSizes.size() - i + 1));
     1814        }
    18111815        if (gridOverlay.config.showLineNames && columnLineNames.contains(i)) {
    18121816            for (auto lineName : columnLineNames.get(i)) {
     
    19011905
    19021906        StringBuilder lineLabel;
    1903         if (gridOverlay.config.showLineNumbers)
    1904             lineLabel.append(i + 1, thinSpace, bullet, thinSpace, -static_cast<int>(rowPositions.size() - i));
     1907        if (gridOverlay.config.showLineNumbers) {
     1908            lineLabel.append(i + 1);
     1909            if (i <= authoredTrackRowSizes.size())
     1910                lineLabel.append(emSpace, -static_cast<int>(authoredTrackRowSizes.size() - i + 1));
     1911        }
    19051912        if (gridOverlay.config.showLineNames && rowLineNames.contains(i)) {
    19061913            for (auto lineName : rowLineNames.get(i)) {
Note: See TracChangeset for help on using the changeset viewer.