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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 } 1525 }
1526 1526
1527 return document->isPageBoxVisible(pageNumber); 1527 return document->isPageBoxVisible(pageNumber);
1528 } 1528 }
1529 1529
1530 String Internals::layerTreeAsText(Document* document, ExceptionCode& ec) const 1530 String Internals::layerTreeAsText(Document* document, ExceptionCode& ec) const
1531 { 1531 {
1532 return layerTreeAsText(document, 0, ec); 1532 return layerTreeAsText(document, 0, ec);
1533 } 1533 }
1534 1534
1535 static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionCode& ec, RenderLayer::PaintOrderListType type)
1536 {
1537 if (!element) {
1538 ec = INVALID_ACCESS_ERR;
1539 return 0;
1540 }
1541
1542 element->document()->updateLayout();
1543
1544 RenderObject* renderer = element->renderer();
1545 if (!renderer || !renderer->isBox()) {
1546 ec = INVALID_ACCESS_ERR;
1547 return 0;
1548 }
1549
1550 RenderLayer* layer = toRenderBox(renderer)->layer();
1551 if (!layer) {
1552 ec = INVALID_ACCESS_ERR;
1553 return 0;
1554 }
1555
1556 return layer->paintOrderList(type);
1557 }
1558
1559 PassRefPtr<NodeList> Internals::paintOrderListBeforePromote(Element* element, Ex ceptionCode& ec)
1560 {
1561 return paintOrderList(element, ec, RenderLayer::BeforePromote);
1562 }
1563
1564 PassRefPtr<NodeList> Internals::paintOrderListAfterPromote(Element* element, Exc eptionCode& ec)
1565 {
1566 return paintOrderList(element, ec, RenderLayer::AfterPromote);
1567 }
1568
1535 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC ode& ec) const 1569 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC ode& ec) const
1536 { 1570 {
1537 if (!document || !document->frame()) { 1571 if (!document || !document->frame()) {
1538 ec = INVALID_ACCESS_ERR; 1572 ec = INVALID_ACCESS_ERR;
1539 return String(); 1573 return String();
1540 } 1574 }
1541 1575
1542 LayerTreeFlags layerTreeFlags = 0; 1576 LayerTreeFlags layerTreeFlags = 0;
1543 if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS) 1577 if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS)
1544 layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects; 1578 layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects;
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 1957
1924 RenderObject* renderer = select->renderer(); 1958 RenderObject* renderer = select->renderer();
1925 if (!renderer->isMenuList()) 1959 if (!renderer->isMenuList())
1926 return false; 1960 return false;
1927 1961
1928 RenderMenuList* menuList = toRenderMenuList(renderer); 1962 RenderMenuList* menuList = toRenderMenuList(renderer);
1929 return menuList->popupIsVisible(); 1963 return menuList->popupIsVisible();
1930 } 1964 }
1931 1965
1932 } 1966 }
OLDNEW
« 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