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

Side by Side Diff: Source/WebCore/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: 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 unified diff | Download patch | Annotate | Revision Log
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "InspectorOverlay.h" 68 #include "InspectorOverlay.h"
69 #include "InstrumentingAgents.h" 69 #include "InstrumentingAgents.h"
70 #include "InternalSettings.h" 70 #include "InternalSettings.h"
71 #include "IntRect.h" 71 #include "IntRect.h"
72 #include "Language.h" 72 #include "Language.h"
73 #include "MallocStatistics.h" 73 #include "MallocStatistics.h"
74 #include "MemoryCache.h" 74 #include "MemoryCache.h"
75 #include "MockPagePopupDriver.h" 75 #include "MockPagePopupDriver.h"
76 #include "NodeRenderingContext.h" 76 #include "NodeRenderingContext.h"
77 #include "Page.h" 77 #include "Page.h"
78 #include "PaintOrderLists.h"
78 #include "PrintContext.h" 79 #include "PrintContext.h"
79 #include "PseudoElement.h" 80 #include "PseudoElement.h"
80 #include "Range.h" 81 #include "Range.h"
81 #include "RenderMenuList.h" 82 #include "RenderMenuList.h"
82 #include "RenderObject.h" 83 #include "RenderObject.h"
83 #include "RenderTreeAsText.h" 84 #include "RenderTreeAsText.h"
84 #include "RuntimeEnabledFeatures.h" 85 #include "RuntimeEnabledFeatures.h"
85 #include "SchemeRegistry.h" 86 #include "SchemeRegistry.h"
86 #include "ScrollingCoordinator.h" 87 #include "ScrollingCoordinator.h"
87 #include "SelectRuleFeatureSet.h" 88 #include "SelectRuleFeatureSet.h"
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 } 1641 }
1641 1642
1642 return document->isPageBoxVisible(pageNumber); 1643 return document->isPageBoxVisible(pageNumber);
1643 } 1644 }
1644 1645
1645 String Internals::layerTreeAsText(Document* document, ExceptionCode& ec) const 1646 String Internals::layerTreeAsText(Document* document, ExceptionCode& ec) const
1646 { 1647 {
1647 return layerTreeAsText(document, 0, ec); 1648 return layerTreeAsText(document, 0, ec);
1648 } 1649 }
1649 1650
1651 String Internals::paintOrderListsAsText(Element* element, ExceptionCode& ec)
1652 {
1653 if (!element) {
1654 ec = INVALID_ACCESS_ERR;
1655 return String();
1656 }
1657
1658 element->document()->updateLayout();
1659
1660 RenderObject* renderer = element->renderer();
1661 if (!renderer || !renderer->isBox()) {
1662 ec = INVALID_ACCESS_ERR;
1663 return String();
1664 }
1665
1666 RenderLayer* layer = toRenderBox(renderer)->layer();
1667 if (!layer) {
1668 ec = INVALID_ACCESS_ERR;
1669 return String();
1670 }
1671
1672 return layer->paintOrderListsAsText();
1673 }
1674
1675 PassRefPtr<PaintOrderLists> Internals::paintOrderLists(Element* element, Excepti onCode& ec)
1676 {
1677 if (!element) {
1678 ec = INVALID_ACCESS_ERR;
1679 return 0;
1680 }
1681
1682 element->document()->updateLayout();
1683
1684 RenderObject* renderer = element->renderer();
1685 if (!renderer || !renderer->isBox()) {
1686 ec = INVALID_ACCESS_ERR;
1687 return 0;
1688 }
1689
1690 RenderLayer* layer = toRenderBox(renderer)->layer();
1691 if (!layer) {
1692 ec = INVALID_ACCESS_ERR;
1693 return 0;
1694 }
1695
1696 return layer->paintOrderLists();
1697 }
1698
1650 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC ode& ec) const 1699 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC ode& ec) const
1651 { 1700 {
1652 if (!document || !document->frame()) { 1701 if (!document || !document->frame()) {
1653 ec = INVALID_ACCESS_ERR; 1702 ec = INVALID_ACCESS_ERR;
1654 return String(); 1703 return String();
1655 } 1704 }
1656 1705
1657 LayerTreeFlags layerTreeFlags = 0; 1706 LayerTreeFlags layerTreeFlags = 0;
1658 if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS) 1707 if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS)
1659 layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects; 1708 layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 2135
2087 RenderObject* renderer = select->renderer(); 2136 RenderObject* renderer = select->renderer();
2088 if (!renderer->isMenuList()) 2137 if (!renderer->isMenuList())
2089 return false; 2138 return false;
2090 2139
2091 RenderMenuList* menuList = toRenderMenuList(renderer); 2140 RenderMenuList* menuList = toRenderMenuList(renderer);
2092 return menuList->popupIsVisible(); 2141 return menuList->popupIsVisible();
2093 } 2142 }
2094 2143
2095 } 2144 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698