Bug 189824 - Rename Frame to BrowsingContext
Summary: Rename Frame to BrowsingContext
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: https://html.spec.whatwg.org/#windows
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-21 03:16 PDT by Antti Koivisto
Modified: 2018-09-25 11:56 PDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2018-09-21 03:16:23 PDT
"Frame" is a confusing name for a non-visual object. "Browsing context" is an HTML spec term that matches well what the Frame class actually represents. We literally have this code in Document:

    bool hasBrowsingContext() const { return !!frame(); }
Comment 1 zalan 2018-09-21 06:22:58 PDT
oh wow
Comment 2 Geoffrey Garen 2018-09-24 14:21:32 PDT
Is it possible to make a browsing context that is not a frame?
Comment 3 Chris Dumez 2018-09-24 14:25:58 PDT
(In reply to Geoffrey Garen from comment #2)
> Is it possible to make a browsing context that is not a frame?

AFAIK, Frame in WebKit and "Browsing Context" in the HTML spec are synonymous.

Calling it "Browsing Context" would align us nicely with the HTML spec and make it easier to implement spec text. However, I personally feel that a "Frame" is a clearer concept than a "Browsing Context". If I were not familiar with the HTML spec, I would have no idea what a browsing context is. However, it is pretty obvious what a Frame is.
Comment 4 Alex Christensen 2018-09-24 14:26:59 PDT
Could we rename iframe to ibrowsingcontext, too?
Comment 5 Chris Dumez 2018-09-24 14:28:16 PDT
(In reply to Alex Christensen from comment #4)
> Could we rename iframe to ibrowsingcontext, too?

I *think* this is a joke but iframe is already named HTMLIFrameElement, as per the HTML specification.
Comment 6 Chris Dumez 2018-09-24 14:30:33 PDT
I personally kind of like the current situation where it is named Frame but there is a hasBrowsingContext() utility function that helps us match the HTML spec text.

Also note that in the future, we plan to have a Remote / Local version of Frame for out-of-process iframes.
Comment 7 Ryosuke Niwa 2018-09-24 15:27:27 PDT
I'm conflicted about this too. I *think* browsing context is a common enough spec jargon which appears frequently enough that anyone seriously working on a browser engine needs to be familiar with.

However, I agree with Chris that the idea of a frame is a lot simpler to understand than the abstract concept of a browsing context.

Maybe we can call it BrowsingContextFrame / FrameBrowsingContext?

Another alternative is to add a comment saying a frame is a browsing context. But overall, having to be aware of two different terms to mean the same thing is worse than either calling it a browsing context or a frame. So I'd vote for renaming Frame to BrowsingContext if any.
Comment 8 Chris Dumez 2018-09-24 15:30:16 PDT
Yes, I would not be opposed to renaming to BrowsingContext. Maybe we should just get used to using the HTML spec terms.
Comment 9 Antti Koivisto 2018-09-25 03:54:58 PDT
(In reply to Alex Christensen from comment #4)
> Could we rename iframe to ibrowsingcontext, too?

I think this confusion points out why this might be a good idea.
Comment 10 Alex Christensen 2018-09-25 11:35:39 PDT
> > Could we rename iframe to ibrowsingcontext, too?
> I think this confusion points out why this might be a good idea.
This was indeed a joke.  It was showing that "frame" is also used in the html spec to refer to a browsing context as a point to oppose this change.
Comment 11 Alex Christensen 2018-09-25 11:36:21 PDT
We also have WKFrameInfo
Comment 12 Ryosuke Niwa 2018-09-25 11:56:46 PDT
(In reply to Alex Christensen from comment #10)
> > > Could we rename iframe to ibrowsingcontext, too?
> > I think this confusion points out why this might be a good idea.
> This was indeed a joke.  It was showing that "frame" is also used in the
> html spec to refer to a browsing context as a point to oppose this change.

You mean a frame element? WebCore::Frame definitely does not represent a frame element though.

The word "frame" is usually used to prefer to a frame of a screen / video in the HTML spec. e.g. https://html.spec.whatwg.org/#poster-frame

It's true that some specs colloquially refer to a browsing context as a "frame" but that's more of a legacy, and the state-of-art term going forward in the spec land is really browsing context.

(In reply to Alex Christensen from comment #11)
> We also have WKFrameInfo

Yeah, and WKFrame and what not.

Again, it's hard to tell which names would be better but since we don't have the power to change the terminology in the spec, we're probably better off alining ourselves to the spec rather than keep using a different name.