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

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

Issue 975933002: Return reference from styleEngine() accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « Source/web/PopupMenuImpl.cpp ('k') | Source/web/tests/WebDocumentTest.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) 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 { 210 {
211 return WebDocumentType(constUnwrap<Document>()->doctype()); 211 return WebDocumentType(constUnwrap<Document>()->doctype());
212 } 212 }
213 213
214 void WebDocument::insertStyleSheet(const WebString& sourceCode) 214 void WebDocument::insertStyleSheet(const WebString& sourceCode)
215 { 215 {
216 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); 216 RefPtrWillBeRawPtr<Document> document = unwrap<Document>();
217 ASSERT(document); 217 ASSERT(document);
218 RefPtrWillBeRawPtr<StyleSheetContents> parsedSheet = StyleSheetContents::cre ate(CSSParserContext(*document, 0)); 218 RefPtrWillBeRawPtr<StyleSheetContents> parsedSheet = StyleSheetContents::cre ate(CSSParserContext(*document, 0));
219 parsedSheet->parseString(sourceCode); 219 parsedSheet->parseString(sourceCode);
220 document->styleEngine()->addAuthorSheet(parsedSheet); 220 document->styleEngine().addAuthorSheet(parsedSheet);
221 } 221 }
222 222
223 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors) 223 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors)
224 { 224 {
225 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); 225 RefPtrWillBeRawPtr<Document> document = unwrap<Document>();
226 Vector<String> selectors; 226 Vector<String> selectors;
227 selectors.append(webSelectors.data(), webSelectors.size()); 227 selectors.append(webSelectors.data(), webSelectors.size());
228 CSSSelectorWatch::from(*document).watchCSSSelectors(selectors); 228 CSSSelectorWatch::from(*document).watchCSSSelectors(selectors);
229 } 229 }
230 230
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // stylesheet gets applied. When isTransitionDocument is false, it ensures 291 // stylesheet gets applied. When isTransitionDocument is false, it ensures
292 // the transition UA stylesheet is not applied when reverting the transition . 292 // the transition UA stylesheet is not applied when reverting the transition .
293 unwrap<Document>()->setIsTransitionDocument(isTransitionDocument); 293 unwrap<Document>()->setIsTransitionDocument(isTransitionDocument);
294 } 294 }
295 295
296 void WebDocument::beginExitTransition(const WebString& cssSelector, bool exitToN ativeApp) 296 void WebDocument::beginExitTransition(const WebString& cssSelector, bool exitToN ativeApp)
297 { 297 {
298 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); 298 RefPtrWillBeRawPtr<Document> document = unwrap<Document>();
299 if (!exitToNativeApp) 299 if (!exitToNativeApp)
300 document->hideTransitionElements(cssSelector); 300 document->hideTransitionElements(cssSelector);
301 document->styleEngine()->setExitTransitionStylesheetsEnabled(true); 301 document->styleEngine().setExitTransitionStylesheetsEnabled(true);
302 } 302 }
303 303
304 void WebDocument::revertExitTransition() 304 void WebDocument::revertExitTransition()
305 { 305 {
306 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); 306 RefPtrWillBeRawPtr<Document> document = unwrap<Document>();
307 document->styleEngine()->setExitTransitionStylesheetsEnabled(false); 307 document->styleEngine().setExitTransitionStylesheetsEnabled(false);
308 } 308 }
309 309
310 void WebDocument::hideTransitionElements(const WebString& cssSelector) 310 void WebDocument::hideTransitionElements(const WebString& cssSelector)
311 { 311 {
312 RefPtrWillBeRawPtr<Document> document = unwrap<Document>(); 312 RefPtrWillBeRawPtr<Document> document = unwrap<Document>();
313 document->hideTransitionElements(cssSelector); 313 document->hideTransitionElements(cssSelector);
314 } 314 }
315 315
316 void WebDocument::showTransitionElements(const WebString& cssSelector) 316 void WebDocument::showTransitionElements(const WebString& cssSelector)
317 { 317 {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 m_private = elem; 384 m_private = elem;
385 return *this; 385 return *this;
386 } 386 }
387 387
388 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const 388 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const
389 { 389 {
390 return toDocument(m_private.get()); 390 return toDocument(m_private.get());
391 } 391 }
392 392
393 } // namespace blink 393 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/PopupMenuImpl.cpp ('k') | Source/web/tests/WebDocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698