| 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 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 return layer1->scrollsWithRespectTo(layer2); | 1746 return layer1->scrollsWithRespectTo(layer2); |
| 1747 } | 1747 } |
| 1748 | 1748 |
| 1749 bool Internals::isUnclippedDescendant(Element* element, ExceptionState& exceptio
nState) | 1749 bool Internals::isUnclippedDescendant(Element* element, ExceptionState& exceptio
nState) |
| 1750 { | 1750 { |
| 1751 if (!element) { | 1751 if (!element) { |
| 1752 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); | 1752 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); |
| 1753 return 0; | 1753 return 0; |
| 1754 } | 1754 } |
| 1755 | 1755 |
| 1756 element->document().updateLayout(); | 1756 element->document().view()->updateLayoutAndStyleForPainting(); |
| 1757 | 1757 |
| 1758 RenderObject* renderer = element->renderer(); | 1758 RenderObject* renderer = element->renderer(); |
| 1759 if (!renderer || !renderer->isBox()) { | 1759 if (!renderer || !renderer->isBox()) { |
| 1760 exceptionState.throwDOMException(InvalidAccessError, renderer ? "The pro
vided element's renderer is not a box." : "The provided element has no renderer.
"); | 1760 exceptionState.throwDOMException(InvalidAccessError, renderer ? "The pro
vided element's renderer is not a box." : "The provided element has no renderer.
"); |
| 1761 return 0; | 1761 return 0; |
| 1762 } | 1762 } |
| 1763 | 1763 |
| 1764 RenderLayer* layer = toRenderBox(renderer)->layer(); | 1764 RenderLayer* layer = toRenderBox(renderer)->layer(); |
| 1765 if (!layer) { | 1765 if (!layer) { |
| 1766 exceptionState.throwDOMException(InvalidAccessError, "No render layer ca
n be obtained from the provided element."); | 1766 exceptionState.throwDOMException(InvalidAccessError, "No render layer ca
n be obtained from the provided element."); |
| 1767 return 0; | 1767 return 0; |
| 1768 } | 1768 } |
| 1769 | 1769 |
| 1770 return layer->isUnclippedDescendant(); | 1770 return layer->isUnclippedDescendant(); |
| 1771 } | 1771 } |
| 1772 | 1772 |
| 1773 bool Internals::needsCompositedScrolling(Element* element, ExceptionState& excep
tionState) | 1773 bool Internals::needsCompositedScrolling(Element* element, ExceptionState& excep
tionState) |
| 1774 { | 1774 { |
| 1775 if (!element) { | 1775 if (!element) { |
| 1776 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); | 1776 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); |
| 1777 return 0; | 1777 return 0; |
| 1778 } | 1778 } |
| 1779 | 1779 |
| 1780 element->document().updateLayout(); | 1780 element->document().view()->updateLayoutAndStyleForPainting(); |
| 1781 | 1781 |
| 1782 RenderObject* renderer = element->renderer(); | 1782 RenderObject* renderer = element->renderer(); |
| 1783 if (!renderer || !renderer->isBox()) { | 1783 if (!renderer || !renderer->isBox()) { |
| 1784 exceptionState.throwDOMException(InvalidAccessError, renderer ? "The pro
vided element's renderer is not a box." : "The provided element has no renderer.
"); | 1784 exceptionState.throwDOMException(InvalidAccessError, renderer ? "The pro
vided element's renderer is not a box." : "The provided element has no renderer.
"); |
| 1785 return 0; | 1785 return 0; |
| 1786 } | 1786 } |
| 1787 | 1787 |
| 1788 RenderLayer* layer = toRenderBox(renderer)->layer(); | 1788 RenderLayer* layer = toRenderBox(renderer)->layer(); |
| 1789 if (!layer) { | 1789 if (!layer) { |
| 1790 exceptionState.throwDOMException(InvalidAccessError, "No render layer ca
n be obtained from the provided element."); | 1790 exceptionState.throwDOMException(InvalidAccessError, "No render layer ca
n be obtained from the provided element."); |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2470 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2470 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
| 2471 { | 2471 { |
| 2472 if (!node) | 2472 if (!node) |
| 2473 return String(); | 2473 return String(); |
| 2474 blink::WebPoint point(x, y); | 2474 blink::WebPoint point(x, y); |
| 2475 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2475 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
| 2476 return surroundingText.content(); | 2476 return surroundingText.content(); |
| 2477 } | 2477 } |
| 2478 | 2478 |
| 2479 } | 2479 } |
| OLD | NEW |