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

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

Issue 23467007: Have Range constructor take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 if (markers.size() <= index) 884 if (markers.size() <= index)
885 return 0; 885 return 0;
886 return markers[index]; 886 return markers[index];
887 } 887 }
888 888
889 PassRefPtr<Range> Internals::markerRangeForNode(Node* node, const String& marker Type, unsigned index, ExceptionState& es) 889 PassRefPtr<Range> Internals::markerRangeForNode(Node* node, const String& marker Type, unsigned index, ExceptionState& es)
890 { 890 {
891 DocumentMarker* marker = markerAt(node, markerType, index, es); 891 DocumentMarker* marker = markerAt(node, markerType, index, es);
892 if (!marker) 892 if (!marker)
893 return 0; 893 return 0;
894 return Range::create(&node->document(), node, marker->startOffset(), node, m arker->endOffset()); 894 return Range::create(node->document(), node, marker->startOffset(), node, ma rker->endOffset());
895 } 895 }
896 896
897 String Internals::markerDescriptionForNode(Node* node, const String& markerType, unsigned index, ExceptionState& es) 897 String Internals::markerDescriptionForNode(Node* node, const String& markerType, unsigned index, ExceptionState& es)
898 { 898 {
899 DocumentMarker* marker = markerAt(node, markerType, index, es); 899 DocumentMarker* marker = markerAt(node, markerType, index, es);
900 if (!marker) 900 if (!marker)
901 return String(); 901 return String();
902 return marker->description(); 902 return marker->description();
903 } 903 }
904 904
905 void Internals::addTextMatchMarker(const Range* range, bool isActive) 905 void Internals::addTextMatchMarker(const Range* range, bool isActive)
906 { 906 {
907 range->ownerDocument()->updateLayoutIgnorePendingStylesheets(); 907 range->ownerDocument().updateLayoutIgnorePendingStylesheets();
908 range->ownerDocument()->markers()->addTextMatchMarker(range, isActive); 908 range->ownerDocument().markers()->addTextMatchMarker(range, isActive);
909 } 909 }
910 910
911 void Internals::setMarkersActive(Node* node, unsigned startOffset, unsigned endO ffset, bool active, ExceptionState& es) 911 void Internals::setMarkersActive(Node* node, unsigned startOffset, unsigned endO ffset, bool active, ExceptionState& es)
912 { 912 {
913 if (!node) { 913 if (!node) {
914 es.throwDOMException(InvalidAccessError); 914 es.throwDOMException(InvalidAccessError);
915 return; 915 return;
916 } 916 }
917 917
918 node->document().markers()->setMarkersActive(node, startOffset, endOffset, a ctive); 918 node->document().markers()->setMarkersActive(node, startOffset, endOffset, a ctive);
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 return false; 2211 return false;
2212 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); 2212 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
2213 // To prevent tests that call loseSharedGraphicsContext3D from being 2213 // To prevent tests that call loseSharedGraphicsContext3D from being
2214 // flaky, we call finish so that the context is guaranteed to be lost 2214 // flaky, we call finish so that the context is guaranteed to be lost
2215 // synchronously (i.e. before returning). 2215 // synchronously (i.e. before returning).
2216 sharedContext->finish(); 2216 sharedContext->finish();
2217 return true; 2217 return true;
2218 } 2218 }
2219 2219
2220 } 2220 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698