summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbroman@chromium.org <jbroman@chromium.org>2014-11-14 18:18:55 +0000
committerjbroman@chromium.org <jbroman@chromium.org>2014-11-14 18:18:55 +0000
commite04d7acb6883d4223be6b7885395d1f67e1dc8fe (patch)
treefc6e2133892b2e439569781a465ac8fa408a5cd1
parent8f305b2ca8635aaf0d4353c6388d8050bf78987f (diff)
downloadchromium_src-e04d7acb6883d4223be6b7885395d1f67e1dc8fe.zip
chromium_src-e04d7acb6883d4223be6b7885395d1f67e1dc8fe.tar.gz
chromium_src-e04d7acb6883d4223be6b7885395d1f67e1dc8fe.tar.bz2
Revert of HTMLPlugInElement: Use custom focus logic only when there is a plugin. (patchset #1 id:1 of https://codereview.chromium.org/717193003/)
Reason for revert: probable cause of use-after-free: https://code.google.com/p/chromium/issues/detail?id=433357 Original issue's description: > HTMLPlugInElement: Use custom focus logic only when there is a plugin. > > This allows focus to enter and leave plugin placeholders, so that constituent > elements (such as a close button) can be keyboard-focused. > > TEST=fast/plugins/plugin/placeholder-focus.html > BUG=364716 > > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185290 TBR=mkwst@chromium.org,esprehn@chromium.org NOTREECHECKS=true NOTRY=true BUG=364716 Review URL: https://codereview.chromium.org/729573002 git-svn-id: svn://svn.chromium.org/blink/trunk@185383 bbb929c8-8fbe-4397-9dbb-9b2b20218538
-rw-r--r--third_party/WebKit/LayoutTests/fast/plugins/plugin-placeholder-focus-expected.txt14
-rw-r--r--third_party/WebKit/LayoutTests/fast/plugins/plugin-placeholder-focus.html27
-rw-r--r--third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp6
3 files changed, 1 insertions, 46 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/plugins/plugin-placeholder-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/plugins/plugin-placeholder-focus-expected.txt
deleted file mode 100644
index edb8a5e..0000000
--- a/third_party/WebKit/LayoutTests/fast/plugins/plugin-placeholder-focus-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Ensures that elements within a plugin placeholder can be keyboard focused.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS document.activeElement is input1
-PASS shadowRoot1.activeElement is null
-PASS document.activeElement is plugin1
-PASS shadowRoot1.activeElement is non-null.
-PASS document.activeElement is input1
-PASS shadowRoot1.activeElement is null
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/fast/plugins/plugin-placeholder-focus.html b/third_party/WebKit/LayoutTests/fast/plugins/plugin-placeholder-focus.html
deleted file mode 100644
index fc4ce93..0000000
--- a/third_party/WebKit/LayoutTests/fast/plugins/plugin-placeholder-focus.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<script src="../../resources/js-test.js"></script>
-<div id="description"></div>
-<div id="console"></div>
-
-<input id="input1">
-<object id="plugin1" type="application/x-fake-plugin"></object>
-
-<script>
-description('Ensures that elements within a plugin placeholder can be keyboard focused.');
-
-// Close buttons are focusable, so we expect focus to move into and out of the placeholder.
-var input1 = document.getElementById("input1");
-var plugin1 = document.getElementById("plugin1");
-internals.forcePluginPlaceholder(plugin1, { closeable: true });
-var shadowRoot1 = internals.youngestShadowRoot(plugin1);
-input1.focus();
-shouldBe("document.activeElement", "input1");
-shouldBeNull("shadowRoot1.activeElement");
-eventSender.keyDown("\t");
-shouldBe("document.activeElement", "plugin1");
-shouldBeNonNull("shadowRoot1.activeElement");
-eventSender.keyDown("\t", ["shiftKey"]);
-shouldBe("document.activeElement", "input1");
-shouldBeNull("shadowRoot1.activeElement");
-document.activeElement.blur();
-</script>
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
index df9adf0..5f5dd4f 100644
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
@@ -390,18 +390,14 @@ RenderPart* HTMLPlugInElement::renderPartForJSBindings() const
bool HTMLPlugInElement::isKeyboardFocusable() const
{
- if (useFallbackContent() || usePlaceholderContent())
- return HTMLElement::isKeyboardFocusable();
-
if (!document().isActive())
return false;
-
return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(pluginWidget())->supportsKeyboardFocus();
}
bool HTMLPlugInElement::hasCustomFocusLogic() const
{
- return renderer() && renderer()->isEmbeddedObject();
+ return !hasAuthorShadowRoot();
}
bool HTMLPlugInElement::isPluginElement() const