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

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

Issue 307353002: Use Position instead of VisiblePosition for SurroundingText. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 years, 6 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
« no previous file with comments | « Source/core/editing/SurroundingTextTest.cpp ('k') | Source/web/WebSurroundingText.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after
2332 void Internals::setValueForUser(Element* element, const String& value) 2332 void Internals::setValueForUser(Element* element, const String& value)
2333 { 2333 {
2334 toHTMLInputElement(element)->setValueForUser(value); 2334 toHTMLInputElement(element)->setValueForUser(value);
2335 } 2335 }
2336 2336
2337 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) 2337 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength)
2338 { 2338 {
2339 if (!node) 2339 if (!node)
2340 return String(); 2340 return String();
2341 blink::WebPoint point(x, y); 2341 blink::WebPoint point(x, y);
2342 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); 2342 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredEquivalent( ), maxLength);
2343 return surroundingText.content(); 2343 return surroundingText.content();
2344 } 2344 }
2345 2345
2346 void Internals::setFocused(bool focused) 2346 void Internals::setFocused(bool focused)
2347 { 2347 {
2348 frame()->page()->focusController().setFocused(focused); 2348 frame()->page()->focusController().setFocused(focused);
2349 } 2349 }
2350 2350
2351 void Internals::setNetworkStateNotifierTestOnly(bool testOnly) 2351 void Internals::setNetworkStateNotifierTestOnly(bool testOnly)
2352 { 2352 {
(...skipping 16 matching lines...) Expand all
2369 } else if (type == "none") { 2369 } else if (type == "none") {
2370 webtype = blink::ConnectionTypeNone; 2370 webtype = blink::ConnectionTypeNone;
2371 } else { 2371 } else {
2372 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type)); 2372 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type));
2373 return; 2373 return;
2374 } 2374 }
2375 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2375 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2376 } 2376 }
2377 2377
2378 } // namespace WebCore 2378 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/SurroundingTextTest.cpp ('k') | Source/web/WebSurroundingText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698