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

Side by Side Diff: Source/core/testing/Internals.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/core/page/Page.cpp ('k') | Source/web/PopupMenuImpl.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 282 }
283 283
284 unsigned Internals::updateStyleAndReturnAffectedElementCount(ExceptionState& exc eptionState) const 284 unsigned Internals::updateStyleAndReturnAffectedElementCount(ExceptionState& exc eptionState) const
285 { 285 {
286 Document* document = contextDocument(); 286 Document* document = contextDocument();
287 if (!document) { 287 if (!document) {
288 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available."); 288 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
289 return 0; 289 return 0;
290 } 290 }
291 291
292 unsigned beforeCount = document->styleEngine()->resolverAccessCount(); 292 unsigned beforeCount = document->styleEngine().resolverAccessCount();
293 document->updateRenderTreeIfNeeded(); 293 document->updateRenderTreeIfNeeded();
294 return document->styleEngine()->resolverAccessCount() - beforeCount; 294 return document->styleEngine().resolverAccessCount() - beforeCount;
295 } 295 }
296 296
297 unsigned Internals::needsLayoutCount(ExceptionState& exceptionState) const 297 unsigned Internals::needsLayoutCount(ExceptionState& exceptionState) const
298 { 298 {
299 LocalFrame* contextFrame = frame(); 299 LocalFrame* contextFrame = frame();
300 if (!contextFrame) { 300 if (!contextFrame) {
301 exceptionState.throwDOMException(InvalidAccessError, "No context frame i s available."); 301 exceptionState.throwDOMException(InvalidAccessError, "No context frame i s available.");
302 return 0; 302 return 0;
303 } 303 }
304 304
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 { 2285 {
2286 Vector<Document::TransitionElementData> elementData; 2286 Vector<Document::TransitionElementData> elementData;
2287 frame()->document()->getTransitionElementData(elementData); 2287 frame()->document()->getTransitionElementData(elementData);
2288 2288
2289 for (const auto& element : elementData) 2289 for (const auto& element : elementData)
2290 frame()->document()->showTransitionElements(AtomicString(element.selecto r)); 2290 frame()->document()->showTransitionElements(AtomicString(element.selecto r));
2291 } 2291 }
2292 2292
2293 void Internals::setExitTransitionStylesheetsEnabled(bool enabled) 2293 void Internals::setExitTransitionStylesheetsEnabled(bool enabled)
2294 { 2294 {
2295 frame()->document()->styleEngine()->setExitTransitionStylesheetsEnabled(enab led); 2295 frame()->document()->styleEngine().setExitTransitionStylesheetsEnabled(enabl ed);
2296 } 2296 }
2297 2297
2298 void Internals::forcePluginPlaceholder(HTMLElement* element, PassRefPtrWillBeRaw Ptr<DocumentFragment> fragment, ExceptionState& exceptionState) 2298 void Internals::forcePluginPlaceholder(HTMLElement* element, PassRefPtrWillBeRaw Ptr<DocumentFragment> fragment, ExceptionState& exceptionState)
2299 { 2299 {
2300 if (!element->isPluginElement()) { 2300 if (!element->isPluginElement()) {
2301 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov ided is not a plugin."); 2301 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov ided is not a plugin.");
2302 return; 2302 return;
2303 } 2303 }
2304 toHTMLPlugInElement(element)->setPlaceholder(DocumentFragmentPluginPlacehold er::create(fragment)); 2304 toHTMLPlugInElement(element)->setPlaceholder(DocumentFragmentPluginPlacehold er::create(fragment));
2305 } 2305 }
(...skipping 11 matching lines...) Expand all
2317 { 2317 {
2318 ThreadState::current()->setGCState(ThreadState::GCScheduledForTesting); 2318 ThreadState::current()->setGCState(ThreadState::GCScheduledForTesting);
2319 } 2319 }
2320 2320
2321 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&) 2321 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&)
2322 { 2322 {
2323 return new InternalsIterationSource(); 2323 return new InternalsIterationSource();
2324 } 2324 }
2325 2325
2326 } // namespace blink 2326 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/web/PopupMenuImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698