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

Unified Diff: sky/engine/core/dom/Document.cpp

Issue 682263003: Remove RenderWidget. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « sky/engine/core/core.gni ('k') | sky/engine/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Document.cpp
diff --git a/sky/engine/core/dom/Document.cpp b/sky/engine/core/dom/Document.cpp
index 9534a0ffa3814b699416729b8df22152d6bfa645..465edccdaf8b363eb3ec1508d38d15b16f0665a3 100644
--- a/sky/engine/core/dom/Document.cpp
+++ b/sky/engine/core/dom/Document.cpp
@@ -133,7 +133,6 @@
#include "core/page/scrolling/ScrollingCoordinator.h"
#include "core/rendering/HitTestResult.h"
#include "core/rendering/RenderView.h"
-#include "core/rendering/RenderWidget.h"
#include "core/rendering/compositing/RenderLayerCompositor.h"
#include "platform/DateComponents.h"
#include "platform/EventDispatchForbiddenScope.h"
@@ -234,14 +233,6 @@ static inline bool isValidNamePart(UChar32 c)
return true;
}
-static Widget* widgetForElement(const Element& focusedElement)
-{
- RenderObject* renderer = focusedElement.renderer();
- if (!renderer || !renderer->isWidget())
- return 0;
- return toRenderWidget(renderer)->widget();
-}
-
static bool acceptsEditingFocus(const Element& element)
{
ASSERT(element.hasEditableStyle());
@@ -2085,13 +2076,8 @@ bool Document::setFocusedElement(PassRefPtr<Element> prpNewFocusedElement, Focus
}
}
- if (view()) {
- Widget* oldWidget = widgetForElement(*oldFocusedElement);
- if (oldWidget)
- oldWidget->setFocus(false);
- else
- view()->setFocus(false);
- }
+ if (view())
+ view()->setFocus(false);
}
if (newFocusedElement && newFocusedElement->isFocusable()) {
@@ -2139,23 +2125,8 @@ bool Document::setFocusedElement(PassRefPtr<Element> prpNewFocusedElement, Focus
if (m_focusedElement->isRootEditableElement())
frame()->spellChecker().didBeginEditing(m_focusedElement.get());
- // eww, I suck. set the qt focus correctly
- // ### find a better place in the code for this
- if (view()) {
- Widget* focusWidget = widgetForElement(*m_focusedElement);
- if (focusWidget) {
- // Make sure a widget has the right size before giving it focus.
- // Otherwise, we are testing edge cases of the Widget code.
- // Specifically, in WebCore this does not work well for text fields.
- updateLayout();
- // Re-get the widget in case updating the layout changed things.
- focusWidget = widgetForElement(*m_focusedElement);
- }
- if (focusWidget)
- focusWidget->setFocus(true);
- else
- view()->setFocus(true);
- }
+ if (view())
+ view()->setFocus(true);
}
if (!focusChangeBlocked && frameHost())
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698