Closed Bug 1479486 Opened 6 years ago Closed 6 years ago

Can we remove the forward() and home() APIs on windows?

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Window.webidl has these three APIs:

  [Throws, ChromeOnly] void back();
  [Throws, ChromeOnly] void forward();
  [Throws, ChromeOnly, NeedsSubjectPrincipal] void home();

According to code coverage, back() is exercised, but forward() and home() are not.  Can we remove them?  Also, could we change the window.back() caller to doing window.history.back() if that's what it really wants to do?
Flags: needinfo?(dtownsend)
Depends on: 1479475
Yes, we can remove these and change any existing callers of window.back() to window.history.back().
Flags: needinfo?(dtownsend)
Well, back() is used, but only in tests, and those can use history.back().
Attachment #8996191 - Flags: review?(continuation)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8996191 [details] [diff] [review]
Remove some unused chromeonly history APIs on Window

Review of attachment 8996191 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsGlobalWindowOuter.cpp
@@ -4910,5 @@
> -#endif
> -    homeURL = NS_LITERAL_STRING(DEFAULT_HOME_PAGE);
> -  }
> -
> -#ifdef MOZ_PHOENIX

This is a weird ifdef. It is still used in one other place, and is win32 only.
Attachment #8996191 - Flags: review?(continuation) → review+
> This is a weird ifdef

Yes, yes, it is.  I filed bug 1479894 on nixing it.
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b75e262fac02
Remove some unused chromeonly history APIs on Window.  r=mccr8
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/81eb830da3e6
Remove some unused chromeonly history APIs on Window.  r=mccr8
https://hg.mozilla.org/mozilla-central/rev/81eb830da3e6
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Flags: needinfo?(bzbarsky)
(In reply to Eric Shepherd [:sheppy] from comment #9)
> Documentation updated:
> 
> https://developer.mozilla.org/en-US/docs/Web/API/Window/back
> https://developer.mozilla.org/en-US/docs/Web/API/Window/forward
> https://developer.mozilla.org/en-US/docs/Web/API/Window
> 
> Noted on Firefox 63 for developers.

Since these methods were [ChromeOnly], they were removed as a Web API far back (Firefox 31, according to bug 1012944).
I fixed the docs to say Firefox 31.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: