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

Side by Side Diff: Source/web/WebDocument.cpp

Issue 23516004: Have CSSParserContext take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/testing/Internals.cpp ('k') | no next file » | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 WebDocumentType WebDocument::doctype() const 198 WebDocumentType WebDocument::doctype() const
199 { 199 {
200 return WebDocumentType(constUnwrap<Document>()->doctype()); 200 return WebDocumentType(constUnwrap<Document>()->doctype());
201 } 201 }
202 202
203 void WebDocument::insertUserStyleSheet(const WebString& sourceCode, UserStyleLev el styleLevel) 203 void WebDocument::insertUserStyleSheet(const WebString& sourceCode, UserStyleLev el styleLevel)
204 { 204 {
205 RefPtr<Document> document = unwrap<Document>(); 205 RefPtr<Document> document = unwrap<Document>();
206 206 ASSERT(document);
207 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document .get()); 207 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(*documen t.get());
208 parsedSheet->setIsUserStyleSheet(styleLevel == UserStyleUserLevel); 208 parsedSheet->setIsUserStyleSheet(styleLevel == UserStyleUserLevel);
209 parsedSheet->parseString(sourceCode); 209 parsedSheet->parseString(sourceCode);
210 if (parsedSheet->isUserStyleSheet()) 210 if (parsedSheet->isUserStyleSheet())
211 document->styleSheetCollections()->addUserSheet(parsedSheet); 211 document->styleSheetCollections()->addUserSheet(parsedSheet);
212 else 212 else
213 document->styleSheetCollections()->addAuthorSheet(parsedSheet); 213 document->styleSheetCollections()->addAuthorSheet(parsedSheet);
214 } 214 }
215 215
216 void WebDocument::cancelFullScreen() 216 void WebDocument::cancelFullScreen()
217 { 217 {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 m_private = elem; 302 m_private = elem;
303 return *this; 303 return *this;
304 } 304 }
305 305
306 WebDocument::operator PassRefPtr<Document>() const 306 WebDocument::operator PassRefPtr<Document>() const
307 { 307 {
308 return toDocument(m_private.get()); 308 return toDocument(m_private.get());
309 } 309 }
310 310
311 } // namespace WebKit 311 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698