From b65aeee9ac8791718427d14fd30b3ee7f8f157eb Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Sat, 26 Nov 2011 10:33:09 +0900 Subject: [PATCH] Bug 703186 Use system event listener for focus/blur event handling for element r=smaug --- layout/generic/nsImageMap.cpp | 16 ++++++------- layout/reftests/bugs/703186-1-ref.html | 23 +++++++++++++++++++ layout/reftests/bugs/703186-1.html | 25 +++++++++++++++++++++ layout/reftests/bugs/703186-2-ref.html | 29 ++++++++++++++++++++++++ layout/reftests/bugs/703186-2.html | 31 ++++++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 3 +++ 6 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 layout/reftests/bugs/703186-1-ref.html create mode 100644 layout/reftests/bugs/703186-1.html create mode 100644 layout/reftests/bugs/703186-2-ref.html create mode 100644 layout/reftests/bugs/703186-2.html diff --git a/layout/generic/nsImageMap.cpp b/layout/generic/nsImageMap.cpp index 6a9f25fd371..36eb47b82d6 100644 --- a/layout/generic/nsImageMap.cpp +++ b/layout/generic/nsImageMap.cpp @@ -738,10 +738,10 @@ nsImageMap::FreeAreas() "Unexpected primary frame"); area->mArea->SetPrimaryFrame(nsnull); - area->mArea->RemoveEventListener(NS_LITERAL_STRING("focus"), this, - false); - area->mArea->RemoveEventListener(NS_LITERAL_STRING("blur"), this, - false); + area->mArea->RemoveSystemEventListener(NS_LITERAL_STRING("focus"), this, + false); + area->mArea->RemoveSystemEventListener(NS_LITERAL_STRING("blur"), this, + false); delete area; } mAreas.Clear(); @@ -859,10 +859,10 @@ nsImageMap::AddArea(nsIContent* aArea) return NS_ERROR_OUT_OF_MEMORY; //Add focus listener to track area focus changes - aArea->AddEventListener(NS_LITERAL_STRING("focus"), this, false, - false); - aArea->AddEventListener(NS_LITERAL_STRING("blur"), this, false, - false); + aArea->AddSystemEventListener(NS_LITERAL_STRING("focus"), this, false, + false); + aArea->AddSystemEventListener(NS_LITERAL_STRING("blur"), this, false, + false); // This is a nasty hack. It needs to go away: see bug 135040. Once this is // removed, the code added to nsCSSFrameConstructor::RestyleElement, diff --git a/layout/reftests/bugs/703186-1-ref.html b/layout/reftests/bugs/703186-1-ref.html new file mode 100644 index 00000000000..40a6e6eebb0 --- /dev/null +++ b/layout/reftests/bugs/703186-1-ref.html @@ -0,0 +1,23 @@ + + + + + + + + + + + + diff --git a/layout/reftests/bugs/703186-1.html b/layout/reftests/bugs/703186-1.html new file mode 100644 index 00000000000..1a2d21f4d16 --- /dev/null +++ b/layout/reftests/bugs/703186-1.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/layout/reftests/bugs/703186-2-ref.html b/layout/reftests/bugs/703186-2-ref.html new file mode 100644 index 00000000000..2e883bb3cbb --- /dev/null +++ b/layout/reftests/bugs/703186-2-ref.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/layout/reftests/bugs/703186-2.html b/layout/reftests/bugs/703186-2.html new file mode 100644 index 00000000000..312f0e8c7df --- /dev/null +++ b/layout/reftests/bugs/703186-2.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index b4d44a9f948..2dce0ebcaf5 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1673,3 +1673,6 @@ fails-if(layersGPUAccelerated&&cocoaWidget) == 654950-1.html 654950-1-ref.html # == 691571-1.html 691571-1-ref.html == 696307-1.html 696307-1-ref.html == 696739-1.html 696739-1-ref.html +needs-focus == 703186-1.html 703186-1-ref.html +needs-focus == 703186-2.html 703186-2-ref.html +needs-focus != 703186-1.html 703186-2.html