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

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

Issue 2552353003: Setting preferred stylesheet simplified. (Closed)
Patch Set: Rebased. Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngine.h » ('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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 DCHECK(m_isCSS); 197 DCHECK(m_isCSS);
198 CSSParserContext parserContext(document(), nullptr, baseURL, charset); 198 CSSParserContext parserContext(document(), nullptr, baseURL, charset);
199 199
200 StyleSheetContents* newSheet = 200 StyleSheetContents* newSheet =
201 StyleSheetContents::create(href, parserContext); 201 StyleSheetContents::create(href, parserContext);
202 202
203 CSSStyleSheet* cssSheet = CSSStyleSheet::create(newSheet, *this); 203 CSSStyleSheet* cssSheet = CSSStyleSheet::create(newSheet, *this);
204 cssSheet->setDisabled(m_alternate); 204 cssSheet->setDisabled(m_alternate);
205 cssSheet->setTitle(m_title); 205 cssSheet->setTitle(m_title);
206 if (!m_alternate && !m_title.isEmpty()) 206 if (!m_alternate && !m_title.isEmpty())
207 document().styleEngine().setPreferredStylesheetSetNameIfNotSet( 207 document().styleEngine().setPreferredStylesheetSetNameIfNotSet(m_title);
208 m_title, StyleEngine::DontUpdateActiveSheets);
209 cssSheet->setMediaQueries(MediaQuerySet::create(m_media)); 208 cssSheet->setMediaQueries(MediaQuerySet::create(m_media));
210 209
211 m_sheet = cssSheet; 210 m_sheet = cssSheet;
212 211
213 // We don't need the cross-origin security check here because we are 212 // We don't need the cross-origin security check here because we are
214 // getting the sheet text in "strict" mode. This enforces a valid CSS MIME 213 // getting the sheet text in "strict" mode. This enforces a valid CSS MIME
215 // type. 214 // type.
216 parseStyleSheet(sheet->sheetText()); 215 parseStyleSheet(sheet->sheetText());
217 } 216 }
218 217
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 298 }
300 299
301 DEFINE_TRACE(ProcessingInstruction) { 300 DEFINE_TRACE(ProcessingInstruction) {
302 visitor->trace(m_sheet); 301 visitor->trace(m_sheet);
303 visitor->trace(m_listenerForXSLT); 302 visitor->trace(m_listenerForXSLT);
304 CharacterData::trace(visitor); 303 CharacterData::trace(visitor);
305 ResourceOwner<StyleSheetResource>::trace(visitor); 304 ResourceOwner<StyleSheetResource>::trace(visitor);
306 } 305 }
307 306
308 } // namespace blink 307 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698