Unreviewed, rolling out r153925.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2013 20:54:48 +0000 (20:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2013 20:54:48 +0000 (20:54 +0000)
http://trac.webkit.org/changeset/153925
https://bugs.webkit.org/show_bug.cgi?id=119768

broke fast/media/media-query-list-07.html (Requested by kling
on #webkit).

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(JSValueToNative):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::JSTestCallback):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
* css/MediaAllInOne.cpp:
* css/MediaQueryListListener.cpp: Copied from Source/WebCore/css/MediaQueryListListener.idl.
(WebCore::MediaQueryListListener::queryChanged):
* css/MediaQueryListListener.h:
(WebCore::MediaQueryListListener::create):
(WebCore::MediaQueryListListener::operator==):
(WebCore::MediaQueryListListener::MediaQueryListListener):
* css/MediaQueryListListener.idl:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::Listener::evaluate):
(WebCore::MediaQueryMatcher::styleResolverChanged):
* css/MediaQueryMatcher.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154020 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/DerivedSources.pri
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/css/MediaAllInOne.cpp
Source/WebCore/css/MediaQueryListListener.cpp [new file with mode: 0644]
Source/WebCore/css/MediaQueryListListener.h
Source/WebCore/css/MediaQueryListListener.idl
Source/WebCore/css/MediaQueryMatcher.cpp
Source/WebCore/css/MediaQueryMatcher.h

index 3cd6c83..5a7a454 100644 (file)
@@ -316,7 +316,6 @@ set(WebCore_IDL_FILES
     css/FontLoader.idl
     css/MediaList.idl
     css/MediaQueryList.idl
-    css/MediaQueryListListener.idl
     css/RGBColor.idl
     css/Rect.idl
     css/StyleMedia.idl
@@ -1075,6 +1074,7 @@ set(WebCore_SOURCES
     css/MediaQueryEvaluator.cpp
     css/MediaQueryExp.cpp
     css/MediaQueryList.cpp
+    css/MediaQueryListListener.cpp
     css/MediaQueryMatcher.cpp
     css/PageRuleCollector.cpp
     css/PropertySetCSSStyleDeclaration.cpp
index c6e7561..1d7378f 100644 (file)
@@ -1,3 +1,43 @@
+2013-08-13  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r153925.
+        http://trac.webkit.org/changeset/153925
+        https://bugs.webkit.org/show_bug.cgi?id=119768
+
+        broke fast/media/media-query-list-07.html (Requested by kling
+        on #webkit).
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * DerivedSources.pri:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateCallbackHeader):
+        (GenerateCallbackImplementation):
+        (JSValueToNative):
+        * bindings/scripts/IDLAttributes.txt:
+        * bindings/scripts/test/JS/JSTestCallback.cpp:
+        (WebCore::JSTestCallback::JSTestCallback):
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+        (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
+        * css/MediaAllInOne.cpp:
+        * css/MediaQueryListListener.cpp: Copied from Source/WebCore/css/MediaQueryListListener.idl.
+        (WebCore::MediaQueryListListener::queryChanged):
+        * css/MediaQueryListListener.h:
+        (WebCore::MediaQueryListListener::create):
+        (WebCore::MediaQueryListListener::operator==):
+        (WebCore::MediaQueryListListener::MediaQueryListListener):
+        * css/MediaQueryListListener.idl:
+        * css/MediaQueryMatcher.cpp:
+        (WebCore::MediaQueryMatcher::Listener::evaluate):
+        (WebCore::MediaQueryMatcher::styleResolverChanged):
+        * css/MediaQueryMatcher.h:
+
 2013-08-13  Simon Fraser  <simon.fraser@apple.com>
 
         Every scroll causes additional layer tree work because of flatteningLayer->removeFromParent();
index 925aad8..9f5eb2e 100644 (file)
 #include "JSMediaError.cpp"
 #include "JSMediaList.cpp"
 #include "JSMediaQueryList.cpp"
-#include "JSMediaQueryListListener.cpp"
 #if ENABLE(MEDIA_SOURCE)
 #include "JSMediaSource.cpp"
 #endif
index 36c0a4d..ddd08ac 100644 (file)
@@ -651,7 +651,7 @@ BINDING_IDLS = \
 
 DOM_CLASSES=$(basename $(notdir $(BINDING_IDLS)))
 
-JS_DOM_HEADERS=$(filter-out JSEventListener.h, $(DOM_CLASSES:%=JS%.h))
+JS_DOM_HEADERS=$(filter-out JSMediaQueryListListener.h JSEventListener.h, $(DOM_CLASSES:%=JS%.h))
 
 WEB_DOM_HEADERS :=
 
index 93297fc..aac1097 100644 (file)
@@ -209,7 +209,6 @@ IDL_BINDINGS += \
     $$PWD/css/FontLoader.idl \
     $$PWD/css/MediaList.idl \
     $$PWD/css/MediaQueryList.idl \
-    $$PWD/css/MediaQueryListListener.idl \
     $$PWD/css/Rect.idl \
     $$PWD/css/RGBColor.idl \
     $$PWD/css/StyleMedia.idl \
index fc7a632..4f208a7 100644 (file)
@@ -527,8 +527,6 @@ webcore_built_sources += \
        DerivedSources/WebCore/JSMediaStreamTrackEvent.h \
        DerivedSources/WebCore/JSMediaQueryList.cpp \
        DerivedSources/WebCore/JSMediaQueryList.h \
-       DerivedSources/WebCore/JSMediaQueryListListener.cpp \
-       DerivedSources/WebCore/JSMediaQueryListListener.h \
        DerivedSources/WebCore/JSMessageChannel.cpp \
        DerivedSources/WebCore/JSMessageChannel.h \
        DerivedSources/WebCore/JSMessageEvent.cpp \
@@ -1363,7 +1361,6 @@ dom_binding_idls += \
        $(WebCore)/css/FontLoader.idl \
        $(WebCore)/css/MediaList.idl \
        $(WebCore)/css/MediaQueryList.idl \
-       $(WebCore)/css/MediaQueryListListener.idl \
        $(WebCore)/css/RGBColor.idl \
        $(WebCore)/css/Rect.idl \
        $(WebCore)/css/StyleMedia.idl \
@@ -2720,6 +2717,7 @@ webcore_sources += \
        Source/WebCore/css/MediaQueryExp.h \
        Source/WebCore/css/MediaQueryList.cpp \
        Source/WebCore/css/MediaQueryList.h \
+       Source/WebCore/css/MediaQueryListListener.cpp \
        Source/WebCore/css/MediaQueryListListener.h \
        Source/WebCore/css/MediaQueryMatcher.cpp \
        Source/WebCore/css/MediaQueryMatcher.h \
index ad01a51..7db1f29 100644 (file)
@@ -317,6 +317,7 @@ SOURCES += \
     css/MediaQueryEvaluator.cpp \
     css/MediaQueryExp.cpp \
     css/MediaQueryList.cpp \
+    css/MediaQueryListListener.cpp \
     css/MediaQueryMatcher.cpp \
     css/PageRuleCollector.cpp \
     css/PropertySetCSSStyleDeclaration.cpp \
index 5a488b0..7ad5e4b 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaQueryListListener.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMessageChannel.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="..\css\MediaQueryListListener.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\css\MediaQueryMatcher.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaError.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaList.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaQueryList.h" />
-    <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaQueryListListener.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMessageChannel.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMessageEvent.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMessagePort.h" />
index a7a69d1..3260bce 100644 (file)
     <ClCompile Include="..\css\MediaQueryList.cpp">
       <Filter>css</Filter>
     </ClCompile>
+    <ClCompile Include="..\css\MediaQueryListListener.cpp">
+      <Filter>css</Filter>
+    </ClCompile>
     <ClCompile Include="..\css\MediaQueryMatcher.cpp">
       <Filter>css</Filter>
     </ClCompile>
     <ClCompile Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaQueryList.cpp">
       <Filter>DerivedSources</Filter>
     </ClCompile>
-    <ClCompile Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaQueryListListener.cpp">
-      <Filter>DerivedSources</Filter>
-    </ClCompile>
     <ClCompile Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMessageChannel.cpp">
       <Filter>DerivedSources</Filter>
     </ClCompile>
     <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaQueryList.h">
       <Filter>DerivedSources</Filter>
     </ClInclude>
-    <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMediaQueryListListener.h">
-      <Filter>DerivedSources</Filter>
-    </ClInclude>
     <ClInclude Include="$(ConfigurationBuildDir)\obj32\$(ProjectName)\DerivedSources\JSMessageChannel.h">
       <Filter>DerivedSources</Filter>
     </ClInclude>
index e7c4463..dce831c 100644 (file)
                7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; };
                7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; };
-               7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */; };
-               7C5343FD17B74B63004232F0 /* JSMediaQueryListListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */; };
                7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */; };
                7CE30DA9171B63D200EC33E1 /* FrameSnapshottingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CE30DA7171B63D200EC33E1 /* FrameSnapshottingMac.mm */; };
                7CE30DAA171B63D200EC33E1 /* FrameSnapshottingMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE30DA8171B63D200EC33E1 /* FrameSnapshottingMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                D23CA56C0AB0EB8D005108A5 /* RangeException.h in Headers */ = {isa = PBXBuildFile; fileRef = D23CA56B0AB0EB8D005108A5 /* RangeException.h */; };
                D302754912A5FE84004BD828 /* RenderDetailsMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D302754512A5FE84004BD828 /* RenderDetailsMarker.cpp */; };
                D302754A12A5FE84004BD828 /* RenderDetailsMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = D302754612A5FE84004BD828 /* RenderDetailsMarker.h */; };
+               D340629B1253BC8C009E4259 /* MediaQueryListListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D340629A1253BC8C009E4259 /* MediaQueryListListener.cpp */; };
                D359D789129CA2710006E5D2 /* HTMLDetailsElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D359D786129CA2710006E5D2 /* HTMLDetailsElement.cpp */; };
                D359D78A129CA2710006E5D2 /* HTMLDetailsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = D359D787129CA2710006E5D2 /* HTMLDetailsElement.h */; };
                D359D791129CA3C00006E5D2 /* DOMHTMLDetailsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = D359D78E129CA3C00006E5D2 /* DOMHTMLDetailsElement.h */; };
                7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; };
                7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorOverlay.cpp; sourceTree = "<group>"; };
                7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorOverlay.h; sourceTree = "<group>"; };
-               7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaQueryListListener.cpp; sourceTree = "<group>"; };
-               7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSMediaQueryListListener.h; sourceTree = "<group>"; };
                7C60128060078BB70E367A95 /* DNSResolveQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNSResolveQueue.cpp; sourceTree = "<group>"; };
                7C6136F61710C35200FF4A57 /* Hasher.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = Hasher.pm; path = scripts/Hasher.pm; sourceTree = "<group>"; };
                7C6136F71710C35200FF4A57 /* InFilesCompiler.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = InFilesCompiler.pm; path = scripts/InFilesCompiler.pm; sourceTree = "<group>"; };
                D23CA56B0AB0EB8D005108A5 /* RangeException.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RangeException.h; sourceTree = "<group>"; };
                D302754512A5FE84004BD828 /* RenderDetailsMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderDetailsMarker.cpp; sourceTree = "<group>"; };
                D302754612A5FE84004BD828 /* RenderDetailsMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderDetailsMarker.h; sourceTree = "<group>"; };
+               D340629A1253BC8C009E4259 /* MediaQueryListListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaQueryListListener.cpp; sourceTree = "<group>"; };
                D359D786129CA2710006E5D2 /* HTMLDetailsElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDetailsElement.cpp; sourceTree = "<group>"; };
                D359D787129CA2710006E5D2 /* HTMLDetailsElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLDetailsElement.h; sourceTree = "<group>"; };
                D359D788129CA2710006E5D2 /* HTMLDetailsElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLDetailsElement.idl; sourceTree = "<group>"; };
                                BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */,
                                D3A94A42122DC40F00A37BBC /* JSMediaQueryList.cpp */,
                                D3A94A43122DC40F00A37BBC /* JSMediaQueryList.h */,
-                               7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */,
-                               7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */,
                                BCFE2F0F0C1B58370020235F /* JSRect.cpp */,
                                BCFE2F100C1B58370020235F /* JSRect.h */,
                                BC74DA461013F468007987AD /* JSRGBColor.cpp */,
                                D3A94A31122DABAC00A37BBC /* MediaQueryList.cpp */,
                                D3A94A32122DABAC00A37BBC /* MediaQueryList.h */,
                                D3A94A33122DABAC00A37BBC /* MediaQueryList.idl */,
+                               D340629A1253BC8C009E4259 /* MediaQueryListListener.cpp */,
                                D3A94A34122DABAC00A37BBC /* MediaQueryListListener.h */,
                                D3A94A35122DABAC00A37BBC /* MediaQueryListListener.idl */,
                                D3AA10F1123A98AA0092152B /* MediaQueryMatcher.cpp */,
                                E1CDE9221501916900862CC5 /* AsyncFileStream.h in Headers */,
                                89D08DA012228451001241DF /* AsyncFileSystem.h in Headers */,
                                89D08DA112228451001241DF /* AsyncFileSystemCallbacks.h in Headers */,
-                               7C5343FD17B74B63004232F0 /* JSMediaQueryListListener.h in Headers */,
                                976D6C77122B8A3D001FD1F7 /* AsyncFileWriter.h in Headers */,
                                976D6C93122B8A3D001FD1F7 /* AsyncFileWriterClient.h in Headers */,
                                37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */,
                                85DF2C5D0AA341F600AD64C5 /* DOMHTMLFormElement.mm in Sources */,
                                85DF81960AA77E4B00486AD7 /* DOMHTMLFrameElement.mm in Sources */,
                                85DF81980AA77E4B00486AD7 /* DOMHTMLFrameSetElement.mm in Sources */,
-                               7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */,
                                85992EBB0AA5069500AC0785 /* DOMHTMLHeadElement.mm in Sources */,
                                85183B450AA6926100F19FA3 /* DOMHTMLHeadingElement.mm in Sources */,
                                85ECBEF20AA7626900544F0B /* DOMHTMLHRElement.mm in Sources */,
                                4E19592B0A39DACC00220FE5 /* MediaQueryEvaluator.cpp in Sources */,
                                4E19592D0A39DACC00220FE5 /* MediaQueryExp.cpp in Sources */,
                                D3A94A38122DABAC00A37BBC /* MediaQueryList.cpp in Sources */,
+                               D340629B1253BC8C009E4259 /* MediaQueryListListener.cpp in Sources */,
                                D3AA10F3123A98AA0092152B /* MediaQueryMatcher.cpp in Sources */,
                                FD671A77159BB07000197559 /* MediaStreamAudioSourceNode.cpp in Sources */,
                                BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */,
index 452fa2a..5eacbfe 100644 (file)
@@ -3131,10 +3131,6 @@ sub GenerateCallbackHeader
     # Destructor
     push(@headerContent, "    virtual ~$className();\n");
 
-    if ($interface->extendedAttributes->{"CallbackNeedsOperatorEqual"}) {
-        push(@headerContent, "    virtual bool operator==(const $interfaceName&) const;\n\n")
-    }
-
     # Functions
     my $numFunctions = @{$interface->functions};
     if ($numFunctions > 0) {
@@ -3193,12 +3189,7 @@ sub GenerateCallbackImplementation
 
     # Constructor
     push(@implContent, "${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n");
-    if ($interface->extendedAttributes->{"CallbackNeedsOperatorEqual"}) {
-        push(@implContent, "    : ${interfaceName}(${className}Type)\n");
-    } else {
-        push(@implContent, "    : ${interfaceName}()\n");
-    }
-    push(@implContent, "    , ActiveDOMCallback(globalObject->scriptExecutionContext())\n");
+    push(@implContent, "    : ActiveDOMCallback(globalObject->scriptExecutionContext())\n");
     push(@implContent, "    , m_data(new JSCallbackData(callback, globalObject))\n");
     push(@implContent, "{\n");
     push(@implContent, "}\n\n");
@@ -3216,16 +3207,8 @@ sub GenerateCallbackImplementation
     push(@implContent, "#ifndef NDEBUG\n");
     push(@implContent, "    m_data = 0;\n");
     push(@implContent, "#endif\n");
-    push(@implContent, "}\n\n");
+    push(@implContent, "}\n");
 
-    if ($interface->extendedAttributes->{"CallbackNeedsOperatorEqual"}) {
-        push(@implContent, "bool ${className}::operator==(const ${interfaceName}& other) const\n");
-        push(@implContent, "{\n");
-        push(@implContent, "    if (other.type() != type())\n");
-        push(@implContent, "        return false;\n");
-        push(@implContent, "    return static_cast<const ${className}*>(&other)->m_data->callback() == m_data->callback();\n");
-        push(@implContent, "}\n\n");
-    }
     # Functions
     my $numFunctions = @{$interface->functions};
     if ($numFunctions > 0) {
@@ -3356,7 +3339,8 @@ my %nativeType = (
     "unsigned long long" => "unsigned long long",
     "byte" => "int8_t",
     "octet" => "uint8_t",
-    "DOMTimeStamp" => "DOMTimeStamp",
+    "MediaQueryListListener" => "RefPtr<MediaQueryListListener>",
+    "DOMTimeStamp" => "DOMTimeStamp",    
 );
 
 sub GetNativeType
@@ -3491,6 +3475,11 @@ sub JSValueToNative
         return "to$type(exec->vm(), $value)";
     }
 
+    if ($type eq "MediaQueryListListener") {
+        AddToImplIncludes("MediaQueryListListener.h", $conditional);
+        return "MediaQueryListListener::create(ScriptValue(exec->vm(), " . $value ."))";
+    }
+
     if ($type eq "SerializedScriptValue") {
         AddToImplIncludes("SerializedScriptValue.h", $conditional);
         return "SerializedScriptValue::create(exec, $value, 0, 0)";
index 8f9caf7..f9e1538 100644 (file)
@@ -21,7 +21,6 @@
 ActiveDOMObject
 CPPPureInterface
 CachedAttribute
-CallbackNeedsOperatorEqual
 CallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack
 CheckSecurity
 CheckSecurityForNode
index 49e5932..3f0afb2 100644 (file)
@@ -36,8 +36,7 @@ using namespace JSC;
 namespace WebCore {
 
 JSTestCallback::JSTestCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
-    : TestCallback()
-    , ActiveDOMCallback(globalObject->scriptExecutionContext())
+    : ActiveDOMCallback(globalObject->scriptExecutionContext())
     , m_data(new JSCallbackData(callback, globalObject))
 {
 }
@@ -56,7 +55,6 @@ JSTestCallback::~JSTestCallback()
 #endif
 }
 
-
 // Functions
 
 bool JSTestCallback::callbackWithNoParam()
index e29605b..1fcefa0 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "ExceptionCode.h"
 #include "JSDOMBinding.h"
-#include "JSMediaQueryListListener.h"
+#include "MediaQueryListListener.h"
 #include "TestMediaQueryListListener.h"
 #include <runtime/Error.h>
 #include <wtf/GetPtr.h>
@@ -167,9 +167,9 @@ EncodedJSValue JSC_HOST_CALL jsTestMediaQueryListListenerPrototypeFunctionMethod
     TestMediaQueryListListener* impl = static_cast<TestMediaQueryListListener*>(castedThis->impl());
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction())
-        return throwVMTypeError(exec);
-    RefPtr<MediaQueryListListener> listener = JSMediaQueryListListener::create(asObject(exec->argument(0)), castedThis->globalObject());
+    RefPtr<MediaQueryListListener> listener(MediaQueryListListener::create(ScriptValue(exec->vm(), exec->argument(0))));
+    if (exec->hadException())
+        return JSValue::encode(jsUndefined());
     impl->method(listener);
     return JSValue::encode(jsUndefined());
 }
index fe289d5..3c71b82 100644 (file)
@@ -31,4 +31,5 @@
 #include "MediaQueryEvaluator.cpp"
 #include "MediaQueryExp.cpp"
 #include "MediaQueryList.cpp"
+#include "MediaQueryListListener.cpp"
 #include "MediaQueryMatcher.cpp"
diff --git a/Source/WebCore/css/MediaQueryListListener.cpp b/Source/WebCore/css/MediaQueryListListener.cpp
new file mode 100644 (file)
index 0000000..f771a09
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "MediaQueryListListener.h"
+
+#include "MediaQueryList.h"
+#include "ScriptFunctionCall.h"
+
+#include "JSMediaQueryList.h"
+
+namespace WebCore {
+
+void MediaQueryListListener::queryChanged(ScriptState* state, MediaQueryList* query)
+{
+    ScriptCallback callback(state, m_value);
+    callback.appendArgument(toJS(state, deprecatedGlobalObjectForPrototype(state), query));
+    callback.call();
+}
+
+}
index 737d71c..930e8ee 100644 (file)
 #ifndef MediaQueryListListener_h
 #define MediaQueryListListener_h
 
+#include "ScriptState.h"
+#include "ScriptValue.h"
 #include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
 class MediaQueryList;
 
+// See http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface
+
 class MediaQueryListListener : public RefCounted<MediaQueryListListener> {
 public:
-    enum Type {
-        JSMediaQueryListListenerType
-    };
-
-    virtual bool queryChanged(MediaQueryList*) = 0;
-    virtual bool operator==(const MediaQueryListListener&) const = 0;
-    virtual ~MediaQueryListListener() { }
-
-    Type type() const { return m_type; }
-
-protected:
-    explicit MediaQueryListListener(Type type)
-        : m_type(type)
+    static PassRefPtr<MediaQueryListListener> create(const ScriptValue& value)
     {
+        if (!value.isFunction())
+            return 0;
+        return adoptRef(new MediaQueryListListener(value));
     }
+    void queryChanged(ScriptState*, MediaQueryList*);
+
+    bool operator==(const MediaQueryListListener& other) const { return m_value == other.m_value; }
 
 private:
-    Type m_type;
+    MediaQueryListListener(const ScriptValue& value) : m_value(value) { }
+
+    ScriptValue m_value;
 };
 
-} // namespace WebCore
+}
 
 #endif // MediaQueryListListener_h
index 5c320ff..0ffdcfa 100644 (file)
  */
 
 [
-    CallbackNeedsOperatorEqual
-] callback interface MediaQueryListListener {
-    boolean queryChanged([Default=Undefined] optional MediaQueryList list);
+    NoInterfaceObject,
+    JSNoStaticTables,
+    ObjCProtocol,
+    CPPPureInterface,
+] interface MediaQueryListListener {
+    void queryChanged([Default=Undefined] optional MediaQueryList list);
 };
index 44d9057..6ff2f1d 100644 (file)
@@ -42,12 +42,12 @@ MediaQueryMatcher::Listener::~Listener()
 {
 }
 
-void MediaQueryMatcher::Listener::evaluate(MediaQueryEvaluator* evaluator)
+void MediaQueryMatcher::Listener::evaluate(ScriptState* state, MediaQueryEvaluator* evaluator)
 {
     bool notify;
     m_query->evaluate(evaluator, notify);
     if (notify)
-        m_listener->queryChanged(m_query.get());
+        m_listener->queryChanged(state, m_query.get());
 }
 
 MediaQueryMatcher::MediaQueryMatcher(Document* document)
@@ -141,13 +141,17 @@ void MediaQueryMatcher::styleResolverChanged()
 {
     ASSERT(m_document);
 
+    ScriptState* scriptState = mainWorldScriptState(m_document->frame());
+    if (!scriptState)
+        return;
+
     ++m_evaluationRound;
     OwnPtr<MediaQueryEvaluator> evaluator = prepareEvaluator();
     if (!evaluator)
         return;
 
     for (size_t i = 0; i < m_listeners.size(); ++i)
-        m_listeners[i]->evaluate(evaluator.get());
+        m_listeners[i]->evaluate(scriptState, evaluator.get());
 }
 
-} // namespace WebCore
+}
index c6f7d77..6eae35f 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef MediaQueryMatcher_h
 #define MediaQueryMatcher_h
 
+#include "ScriptState.h"
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
@@ -58,7 +59,7 @@ private:
         Listener(PassRefPtr<MediaQueryListListener>, PassRefPtr<MediaQueryList>);
         ~Listener();
 
-        void evaluate(MediaQueryEvaluator*);
+        void evaluate(ScriptState*, MediaQueryEvaluator*);
 
         MediaQueryListListener* listener() { return m_listener.get(); }
         MediaQueryList* query() { return m_query.get(); }
@@ -81,6 +82,6 @@ private:
     unsigned m_evaluationRound;
 };
 
-} // namespace WebCore
+}
 
 #endif // MediaQueryMatcher_h