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

Unified Diff: third_party/WebKit/Source/web/ExternalPopupMenu.cpp

Issue 1970653003: ExternalPopupMenu should recreate its popup only if a SELECT subtree is updated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ExternalPopupMenu::m_shownDOMTreeVersion Created 4 years, 7 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
Index: third_party/WebKit/Source/web/ExternalPopupMenu.cpp
diff --git a/third_party/WebKit/Source/web/ExternalPopupMenu.cpp b/third_party/WebKit/Source/web/ExternalPopupMenu.cpp
index 32b217e9cf6e0236efb2c97f96220a4d275b86ac..218c1cb67121e3a4f77a4cdc333eb569e9a3028d 100644
--- a/third_party/WebKit/Source/web/ExternalPopupMenu.cpp
+++ b/third_party/WebKit/Source/web/ExternalPopupMenu.cpp
@@ -95,10 +95,7 @@ bool ExternalPopupMenu::showInternal()
FloatQuad quad(toLayoutBox(layoutObject)->localToAbsoluteQuad(FloatQuad(toLayoutBox(layoutObject)->borderBoundingBox())));
IntRect rect(quad.enclosingBoundingBox());
IntRect rectInViewport = m_localFrame->view()->soonToBeRemovedContentsToUnscaledViewport(rect);
- // TODO(tkent): If the anchor rectangle is not visible, we should not
- // show a popup.
m_webExternalPopupMenu->show(rectInViewport);
- m_shownDOMTreeVersion = m_ownerElement->document().domTreeVersion();
return true;
} else {
// The client might refuse to create a popup (when there is already one pending to be shown for example).
@@ -144,12 +141,14 @@ void ExternalPopupMenu::hide()
void ExternalPopupMenu::updateFromElement()
{
- if (m_needsUpdate)
- return;
- // TOOD(tkent): Even if DOMTreeVersion is not changed, we should update the
+ // TOOD(tkent): Even if DOM mutation didn't happen, we should update the
// popup location/content in some cases. e.g. Updating ComputedStyle of the
// SELECT element affects popup position and OPTION style.
- if (m_shownDOMTreeVersion == m_ownerElement->document().domTreeVersion())
+}
+
+void ExternalPopupMenu::updateFromElementWithMutation()
+{
+ if (m_needsUpdate)
return;
m_needsUpdate = true;
m_ownerElement->document().postTask(BLINK_FROM_HERE, createSameThreadTask(&ExternalPopupMenu::update, this));

Powered by Google App Engine
This is Rietveld 408576698