Prevent HTMLPreloadScanner from fetching resources inside <template>
https://bugs.webkit.org/show_bug.cgi?id=106687

Reviewed by Adam Barth.

Source/WebCore:

This patch adds a simple counter to the preload scanner which increments on template start
tag and decrements on template element. It only fetchs resources when the counter is at zero
(i.e. for elements not contained by a template element).

Test re-enabled within fast/dom/HTMLTemplateElement/inertContents.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::HTMLPreloadScanner::HTMLPreloadScanner):
(WebCore::HTMLPreloadScanner::processToken):
* html/parser/HTMLPreloadScanner.h:
(HTMLPreloadScanner):

LayoutTests:

* fast/dom/HTMLTemplateElement/inertContents-expected.txt:
* fast/dom/HTMLTemplateElement/inertContents.html:


git-svn-id: svn://svn.chromium.org/blink/trunk@139502 bbb929c8-8fbe-4397-9dbb-9b2b20218538
 void HTMLPreloadScanner::updatePredictedBaseElementURL(const KURL& baseElementURL)
{
    if (!m_predictedBaseElementURL.isEmpty())
        return;
    m_predictedBaseElementURL = baseElementURL;
}

 void HTMLPreloadScanner::updatePredictedBaseElementURL(const KURL& baseElementURL)
{
    if (!m_predictedBaseElementURL.isEmpty())
        return;
    m_predictedBaseElementURL = baseElementURL;
}
