WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-87352-20120524173823.patch (text/plain), 7.16 KB, created by
Shinya Kawanaka
on 2012-05-24 01:38:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Shinya Kawanaka
Created:
2012-05-24 01:38:24 PDT
Size:
7.16 KB
patch
obsolete
>Subversion Revision: 118292 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c22cbd9f8558660e1179119e08837cf3fb680db1..c0d35bd4b225416428f560604110678e35bcc0de 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2012-05-24 Shinya Kawanaka <shinyak@chromium.org> >+ >+ cut, copy or paste event won't be fired in Shadow DOM. >+ https://bugs.webkit.org/show_bug.cgi?id=87352 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ cut, copy or paste event was not fired in Shadow DOM. >+ Since event re-targeting has been implemented, it should be safe to fire them in Shadow DOM now. >+ >+ Tests: fast/dom/shadow/cppevent-in-shadow.html >+ fast/dom/shadow/cppevent-input-in-shadow.html >+ >+ * editing/Editor.cpp: >+ (WebCore::Editor::findEventTargetFrom): >+ > 2012-05-23 Huang Dongsung <luxtella@company100.net> > > Remove unused declarations in MemoryCache.h >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index 6f45481633d3760f73882734bc9254f18637f686..4878270ea8d611e1c11b1545ba75b511c8a4bace 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -674,8 +674,8 @@ Node* Editor::findEventTargetFrom(const VisibleSelection& selection) const > target = m_frame->document()->body(); > if (!target) > return 0; >- return target->shadowAncestorNode(); > >+ return target; > } > > Node* Editor::findEventTargetFromSelection() const >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index bd437808827382a524a293abb118e5c736f5406c..9b05610a7d1b09d4720efa89db30e1f9d07b5157 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2012-05-24 Shinya Kawanaka <shinyak@chromium.org> >+ >+ cut, copy or paste event won't be fired in Shadow DOM. >+ https://bugs.webkit.org/show_bug.cgi?id=87352 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/dom/shadow/cppevent-in-shadow-expected.txt: Added. >+ * fast/dom/shadow/cppevent-in-shadow.html: Added. >+ * fast/dom/shadow/cppevent-input-in-shadow-expected.txt: Added. >+ * fast/dom/shadow/cppevent-input-in-shadow.html: Added. >+ > 2012-05-23 Eric Seidel <eric@webkit.org> > > Add seamless layout code (and pass most of the remaining seamless tests) >diff --git a/LayoutTests/fast/dom/shadow/cppevent-in-shadow-expected.txt b/LayoutTests/fast/dom/shadow/cppevent-in-shadow-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..cbe72250178181510064a47cfa4939999d54cd55 >--- /dev/null >+++ b/LayoutTests/fast/dom/shadow/cppevent-in-shadow-expected.txt >@@ -0,0 +1,10 @@ >+dark: copy is fired. >+host: copy is fired. >+dark: cut is fired. >+host: cut is fired. >+dark: paste is fired. >+host: paste is fired. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/dom/shadow/cppevent-in-shadow.html b/LayoutTests/fast/dom/shadow/cppevent-in-shadow.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e1872a55d3905dd06b39fa7aa5c1f2e6e2d26155 >--- /dev/null >+++ b/LayoutTests/fast/dom/shadow/cppevent-in-shadow.html >@@ -0,0 +1,61 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<script src="resources/polyfill.js"></script> >+<script src="../resources/event-sender-util.js"></script> >+<script src="../../js/resources/js-test-pre.js"></script> >+ >+<div id="host"></div> >+<pre id="console"></pre> >+ >+<script> >+function addListeners(element, name) { >+ var eventNames = ['copy', 'cut', 'paste']; >+ for (var i = 0; i < eventNames.length; ++i) { >+ (function(i) { >+ element.addEventListener(eventNames[i], function(e) { >+ debug(name + ': ' + eventNames[i] + ' is fired.'); >+ }); >+ })(i); >+ } >+} >+ >+function createBox(name) { >+ var div = document.createElement('div'); >+ div.style.width = '100px'; >+ div.style.height = '100px'; >+ div.setAttribute('contenteditable', true); >+ >+ return div; >+} >+ >+ >+var shadowRoot = new WebKitShadowRoot(host); >+var div = document.createElement('div'); >+shadowRoot.appendChild(div); >+ >+var darkRoot = new WebKitShadowRoot(div); >+var box = createBox('dark'); >+box.innerHTML = "Kotori Otonashi"; >+darkRoot.appendChild(box); >+ >+addListeners(box, 'dark'); >+addListeners(host, 'host'); >+ >+if (window.eventSender) { >+ eventSender.mouseMoveTo(box.offsetLeft, box.offsetTop + box.offsetHeight / 2); >+ eventSender.mouseDown(); >+ eventSender.mouseMoveTo(box.offsetLeft + box.offsetWidth, box.offsetTop + box.offsetHeight / 2); >+ eventSender.mouseUp(); >+} >+ >+document.execCommand('copy'); >+document.execCommand('cut'); >+document.execCommand('paste'); >+ >+var successfullyParsed = true; >+</script> >+ >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/fast/dom/shadow/cppevent-input-in-shadow-expected.txt b/LayoutTests/fast/dom/shadow/cppevent-input-in-shadow-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..cbe72250178181510064a47cfa4939999d54cd55 >--- /dev/null >+++ b/LayoutTests/fast/dom/shadow/cppevent-input-in-shadow-expected.txt >@@ -0,0 +1,10 @@ >+dark: copy is fired. >+host: copy is fired. >+dark: cut is fired. >+host: cut is fired. >+dark: paste is fired. >+host: paste is fired. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/dom/shadow/cppevent-input-in-shadow.html b/LayoutTests/fast/dom/shadow/cppevent-input-in-shadow.html >new file mode 100644 >index 0000000000000000000000000000000000000000..93f357bb245fbfde656056f3d4e87526499aa8ac >--- /dev/null >+++ b/LayoutTests/fast/dom/shadow/cppevent-input-in-shadow.html >@@ -0,0 +1,59 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<script src="resources/polyfill.js"></script> >+<script src="../resources/event-sender-util.js"></script> >+<script src="../../js/resources/js-test-pre.js"></script> >+ >+<div id="host"></div> >+<pre id="console"></pre> >+ >+<script> >+function addListeners(element, name) { >+ var eventNames = ['copy', 'cut', 'paste']; >+ for (var i = 0; i < eventNames.length; ++i) { >+ (function(i) { >+ element.addEventListener(eventNames[i], function(e) { >+ debug(name + ': ' + eventNames[i] + ' is fired.'); >+ }); >+ })(i); >+ } >+} >+ >+function createInput() { >+ var div = document.createElement('input'); >+ div.style.width = '100px'; >+ div.style.height = '100px'; >+ return div; >+} >+ >+ >+var shadowRoot = new WebKitShadowRoot(host); >+var div = document.createElement('div'); >+shadowRoot.appendChild(div); >+ >+var darkRoot = new WebKitShadowRoot(div); >+var input = createInput(); >+input.setAttribute('value', 'Kotori Otonashi'); >+darkRoot.appendChild(input); >+ >+addListeners(input, 'dark'); >+addListeners(host, 'host'); >+ >+if (window.eventSender) { >+ eventSender.mouseMoveTo(input.offsetLeft, input.offsetTop + input.offsetHeight / 2); >+ eventSender.mouseDown(); >+ eventSender.mouseMoveTo(input.offsetLeft + input.offsetWidth, input.offsetTop + input.offsetHeight / 2); >+ eventSender.mouseUp(); >+} >+ >+document.execCommand('copy'); >+document.execCommand('cut'); >+document.execCommand('paste'); >+ >+var successfullyParsed = true; >+</script> >+ >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 87352
: 143758