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-52195-20110111111052.patch (text/plain), 16.21 KB, created by
Dimitri Glazkov (Google)
on 2011-01-11 11:10:54 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dimitri Glazkov (Google)
Created:
2011-01-11 11:10:54 PST
Size:
16.21 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index a07bfd9bd51f096d49b401710ea638e7262933a4..ae19b9221d4b3e301eac90d15198210f2c73ce80 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2011-01-11 Dimitri Glazkov <dglazkov@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ REGRESSION(r71934) Can't type in search edit field on skin-one.com >+ https://bugs.webkit.org/show_bug.cgi?id=52195 >+ >+ * fast/events/shadow-boundary-crossing-2-expected.txt: Removed. >+ * fast/events/shadow-boundary-crossing-2.html: Removed. >+ * fast/events/shadow-boundary-crossing-expected.txt: >+ * fast/events/shadow-boundary-crossing.html: >+ > 2011-01-11 Stephen White <senorblanco@chromium.org> > > Unreviewed; yet another gpu test_expectations update. >diff --git a/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt b/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt >deleted file mode 100644 >index a2f1ece9434fc0da4884da513c54ff3655530edf..0000000000000000000000000000000000000000 >--- a/LayoutTests/fast/events/shadow-boundary-crossing-2-expected.txt >+++ /dev/null >@@ -1,10 +0,0 @@ >-Tests to ensure that shadow DOM boundary is not crossed during event propagation. Can only run within DRT. >- >-See bug 46015 for details. >- >-Mutation events should not propagate out of the shadow DOM: PASS >-Label should look beyond shadow boundary to detect if it encloses its associated element: PASS >-Events for default event handler should not be retargeted: PASS >-Other events should be retargeted: PASS >-After event dispatch, the event object should not reveal shadow DOM: PASS >-Focusing same shadow DOM element repeatedly should not trigger multiple focus/blur events: PASS >diff --git a/LayoutTests/fast/events/shadow-boundary-crossing-2.html b/LayoutTests/fast/events/shadow-boundary-crossing-2.html >deleted file mode 100644 >index 91b362f57b81e152f3a0e96c4126bb8d0ed24b8a..0000000000000000000000000000000000000000 >--- a/LayoutTests/fast/events/shadow-boundary-crossing-2.html >+++ /dev/null >@@ -1,147 +0,0 @@ >-<html> >-<head> >-<script> >- >-var logDiv; >- >-function log(msg, success) >-{ >- logDiv.appendChild(document.createElement('div')).textContent = msg + ': ' + (success ? 'PASS' : 'FAIL'); >-} >- >-function clickOn(element) >-{ >- if (!window.eventSender) >- return; >- >- var x = element.offsetLeft + element.offsetWidth / 2; >- var y = element.offsetTop + element.offsetHeight / 2; >- eventSender.mouseMoveTo(x, y); >- eventSender.mouseDown(); >- eventSender.mouseUp(); >-} >- >-function clickOnLeftQuarterOf(element) >-{ >- if (!window.eventSender) >- return; >- >- var x = element.offsetLeft + element.offsetWidth / 4; >- var y = element.offsetTop + element.offsetHeight / 2; >- eventSender.mouseMoveTo(x, y); >- eventSender.mouseDown(); >- eventSender.mouseUp(); >-} >- >-function leapForward() >-{ >- if (!window.eventSender) >- return; >- >- eventSender.leapForward(1000); >-} >- >-var tests = { >- mutationEventPropagation: function() >- { >- var textarea = document.body.appendChild(document.createElement('textarea')); >- var mutationEventFired; >- textarea.addEventListener('DOMSubtreeModified', function(e) >- { >- mutationEventFired = true; >- }, false); >- textarea.value = 'test'; >- // Trigger style recalc and sadly, the actual mutation of the textarea shadow DOM. >- textarea.offsetHeight; >- log('Mutation events should not propagate out of the shadow DOM', !mutationEventFired); >- textarea.parentNode.removeChild(textarea); >- }, >- labelSyntheticClick: function() >- { >- var count = 0; >- var label = document.body.appendChild(document.createElement('label')); >- var searchInput = label.appendChild(document.createElement('input')); >- searchInput.setAttribute('type', 'search'); >- searchInput.setAttribute('id', 'baz'); >- label.setAttribute('for', 'baz'); >- searchInput.addEventListener('click', function(e) >- { >- count++; >- }, false); >- clickOn(searchInput); >- log("Label should look beyond shadow boundary to detect if it encloses its associated element", count == 1); >- label.parentNode.removeChild(label); >- }, >- defaultEventRetargeting: function() >- { >- var count = 0; >- var fileInput = document.body.appendChild(document.createElement('input')); >- fileInput.setAttribute('type', 'file'); >- var counter = function() >- { >- count++; >- } >- document.body.addEventListener('DOMActivate', counter, false); >- clickOnLeftQuarterOf(fileInput); >- log("Events for default event handler should not be retargeted", count == 1); >- document.body.removeEventListener('DOMActivate', counter, false); >- fileInput.parentNode.removeChild(fileInput); >- }, >- eventInProgress: function() >- { >- var textInput = document.body.appendChild(document.createElement('input')); >- textInput.addEventListener('click', function(e) >- { >- log('Other events should be retargeted', e.target == textInput); >- }, false); >- clickOn(textInput); >- textInput.parentNode.removeChild(textInput); >- }, >- finalEventObject: function() >- { >- var textInput = document.body.appendChild(document.createElement('input')); >- var storedEvent; >- textInput.addEventListener('click', function(e) >- { >- storedEvent = e; >- }, false); >- clickOn(textInput); >- log('After event dispatch, the event object should not reveal shadow DOM', storedEvent && storedEvent.target == textInput); >- textInput.parentNode.removeChild(textInput); >- }, >- focusEventPropagation: function() >- { >- var searchInput = document.body.appendChild(document.createElement('input')); >- searchInput.setAttribute('type', 'search'); >- var count = 0; >- searchInput.addEventListener('focus', function(evt) >- { >- count++; >- }); >- clickOn(searchInput); >- leapForward(); >- clickOn(searchInput); >- log('Focusing same shadow DOM element repeatedly should not trigger multiple focus/blur events', count == 1); >- searchInput.parentNode.removeChild(searchInput); >- } >-}; >- >-function runTest() >-{ >- if (window.layoutTestController) >- layoutTestController.dumpAsText(); >- >- logDiv = document.getElementById('log'); >- for(var testName in tests) { >- tests[testName](); >- } >-} >- >-</script> >-</head> >-<body onload="runTest()"> >- <p>Tests to ensure that shadow DOM boundary is not crossed during event propagation. Can only run within DRT. >- <p>See <a href="https://bugs.webkit.org/show_bug.cgi?id=46015">bug 46015</a> for details. >- <div id="log"></div> >-</body> >-</html> >\ No newline at end of file >diff --git a/LayoutTests/fast/events/shadow-boundary-crossing-expected.txt b/LayoutTests/fast/events/shadow-boundary-crossing-expected.txt >index fd729d944b72e4bafbce0fcace770e725c4abb2a..678f3ab3f8d3dce7397a1b9436b5d673a6161f2c 100644 >--- a/LayoutTests/fast/events/shadow-boundary-crossing-expected.txt >+++ b/LayoutTests/fast/events/shadow-boundary-crossing-expected.txt >@@ -1,5 +1,11 @@ >-Test for http://bugs.webkit.org/show_bug.cgi?id=12780 REGRESSION (r19341-r19385): Reproducible crash in "onselectstart" event. >- >-Result: PASS >+Tests to ensure that shadow DOM boundary is not crossed during event propagation. Can only run within DRT. > >+See bug 46015 for details. > >+Mutation events should not propagate out of the shadow DOM: PASS >+The selectstart event should not propagate out of the shadow DOM: PASS >+Label should look beyond shadow boundary to detect if it encloses its associated element: PASS >+Events for default event handler should not be retargeted: PASS >+Other events should be retargeted: PASS >+After event dispatch, the event object should not reveal shadow DOM: PASS >+Focusing same shadow DOM element repeatedly should not trigger multiple focus/blur events: PASS >diff --git a/LayoutTests/fast/events/shadow-boundary-crossing.html b/LayoutTests/fast/events/shadow-boundary-crossing.html >index e0023330e1dc16c67db901114241c63bb1eda11d..4e8486b2be69812c0691735429f38d1759fcfee2 100644 >--- a/LayoutTests/fast/events/shadow-boundary-crossing.html >+++ b/LayoutTests/fast/events/shadow-boundary-crossing.html >@@ -1,43 +1,160 @@ > <html> > <head> >- <title></title> >- <script type="text/javascript"> >- var success; >- var target; >+<script> > >- function selectStart(event) >- { >- success = event.target == target; >- } >+var logDiv; > >- function test() >- { >- if (!window.layoutTestController) >- return; >- layoutTestController.dumpAsText(); >+function log(msg, success) >+{ >+ logDiv.appendChild(document.createElement('div')).textContent = msg + ': ' + (success ? 'PASS' : 'FAIL'); >+} >+ >+function clickOn(element) >+{ >+ if (!window.eventSender) >+ return; >+ >+ var x = element.offsetLeft + element.offsetWidth / 2; >+ var y = element.offsetTop + element.offsetHeight / 2; >+ eventSender.mouseMoveTo(x, y); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+} > >- target = document.getElementById("target"); >- var x = target.offsetLeft + target.offsetWidth / 2; >- var y = target.offsetTop + target.offsetHeight / 2; >+function clickOnLeftQuarterOf(element) >+{ >+ if (!window.eventSender) >+ return; > >- eventSender.mouseMoveTo(x, y); >- eventSender.mouseDown(); >- eventSender.mouseUp(); >+ var x = element.offsetLeft + element.offsetWidth / 4; >+ var y = element.offsetTop + element.offsetHeight / 2; >+ eventSender.mouseMoveTo(x, y); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+} > >- document.getElementById("result").innerText = !success ? "FAIL" : "PASS"; >+function leapForward() >+{ >+ if (!window.eventSender) >+ return; >+ >+ eventSender.leapForward(1000); >+} >+ >+var tests = { >+ mutationEventPropagation: function() >+ { >+ var textarea = document.body.appendChild(document.createElement('textarea')); >+ var mutationEventFired; >+ textarea.addEventListener('DOMSubtreeModified', function(e) >+ { >+ mutationEventFired = true; >+ }, false); >+ textarea.value = 'test'; >+ // Trigger style recalc and sadly, the actual mutation of the textarea shadow DOM. >+ textarea.offsetHeight; >+ log('Mutation events should not propagate out of the shadow DOM', !mutationEventFired); >+ textarea.parentNode.removeChild(textarea); >+ }, >+ selectstartEventPropagation: function() >+ { >+ var textInput = document.body.appendChild(document.createElement('input')); >+ var selectstartEventFired = false; >+ document.selectstart = function() >+ { >+ selectstartEventFired = true; > } >+ clickOn(textInput); >+ log('The selectstart event should not propagate out of the shadow DOM', !selectstartEventFired); >+ textInput.parentNode.removeChild(textInput); >+ document.selectstart = null; >+ }, >+ labelSyntheticClick: function() >+ { >+ var count = 0; >+ var label = document.body.appendChild(document.createElement('label')); >+ var searchInput = label.appendChild(document.createElement('input')); >+ searchInput.setAttribute('type', 'search'); >+ searchInput.setAttribute('id', 'baz'); >+ label.setAttribute('for', 'baz'); >+ searchInput.addEventListener('click', function(e) >+ { >+ count++; >+ }, false); >+ clickOn(searchInput); >+ log("Label should look beyond shadow boundary to detect if it encloses its associated element", count == 1); >+ label.parentNode.removeChild(label); >+ }, >+ defaultEventRetargeting: function() >+ { >+ var count = 0; >+ var fileInput = document.body.appendChild(document.createElement('input')); >+ fileInput.setAttribute('type', 'file'); >+ var counter = function() >+ { >+ count++; >+ } >+ document.body.addEventListener('DOMActivate', counter, false); >+ clickOnLeftQuarterOf(fileInput); >+ log("Events for default event handler should not be retargeted", count == 1); >+ document.body.removeEventListener('DOMActivate', counter, false); >+ fileInput.parentNode.removeChild(fileInput); >+ }, >+ eventInProgress: function() >+ { >+ var textInput = document.body.appendChild(document.createElement('input')); >+ textInput.addEventListener('click', function(e) >+ { >+ log('Other events should be retargeted', e.target == textInput); >+ }, false); >+ clickOn(textInput); >+ textInput.parentNode.removeChild(textInput); >+ }, >+ finalEventObject: function() >+ { >+ var textInput = document.body.appendChild(document.createElement('input')); >+ var storedEvent; >+ textInput.addEventListener('click', function(e) >+ { >+ storedEvent = e; >+ }, false); >+ clickOn(textInput); >+ log('After event dispatch, the event object should not reveal shadow DOM', storedEvent && storedEvent.target == textInput); >+ textInput.parentNode.removeChild(textInput); >+ }, >+ focusEventPropagation: function() >+ { >+ var searchInput = document.body.appendChild(document.createElement('input')); >+ searchInput.setAttribute('type', 'search'); >+ var count = 0; >+ searchInput.addEventListener('focus', function(evt) >+ { >+ count++; >+ }); >+ clickOn(searchInput); >+ leapForward(); >+ clickOn(searchInput); >+ log('Focusing same shadow DOM element repeatedly should not trigger multiple focus/blur events', count == 1); >+ searchInput.parentNode.removeChild(searchInput); >+ } >+}; >+ >+function runTest() >+{ >+ if (window.layoutTestController) >+ layoutTestController.dumpAsText(); >+ >+ logDiv = document.getElementById('log'); >+ for(var testName in tests) { >+ tests[testName](); >+ } >+} > >- addEventListener("selectstart", selectStart, true); >- </script> >+</script> > </head> >-<body onload="test()"> >- <p> >- Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=12780">http://bugs.webkit.org/show_bug.cgi?id=12780</a> >- REGRESSION (r19341-r19385): Reproducible crash in "onselectstart" event</i>. >- </p> >- <p> >- Result: <span id="result">cannot run interactively</span> >- </p> >- <input id="target"> >+<body onload="runTest()"> >+ <p>Tests to ensure that shadow DOM boundary is not crossed during event propagation. Can only run within DRT. >+ <p>See <a href="https://bugs.webkit.org/show_bug.cgi?id=46015">bug 46015</a> for details. >+ <div id="log"></div> > </body> >-</html> >+</html> >\ No newline at end of file >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9147f0ac3ed7a8030538ee812c19ef317ae4bc41..6d45698441a0d79bf14a3725a18bf634666fea70 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,13 @@ >+2011-01-11 Dimitri Glazkov <dglazkov@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ REGRESSION(r71934) Can't type in search edit field on skin-one.com >+ https://bugs.webkit.org/show_bug.cgi?id=52195 >+ >+ * dom/Node.cpp: >+ (WebCore::Node::dispatchGenericEvent): >+ > 2011-01-11 Csaba Osztrogonác <ossy@webkit.org> > > Unreviewed buildfix. >diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp >index a589282f20a65a6c617f80313b0ab298a4d6e8cc..ea735d76df5e69137254184e41db5a5de3797f00 100644 >--- a/Source/WebCore/dom/Node.cpp >+++ b/Source/WebCore/dom/Node.cpp >@@ -2625,7 +2625,7 @@ bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent) > RefPtr<Node> thisNode(this); > RefPtr<EventTarget> originalTarget = event->target(); > Vector<EventContext> ancestors; >- getEventAncestors(ancestors, originalTarget.get(), event->isMutationEvent() ? StayInsideShadowDOM : RetargetEvent); >+ getEventAncestors(ancestors, originalTarget.get(), event->isMutationEvent() || event->type() == eventNames().selectstartEvent ? StayInsideShadowDOM : RetargetEvent); > > WindowEventContext windowContext(event.get(), this, topEventContext(ancestors)); >
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 52195
:
78556
|
78559