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

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

Issue 13467028: Add an intermediate function to generate 2 paint-order lists. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressing review comments 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
« 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 254dc8c1904d65dd903e89f29c79934638d0e4ba..ff773a00d8a5fbbb2900468f3af947bb00c21362 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -1532,6 +1532,40 @@ String Internals::layerTreeAsText(Document* document, ExceptionCode& ec) const
return layerTreeAsText(document, 0, ec);
}
+static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionCode& ec, RenderLayer::PaintOrderListType type)
+{
+ if (!element) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ element->document()->updateLayout();
+
+ RenderObject* renderer = element->renderer();
+ if (!renderer || !renderer->isBox()) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ RenderLayer* layer = toRenderBox(renderer)->layer();
+ if (!layer) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ return layer->paintOrderList(type);
+}
+
+PassRefPtr<NodeList> Internals::paintOrderListBeforePromote(Element* element, ExceptionCode& ec)
+{
+ return paintOrderList(element, ec, RenderLayer::BeforePromote);
+}
+
+PassRefPtr<NodeList> Internals::paintOrderListAfterPromote(Element* element, ExceptionCode& ec)
+{
+ return paintOrderList(element, ec, RenderLayer::AfterPromote);
+}
+
String Internals::layerTreeAsText(Document* document, unsigned flags, 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