Chromium Code Reviews

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 1057603002: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix case where documentElement was added to scroll chain twice. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 97 matching lines...)
108 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" 108 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
109 #include "core/loader/FrameLoader.h" 109 #include "core/loader/FrameLoader.h"
110 #include "core/loader/HistoryItem.h" 110 #include "core/loader/HistoryItem.h"
111 #include "core/page/Chrome.h" 111 #include "core/page/Chrome.h"
112 #include "core/page/ChromeClient.h" 112 #include "core/page/ChromeClient.h"
113 #include "core/page/EventHandler.h" 113 #include "core/page/EventHandler.h"
114 #include "core/page/FocusController.h" 114 #include "core/page/FocusController.h"
115 #include "core/page/NetworkStateNotifier.h" 115 #include "core/page/NetworkStateNotifier.h"
116 #include "core/page/Page.h" 116 #include "core/page/Page.h"
117 #include "core/page/PrintContext.h" 117 #include "core/page/PrintContext.h"
118 #include "core/page/scrolling/ScrollState.h"
118 #include "core/paint/DeprecatedPaintLayer.h" 119 #include "core/paint/DeprecatedPaintLayer.h"
119 #include "core/plugins/testing/DictionaryPluginPlaceholder.h" 120 #include "core/plugins/testing/DictionaryPluginPlaceholder.h"
120 #include "core/plugins/testing/DocumentFragmentPluginPlaceholder.h" 121 #include "core/plugins/testing/DocumentFragmentPluginPlaceholder.h"
121 #include "core/testing/DictionaryTest.h" 122 #include "core/testing/DictionaryTest.h"
122 #include "core/testing/GCObservation.h" 123 #include "core/testing/GCObservation.h"
123 #include "core/testing/InternalSettings.h" 124 #include "core/testing/InternalSettings.h"
124 #include "core/testing/LayerRect.h" 125 #include "core/testing/LayerRect.h"
125 #include "core/testing/LayerRectList.h" 126 #include "core/testing/LayerRectList.h"
126 #include "core/testing/PluginPlaceholderOptions.h" 127 #include "core/testing/PluginPlaceholderOptions.h"
127 #include "core/testing/PrivateScriptTest.h" 128 #include "core/testing/PrivateScriptTest.h"
(...skipping 2182 matching lines...)
2310 2311
2311 void Internals::forcePluginPlaceholder(HTMLElement* element, const PluginPlaceho lderOptions& options, ExceptionState& exceptionState) 2312 void Internals::forcePluginPlaceholder(HTMLElement* element, const PluginPlaceho lderOptions& options, ExceptionState& exceptionState)
2312 { 2313 {
2313 if (!element->isPluginElement()) { 2314 if (!element->isPluginElement()) {
2314 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov ided is not a plugin."); 2315 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov ided is not a plugin.");
2315 return; 2316 return;
2316 } 2317 }
2317 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options)); 2318 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options));
2318 } 2319 }
2319 2320
2321 void Internals::setScrollChain(ScrollState* scrollState,
2322 const WillBeHeapVector<RefPtrWillBeMember<Element>>& elements, ExceptionStat e&)
2323 {
2324 WillBeHeapDeque<RefPtrWillBeMember<Element>> scrollChain;
2325 for (size_t i = 0; i < elements.size(); ++i)
2326 scrollChain.append(elements[i]);
2327 scrollState->setScrollChain(scrollChain);
2328 }
2329
2320 void Internals::forceBlinkGCWithoutV8GC() 2330 void Internals::forceBlinkGCWithoutV8GC()
2321 { 2331 {
2322 ThreadState::current()->setGCState(ThreadState::GCScheduledForTesting); 2332 ThreadState::current()->setGCState(ThreadState::GCScheduledForTesting);
2323 } 2333 }
2324 2334
2325 String Internals::selectedHTMLForClipboard() 2335 String Internals::selectedHTMLForClipboard()
2326 { 2336 {
2327 return frame()->selection().selectedHTMLForClipboard(); 2337 return frame()->selection().selectedHTMLForClipboard();
2328 } 2338 }
2329 2339
2330 String Internals::selectedTextForClipboard() 2340 String Internals::selectedTextForClipboard()
2331 { 2341 {
2332 return frame()->selection().selectedTextForClipboard(); 2342 return frame()->selection().selectedTextForClipboard();
2333 } 2343 }
2334 2344
2335 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&) 2345 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&)
2336 { 2346 {
2337 return new InternalsIterationSource(); 2347 return new InternalsIterationSource();
2338 } 2348 }
2339 2349
2340 } // namespace blink 2350 } // namespace blink
OLDNEW

Powered by Google App Engine