Closed Bug 1579474 Opened 5 years ago Closed 5 years ago

Remove unused entities from browser.dtd

Categories

(Firefox :: General, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 71
Tracking Status
firefox71 --- fixed

People

(Reporter: bgrins, Assigned: zbraniecki)

References

Details

Attachments

(1 file)

Blocks: 1579477
No longer blocks: 1501881

I compared the list of entities in browser.dtd with the list of entities used on the startup (milestone 2) to find ones that don't seem to be loaded at all on startup.

The script: https://gist.github.com/zbraniecki/422e08e23318ddf558de478c7cec8bc5#file-find_obsolete-py

The output:

mainWindow.titlemodifier
menubarCmd.label
menubarCmd.accesskey
pageSourceCmd.label
pageSourceCmd.accesskey
pageInfoCmd.label
pageInfoCmd.accesskey
mirrorTabCmd.label
mirrorTabCmd.accesskey
toggleReaderMode.win.keycode
fxa.menu.signedInAs.label
fxa.menu.manageAccount.label
exitDOMFullscreen.button
bookmarksMenu.label
bookmarksMenu.accesskey
backForwardButtonMenu.tooltip
printButton.tooltip
urlbar.permissionsGranted.tooltip
urlbar.flashPluginBlocked.tooltip
bookmarksGtkCmd.commandkey
bookmarksWinCmd.commandkey
downloadsUnix.commandkey
redoCmd.label
redoCmd.key
redoCmd.accesskey
deleteCmd.key
preferencesCmd2.label
showAllHistoryCmd.commandkey
urlbar.accesskey
searchFocus.commandkey2
searchFocusUnix.commandkey
contentSearchInput.label
searchWithDesc.label
changeSearchSettings.button
changeSearchSettings.tooltip
searchInNewTab.label
searchInNewTab.accesskey
searchSetAsDefault.label
searchSetAsDefault.accesskey
videoShowStats.label
videoShowStats.accesskey
videoHideStats.label
videoHideStats.accesskey
fullZoom.accesskey
quitApplicationCmdWin2.label
quitApplicationCmdWin2.accesskey
quitApplicationCmdWin2.tooltip
quitApplicationCmd.label
quitApplicationCmd.accesskey
editPopupSettings.label
identity.connectionSecure3
identity.connectionNotSecure2
identity.evOwnerLabel2
identity.permissions3
protections.showreport.label
protections.blocking2.label
protections.notBlocking2.label
protections.notFound.label
protections.socialMediaTrackers.label
protections.crossSiteTrackingCookies.label
protections.trackingContent.label
protections.fingerprinters.label
protections.cryptominers.label
protections.trackingContent2.description
syncToolbarButton.label
getUserMedia.audioCapture.label
contentBlocking.openBreakageReportView2.label
contentBlocking.breakageReportView.label
contentBlocking.breakageReportView.collection.comments.label
trackingProtection.unblock5.label
trackingProtection.unblock5.accesskey
trackingProtection.unblockPrivate5.label
trackingProtection.unblockPrivate5.accesskey
trackingProtection.block6.label
trackingProtection.block6.accesskey
trackingProtection.reload2.label
trackingProtection.reload2.accesskey
pluginNotification.showAll.label
pluginNotification.showAll.accesskey
pluginNotification.width
homepageControlled.message

Not all of them are actually unused - some are being some ifdef, or on different platform. But that's a good starting list to find the ones we can safely remove.

Summary: pinTab.accesskey and unpinTab.accesskey entities seem to be unreferenced and could be removed → Remove unused entities from browser.dtd
Assignee: nobody → gandalf
Status: NEW → ASSIGNED

I filtered out the entities that are referenced anywhere. Here is the list of strings not referenced anywhere at all:

pageSourceCmd.label
pageSourceCmd.accesskey
pageInfoCmd.label
pageInfoCmd.accesskey
mirrorTabCmd.label
mirrorTabCmd.accesskey
fxa.menu.signedInAs.label
fxa.menu.manageAccount.label
bookmarksMenu.label
bookmarksMenu.accesskey
urlbar.flashPluginBlocked.tooltip
deleteCmd.key
contentSearchInput.label
videoShowStats.label
videoShowStats.accesskey
videoHideStats.label
videoHideStats.accesskey
fullZoom.accesskey
protections.socialMediaTrackers.label
protections.crossSiteTrackingCookies.label
protections.trackingContent.label
protections.fingerprinters.label
protections.cryptominers.label
syncToolbarButton.label
getUserMedia.audioCapture.label
contentBlocking.openBreakageReportView2.label
contentBlocking.breakageReportView.label
contentBlocking.breakageReportView.collection.comments.label
trackingProtection.unblock5.label
trackingProtection.unblock5.accesskey
trackingProtection.unblockPrivate5.label
trackingProtection.unblockPrivate5.accesskey
trackingProtection.block6.label
trackingProtection.block6.accesskey
trackingProtection.reload2.label
trackingProtection.reload2.accesskey
pluginNotification.showAll.label
pluginNotification.showAll.accesskey
pluginNotification.width
homepageControlled.message

In bug 1555225 you added the protections.* strings but they're not referenced anywhere. Is it ok for us to remove them?

Flags: needinfo?(nhnt11)

(In reply to Zibi Braniecki [:zbraniecki][:gandalf] from comment #3)

In bug 1555225 you added the protections.* strings but they're not referenced anywhere. Is it ok for us to remove them?

No problem, please go ahead, in fact we have bug 1572532 that is about cleaning up the protections panel strings.

Flags: needinfo?(nhnt11)

Is it possible to convert the script you used into a test? Maybe it should run only in Beta? I feel like we might have already considered this before and that there are good reasons not to test this in CI (pre-landing strings, etc) but wanted to voice the idea.

Pushed by zbraniecki@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a4eda2e0bd01
Remove unused DTD entities from browser.dtd. r=bgrins

Is it possible to convert the script you used into a test?

Not trivially. There's a human factor involved in edge cases, so a test would have to report potential unused strings for a human to review. I'm not sure how to do that.

See Also: → 1572532
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: