Chromium Code Reviews| 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 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2391 ContextLifecycleObserver::trace(visitor); | 2391 ContextLifecycleObserver::trace(visitor); |
| 2392 } | 2392 } |
| 2393 | 2393 |
| 2394 void Internals::setValueForUser(Element* element, const String& value) | 2394 void Internals::setValueForUser(Element* element, const String& value) |
| 2395 { | 2395 { |
| 2396 toHTMLInputElement(element)->setValueForUser(value); | 2396 toHTMLInputElement(element)->setValueForUser(value); |
| 2397 } | 2397 } |
| 2398 | 2398 |
| 2399 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) | 2399 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) |
| 2400 { | 2400 { |
| 2401 if (!node || !node->layoutObject()) | 2401 if (!node || !node->layoutObject()) |
|
yosin_UTC9
2016/09/16 02:01:21
We should update layout before using |Node::layout
| |
| 2402 return String(); | 2402 return String(); |
| 2403 blink::WebPoint point(x, y); | 2403 blink::WebPoint point(x, y); |
| 2404 SurroundingText surroundingText(createVisiblePosition(node->layoutObject()-> positionForPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredE quivalent(), maxLength); | 2404 SurroundingText surroundingText(createVisiblePositionDeprecated(node->layout Object()->positionForPoint(static_cast<IntPoint>(point))).deepEquivalent().paren tAnchoredEquivalent(), maxLength); |
| 2405 return surroundingText.content(); | 2405 return surroundingText.content(); |
| 2406 } | 2406 } |
| 2407 | 2407 |
| 2408 void Internals::setFocused(bool focused) | 2408 void Internals::setFocused(bool focused) |
| 2409 { | 2409 { |
| 2410 if (!frame()) | 2410 if (!frame()) |
| 2411 return; | 2411 return; |
| 2412 | 2412 |
| 2413 frame()->page()->focusController().setFocused(focused); | 2413 frame()->page()->focusController().setFocused(focused); |
| 2414 } | 2414 } |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2652 | 2652 |
| 2653 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); | 2653 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); |
| 2654 } | 2654 } |
| 2655 | 2655 |
| 2656 void Internals::crash() | 2656 void Internals::crash() |
| 2657 { | 2657 { |
| 2658 CHECK(false) << "Intentional crash"; | 2658 CHECK(false) << "Intentional crash"; |
| 2659 } | 2659 } |
| 2660 | 2660 |
| 2661 } // namespace blink | 2661 } // namespace blink |
| OLD | NEW |