| OLD | NEW |
| 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 Loading... |
| 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 // PATCH 1 (just moving stuff to its right place. Maybe this is just noisy?) |
| 1574 |
| 1575 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC
ode& ec) const |
| 1576 { |
| 1577 if (!document || !document->frame()) { |
| 1578 ec = INVALID_ACCESS_ERR; |
| 1579 return String(); |
| 1580 } |
| 1581 |
| 1582 LayerTreeFlags layerTreeFlags = 0; |
| 1583 if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS) |
| 1584 layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects; |
| 1585 if (flags & LAYER_TREE_INCLUDES_TILE_CACHES) |
| 1586 layerTreeFlags |= LayerTreeFlagsIncludeTileCaches; |
| 1587 if (flags & LAYER_TREE_INCLUDES_REPAINT_RECTS) |
| 1588 layerTreeFlags |= LayerTreeFlagsIncludeRepaintRects; |
| 1589 if (flags & LAYER_TREE_INCLUDES_PAINTING_PHASES) |
| 1590 layerTreeFlags |= LayerTreeFlagsIncludePaintingPhases; |
| 1591 |
| 1592 return document->frame()->layerTreeAsText(layerTreeFlags); |
| 1593 } |
| 1594 |
| 1573 static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionCode& ec,
RenderLayer::PaintOrderListType type) | 1595 static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionCode& ec,
RenderLayer::PaintOrderListType type) |
| 1574 { | 1596 { |
| 1575 if (!element) { | 1597 if (!element) { |
| 1576 ec = INVALID_ACCESS_ERR; | 1598 ec = INVALID_ACCESS_ERR; |
| 1577 return 0; | 1599 return 0; |
| 1578 } | 1600 } |
| 1579 | 1601 |
| 1580 element->document()->updateLayout(); | 1602 element->document()->updateLayout(); |
| 1581 | 1603 |
| 1582 RenderObject* renderer = element->renderer(); | 1604 RenderObject* renderer = element->renderer(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1599 PassRefPtr<NodeList> Internals::paintOrderListBeforePromote(Element* element, Ex
ceptionCode& ec) | 1621 PassRefPtr<NodeList> Internals::paintOrderListBeforePromote(Element* element, Ex
ceptionCode& ec) |
| 1600 { | 1622 { |
| 1601 return paintOrderList(element, ec, RenderLayer::BeforePromote); | 1623 return paintOrderList(element, ec, RenderLayer::BeforePromote); |
| 1602 } | 1624 } |
| 1603 | 1625 |
| 1604 PassRefPtr<NodeList> Internals::paintOrderListAfterPromote(Element* element, Exc
eptionCode& ec) | 1626 PassRefPtr<NodeList> Internals::paintOrderListAfterPromote(Element* element, Exc
eptionCode& ec) |
| 1605 { | 1627 { |
| 1606 return paintOrderList(element, ec, RenderLayer::AfterPromote); | 1628 return paintOrderList(element, ec, RenderLayer::AfterPromote); |
| 1607 } | 1629 } |
| 1608 | 1630 |
| 1609 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionC
ode& ec) const | 1631 // PATCH 1 |
| 1632 void Internals::setNeedsCompositedScrolling(Element* element, unsigned needsComp
ositedScrolling, ExceptionCode& ec) |
| 1610 { | 1633 { |
| 1611 if (!document || !document->frame()) { | 1634 if (!element) { |
| 1612 ec = INVALID_ACCESS_ERR; | 1635 ec = INVALID_ACCESS_ERR; |
| 1613 return String(); | 1636 return; |
| 1614 } | 1637 } |
| 1615 | 1638 |
| 1616 LayerTreeFlags layerTreeFlags = 0; | 1639 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 | 1640 |
| 1626 return document->frame()->layerTreeAsText(layerTreeFlags); | 1641 RenderObject* renderer = element->renderer(); |
| 1642 if (!renderer || !renderer->isBox()) { |
| 1643 ec = INVALID_ACCESS_ERR; |
| 1644 return; |
| 1645 } |
| 1646 |
| 1647 RenderLayer* layer = toRenderBox(renderer)->layer(); |
| 1648 if (!layer) { |
| 1649 ec = INVALID_ACCESS_ERR; |
| 1650 return; |
| 1651 } |
| 1652 |
| 1653 layer->setForceNeedsCompositedScrolling(static_cast<RenderLayer::ForceNeedsC
ompositedScrollingMode>(needsCompositedScrolling)); |
| 1627 } | 1654 } |
| 1628 | 1655 |
| 1629 String Internals::repaintRectsAsText(Document* document, ExceptionCode& ec) cons
t | 1656 String Internals::repaintRectsAsText(Document* document, ExceptionCode& ec) cons
t |
| 1630 { | 1657 { |
| 1631 if (!document || !document->frame()) { | 1658 if (!document || !document->frame()) { |
| 1632 ec = INVALID_ACCESS_ERR; | 1659 ec = INVALID_ACCESS_ERR; |
| 1633 return String(); | 1660 return String(); |
| 1634 } | 1661 } |
| 1635 | 1662 |
| 1636 return document->frame()->trackedRepaintRectsAsText(); | 1663 return document->frame()->trackedRepaintRectsAsText(); |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1997 | 2024 |
| 1998 RenderObject* renderer = select->renderer(); | 2025 RenderObject* renderer = select->renderer(); |
| 1999 if (!renderer->isMenuList()) | 2026 if (!renderer->isMenuList()) |
| 2000 return false; | 2027 return false; |
| 2001 | 2028 |
| 2002 RenderMenuList* menuList = toRenderMenuList(renderer); | 2029 RenderMenuList* menuList = toRenderMenuList(renderer); |
| 2003 return menuList->popupIsVisible(); | 2030 return menuList->popupIsVisible(); |
| 2004 } | 2031 } |
| 2005 | 2032 |
| 2006 } | 2033 } |
| OLD | NEW |