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

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

Issue 237313003: CSS shapes support in Web Inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrected wrong if statement condition Created 6 years, 8 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
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.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 15 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 18 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
19 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "Internals.h" 28 #include "Internals.h"
29
Bear Travis 2014/04/17 20:26:45 Removed line break.
Habib Virji 2014/04/23 16:28:33 Done.
30 #include <v8.h> 29 #include <v8.h>
31 #include "InspectorFrontendClientLocal.h" 30 #include "InspectorFrontendClientLocal.h"
32 #include "InternalProfilers.h" 31 #include "InternalProfilers.h"
33 #include "InternalRuntimeFlags.h" 32 #include "InternalRuntimeFlags.h"
34 #include "InternalSettings.h" 33 #include "InternalSettings.h"
35 #include "LayerRect.h" 34 #include "LayerRect.h"
36 #include "LayerRectList.h" 35 #include "LayerRectList.h"
37 #include "MallocStatistics.h" 36 #include "MallocStatistics.h"
38 #include "MockPagePopupDriver.h" 37 #include "MockPagePopupDriver.h"
39 #include "RuntimeEnabledFeatures.h" 38 #include "RuntimeEnabledFeatures.h"
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 if (!document || !document->page()) { 805 if (!document || !document->page()) {
807 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's Page cannot be retrieved." : "No context document can be obtained."); 806 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's Page cannot be retrieved." : "No context document can be obtained.");
808 return ClientRectList::create(); 807 return ClientRectList::create();
809 } 808 }
810 809
811 Highlight highlight; 810 Highlight highlight;
812 document->page()->inspectorController().getHighlight(&highlight); 811 document->page()->inspectorController().getHighlight(&highlight);
813 return ClientRectList::create(highlight.quads); 812 return ClientRectList::create(highlight.quads);
814 } 813 }
815 814
815 String Internals::inspectorHighlightCSSShapes(Node *node, ExceptionState& except ionState)
816 {
817 if (!node) {
818 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Node"));
819 return String();
820 }
821
822 RefPtr<JSONObject> object = node->document().page()->inspectorController().b uildObjectForShapeOutside(node->document().frame(), toRenderBox(node->renderer() ));
823 return object ? object->toJSONString(): String();
824 }
825
816 unsigned Internals::markerCountForNode(Node* node, const String& markerType, Exc eptionState& exceptionState) 826 unsigned Internals::markerCountForNode(Node* node, const String& markerType, Exc eptionState& exceptionState)
817 { 827 {
818 if (!node) { 828 if (!node) {
819 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Node")); 829 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Node"));
820 return 0; 830 return 0;
821 } 831 }
822 832
823 DocumentMarker::MarkerTypes markerTypes = 0; 833 DocumentMarker::MarkerTypes markerTypes = 0;
824 if (!markerTypesFrom(markerType, markerTypes)) { 834 if (!markerTypesFrom(markerType, markerTypes)) {
825 exceptionState.throwDOMException(SyntaxError, "The marker type provided ('" + markerType + "') is invalid."); 835 exceptionState.throwDOMException(SyntaxError, "The marker type provided ('" + markerType + "') is invalid.");
(...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) 2498 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength)
2489 { 2499 {
2490 if (!node) 2500 if (!node)
2491 return String(); 2501 return String();
2492 blink::WebPoint point(x, y); 2502 blink::WebPoint point(x, y);
2493 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); 2503 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength);
2494 return surroundingText.content(); 2504 return surroundingText.content();
2495 } 2505 }
2496 2506
2497 } 2507 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698