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

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

Issue 2079303002: Move preferred stylesheet set out of active sheet update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 198 }
199 199
200 DCHECK(m_isCSS); 200 DCHECK(m_isCSS);
201 CSSParserContext parserContext(document(), 0, baseURL, charset); 201 CSSParserContext parserContext(document(), 0, baseURL, charset);
202 202
203 StyleSheetContents* newSheet = StyleSheetContents::create(href, parserContex t); 203 StyleSheetContents* newSheet = StyleSheetContents::create(href, parserContex t);
204 204
205 CSSStyleSheet* cssSheet = CSSStyleSheet::create(newSheet, this); 205 CSSStyleSheet* cssSheet = CSSStyleSheet::create(newSheet, this);
206 cssSheet->setDisabled(m_alternate); 206 cssSheet->setDisabled(m_alternate);
207 cssSheet->setTitle(m_title); 207 cssSheet->setTitle(m_title);
208 if (!m_alternate && !m_title.isEmpty())
209 document().styleEngine().setPreferredStylesheetSetNameIfNotSet(m_title);
208 cssSheet->setMediaQueries(MediaQuerySet::create(m_media)); 210 cssSheet->setMediaQueries(MediaQuerySet::create(m_media));
209 211
210 m_sheet = cssSheet; 212 m_sheet = cssSheet;
211 213
212 // We don't need the cross-origin security check here because we are 214 // We don't need the cross-origin security check here because we are
213 // getting the sheet text in "strict" mode. This enforces a valid CSS MIME 215 // getting the sheet text in "strict" mode. This enforces a valid CSS MIME
214 // type. 216 // type.
215 parseStyleSheet(sheet->sheetText()); 217 parseStyleSheet(sheet->sheetText());
216 } 218 }
217 219
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 296
295 DEFINE_TRACE(ProcessingInstruction) 297 DEFINE_TRACE(ProcessingInstruction)
296 { 298 {
297 visitor->trace(m_sheet); 299 visitor->trace(m_sheet);
298 visitor->trace(m_listenerForXSLT); 300 visitor->trace(m_listenerForXSLT);
299 CharacterData::trace(visitor); 301 CharacterData::trace(visitor);
300 ResourceOwner<StyleSheetResource>::trace(visitor); 302 ResourceOwner<StyleSheetResource>::trace(visitor);
301 } 303 }
302 304
303 } // namespace blink 305 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698