mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWebView: Sort vendor-prefixed properties last in the inspector
Previously, the legacy `-webkit-foo` properties would all be top of the list, when they are generally not useful to inspect. Instead, put them at the bottom, so that users can still see them if they want to, but they're not in the way.
This commit is contained in:
parent
963cf1c2c4
commit
113b4da1df
Notes:
github-actions[bot]
2024-08-02 12:52:47 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/113b4da1df7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/931 Reviewed-by: https://github.com/trflynn89
1 changed files with 14 additions and 1 deletions
|
@ -204,7 +204,20 @@ inspector.createPropertyTables = (computedStyle, resolvedStyle, customProperties
|
|||
newTable.setAttribute("id", tableID);
|
||||
|
||||
Object.keys(properties)
|
||||
.sort()
|
||||
.sort((a, b) => {
|
||||
let baseResult = a.localeCompare(b);
|
||||
// Manually move vendor-prefixed items after non-prefixed ones.
|
||||
if (a[0] === "-") {
|
||||
if (b[0] === "-") {
|
||||
return baseResult;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (b[0] === "-") {
|
||||
return -1;
|
||||
}
|
||||
return baseResult;
|
||||
})
|
||||
.forEach(name => {
|
||||
let row = newTable.insertRow();
|
||||
|
||||
|
|
Loading…
Reference in a new issue