| OLD | NEW |
| 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 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2424 ContextLifecycleObserver::trace(visitor); | 2424 ContextLifecycleObserver::trace(visitor); |
| 2425 } | 2425 } |
| 2426 | 2426 |
| 2427 void Internals::setValueForUser(Element* element, const String& value) | 2427 void Internals::setValueForUser(Element* element, const String& value) |
| 2428 { | 2428 { |
| 2429 toHTMLInputElement(element)->setValueForUser(value); | 2429 toHTMLInputElement(element)->setValueForUser(value); |
| 2430 } | 2430 } |
| 2431 | 2431 |
| 2432 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2432 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
| 2433 { | 2433 { |
| 2434 if (!node || !node->layoutObject()) | 2434 if (!node) |
| 2435 return String(); |
| 2436 |
| 2437 // VisiblePosition and SurroundingText must be created with clean layout. |
| 2438 node->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 2439 DocumentLifecycle::DisallowTransitionScope disallowTransition(node->document
().lifecycle()); |
| 2440 |
| 2441 if (!node->layoutObject()) |
| 2435 return String(); | 2442 return String(); |
| 2436 blink::WebPoint point(x, y); | 2443 blink::WebPoint point(x, y); |
| 2437 SurroundingText surroundingText(createVisiblePositionDeprecated(node->layout
Object()->positionForPoint(static_cast<IntPoint>(point))).deepEquivalent().paren
tAnchoredEquivalent(), maxLength); | 2444 SurroundingText surroundingText(createVisiblePosition(node->layoutObject()->
positionForPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredE
quivalent(), maxLength); |
| 2438 return surroundingText.content(); | 2445 return surroundingText.content(); |
| 2439 } | 2446 } |
| 2440 | 2447 |
| 2441 void Internals::setFocused(bool focused) | 2448 void Internals::setFocused(bool focused) |
| 2442 { | 2449 { |
| 2443 if (!frame()) | 2450 if (!frame()) |
| 2444 return; | 2451 return; |
| 2445 | 2452 |
| 2446 frame()->page()->focusController().setFocused(focused); | 2453 frame()->page()->focusController().setFocused(focused); |
| 2447 } | 2454 } |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2685 | 2692 |
| 2686 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); | 2693 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); |
| 2687 } | 2694 } |
| 2688 | 2695 |
| 2689 void Internals::crash() | 2696 void Internals::crash() |
| 2690 { | 2697 { |
| 2691 CHECK(false) << "Intentional crash"; | 2698 CHECK(false) << "Intentional crash"; |
| 2692 } | 2699 } |
| 2693 | 2700 |
| 2694 } // namespace blink | 2701 } // namespace blink |
| OLD | NEW |