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

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

Issue 202523004: Fully update compositing information for *layerTreeAsText calls (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 return document->isPageBoxVisible(pageNumber); 1640 return document->isPageBoxVisible(pageNumber);
1641 } 1641 }
1642 1642
1643 String Internals::layerTreeAsText(Document* document, ExceptionState& exceptionS tate) const 1643 String Internals::layerTreeAsText(Document* document, ExceptionState& exceptionS tate) const
1644 { 1644 {
1645 return layerTreeAsText(document, 0, exceptionState); 1645 return layerTreeAsText(document, 0, exceptionState);
1646 } 1646 }
1647 1647
1648 String Internals::elementLayerTreeAsText(Element* element, ExceptionState& excep tionState) const 1648 String Internals::elementLayerTreeAsText(Element* element, ExceptionState& excep tionState) const
1649 { 1649 {
1650 DisableCompositingQueryAsserts disabler; 1650 FrameView* frameView = element->document().view();
1651 frameView->updateLayoutAndStyleForPainting();
1652
1651 return elementLayerTreeAsText(element, 0, exceptionState); 1653 return elementLayerTreeAsText(element, 0, exceptionState);
1652 } 1654 }
1653 1655
1654 static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionState& exc eptionState, RenderLayerStackingNode::PaintOrderListType type) 1656 static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionState& exc eptionState, RenderLayerStackingNode::PaintOrderListType type)
1655 { 1657 {
1656 if (!element) { 1658 if (!element) {
1657 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Element")); 1659 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Element"));
1658 return nullptr; 1660 return nullptr;
1659 } 1661 }
1660 1662
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 return layer->needsCompositedScrolling(); 1767 return layer->needsCompositedScrolling();
1766 } 1768 }
1767 1769
1768 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionS tate& exceptionState) const 1770 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionS tate& exceptionState) const
1769 { 1771 {
1770 if (!document || !document->frame()) { 1772 if (!document || !document->frame()) {
1771 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's frame cannot be retrieved." : "The document provided is invalid."); 1773 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's frame cannot be retrieved." : "The document provided is invalid.");
1772 return String(); 1774 return String();
1773 } 1775 }
1774 1776
1777 document->view()->updateLayoutAndStyleForPainting();
1778
1775 return document->frame()->layerTreeAsText(flags); 1779 return document->frame()->layerTreeAsText(flags);
1776 } 1780 }
1777 1781
1778 String Internals::elementLayerTreeAsText(Element* element, unsigned flags, Excep tionState& exceptionState) const 1782 String Internals::elementLayerTreeAsText(Element* element, unsigned flags, Excep tionState& exceptionState) const
1779 { 1783 {
1780 if (!element) { 1784 if (!element) {
1781 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Element")); 1785 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Element"));
1782 return String(); 1786 return String();
1783 } 1787 }
1784 1788
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 } 2415 }
2412 2416
2413 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) 2417 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength)
2414 { 2418 {
2415 blink::WebPoint point(x, y); 2419 blink::WebPoint point(x, y);
2416 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); 2420 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength);
2417 return surroundingText.content(); 2421 return surroundingText.content();
2418 } 2422 }
2419 2423
2420 } 2424 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698