Open Bug 1513400 Opened 7 years ago Updated 10 months ago

Create target check convenience methods in nsDocShellLoadState

Categories

(Core :: DOM: Navigation, enhancement, P3)

enhancement

Tracking

()

REOPENED

People

(Reporter: qdot, Unassigned)

References

Details

From this comment by :nika on https://phabricator.services.mozilla.com/D13488: > I wonder if LoadState should have a TargetIs(...) method or similar, because I imagine we'll be doing these checks a good amount. > > Perhaps even adding "IsTargetBlank()", "IsTargetParent()", "IsTargetTop()", "IsTargetSelf()"? > > It might also be good to have a "HasTarget()" method to get rid of some of the empty() checks. *shrug*. And > Hmm, I wonder if there should be a ClearTarget() method rather than setting target to the empty string...
Assignee: kyle → nobody

nsDocShell has been changed a lot (and replaced by BrowsingContext at a number of places) to make it Fission compatible via other bugs. So, closing all of this bug list as WFM.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME

This particular code is still same as when it was reviewed:

https://searchfox.org/mozilla-central/rev/fa11d06fd84c487cb0a135c08af796daa6a56e44/docshell/base/nsDocShell.cpp#8229-8231

aLoadState->Target().LowerCaseEqualsLiteral("_self") ||
aLoadState->Target().LowerCaseEqualsLiteral("_parent") ||
aLoadState->Target().LowerCaseEqualsLiteral("_top")) {

https://phabricator.services.mozilla.com/D13488?id=41317#inline-76100

Might still be worth tracking.

Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
You need to log in before you can comment on or make changes to this bug.