Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (153924 => 153925)
--- trunk/Source/WebCore/CMakeLists.txt 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/CMakeLists.txt 2013-08-11 20:11:19 UTC (rev 153925)
@@ -316,6 +316,7 @@
css/FontLoader.idl
css/MediaList.idl
css/MediaQueryList.idl
+ css/MediaQueryListListener.idl
css/RGBColor.idl
css/Rect.idl
css/StyleMedia.idl
@@ -1074,7 +1075,6 @@
css/MediaQueryEvaluator.cpp
css/MediaQueryExp.cpp
css/MediaQueryList.cpp
- css/MediaQueryListListener.cpp
css/MediaQueryMatcher.cpp
css/PageRuleCollector.cpp
css/PropertySetCSSStyleDeclaration.cpp
Modified: trunk/Source/WebCore/ChangeLog (153924 => 153925)
--- trunk/Source/WebCore/ChangeLog 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/ChangeLog 2013-08-11 20:11:19 UTC (rev 153925)
@@ -1,3 +1,48 @@
+2013-08-11 Sam Weinig <s...@webkit.org>
+
+ Cleanup MediaQueryListListener
+ https://bugs.webkit.org/show_bug.cgi?id=119664
+
+ Reviewed by Andreas Kling.
+
+ Make MediaQueryListListener a proper WebIDL callback.
+
+ * 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:
+ Update project files.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateCallbackHeader):
+ (GenerateCallbackImplementation):
+ (JSValueToNative):
+ * bindings/scripts/IDLAttributes.txt:
+ Add support for CallbackNeedsOperatorEqual, which adds an operator==.
+
+ * css/MediaAllInOne.cpp:
+ Remove MediaQueryListListener.cpp.
+
+ * css/MediaQueryListListener.cpp:
+ Removed.
+
+ * css/MediaQueryListListener.h:
+ (WebCore::MediaQueryListListener::~MediaQueryListListener):
+ (WebCore::MediaQueryListListener::MediaQueryListListener):
+ * css/MediaQueryListListener.idl:
+ Convert to a proper WebIDL callback.
+
+ * css/MediaQueryMatcher.cpp:
+ (WebCore::MediaQueryMatcher::Listener::evaluate):
+ (WebCore::MediaQueryMatcher::styleResolverChanged):
+ * css/MediaQueryMatcher.h:
+ Remove all traces of the ScriptState.
+
2013-08-11 Carlos Garcia Campos <cgar...@igalia.com>
Unreviewed. Fix make distcheck.
Modified: trunk/Source/WebCore/DerivedSources.cpp (153924 => 153925)
--- trunk/Source/WebCore/DerivedSources.cpp 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/DerivedSources.cpp 2013-08-11 20:11:19 UTC (rev 153925)
@@ -274,6 +274,7 @@
#include "JSMediaError.cpp"
#include "JSMediaList.cpp"
#include "JSMediaQueryList.cpp"
+#include "JSMediaQueryListListener.cpp"
#if ENABLE(MEDIA_SOURCE)
#include "JSMediaSource.cpp"
#endif
Modified: trunk/Source/WebCore/DerivedSources.make (153924 => 153925)
--- trunk/Source/WebCore/DerivedSources.make 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/DerivedSources.make 2013-08-11 20:11:19 UTC (rev 153925)
@@ -651,7 +651,7 @@
DOM_CLASSES=$(basename $(notdir $(BINDING_IDLS)))
-JS_DOM_HEADERS=$(filter-out JSMediaQueryListListener.h JSEventListener.h, $(DOM_CLASSES:%=JS%.h))
+JS_DOM_HEADERS=$(filter-out JSEventListener.h, $(DOM_CLASSES:%=JS%.h))
WEB_DOM_HEADERS :=
Modified: trunk/Source/WebCore/DerivedSources.pri (153924 => 153925)
--- trunk/Source/WebCore/DerivedSources.pri 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/DerivedSources.pri 2013-08-11 20:11:19 UTC (rev 153925)
@@ -209,6 +209,7 @@
$$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 \
Modified: trunk/Source/WebCore/GNUmakefile.list.am (153924 => 153925)
--- trunk/Source/WebCore/GNUmakefile.list.am 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2013-08-11 20:11:19 UTC (rev 153925)
@@ -527,6 +527,8 @@
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 \
@@ -1361,6 +1363,7 @@
$(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 \
@@ -2717,7 +2720,6 @@
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 \
Modified: trunk/Source/WebCore/Target.pri (153924 => 153925)
--- trunk/Source/WebCore/Target.pri 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/Target.pri 2013-08-11 20:11:19 UTC (rev 153925)
@@ -317,7 +317,6 @@
css/MediaQueryEvaluator.cpp \
css/MediaQueryExp.cpp \
css/MediaQueryList.cpp \
- css/MediaQueryListListener.cpp \
css/MediaQueryMatcher.cpp \
css/PageRuleCollector.cpp \
css/PropertySetCSSStyleDeclaration.cpp \
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (153924 => 153925)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2013-08-11 20:11:19 UTC (rev 153925)
@@ -3364,6 +3364,20 @@
<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>
@@ -9275,14 +9289,6 @@
<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>
@@ -18394,6 +18400,7 @@
<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" />
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (153924 => 153925)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters 2013-08-11 20:11:19 UTC (rev 153925)
@@ -2328,9 +2328,6 @@
<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>
@@ -6046,6 +6043,9 @@
<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>
@@ -13782,6 +13782,9 @@
<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>
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (153924 => 153925)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2013-08-11 20:11:19 UTC (rev 153925)
@@ -1959,6 +1959,8 @@
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, ); }; };
@@ -5277,7 +5279,6 @@
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 */; };
@@ -8390,6 +8391,8 @@
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>"; };
@@ -12047,7 +12050,6 @@
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>"; };
@@ -17284,6 +17286,8 @@
BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */,
D3A94A42122DC40F00A37BBC /* JSMediaQueryList.cpp */,
D3A94A43122DC40F00A37BBC /* JSMediaQueryList.h */,
+ 7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */,
+ 7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */,
BCFE2F0F0C1B58370020235F /* JSRect.cpp */,
BCFE2F100C1B58370020235F /* JSRect.h */,
BC74DA461013F468007987AD /* JSRGBColor.cpp */,
@@ -19826,7 +19830,6 @@
D3A94A31122DABAC00A37BBC /* MediaQueryList.cpp */,
D3A94A32122DABAC00A37BBC /* MediaQueryList.h */,
D3A94A33122DABAC00A37BBC /* MediaQueryList.idl */,
- D340629A1253BC8C009E4259 /* MediaQueryListListener.cpp */,
D3A94A34122DABAC00A37BBC /* MediaQueryListListener.h */,
D3A94A35122DABAC00A37BBC /* MediaQueryListListener.idl */,
D3AA10F1123A98AA0092152B /* MediaQueryMatcher.cpp */,
@@ -20986,6 +20989,7 @@
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 */,
@@ -24851,6 +24855,7 @@
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 */,
@@ -26083,7 +26088,6 @@
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 */,
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (153924 => 153925)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2013-08-11 20:11:19 UTC (rev 153925)
@@ -3131,6 +3131,10 @@
# 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) {
@@ -3189,7 +3193,12 @@
# Constructor
push(@implContent, "${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n");
- push(@implContent, " : ActiveDOMCallback(globalObject->scriptExecutionContext())\n");
+ if ($interface->extendedAttributes->{"CallbackNeedsOperatorEqual"}) {
+ push(@implContent, " : ${interfaceName}(${className}Type)\n");
+ } else {
+ push(@implContent, " : ${interfaceName}()\n");
+ }
+ push(@implContent, " , ActiveDOMCallback(globalObject->scriptExecutionContext())\n");
push(@implContent, " , m_data(new JSCallbackData(callback, globalObject))\n");
push(@implContent, "{\n");
push(@implContent, "}\n\n");
@@ -3207,8 +3216,16 @@
push(@implContent, "#ifndef NDEBUG\n");
push(@implContent, " m_data = 0;\n");
push(@implContent, "#endif\n");
- push(@implContent, "}\n");
+ push(@implContent, "}\n\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) {
@@ -3339,8 +3356,7 @@
"unsigned long long" => "unsigned long long",
"byte" => "int8_t",
"octet" => "uint8_t",
- "MediaQueryListListener" => "RefPtr<MediaQueryListListener>",
- "DOMTimeStamp" => "DOMTimeStamp",
+ "DOMTimeStamp" => "DOMTimeStamp",
);
sub GetNativeType
@@ -3475,11 +3491,6 @@
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)";
Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (153924 => 153925)
--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt 2013-08-11 20:11:19 UTC (rev 153925)
@@ -21,6 +21,7 @@
ActiveDOMObject
CPPPureInterface
CachedAttribute
+CallbackNeedsOperatorEqual
CallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack
CheckSecurity
CheckSecurityForNode
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp (153924 => 153925)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp 2013-08-11 20:11:19 UTC (rev 153925)
@@ -36,7 +36,8 @@
namespace WebCore {
JSTestCallback::JSTestCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
- : ActiveDOMCallback(globalObject->scriptExecutionContext())
+ : TestCallback()
+ , ActiveDOMCallback(globalObject->scriptExecutionContext())
, m_data(new JSCallbackData(callback, globalObject))
{
}
@@ -55,6 +56,7 @@
#endif
}
+
// Functions
bool JSTestCallback::callbackWithNoParam()
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp (153924 => 153925)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp 2013-08-11 20:11:19 UTC (rev 153925)
@@ -23,7 +23,7 @@
#include "ExceptionCode.h"
#include "JSDOMBinding.h"
-#include "MediaQueryListListener.h"
+#include "JSMediaQueryListListener.h"
#include "TestMediaQueryListListener.h"
#include <runtime/Error.h>
#include <wtf/GetPtr.h>
@@ -167,9 +167,9 @@
TestMediaQueryListListener* impl = static_cast<TestMediaQueryListListener*>(castedThis->impl());
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- RefPtr<MediaQueryListListener> listener(MediaQueryListListener::create(ScriptValue(exec->vm(), exec->argument(0))));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
+ if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction())
+ return throwVMTypeError(exec);
+ RefPtr<MediaQueryListListener> listener = JSMediaQueryListListener::create(asObject(exec->argument(0)), castedThis->globalObject());
impl->method(listener);
return JSValue::encode(jsUndefined());
}
Modified: trunk/Source/WebCore/css/MediaAllInOne.cpp (153924 => 153925)
--- trunk/Source/WebCore/css/MediaAllInOne.cpp 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/css/MediaAllInOne.cpp 2013-08-11 20:11:19 UTC (rev 153925)
@@ -31,5 +31,4 @@
#include "MediaQueryEvaluator.cpp"
#include "MediaQueryExp.cpp"
#include "MediaQueryList.cpp"
-#include "MediaQueryListListener.cpp"
#include "MediaQueryMatcher.cpp"
Deleted: trunk/Source/WebCore/css/MediaQueryListListener.cpp (153924 => 153925)
--- trunk/Source/WebCore/css/MediaQueryListListener.cpp 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/css/MediaQueryListListener.cpp 2013-08-11 20:11:19 UTC (rev 153925)
@@ -1,37 +0,0 @@
-/*
- * 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();
-}
-
-}
Modified: trunk/Source/WebCore/css/MediaQueryListListener.h (153924 => 153925)
--- trunk/Source/WebCore/css/MediaQueryListListener.h 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/css/MediaQueryListListener.h 2013-08-11 20:11:19 UTC (rev 153925)
@@ -20,35 +20,34 @@
#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:
- static PassRefPtr<MediaQueryListListener> create(const ScriptValue& value)
+ 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)
{
- 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:
- MediaQueryListListener(const ScriptValue& value) : m_value(value) { }
-
- ScriptValue m_value;
+ Type m_type;
};
-}
+} // namespace WebCore
#endif // MediaQueryListListener_h
Modified: trunk/Source/WebCore/css/MediaQueryListListener.idl (153924 => 153925)
--- trunk/Source/WebCore/css/MediaQueryListListener.idl 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/css/MediaQueryListListener.idl 2013-08-11 20:11:19 UTC (rev 153925)
@@ -18,10 +18,7 @@
*/
[
- NoInterfaceObject,
- JSNoStaticTables,
- ObjCProtocol,
- CPPPureInterface,
-] interface MediaQueryListListener {
- void queryChanged([Default=Undefined] optional MediaQueryList list);
+ CallbackNeedsOperatorEqual
+] callback interface MediaQueryListListener {
+ boolean queryChanged([Default=Undefined] optional MediaQueryList list);
};
Modified: trunk/Source/WebCore/css/MediaQueryMatcher.cpp (153924 => 153925)
--- trunk/Source/WebCore/css/MediaQueryMatcher.cpp 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/css/MediaQueryMatcher.cpp 2013-08-11 20:11:19 UTC (rev 153925)
@@ -42,12 +42,12 @@
{
}
-void MediaQueryMatcher::Listener::evaluate(ScriptState* state, MediaQueryEvaluator* evaluator)
+void MediaQueryMatcher::Listener::evaluate(MediaQueryEvaluator* evaluator)
{
bool notify;
m_query->evaluate(evaluator, notify);
if (notify)
- m_listener->queryChanged(state, m_query.get());
+ m_listener->queryChanged(m_query.get());
}
MediaQueryMatcher::MediaQueryMatcher(Document* document)
@@ -143,17 +143,13 @@
{
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(scriptState, evaluator.get());
+ m_listeners[i]->evaluate(evaluator.get());
}
-}
+} // namespace WebCore
Modified: trunk/Source/WebCore/css/MediaQueryMatcher.h (153924 => 153925)
--- trunk/Source/WebCore/css/MediaQueryMatcher.h 2013-08-11 17:41:09 UTC (rev 153924)
+++ trunk/Source/WebCore/css/MediaQueryMatcher.h 2013-08-11 20:11:19 UTC (rev 153925)
@@ -20,7 +20,6 @@
#ifndef MediaQueryMatcher_h
#define MediaQueryMatcher_h
-#include "ScriptState.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
@@ -59,7 +58,7 @@
Listener(PassRefPtr<MediaQueryListListener>, PassRefPtr<MediaQueryList>);
~Listener();
- void evaluate(ScriptState*, MediaQueryEvaluator*);
+ void evaluate(MediaQueryEvaluator*);
MediaQueryListListener* listener() { return m_listener.get(); }
MediaQueryList* query() { return m_query.get(); }
@@ -82,6 +81,6 @@
unsigned m_evaluationRound;
};
-}
+} // namespace WebCore
#endif // MediaQueryMatcher_h