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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2739573005: Rename Document::widgetForElement to frameViewBaseForElement (Closed)
Patch Set: Move Document::widgetForElement to Node::frameViewBase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.h » ('j') | third_party/WebKit/Source/core/dom/Node.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.h » ('j') | third_party/WebKit/Source/core/dom/Node.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698