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

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

Issue 1326563002: Introduce visiblePositionOf() with PositionWithAffinity as replacement of VisiblePosition constructo (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-01T10:55:04 Created 5 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
« no previous file with comments | « Source/core/layout/HitTestResult.cpp ('k') | Source/web/ContextMenuClientImpl.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 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after
2311 void Internals::setValueForUser(Element* element, const String& value) 2311 void Internals::setValueForUser(Element* element, const String& value)
2312 { 2312 {
2313 toHTMLInputElement(element)->setValueForUser(value); 2313 toHTMLInputElement(element)->setValueForUser(value);
2314 } 2314 }
2315 2315
2316 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) 2316 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength)
2317 { 2317 {
2318 if (!node || !node->layoutObject()) 2318 if (!node || !node->layoutObject())
2319 return String(); 2319 return String();
2320 blink::WebPoint point(x, y); 2320 blink::WebPoint point(x, y);
2321 SurroundingText surroundingText(VisiblePosition(node->layoutObject()->positi onForPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredEquival ent(), maxLength); 2321 SurroundingText surroundingText(visiblePositionOf(node->layoutObject()->posi tionForPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredEquiv alent(), maxLength);
2322 return surroundingText.content(); 2322 return surroundingText.content();
2323 } 2323 }
2324 2324
2325 void Internals::setFocused(bool focused) 2325 void Internals::setFocused(bool focused)
2326 { 2326 {
2327 frame()->page()->focusController().setFocused(focused); 2327 frame()->page()->focusController().setFocused(focused);
2328 } 2328 }
2329 2329
2330 void Internals::setInitialFocus(bool reverse) 2330 void Internals::setInitialFocus(bool reverse)
2331 { 2331 {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
2462 2462
2463 return animator->setScrollbarsVisibleForTesting(visible); 2463 return animator->setScrollbarsVisibleForTesting(visible);
2464 } 2464 }
2465 2465
2466 void Internals::forceRestrictIFramePermissions() 2466 void Internals::forceRestrictIFramePermissions()
2467 { 2467 {
2468 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); 2468 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true);
2469 } 2469 }
2470 2470
2471 } // namespace blink 2471 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/HitTestResult.cpp ('k') | Source/web/ContextMenuClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698