"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(); }
oh wow
Is it possible to make a browsing context that is not a frame?
(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.
Could we rename iframe to ibrowsingcontext, too?
(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.
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.
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.
Yes, I would not be opposed to renaming to BrowsingContext. Maybe we should just get used to using the HTML spec terms.
(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.
> > 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.
We also have WKFrameInfo
(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.