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

Unified Diff: Source/core/testing/Internals.cpp

Issue 14858004: Clean up the way layout tests force elements to opt in/out of composited scrolling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 843d1694e0cccef4127e5b35a1b1044062d66315..f6e474b4f0ee989aee2e2054961a3b0b8c4c5bc1 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -1531,6 +1531,30 @@ String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC
return document->frame()->layerTreeAsText(layerTreeFlags);
}
+void Internals::setNeedsCompositedScrolling(Element* element, unsigned needsCompositedScrolling, ExceptionCode& ec)
+{
+ if (!element) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ element->document()->updateLayout();
+
+ RenderObject* renderer = element->renderer();
+ if (!renderer || !renderer->isBox()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ RenderLayer* layer = toRenderBox(renderer)->layer();
+ if (!layer) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ layer->setForceNeedsCompositedScrolling(static_cast<RenderLayer::ForceNeedsCompositedScrollingMode>(needsCompositedScrolling));
+}
+
String Internals::repaintRectsAsText(Document* document, ExceptionCode& ec) const
{
if (!document || !document->frame()) {
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698