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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 14741004: NOT FOR REVIEW - Update comp-scrolling state at a well defined point in the pipeline. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 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 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 } 1563 }
1564 1564
1565 return document->isPageBoxVisible(pageNumber); 1565 return document->isPageBoxVisible(pageNumber);
1566 } 1566 }
1567 1567
1568 String Internals::layerTreeAsText(Document* document, ExceptionCode& ec) const 1568 String Internals::layerTreeAsText(Document* document, ExceptionCode& ec) const
1569 { 1569 {
1570 return layerTreeAsText(document, 0, ec); 1570 return layerTreeAsText(document, 0, ec);
1571 } 1571 }
1572 1572
1573 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC ode& ec) const
1574 {
1575 if (!document || !document->frame()) {
1576 ec = INVALID_ACCESS_ERR;
1577 return String();
1578 }
1579
1580 LayerTreeFlags layerTreeFlags = 0;
1581 if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS)
1582 layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects;
1583 if (flags & LAYER_TREE_INCLUDES_TILE_CACHES)
1584 layerTreeFlags |= LayerTreeFlagsIncludeTileCaches;
1585 if (flags & LAYER_TREE_INCLUDES_REPAINT_RECTS)
1586 layerTreeFlags |= LayerTreeFlagsIncludeRepaintRects;
1587 if (flags & LAYER_TREE_INCLUDES_PAINTING_PHASES)
1588 layerTreeFlags |= LayerTreeFlagsIncludePaintingPhases;
1589
1590 return document->frame()->layerTreeAsText(layerTreeFlags);
1591 }
1592
1573 static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionCode& ec, RenderLayer::PaintOrderListType type) 1593 static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionCode& ec, RenderLayer::PaintOrderListType type)
1574 { 1594 {
1575 if (!element) { 1595 if (!element) {
1576 ec = INVALID_ACCESS_ERR; 1596 ec = INVALID_ACCESS_ERR;
1577 return 0; 1597 return 0;
1578 } 1598 }
1579 1599
1580 element->document()->updateLayout(); 1600 element->document()->updateLayout();
1581 1601
1582 RenderObject* renderer = element->renderer(); 1602 RenderObject* renderer = element->renderer();
(...skipping 16 matching lines...) Expand all
1599 PassRefPtr<NodeList> Internals::paintOrderListBeforePromote(Element* element, Ex ceptionCode& ec) 1619 PassRefPtr<NodeList> Internals::paintOrderListBeforePromote(Element* element, Ex ceptionCode& ec)
1600 { 1620 {
1601 return paintOrderList(element, ec, RenderLayer::BeforePromote); 1621 return paintOrderList(element, ec, RenderLayer::BeforePromote);
1602 } 1622 }
1603 1623
1604 PassRefPtr<NodeList> Internals::paintOrderListAfterPromote(Element* element, Exc eptionCode& ec) 1624 PassRefPtr<NodeList> Internals::paintOrderListAfterPromote(Element* element, Exc eptionCode& ec)
1605 { 1625 {
1606 return paintOrderList(element, ec, RenderLayer::AfterPromote); 1626 return paintOrderList(element, ec, RenderLayer::AfterPromote);
1607 } 1627 }
1608 1628
1609 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC ode& ec) const 1629 void Internals::setNeedsCompositedScrolling(Element* element, unsigned needsComp ositedScrolling, ExceptionCode& ec)
1610 { 1630 {
1611 if (!document || !document->frame()) { 1631 if (!element) {
1612 ec = INVALID_ACCESS_ERR; 1632 ec = INVALID_ACCESS_ERR;
1613 return String(); 1633 return;
1614 } 1634 }
1615 1635
1616 LayerTreeFlags layerTreeFlags = 0; 1636 element->document()->updateLayout();
1617 if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS)
1618 layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects;
1619 if (flags & LAYER_TREE_INCLUDES_TILE_CACHES)
1620 layerTreeFlags |= LayerTreeFlagsIncludeTileCaches;
1621 if (flags & LAYER_TREE_INCLUDES_REPAINT_RECTS)
1622 layerTreeFlags |= LayerTreeFlagsIncludeRepaintRects;
1623 if (flags & LAYER_TREE_INCLUDES_PAINTING_PHASES)
1624 layerTreeFlags |= LayerTreeFlagsIncludePaintingPhases;
1625 1637
1626 return document->frame()->layerTreeAsText(layerTreeFlags); 1638 RenderObject* renderer = element->renderer();
1639 if (!renderer || !renderer->isBox()) {
1640 ec = INVALID_ACCESS_ERR;
1641 return;
1642 }
1643
1644 RenderLayer* layer = toRenderBox(renderer)->layer();
1645 if (!layer) {
1646 ec = INVALID_ACCESS_ERR;
1647 return;
1648 }
1649
1650 layer->setForceNeedsCompositedScrolling(static_cast<RenderLayer::ForceNeedsC ompositedScrollingMode>(needsCompositedScrolling));
1627 } 1651 }
1628 1652
1629 String Internals::repaintRectsAsText(Document* document, ExceptionCode& ec) cons t 1653 String Internals::repaintRectsAsText(Document* document, ExceptionCode& ec) cons t
1630 { 1654 {
1631 if (!document || !document->frame()) { 1655 if (!document || !document->frame()) {
1632 ec = INVALID_ACCESS_ERR; 1656 ec = INVALID_ACCESS_ERR;
1633 return String(); 1657 return String();
1634 } 1658 }
1635 1659
1636 return document->frame()->trackedRepaintRectsAsText(); 1660 return document->frame()->trackedRepaintRectsAsText();
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 2021
1998 RenderObject* renderer = select->renderer(); 2022 RenderObject* renderer = select->renderer();
1999 if (!renderer->isMenuList()) 2023 if (!renderer->isMenuList())
2000 return false; 2024 return false;
2001 2025
2002 RenderMenuList* menuList = toRenderMenuList(renderer); 2026 RenderMenuList* menuList = toRenderMenuList(renderer);
2003 return menuList->popupIsVisible(); 2027 return menuList->popupIsVisible();
2004 } 2028 }
2005 2029
2006 } 2030 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698