Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: Source/core/dom/ProcessingInstruction.cpp

Issue 126443005: Use TreeScope::completeURL and baseURL instead of the Document versions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased again, passes tests Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/VisitedLinkState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // We need to make a synthetic XSLStyleSheet that is embedded. It n eeds to be able 114 // We need to make a synthetic XSLStyleSheet that is embedded. It n eeds to be able
115 // to kick off import/include loads that can hang off some parent sh eet. 115 // to kick off import/include loads that can hang off some parent sh eet.
116 if (m_isXSL) { 116 if (m_isXSL) {
117 KURL finalURL(ParsedURLString, m_localHref); 117 KURL finalURL(ParsedURLString, m_localHref);
118 m_sheet = XSLStyleSheet::createEmbedded(this, finalURL); 118 m_sheet = XSLStyleSheet::createEmbedded(this, finalURL);
119 m_loading = false; 119 m_loading = false;
120 } 120 }
121 } else { 121 } else {
122 clearResource(); 122 clearResource();
123 123
124 String url = document().completeURL(href).string(); 124 String url = treeScope().completeURL(href).string();
125 if (!dispatchBeforeLoadEvent(url)) 125 if (!dispatchBeforeLoadEvent(url))
126 return; 126 return;
127 127
128 ResourcePtr<StyleSheetResource> resource; 128 ResourcePtr<StyleSheetResource> resource;
129 FetchRequest request(ResourceRequest(document().completeURL(href)), FetchInitiatorTypeNames::processinginstruction); 129 FetchRequest request(ResourceRequest(treeScope().completeURL(href)), FetchInitiatorTypeNames::processinginstruction);
130 if (m_isXSL) { 130 if (m_isXSL) {
131 resource = document().fetcher()->fetchXSLStyleSheet(request); 131 resource = document().fetcher()->fetchXSLStyleSheet(request);
132 } else { 132 } else {
133 String charset = attrs.get("charset"); 133 String charset = attrs.get("charset");
134 if (charset.isEmpty()) 134 if (charset.isEmpty())
135 charset = document().charset(); 135 charset = document().charset();
136 request.setCharset(charset); 136 request.setCharset(charset);
137 resource = document().fetcher()->fetchCSSStyleSheet(request); 137 resource = document().fetcher()->fetchCSSStyleSheet(request);
138 } 138 }
139 139
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 m_sheet->clearOwnerNode(); 246 m_sheet->clearOwnerNode();
247 m_sheet = 0; 247 m_sheet = 0;
248 } 248 }
249 249
250 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. 250 // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
251 if (document().isActive()) 251 if (document().isActive())
252 document().removedStyleSheet(removedSheet.get()); 252 document().removedStyleSheet(removedSheet.get());
253 } 253 }
254 254
255 } // namespace 255 } // namespace
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/VisitedLinkState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698