| Index: third_party/WebKit/Source/web/WebSurroundingText.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebSurroundingText.cpp b/third_party/WebKit/Source/web/WebSurroundingText.cpp
|
| index 497251765e9751444098988dca7b50a379e065ed..e7cec9067ea4485a5deada655d62ae5efcf1c368 100644
|
| --- a/third_party/WebKit/Source/web/WebSurroundingText.cpp
|
| +++ b/third_party/WebKit/Source/web/WebSurroundingText.cpp
|
| @@ -58,6 +58,8 @@ void WebSurroundingText::initialize(const WebNode& webNode,
|
| if (!node->layoutObject())
|
| return;
|
|
|
| + // TODO(xiaochengh): The followinng SurroundingText can hold a null Range,
|
| + // in which case we should prevent it from being stored in |m_private|.
|
| m_private.reset(new SurroundingText(
|
| createVisiblePosition(node->layoutObject()->positionForPoint(
|
| static_cast<IntPoint>(nodePoint)))
|
| @@ -75,17 +77,14 @@ void WebSurroundingText::initializeFromCurrentSelection(WebLocalFrame* frame,
|
| webFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
|
|
| if (Range* range = createRange(
|
| - webFrame->selection().selection().toNormalizedEphemeralRange()))
|
| + webFrame->selection().selection().toNormalizedEphemeralRange())) {
|
| + // TODO(xiaochengh): The followinng SurroundingText can hold a null Range,
|
| + // in which case we should prevent it from being stored in |m_private|.
|
| m_private.reset(new SurroundingText(*range, maxLength));
|
| + }
|
| }
|
|
|
| WebString WebSurroundingText::textContent() const {
|
| - DCHECK(m_private->document());
|
| -
|
| - // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| - // needs to be audited. See http://crbug.com/590369 for more details.
|
| - m_private->document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
| -
|
| return m_private->content();
|
| }
|
|
|
|
|