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

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: Code review and updated to latest master 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.
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 if (!document || !document->page()) { 786 if (!document || !document->page()) {
787 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's Page cannot be retrieved." : "No context document can be obtained."); 787 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's Page cannot be retrieved." : "No context document can be obtained.");
788 return ClientRectList::create(); 788 return ClientRectList::create();
789 } 789 }
790 790
791 Highlight highlight; 791 Highlight highlight;
792 document->page()->inspectorController().getHighlight(&highlight); 792 document->page()->inspectorController().getHighlight(&highlight);
793 return ClientRectList::create(highlight.quads); 793 return ClientRectList::create(highlight.quads);
794 } 794 }
795 795
796 String Internals::inspectorHighlightShape(Document *document, ExceptionState& ex ceptionState)
797 {
798 if (!document || !document->page()) {
799 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc ument's Page cannot be retrieved." : "No context document can be obtained.");
800 return String();
801 }
802
803 RefPtr<JSONObject> object = document->page()->inspectorController().buildObj ectForShapeOutside();
804 return object ? object->toJSONString(): String();
805 }
806
796 unsigned Internals::markerCountForNode(Node* node, const String& markerType, Exc eptionState& exceptionState) 807 unsigned Internals::markerCountForNode(Node* node, const String& markerType, Exc eptionState& exceptionState)
797 { 808 {
798 if (!node) { 809 if (!node) {
799 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Node")); 810 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Node"));
800 return 0; 811 return 0;
801 } 812 }
802 813
803 DocumentMarker::MarkerTypes markerTypes = 0; 814 DocumentMarker::MarkerTypes markerTypes = 0;
804 if (!markerTypesFrom(markerType, markerTypes)) { 815 if (!markerTypesFrom(markerType, markerTypes)) {
805 exceptionState.throwDOMException(SyntaxError, "The marker type provided ('" + markerType + "') is invalid."); 816 exceptionState.throwDOMException(SyntaxError, "The marker type provided ('" + markerType + "') is invalid.");
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
2371 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) 2382 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength)
2372 { 2383 {
2373 if (!node) 2384 if (!node)
2374 return String(); 2385 return String();
2375 blink::WebPoint point(x, y); 2386 blink::WebPoint point(x, y);
2376 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); 2387 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength);
2377 return surroundingText.content(); 2388 return surroundingText.content();
2378 } 2389 }
2379 2390
2380 } 2391 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698