Changeset 275559 in webkit
- Timestamp:
- Apr 6, 2021 3:09:25 PM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r275558 r275559 1 2021-04-06 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Grid overlay track size labels should show implicit `auto` value and no computed size 4 https://bugs.webkit.org/show_bug.cgi?id=224199 5 6 Reviewed by BJ Burg. 7 8 Previously, implicit `auto` track sizes were only shown if there were some number of explicit track sizes for 9 that track direction (rows/columns). To resolve this, `authoredGridTrackSizes` now only returns explicit 10 authored track sizes, and buildGridOverlay then infers `auto` for all remaining tracks. This will also help 11 resolve bug 224200 by providing a way to distinguish explicit and implicit tracks. 12 13 After discussion, this patch also removes the computed size of tracks from labels, as that information is 14 available in the box model diagram for children elements and having that information in these labels further 15 cramped often limited space for overlay labels. 16 17 * inspector/InspectorOverlay.cpp: 18 (WebCore::authoredGridTrackSizes): 19 (WebCore::InspectorOverlay::buildGridOverlay): 20 1 21 2021-04-06 Patrick Angle <pangle@apple.com> 2 22 -
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
r275558 r275559 1552 1552 handleValueIgnoringLineNames(currentValue); 1553 1553 } 1554 1555 // Remaining tracks will be `auto`.1556 while (trackSizes.size() < expectedTrackCount)1557 trackSizes.append("auto"_s);1558 1554 1559 1555 return trackSizes; … … 1787 1783 1788 1784 if (gridOverlay.config.showTrackSizes) { 1789 auto trackSizeLabel = String::number(roundf(width)); 1790 trackSizeLabel.append("px"_s); 1791 1792 String authoredTrackSize; 1793 if (i < authoredTrackColumnSizes.size()) { 1794 auto authoredTrackSize = authoredTrackColumnSizes[i]; 1795 if (authoredTrackSize.length() && authoredTrackSize != trackSizeLabel) { 1796 trackSizeLabel.append(thinSpace); 1797 trackSizeLabel.append(bullet); 1798 trackSizeLabel.append(thinSpace); 1799 trackSizeLabel.append(authoredTrackSize); 1800 } 1801 } 1802 1785 auto authoredTrackSize = i < authoredTrackColumnSizes.size() ? authoredTrackColumnSizes[i] : "auto"_s; 1803 1786 FloatLine trackTopLine = { columnStartLine.start(), columnEndLine.start() }; 1804 gridHighlightOverlay.labels.append(buildLabel( trackSizeLabel, trackTopLine.pointAtRelativeDistance(0.5), translucentLabelBackgroundColor, correctedArrowDirection(LabelArrowDirection::Up, GridTrackSizingDirection::ForColumns), LabelArrowEdgePosition::Middle));1787 gridHighlightOverlay.labels.append(buildLabel(authoredTrackSize, trackTopLine.pointAtRelativeDistance(0.5), translucentLabelBackgroundColor, correctedArrowDirection(LabelArrowDirection::Up, GridTrackSizingDirection::ForColumns), LabelArrowEdgePosition::Middle)); 1805 1788 } 1806 1789 } else … … 1884 1867 1885 1868 if (gridOverlay.config.showTrackSizes) { 1886 auto trackSizeLabel = String::number(roundf(height)); 1887 trackSizeLabel.append("px"_s); 1888 1889 String authoredTrackSize; 1890 if (i < authoredTrackRowSizes.size()) { 1891 auto authoredTrackSize = authoredTrackRowSizes[i]; 1892 if (authoredTrackSize.length() && authoredTrackSize != trackSizeLabel) { 1893 trackSizeLabel.append(thinSpace); 1894 trackSizeLabel.append(bullet); 1895 trackSizeLabel.append(thinSpace); 1896 trackSizeLabel.append(authoredTrackSize); 1897 } 1898 } 1899 1869 auto authoredTrackSize = i < authoredTrackRowSizes.size() ? authoredTrackRowSizes[i] : "auto"_s; 1900 1870 FloatLine trackLeftLine = { rowStartLine.start(), rowEndLine.start() }; 1901 gridHighlightOverlay.labels.append(buildLabel( trackSizeLabel, trackLeftLine.pointAtRelativeDistance(0.5), translucentLabelBackgroundColor, correctedArrowDirection(LabelArrowDirection::Left, GridTrackSizingDirection::ForRows), LabelArrowEdgePosition::Middle));1871 gridHighlightOverlay.labels.append(buildLabel(authoredTrackSize, trackLeftLine.pointAtRelativeDistance(0.5), translucentLabelBackgroundColor, correctedArrowDirection(LabelArrowDirection::Left, GridTrackSizingDirection::ForRows), LabelArrowEdgePosition::Middle)); 1902 1872 } 1903 1873 } else
Note: See TracChangeset
for help on using the changeset viewer.