Skip to content

Commit

Permalink
Revert of evaluating clipboard event target acording to w3c specifica…
Browse files Browse the repository at this point in the history
…tion (patchset #7 id:120001 of https://codereview.chromium.org/2685723005/ )

Reason for revert:
Changing this functionality improved spec conformance, but introduced regressions where text that used to be copied is no longer copied:
crbug.com/695568
crbug.com/700163

A proposal to change the spec was made here:
w3c/clipboard-apis#40

Original issue's description:
> Make Editor::findEventTargetFrom() to align Clipboard API specification
>
> This patch changes |Editor::findEventTargetFrom()| to return focused element if
> selection start is not editable to align Clipboard API specification[1] for
> improving interoperability.
>
> [1] https://w3c.github.io/clipboard-apis/#to-fire-a-clipboard-event
>
> BUG=690104
> TEST=webkit_unittests --gtest_filter=ClipboardEventFlowTest.*
>
> Review-Url: https://codereview.chromium.org/2685723005
> Cr-Commit-Position: refs/heads/master@{#451716}
> Committed: https://chromium.googlesource.com/chromium/src/+/7afbab0f7619c89aa7a5896024d1628a59cc0ef1

TBR=tkent@chromium.org,ojan@chromium.org,yosin@chromium.org,yutak@chromium.org,sigbjornf@opera.com,mwrobel@opera.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=690104

Review-Url: https://codereview.chromium.org/2745813002
Cr-Commit-Position: refs/heads/master@{#456232}
  • Loading branch information
psybuzz authored and Commit bot committed Mar 11, 2017
1 parent d62ba1f commit 0b5fb5f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 158 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<body onpaste="paste(event)">
<div id="test">This test verifies that we can get types from the clipboard
<div id="test" onpaste="paste(event)">This test verifies that we can get types from the clipboard
during an onpaste event. This test requires DRT.</div>

<div id="results">FAIL</div>
Expand All @@ -25,4 +24,3 @@

runDumpAsTextEditingTest(false);
</script>
</body>
1 change: 0 additions & 1 deletion third_party/WebKit/Source/core/editing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ blink_core_sources("editing") {
source_set("unit_tests") {
testonly = true
sources = [
"ClipboardEventFlowTest.cpp",
"CompositionUnderlineTest.cpp",
"EditingCommandTest.cpp",
"EditingStrategyTest.cpp",
Expand Down
149 changes: 0 additions & 149 deletions third_party/WebKit/Source/core/editing/ClipboardEventFlowTest.cpp

This file was deleted.

4 changes: 1 addition & 3 deletions third_party/WebKit/Source/core/editing/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,7 @@ void Editor::registerCommandGroup(CompositeEditCommand* commandGroupWrapper) {
}

Element* Editor::findEventTargetFrom(const VisibleSelection& selection) const {
Element* target = selection.hasEditableStyle()
? associatedElementOf(selection.start())
: frame().document()->activeElement();
Element* target = associatedElementOf(selection.start());
if (!target)
target = frame().document()->body();

Expand Down
3 changes: 1 addition & 2 deletions third_party/WebKit/Source/core/html/HTMLButtonElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@
#ifndef HTMLButtonElement_h
#define HTMLButtonElement_h

#include "core/CoreExport.h"
#include "core/html/HTMLFormControlElement.h"

namespace blink {

class CORE_EXPORT HTMLButtonElement final : public HTMLFormControlElement {
class HTMLButtonElement final : public HTMLFormControlElement {
DEFINE_WRAPPERTYPEINFO();

public:
Expand Down

0 comments on commit 0b5fb5f

Please sign in to comment.