Skip to content

Instantly share code, notes, and snippets.

@fenderstic
Created January 1, 2016 01:33
Show Gist options
  • Save fenderstic/e4f1a301361469b5c20d to your computer and use it in GitHub Desktop.
Save fenderstic/e4f1a301361469b5c20d to your computer and use it in GitHub Desktop.
Who owns(stores ?) my document in chromium ?

I was getting interest in looking for 'WHERE document() comes from?'.

'Chromium' is quite big and complicated open-source project, so even traversing source code for looking 'where it comes from' also hard. However, it was statred from HTMLMediaElement class(chromium/src/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp). And, finally real implementaion of document() belongs to a class TreeScope(third_party/WebKit/Source/core/dom/TreeScope.h).

The inheritance seems like below, shortly. HTMLMediaElement - HTMLElement - Element - ContainerNode - Node and, Node has TreeScope and it has 'Document& document() const'.

I hope, someone (including me) needs this quick information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment