Before rendering a web page webkit loads the page and all of its subresources from the network. webkit uses libsoup library for network request. The loading of web page is a complex task and webkit uses two loading pipelines one for loading documents into frames and another for loading the subresources (such as images and scripts).

Terminology in webkit page loading:

main resource: html source

sub resource: image files, css files, js files etc..

The diagram below summarizes the major objects involved in the two pipelines: ( taken from https://www.webkit.org/blog/1188/how-webkit-loads-a-web-page/).

how webkit loads a web page

how webkit loads a web page

Loading Frames and FrameLaoder class.

Frameloader class is responsible for loading document into frame. it loads HTML source. Following is the call flow ..

WebCore::FrameLoader::load (this=0x81b6cc4, request=…, substituteData=…, lockHistory=false)
at Source/WebCore/loader/FrameLoader.cpp:1290
RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request, substituteData);

Policy Check
void PolicyChecker::checkNavigationPolicy(const ResourceRequest& request, DocumentLoader* loader,  PassRefPtr<FormState> formState, NavigationPolicyDecisionFunction function, void* argument)
void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& navigationAction, const ResourceRequest& request, PassRefPtr<FormState> formState)

After this

WebCore::MainResourceLoader::continueAfterContentPolicy ( this=0x81ce2f0, contentPolicy=WebCore::PolicyUse, r=…)

After this below execution happens:

Resource Load

WebCore::HTMLDocumentParser::pumpTokenizer (this=0x8239558,
mode=WebCore::HTMLDocumentParser::AllowYield)
at Source/WebCore/html/parser/HTMLDocumentParser.cpp:245
245        PumpSession session(m_pumpSessionNestingLevel);
(gdb) c
Continuing.

Loading Subresources call flow:

Breakpoint 5, WebCore::SubresourceLoader::create (frame=0x81b6c78, resource=
0x81d7060, request=…, options=…)
at Source/WebCore/loader/SubresourceLoader.cpp:90
90        FrameLoader* frameLoader = frame->loader();
(gdb) bt
#0  WebCore::SubresourceLoader::create (frame=0x81b6c78, resource=0x81d7060,
request=…, options=…)
at Source/WebCore/loader/SubresourceLoader.cpp:90
#1  0xb38c7873 in WebCore::ResourceLoadScheduler::scheduleSubresourceLoad (
this=0x8298d70, frame=0x81b6c78, resource=0x81d7060, request=…,
priority=WebCore::ResourceLoadPriorityHigh, options=…)
at Source/WebCore/loader/ResourceLoadScheduler.cpp:94
#2  0xb38584b4 in WebCore::CachedResource::load (this=0x81d7060,
cachedResourceLoader=0x81cffd0, options=…)
at Source/WebCore/loader/cache/CachedResource.cpp:228
#3  0xb386483e in WebCore::CachedResourceLoader::requestResource (
this=0x81cffd0, type=WebCore::CachedResource::CSSStyleSheet, request=…,
charset=…, options=…,
priority=WebCore::ResourceLoadPriorityUnresolved, forPreload=false,
defer=WebCore::CachedResourceLoader::NoDefer)
at Source/WebCore/loader/cache/CachedResourceLoader.cpp:448
#4  0xb3863aea in WebCore::CachedResourceLoader::requestCSSStyleSheet (
this=0x81cffd0, request=…, charset=…,
priority=WebCore::ResourceLoadPriorityUnresolved)
at Source/WebCore/loader/cache/CachedResourceLoader.cpp:188
#5  0xb36a35c1 in WebCore::HTMLLinkElement::process (this=0x81d7c60)
—Type <return> to continue, or q <return> to quit—
at Source/WebCore/html/HTMLLinkElement.cpp:224
#6  0xb36a388a in WebCore::HTMLLinkElement::insertedInto (this=0x81d7c60,
insertionPoint=0x8174228) at Source/WebCore/html/HTMLLinkElement.cpp:260

#7  0xb345413b in WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument (this=0xbfffeca0, node=0x81d7c60)
at Source/WebCore/dom/ContainerNodeAlgorithms.h:196
#8  0xb3459b3a in WebCore::ChildNodeInsertionNotifier::notify (
this=0xbfffeca0, node=0x81d7c60)
at Source/WebCore/dom/ContainerNodeAlgorithms.h:231
#9  0xb3457a47 in WebCore::ContainerNode::parserAppendChild (this=0x8174228,
newChild=…) at Source/WebCore/dom/ContainerNode.cpp:618
#10 0xb36edec4 in WebCore::executeTask (task=…)
at Source/WebCore/html/parser/HTMLConstructionSite.cpp:83
#11 0xb36ee172 in WebCore::HTMLConstructionSite::executeQueuedTasks (
this=0x823a6e4) at Source/WebCore/html/parser/HTMLConstructionSite.cpp:129
#12 0xb370f994 in WebCore::HTMLTreeBuilder::constructTreeFromAtomicToken (
this=0x823a6d0, token=0x81d86b0)
at Source/WebCore/html/parser/HTMLTreeBuilder.cpp:399
#13 0xb370f7c1 in WebCore::HTMLTreeBuilder::constructTreeFromToken (
this=0x823a6d0, rawToken=…)
at Source/WebCore/html/parser/HTMLTreeBuilder.cpp:370
—Type <return> to continue, or q <return> to quit—
#14 0xb36f35c2 in WebCore::HTMLDocumentParser::pumpTokenizer (this=0x8239558,
mode=WebCore::HTMLDocumentParser::AllowYield)
at Source/WebCore/html/parser/HTMLDocumentParser.cpp:269
#15 0xb36f3036 in WebCore::HTMLDocumentParser::pumpTokenizerIfPossible (
this=0x8239558, mode=WebCore::HTMLDocumentParser::AllowYield)
at Source/WebCore/html/parser/HTMLDocumentParser.cpp:173
#16 0xb36f3b5e in WebCore::HTMLDocumentParser::append (this=0x8239558,
source=…) at Source/WebCore/html/parser/HTMLDocumentParser.cpp:361
#17 0xb345efa0 in WebCore::DecodedDataDocumentParser::appendBytes (
this=0x8239558, writer=0x8170e5c,
data=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512) at Source/WebCore/dom/DecodedDataDocumentParser.cpp:50
#18 0xb3880608 in WebCore::DocumentWriter::addData (this=0x8170e5c,
bytes=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512) at Source/WebCore/loader/DocumentWriter.cpp:221
#19 0xb3873907 in WebCore::DocumentLoader::commitData (this=0x8170df0,
bytes=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”—Type <return> to continue, or q <return> to quit—
Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512) at Source/WebCore/loader/DocumentLoader.cpp:359
#20 0xb313c897 in WebKit::WebFrameLoaderClient::committedLoad (
this=0x81b672c, loader=0x8170df0,
data=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512)
at Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:867
#21 0xb3873663 in WebCore::DocumentLoader::commitLoad (this=0x8170df0,
data=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512) at Source/WebCore/loader/DocumentLoader.cpp:324
#22 0xb3873bc2 in WebCore::DocumentLoader::receivedData (this=0x8170df0,
data=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512) at Source/WebCore/loader/DocumentLoader.cpp:395
#23 0xb38b938a in WebCore::MainResourceLoader::addData (this=0x81ce2f0,
—Type <return> to continue, or q <return> to quit—
data=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512, allAtOnce=false)
at Source/WebCore/loader/MainResourceLoader.cpp:192
#24 0xb38c5387 in WebCore::ResourceLoader::didReceiveData (this=0x81ce2f0,
data=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512, encodedDataLength=512, allAtOnce=false)
at Source/WebCore/loader/ResourceLoader.cpp:277
#25 0xb38ba756 in WebCore::MainResourceLoader::didReceiveData (
this=0x81ce2f0,
data=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512, encodedDataLength=512, allAtOnce=false)
at Source/WebCore/loader/MainResourceLoader.cpp:479
#26 0xb38c5c37 in WebCore::ResourceLoader::didReceiveData (this=0x81ce2f0,
data=0x8293250 “<!DOCTYPE html>\n<html>\n\n<head>\n    <meta http-equiv=\”Content-Type\” content=\”text/html; charset=UTF-8\”>\n    <title>The WebKitGTK+ —Type <return> to continue, or q <return> to quit—
Project</title>\n    <link rel=\”stylesheet\” type=\”text/css\” media=\”all\” “…, length=512, encodedDataLength=512)
at Source/WebCore/loader/ResourceLoader.cpp:435
#27 0xb3a73ac3 in WebCore::readCallback (asyncResult=0x8063100,
data=0x81b27e0)
at Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:985
#28 0xb12cabb1 in async_ready_callback_wrapper (source_object=0x8080590,
res=0x8063100, user_data=0x81b27e0) at ginputstream.c:530
#29 0xb12f1337 in g_task_return_now (task=task@entry=0x8063100)
at gtask.c:1105
#30 0xb12f1371 in complete_in_idle_cb (task=task@entry=0x8063100)
at gtask.c:1114
#31 0xb0e04bf0 in g_idle_dispatch (source=source@entry=0xada0a0c8,
callback=0xb12f1350 <complete_in_idle_cb>, user_data=0x8063100)
at gmain.c:5205
#32 0xb0e080a3 in g_main_dispatch (context=0x806d090) at gmain.c:3054
#33 g_main_context_dispatch (context=context@entry=0x806d090) at gmain.c:3630
#34 0xb0e08440 in g_main_context_iterate (context=0x806d090,
block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at gmain.c:3701
#35 0xb0e0891b in g_main_loop_run (loop=0x81358d8) at gmain.c:3895
—Type <return> to continue, or q <return> to quit—
#36 0xb4478763 in WebCore::RunLoop::run ()
at Source/WebCore/platform/gtk/RunLoopGtk.cpp:59
#37 0xb30bc164 in WebKit::WebProcessMainGtk (argc=2, argv=0xbffff3f4)
at Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp:86
#38 0x08048697 in main (argc=2, argv=0xbffff3f4)
at Source/WebKit2/gtk/MainGtk.cpp:31

Reference:https://www.webkit.org/blog/1188/how-webkit-loads-a-web-page/