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

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: . Created 7 years, 8 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
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index ee84fbfc31be8ffef88fe548329f7aeb731d54f6..d275765a8107dbf3cd6676f049d6237f2cd593bd 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -1626,6 +1626,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()) {

Powered by Google App Engine
This is Rietveld 408576698