| Index: third_party/WebKit/Source/core/dom/Document.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
| index fc9c4b2bd381f60c2b2a059bd747c87622edb883..46f0658d21a716d9ddf8a846e4344f883babf777 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -368,13 +368,6 @@ static inline bool isValidNamePart(UChar32 c) {
|
| return true;
|
| }
|
|
|
| -static FrameViewBase* widgetForElement(const Element& focusedElement) {
|
| - LayoutObject* layoutObject = focusedElement.layoutObject();
|
| - if (!layoutObject || !layoutObject->isLayoutPart())
|
| - return 0;
|
| - return toLayoutPart(layoutObject)->frameViewBase();
|
| -}
|
| -
|
| static bool acceptsEditingFocus(const Element& element) {
|
| DCHECK(hasEditableStyle(element));
|
|
|
| @@ -4040,7 +4033,8 @@ bool Document::setFocusedElement(Element* prpNewFocusedElement,
|
| }
|
|
|
| if (view()) {
|
| - FrameViewBase* oldFrameViewBase = widgetForElement(*oldFocusedElement);
|
| + FrameViewBase* oldFrameViewBase = oldFocusedElement->frameViewBase();
|
| +
|
| if (oldFrameViewBase)
|
| oldFrameViewBase->setFocused(false, params.type);
|
| else
|
| @@ -4114,14 +4108,14 @@ bool Document::setFocusedElement(Element* prpNewFocusedElement,
|
| // eww, I suck. set the qt focus correctly
|
| // ### find a better place in the code for this
|
| if (view()) {
|
| - FrameViewBase* focusFrameViewBase = widgetForElement(*m_focusedElement);
|
| + FrameViewBase* focusFrameViewBase = m_focusedElement->frameViewBase();
|
| if (focusFrameViewBase) {
|
| // Make sure a FrameViewBase has the right size before giving it focus.
|
| // Otherwise, we are testing edge cases of the FrameViewBase code.
|
| // Specifically, in WebCore this does not work well for text fields.
|
| updateStyleAndLayout();
|
| // Re-get the FrameViewBase in case updating the layout changed things.
|
| - focusFrameViewBase = widgetForElement(*m_focusedElement);
|
| + focusFrameViewBase = m_focusedElement->frameViewBase();
|
| }
|
| if (focusFrameViewBase)
|
| focusFrameViewBase->setFocused(true, params.type);
|
|
|