| 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 return ClientRect::create(); | 774 return ClientRect::create(); |
| 775 } | 775 } |
| 776 | 776 |
| 777 element->document().updateLayoutIgnorePendingStylesheets(); | 777 element->document().updateLayoutIgnorePendingStylesheets(); |
| 778 RenderObject* renderer = element->renderer(); | 778 RenderObject* renderer = element->renderer(); |
| 779 if (!renderer) | 779 if (!renderer) |
| 780 return ClientRect::create(); | 780 return ClientRect::create(); |
| 781 return ClientRect::create(renderer->absoluteBoundingBoxRectIgnoringTransform
s()); | 781 return ClientRect::create(renderer->absoluteBoundingBoxRectIgnoringTransform
s()); |
| 782 } | 782 } |
| 783 | 783 |
| 784 PassRefPtrWillBeRawPtr<ClientRectList> Internals::inspectorHighlightRects(Docume
nt* document, ExceptionState& exceptionState) | |
| 785 { | |
| 786 if (!document || !document->page()) { | |
| 787 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc
ument's Page cannot be retrieved." : "No context document can be obtained."); | |
| 788 return ClientRectList::create(); | |
| 789 } | |
| 790 | |
| 791 Highlight highlight; | |
| 792 document->page()->inspectorController().getHighlight(&highlight); | |
| 793 return ClientRectList::create(highlight.quads); | |
| 794 } | |
| 795 | |
| 796 unsigned Internals::markerCountForNode(Node* node, const String& markerType, Exc
eptionState& exceptionState) | 784 unsigned Internals::markerCountForNode(Node* node, const String& markerType, Exc
eptionState& exceptionState) |
| 797 { | 785 { |
| 798 if (!node) { | 786 if (!node) { |
| 799 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Node")); | 787 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Node")); |
| 800 return 0; | 788 return 0; |
| 801 } | 789 } |
| 802 | 790 |
| 803 DocumentMarker::MarkerTypes markerTypes = 0; | 791 DocumentMarker::MarkerTypes markerTypes = 0; |
| 804 if (!markerTypesFrom(markerType, markerTypes)) { | 792 if (!markerTypesFrom(markerType, markerTypes)) { |
| 805 exceptionState.throwDOMException(SyntaxError, "The marker type provided
('" + markerType + "') is invalid."); | 793 exceptionState.throwDOMException(SyntaxError, "The marker type provided
('" + markerType + "') is invalid."); |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2375 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2363 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
| 2376 { | 2364 { |
| 2377 if (!node) | 2365 if (!node) |
| 2378 return String(); | 2366 return String(); |
| 2379 blink::WebPoint point(x, y); | 2367 blink::WebPoint point(x, y); |
| 2380 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2368 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
| 2381 return surroundingText.content(); | 2369 return surroundingText.content(); |
| 2382 } | 2370 } |
| 2383 | 2371 |
| 2384 } | 2372 } |
| OLD | NEW |