mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1472887, focusin/out should be composed, and mark chrome event target chain items as chrome, r=masayuki
This commit is contained in:
parent
9df2f94e3d
commit
7146d67afe
@ -773,6 +773,10 @@ MayRetargetToChromeIfCanNotHandleEvent(
|
||||
EventTargetChainItem* chromeTargetEtci =
|
||||
EventTargetChainItemForChromeTarget(aChain, aContent, aChildEtci);
|
||||
if (chromeTargetEtci) {
|
||||
// If we propagate to chrome, need to ensure we mark
|
||||
// EventTargetChainItem to be chrome handler so that event.composedPath()
|
||||
// can return the right value.
|
||||
chromeTargetEtci->SetIsChromeHandler(true);
|
||||
chromeTargetEtci->GetEventTargetParent(aPreVisitor);
|
||||
return chromeTargetEtci;
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
[test-003.html]
|
||||
[A_05_05_03_T01]
|
||||
expected: FAIL
|
||||
prefs: [dom.webcomponents.shadowdom.enabled:true]
|
||||
|
||||
|
@ -45,6 +45,7 @@ A_05_05_03_T01.step(unit(function (ctx) {
|
||||
s.appendChild(input2);
|
||||
|
||||
input1.addEventListener('focusin', A_05_05_03_T01.step_func(function(event) {
|
||||
assert_equals(event.composed, true);
|
||||
assert_equals(event.composedPath().length, 7);
|
||||
assert_equals(event.composedPath()[0].id, 'input1');
|
||||
assert_equals(event.composedPath()[1].id, 'shadow');
|
||||
@ -55,6 +56,10 @@ A_05_05_03_T01.step(unit(function (ctx) {
|
||||
assert_equals(event.composedPath()[6], ctx.iframes[0].contentWindow);
|
||||
}), false);
|
||||
|
||||
input1.addEventListener('focusout', A_05_05_03_T01.step_func(function(event) {
|
||||
assert_equals(event.composed, true);
|
||||
}), false);
|
||||
|
||||
input2.addEventListener('focusin', A_05_05_03_T01.step_func(function(event) {
|
||||
assert_equals(event.composedPath().length, 2);
|
||||
assert_equals(event.composedPath()[0].id, 'input2');
|
||||
|
@ -932,7 +932,8 @@ public:
|
||||
mFlags.mComposed = mMessage == eEditorInput;
|
||||
break;
|
||||
case eFocusEventClass:
|
||||
mFlags.mComposed = mMessage == eBlur || mMessage == eFocus;
|
||||
mFlags.mComposed = mMessage == eBlur || mMessage == eFocus ||
|
||||
mMessage == eFocusOut || mMessage == eFocusIn;
|
||||
break;
|
||||
case eKeyboardEventClass:
|
||||
mFlags.mComposed = mMessage == eKeyDown || mMessage == eKeyUp ||
|
||||
|
Loading…
Reference in New Issue
Block a user