Status: In Progress
Priority: P2: Important
Affects Version/s: 5.9.4
Fix Version/s: None
DNS prefetching can be disabled (and is disabled by default, actually) when using Qt WebKit . However, when a web page explicitely enables DNS prefetching by using a header (X-DNS-Prefetch-Control: on) or a HTML meta http-equiv tag (<meta http-equiv="x-dns-prefetch-control" content="on">), DNS prefetching is enabled anyway, ignoring the settings in QWebSettings (this behavior is inherited from upstream). The following snippet of code shows what is happening (Source/WebCore/dom/Document.cpp):
On line 4734, when initializing DNS prefetching, the settings regarding DNS prefetching are taken into account. However, when a website enables DNS prefetching with a header or a HTML meta http-equiv tag, the settings are ignored and DNS prefetching is enabled anyway (line 4746).
To me, that is somewhat unexpected since I instructed QWebSettings to disable DNS prefetching.
Here is a patch that would solve the problem (the patch is written such that the diff with upstream stays small; I can take a different approach if desired):
Would you accept a patch like this? If so, against which git branch should I submit a gerrit review?
I doubt upstream will take such a patch, as the code seems to be written like this intentionally and furthermore, the behavior is actually described in the documentation .
Thanks to Jens Mueller for contacting Trojita about this issue .