Changeset 147291 in webkit
- Timestamp:
- Mar 31, 2013 4:27:34 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147281 r147291 1 2013-03-31 Rafael Weinstein <rafaelw@chromium.org> 2 3 HTMLLinkElement should resolve resource URLs when resources will be fetched 4 https://bugs.webkit.org/show_bug.cgi?id=113630 5 6 Reviewed by Eric Seidel. 7 8 * fast/dom/HTMLLinkElement/resolve-url-on-insertion-expected.txt: Added. 9 * fast/dom/HTMLLinkElement/resolve-url-on-insertion.html: Added. 10 * fast/dom/HTMLLinkElement/resources/stylesheet2.css: Added. 11 (#test2): 12 1 13 2013-03-30 Tom Sepez <tsepez@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r147287 r147291 1 2013-03-31 Rafael Weinstein <rafaelw@chromium.org> 2 3 HTMLLinkElement should resolve resource URLs when resources will be fetched 4 https://bugs.webkit.org/show_bug.cgi?id=113630 5 6 HTMLLinkElement was resolving its URL when the href attribute was processed and caching it without ever 7 invalidating the cached URL. This patch removes the cached URL and adds getURL() which resolve the 8 URL dynamically. 9 10 Reviewed by Eric Seidel. 11 12 Test: fast/dom/HTMLLinkElement/resolve-url-on-insertion.html 13 14 * html/HTMLLinkElement.cpp: 15 (WebCore::HTMLLinkElement::getURL): 16 (WebCore): 17 (WebCore::HTMLLinkElement::parseAttribute): 18 (WebCore::HTMLLinkElement::shouldLoadLink): 19 (WebCore::HTMLLinkElement::process): 20 * html/HTMLLinkElement.h: 21 (HTMLLinkElement): 22 1 23 2013-03-31 Brady Eidson <beidson@apple.com> 2 24 -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r147205 r147291 138 138 process(); 139 139 } else if (name == hrefAttr) { 140 String url = stripLeadingAndTrailingHTMLSpaces(value);141 m_url = url.isEmpty() ? KURL() : document()->completeURL(url);142 140 process(); 143 141 } else if (name == typeAttr) { … … 164 162 { 165 163 RefPtr<Document> originalDocument = document(); 166 if (!dispatchBeforeLoadEvent( m_url))164 if (!dispatchBeforeLoadEvent(getNonEmptyURLAttribute(hrefAttr))) 167 165 return false; 168 166 // A beforeload handler might have removed us from the document or changed the document. … … 180 178 181 179 String type = m_type.lower(); 182 183 if (!m_linkLoader.loadLink(m_relAttribute, type, m_sizes->toString(), m_url, document())) 180 KURL url = getNonEmptyURLAttribute(hrefAttr); 181 182 if (!m_linkLoader.loadLink(m_relAttribute, type, m_sizes->toString(), url, document())) 184 183 return; 185 184 … … 187 186 188 187 if (m_disabledState != Disabled && (m_relAttribute.m_isStyleSheet || (acceptIfTypeContainsTextCSS && type.contains("text/css"))) 189 && document()->frame() && m_url.isValid()) {188 && document()->frame() && url.isValid()) { 190 189 191 190 String charset = getAttribute(charsetAttr); … … 219 218 // Load stylesheets that are not needed for the rendering immediately with low priority. 220 219 ResourceLoadPriority priority = blocking ? ResourceLoadPriorityUnresolved : ResourceLoadPriorityVeryLow; 221 CachedResourceRequest request(ResourceRequest(document()->completeURL( m_url)), charset, priority);220 CachedResourceRequest request(ResourceRequest(document()->completeURL(url)), charset, priority); 222 221 request.setInitiator(this); 223 222 m_cachedSheet = document()->cachedResourceLoader()->requestCSSStyleSheet(request); -
trunk/Source/WebCore/html/HTMLLinkElement.h
r137045 r147291 137 137 }; 138 138 139 KURL m_url;140 139 String m_type; 141 140 String m_media;
Note: See TracChangeset
for help on using the changeset viewer.