| Differences between
and this patch
- Source/WebCore/ChangeLog +34 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2016-04-06  Sam Weinig  <sam@webkit.org>
2
3
        window.CSS should be a constructor with static functions
4
        https://bugs.webkit.org/show_bug.cgi?id=156294
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Rename DOMWindowCSS to DOMCSSNamespace to avoid name collisions, DOMWindow prefixed
9
        classes cause collisions in JSDOMWindow.
10
11
        * CMakeLists.txt:
12
        * DerivedSources.make:
13
        * WebCore.xcodeproj/project.pbxproj:
14
        Update for renames.
15
16
        * css/DOMCSSNamespace.cpp: Copied from Source/WebCore/css/DOMWindowCSS.cpp.
17
        (WebCore::valueWithoutImportant):
18
        (WebCore::DOMCSSNamespace::supports):
19
        (WebCore::DOMWindowCSS::create): Deleted.
20
        (WebCore::DOMWindowCSS::supports): Deleted.
21
        * css/DOMCSSNamespace.h: Copied from Source/WebCore/css/DOMWindowCSS.h.
22
        (WebCore::DOMWindowCSS::DOMWindowCSS): Deleted.
23
        Rename DOMWindowCSS to DOMCSSNamespace and turn functions into static functions.
24
25
        * css/DOMCSSNamespace.idl: Copied from Source/WebCore/css/DOMWindowCSS.idl.
26
        Remove NoInterfaceObject, to inject a constructor, and turn functions into
27
        static functions matching spec.
28
29
        * page/DOMWindow.cpp:
30
        (WebCore::DOMWindow::css): Deleted.
31
        * page/DOMWindow.h:
32
        * page/DOMWindow.idl:
33
        Remove CSS property. Constructor will be implicitly added.
34
1
2016-04-06  Jer Noble  <jer.noble@apple.com>
35
2016-04-06  Jer Noble  <jer.noble@apple.com>
2
36
3
        CRASH in -[WebCoreNSURLSession taskCompleted:]
37
        CRASH in -[WebCoreNSURLSession taskCompleted:]
- Source/WebCore/CMakeLists.txt -2 / +2 lines
Lines 334-340 set(WebCore_NON_SVG_IDL_FILES Source/WebCore/CMakeLists.txt_sec1
334
    css/CSSValue.idl
334
    css/CSSValue.idl
335
    css/CSSValueList.idl
335
    css/CSSValueList.idl
336
    css/Counter.idl
336
    css/Counter.idl
337
    css/DOMWindowCSS.idl
337
    css/DOMCSSNamespace.idl
338
    css/FontFace.idl
338
    css/FontFace.idl
339
    css/FontFaceSet.idl
339
    css/FontFaceSet.idl
340
    css/MediaList.idl
340
    css/MediaList.idl
Lines 1340-1346 set(WebCore_SOURCES Source/WebCore/CMakeLists.txt_sec2
1340
    css/CSSValuePool.cpp
1340
    css/CSSValuePool.cpp
1341
    css/CSSVariableDependentValue.cpp
1341
    css/CSSVariableDependentValue.cpp
1342
    css/CSSVariableValue.cpp
1342
    css/CSSVariableValue.cpp
1343
    css/DOMWindowCSS.cpp
1343
    css/DOMCSSNamespace.cpp
1344
    css/DocumentRuleSets.cpp
1344
    css/DocumentRuleSets.cpp
1345
    css/ElementRuleCollector.cpp
1345
    css/ElementRuleCollector.cpp
1346
    css/FontVariantBuilder.cpp
1346
    css/FontVariantBuilder.cpp
- Source/WebCore/DerivedSources.make -1 / +1 lines
Lines 247-253 NON_SVG_BINDING_IDLS = \ Source/WebCore/DerivedSources.make_sec1
247
    $(WebCore)/css/CSSValue.idl \
247
    $(WebCore)/css/CSSValue.idl \
248
    $(WebCore)/css/CSSValueList.idl \
248
    $(WebCore)/css/CSSValueList.idl \
249
    $(WebCore)/css/Counter.idl \
249
    $(WebCore)/css/Counter.idl \
250
    $(WebCore)/css/DOMWindowCSS.idl \
250
    $(WebCore)/css/DOMCSSNamespace.idl \
251
    $(WebCore)/css/FontFace.idl \
251
    $(WebCore)/css/FontFace.idl \
252
    $(WebCore)/css/FontFaceSet.idl \
252
    $(WebCore)/css/FontFaceSet.idl \
253
    $(WebCore)/css/MediaList.idl \
253
    $(WebCore)/css/MediaList.idl \
- Source/WebCore/PlatformGTK.cmake -1 / +1 lines
Lines 545-551 list(APPEND GObjectDOMBindingsUnstable_I Source/WebCore/PlatformGTK.cmake_sec1
545
545
546
    Modules/webdatabase/Database.idl
546
    Modules/webdatabase/Database.idl
547
547
548
    css/DOMWindowCSS.idl
548
    css/DOMCSSNamespace.idl
549
    css/MediaQueryList.idl
549
    css/MediaQueryList.idl
550
    css/StyleMedia.idl
550
    css/StyleMedia.idl
551
551
- Source/WebCore/WebCore.xcodeproj/project.pbxproj -18 / +18 lines
Lines 6846-6853 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
6846
		FBF89045169E9F1F0052D86E /* CSSGroupingRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FBF89044169E9F1F0052D86E /* CSSGroupingRule.cpp */; };
6846
		FBF89045169E9F1F0052D86E /* CSSGroupingRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FBF89044169E9F1F0052D86E /* CSSGroupingRule.cpp */; };
6847
		FC54D05716A7673100575E4D /* CSSSupportsRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FC63BDB1167AABAC00F9380F /* CSSSupportsRule.h */; };
6847
		FC54D05716A7673100575E4D /* CSSSupportsRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FC63BDB1167AABAC00F9380F /* CSSSupportsRule.h */; };
6848
		FC54D05816A7676E00575E4D /* JSCSSSupportsRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FC84802E167AB444008CD100 /* JSCSSSupportsRule.h */; };
6848
		FC54D05816A7676E00575E4D /* JSCSSSupportsRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FC84802E167AB444008CD100 /* JSCSSSupportsRule.h */; };
6849
		FC9A0F75164094CF003D6B8D /* DOMWindowCSS.h in Headers */ = {isa = PBXBuildFile; fileRef = FC9A0F72164094CF003D6B8D /* DOMWindowCSS.h */; };
6849
		FC9A0F75164094CF003D6B8D /* DOMCSSNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = FC9A0F72164094CF003D6B8D /* DOMCSSNamespace.h */; };
6850
		FC9E0E4D16419C1E00392BE3 /* JSDOMWindowCSS.h in Headers */ = {isa = PBXBuildFile; fileRef = FC9E0E4B16419C1E00392BE3 /* JSDOMWindowCSS.h */; };
6850
		FC9E0E4D16419C1E00392BE3 /* JSDOMCSSNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = FC9E0E4B16419C1E00392BE3 /* JSDOMCSSNamespace.h */; };
6851
		FCD8832A16A49F8200962227 /* DOMCSSSupportsRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */; };
6851
		FCD8832A16A49F8200962227 /* DOMCSSSupportsRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */; };
6852
		FCD8832B16A49F8200962227 /* DOMCSSSupportsRule.mm in Sources */ = {isa = PBXBuildFile; fileRef = FCD8832916A49F8200962227 /* DOMCSSSupportsRule.mm */; };
6852
		FCD8832B16A49F8200962227 /* DOMCSSSupportsRule.mm in Sources */ = {isa = PBXBuildFile; fileRef = FCD8832916A49F8200962227 /* DOMCSSSupportsRule.mm */; };
6853
		FCD8832C16A49FB000962227 /* DOMCSSSupportsRule.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */; };
6853
		FCD8832C16A49FB000962227 /* DOMCSSSupportsRule.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */; };
Lines 7002-7011 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
7002
		FD62F52E145898D80094B0ED /* AudioSourceProviderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = FD62F52D145898D80094B0ED /* AudioSourceProviderClient.h */; };
7002
		FD62F52E145898D80094B0ED /* AudioSourceProviderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = FD62F52D145898D80094B0ED /* AudioSourceProviderClient.h */; };
7003
		FD671A77159BB07000197559 /* MediaStreamAudioSourceNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD671A74159BB07000197559 /* MediaStreamAudioSourceNode.cpp */; };
7003
		FD671A77159BB07000197559 /* MediaStreamAudioSourceNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD671A74159BB07000197559 /* MediaStreamAudioSourceNode.cpp */; };
7004
		FD671A78159BB07000197559 /* MediaStreamAudioSourceNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FD671A75159BB07000197559 /* MediaStreamAudioSourceNode.h */; };
7004
		FD671A78159BB07000197559 /* MediaStreamAudioSourceNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FD671A75159BB07000197559 /* MediaStreamAudioSourceNode.h */; };
7005
		FD677738195CAF3D0072E0D3 /* DOMWindowCSS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD677735195CAB200072E0D3 /* DOMWindowCSS.cpp */; };
7005
		FD677738195CAF3D0072E0D3 /* DOMCSSNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD677735195CAB200072E0D3 /* DOMCSSNamespace.cpp */; };
7006
		FD677739195CAFBA0072E0D3 /* CSSSupportsRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD677734195CAB200072E0D3 /* CSSSupportsRule.cpp */; };
7006
		FD677739195CAFBA0072E0D3 /* CSSSupportsRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD677734195CAB200072E0D3 /* CSSSupportsRule.cpp */; };
7007
		FD67773A195CB14A0072E0D3 /* JSCSSSupportsRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD677736195CAB7D0072E0D3 /* JSCSSSupportsRule.cpp */; };
7007
		FD67773A195CB14A0072E0D3 /* JSCSSSupportsRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD677736195CAB7D0072E0D3 /* JSCSSSupportsRule.cpp */; };
7008
		FD67773B195CB1E60072E0D3 /* JSDOMWindowCSS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD677737195CAB7D0072E0D3 /* JSDOMWindowCSS.cpp */; };
7008
		FD67773B195CB1E60072E0D3 /* JSDOMCSSNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD677737195CAB7D0072E0D3 /* JSDOMCSSNamespace.cpp */; };
7009
		FD6ED2C3136B8E42003CF072 /* DynamicsCompressorNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6ED2C1136B8E42003CF072 /* DynamicsCompressorNode.cpp */; };
7009
		FD6ED2C3136B8E42003CF072 /* DynamicsCompressorNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6ED2C1136B8E42003CF072 /* DynamicsCompressorNode.cpp */; };
7010
		FD6ED2C4136B8E42003CF072 /* DynamicsCompressorNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FD6ED2C2136B8E42003CF072 /* DynamicsCompressorNode.h */; };
7010
		FD6ED2C4136B8E42003CF072 /* DynamicsCompressorNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FD6ED2C2136B8E42003CF072 /* DynamicsCompressorNode.h */; };
7011
		FD6ED2C7136B8E66003CF072 /* DynamicsCompressor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6ED2C5136B8E66003CF072 /* DynamicsCompressor.cpp */; };
7011
		FD6ED2C7136B8E66003CF072 /* DynamicsCompressor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6ED2C5136B8E66003CF072 /* DynamicsCompressor.cpp */; };
Lines 14919-14927 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
14919
		FC63BDB1167AABAC00F9380F /* CSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSupportsRule.h; sourceTree = "<group>"; };
14919
		FC63BDB1167AABAC00F9380F /* CSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSupportsRule.h; sourceTree = "<group>"; };
14920
		FC63BDB2167AABAC00F9380F /* CSSSupportsRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSSupportsRule.idl; sourceTree = "<group>"; };
14920
		FC63BDB2167AABAC00F9380F /* CSSSupportsRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSSupportsRule.idl; sourceTree = "<group>"; };
14921
		FC84802E167AB444008CD100 /* JSCSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSSupportsRule.h; sourceTree = "<group>"; };
14921
		FC84802E167AB444008CD100 /* JSCSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSSupportsRule.h; sourceTree = "<group>"; };
14922
		FC9A0F72164094CF003D6B8D /* DOMWindowCSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowCSS.h; sourceTree = "<group>"; };
14922
		FC9A0F72164094CF003D6B8D /* DOMCSSNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSNamespace.h; sourceTree = "<group>"; };
14923
		FC9A0F73164094CF003D6B8D /* DOMWindowCSS.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowCSS.idl; sourceTree = "<group>"; };
14923
		FC9A0F73164094CF003D6B8D /* DOMCSSNamespace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMCSSNamespace.idl; sourceTree = "<group>"; };
14924
		FC9E0E4B16419C1E00392BE3 /* JSDOMWindowCSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMWindowCSS.h; sourceTree = "<group>"; };
14924
		FC9E0E4B16419C1E00392BE3 /* JSDOMCSSNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMCSSNamespace.h; sourceTree = "<group>"; };
14925
		FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSSupportsRule.h; sourceTree = "<group>"; };
14925
		FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSSupportsRule.h; sourceTree = "<group>"; };
14926
		FCD8832916A49F8200962227 /* DOMCSSSupportsRule.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMCSSSupportsRule.mm; sourceTree = "<group>"; };
14926
		FCD8832916A49F8200962227 /* DOMCSSSupportsRule.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMCSSSupportsRule.mm; sourceTree = "<group>"; };
14927
		FCEBBAAA16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSSupportsRuleInternal.h; sourceTree = "<group>"; };
14927
		FCEBBAAA16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSSupportsRuleInternal.h; sourceTree = "<group>"; };
Lines 15098-15106 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
15098
		FD671A75159BB07000197559 /* MediaStreamAudioSourceNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSourceNode.h; sourceTree = "<group>"; };
15098
		FD671A75159BB07000197559 /* MediaStreamAudioSourceNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSourceNode.h; sourceTree = "<group>"; };
15099
		FD671A76159BB07000197559 /* MediaStreamAudioSourceNode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStreamAudioSourceNode.idl; sourceTree = "<group>"; };
15099
		FD671A76159BB07000197559 /* MediaStreamAudioSourceNode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStreamAudioSourceNode.idl; sourceTree = "<group>"; };
15100
		FD677734195CAB200072E0D3 /* CSSSupportsRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSSupportsRule.cpp; sourceTree = "<group>"; };
15100
		FD677734195CAB200072E0D3 /* CSSSupportsRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSSupportsRule.cpp; sourceTree = "<group>"; };
15101
		FD677735195CAB200072E0D3 /* DOMWindowCSS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowCSS.cpp; sourceTree = "<group>"; };
15101
		FD677735195CAB200072E0D3 /* DOMCSSNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMCSSNamespace.cpp; sourceTree = "<group>"; };
15102
		FD677736195CAB7D0072E0D3 /* JSCSSSupportsRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSCSSSupportsRule.cpp; path = DerivedSources/WebCore/JSCSSSupportsRule.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
15102
		FD677736195CAB7D0072E0D3 /* JSCSSSupportsRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSCSSSupportsRule.cpp; path = DerivedSources/WebCore/JSCSSSupportsRule.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
15103
		FD677737195CAB7D0072E0D3 /* JSDOMWindowCSS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMWindowCSS.cpp; path = DerivedSources/WebCore/JSDOMWindowCSS.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
15103
		FD677737195CAB7D0072E0D3 /* JSDOMCSSNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMCSSNamespace.cpp; path = DerivedSources/WebCore/JSDOMCSSNamespace.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
15104
		FD6ED2C1136B8E42003CF072 /* DynamicsCompressorNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicsCompressorNode.cpp; sourceTree = "<group>"; };
15104
		FD6ED2C1136B8E42003CF072 /* DynamicsCompressorNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicsCompressorNode.cpp; sourceTree = "<group>"; };
15105
		FD6ED2C2136B8E42003CF072 /* DynamicsCompressorNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicsCompressorNode.h; sourceTree = "<group>"; };
15105
		FD6ED2C2136B8E42003CF072 /* DynamicsCompressorNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicsCompressorNode.h; sourceTree = "<group>"; };
15106
		FD6ED2C5136B8E66003CF072 /* DynamicsCompressor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicsCompressor.cpp; sourceTree = "<group>"; };
15106
		FD6ED2C5136B8E66003CF072 /* DynamicsCompressor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicsCompressor.cpp; sourceTree = "<group>"; };
Lines 20748-20755 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
20748
				14CF78A509F58CD800EB3665 /* JSCSSValue.h */,
20748
				14CF78A509F58CD800EB3665 /* JSCSSValue.h */,
20749
				A8D05FA90A23B30F005E7203 /* JSCSSValueList.cpp */,
20749
				A8D05FA90A23B30F005E7203 /* JSCSSValueList.cpp */,
20750
				A8D05FAA0A23B30F005E7203 /* JSCSSValueList.h */,
20750
				A8D05FAA0A23B30F005E7203 /* JSCSSValueList.h */,
20751
				FD677737195CAB7D0072E0D3 /* JSDOMWindowCSS.cpp */,
20751
				FD677737195CAB7D0072E0D3 /* JSDOMCSSNamespace.cpp */,
20752
				FC9E0E4B16419C1E00392BE3 /* JSDOMWindowCSS.h */,
20752
				FC9E0E4B16419C1E00392BE3 /* JSDOMCSSNamespace.h */,
20753
				BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */,
20753
				BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */,
20754
				BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */,
20754
				BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */,
20755
				D3A94A42122DC40F00A37BBC /* JSMediaQueryList.cpp */,
20755
				D3A94A42122DC40F00A37BBC /* JSMediaQueryList.cpp */,
Lines 23727-23735 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
23727
				A80E6CE10A1989CA007FB8C5 /* DashboardRegion.h */,
23727
				A80E6CE10A1989CA007FB8C5 /* DashboardRegion.h */,
23728
				4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */,
23728
				4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */,
23729
				4A4F48A816B0DFC000EDBB29 /* DocumentRuleSets.h */,
23729
				4A4F48A816B0DFC000EDBB29 /* DocumentRuleSets.h */,
23730
				FD677735195CAB200072E0D3 /* DOMWindowCSS.cpp */,
23730
				FD677735195CAB200072E0D3 /* DOMCSSNamespace.cpp */,
23731
				FC9A0F72164094CF003D6B8D /* DOMWindowCSS.h */,
23731
				FC9A0F72164094CF003D6B8D /* DOMCSSNamespace.h */,
23732
				FC9A0F73164094CF003D6B8D /* DOMWindowCSS.idl */,
23732
				FC9A0F73164094CF003D6B8D /* DOMCSSNamespace.idl */,
23733
				FBDB619A16D6032A00BB3394 /* ElementRuleCollector.cpp */,
23733
				FBDB619A16D6032A00BB3394 /* ElementRuleCollector.cpp */,
23734
				FBDB619E16D6036500BB3394 /* ElementRuleCollector.h */,
23734
				FBDB619E16D6036500BB3394 /* ElementRuleCollector.h */,
23735
				1C66260E1C6E7CA600AB527C /* FontFace.cpp */,
23735
				1C66260E1C6E7CA600AB527C /* FontFace.cpp */,
Lines 25881-25887 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
25881
				5EA3D6E41C859DC100300BBB /* SDPProcessor.h in Headers */,
25881
				5EA3D6E41C859DC100300BBB /* SDPProcessor.h in Headers */,
25882
				85989DD10ACC8BBD00A0BC51 /* DOMWheelEventInternal.h in Headers */,
25882
				85989DD10ACC8BBD00A0BC51 /* DOMWheelEventInternal.h in Headers */,
25883
				1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
25883
				1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
25884
				FC9A0F75164094CF003D6B8D /* DOMWindowCSS.h in Headers */,
25884
				FC9A0F75164094CF003D6B8D /* DOMCSSNamespace.h in Headers */,
25885
				51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */,
25885
				51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */,
25886
				5185FC751BB4C4E80012898F /* DOMWindowIndexedDatabase.h in Headers */,
25886
				5185FC751BB4C4E80012898F /* DOMWindowIndexedDatabase.h in Headers */,
25887
				97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */,
25887
				97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */,
Lines 26533-26539 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
26533
				7694563D1214D97C0007CBAE /* JSDOMTokenList.h in Headers */,
26533
				7694563D1214D97C0007CBAE /* JSDOMTokenList.h in Headers */,
26534
				2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */,
26534
				2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */,
26535
				BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
26535
				BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
26536
				FC9E0E4D16419C1E00392BE3 /* JSDOMWindowCSS.h in Headers */,
26536
				FC9E0E4D16419C1E00392BE3 /* JSDOMCSSNamespace.h in Headers */,
26537
				652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
26537
				652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
26538
				BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */,
26538
				BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */,
26539
				65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */,
26539
				65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */,
Lines 29597-29603 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec9
29597
				31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
29597
				31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
29598
				85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
29598
				85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
29599
				1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
29599
				1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
29600
				FD677738195CAF3D0072E0D3 /* DOMWindowCSS.cpp in Sources */,
29600
				FD677738195CAF3D0072E0D3 /* DOMCSSNamespace.cpp in Sources */,
29601
				517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */,
29601
				517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */,
29602
				5185FC741BB4C4E80012898F /* DOMWindowIndexedDatabase.cpp in Sources */,
29602
				5185FC741BB4C4E80012898F /* DOMWindowIndexedDatabase.cpp in Sources */,
29603
				97B38E28151C4273004622E9 /* DOMWindowNotifications.cpp in Sources */,
29603
				97B38E28151C4273004622E9 /* DOMWindowNotifications.cpp in Sources */,
Lines 30219-30225 Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec10
30219
				2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
30219
				2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
30220
				1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */,
30220
				1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */,
30221
				BC6932730D7E293900AE44D1 /* JSDOMWindowBase.cpp in Sources */,
30221
				BC6932730D7E293900AE44D1 /* JSDOMWindowBase.cpp in Sources */,
30222
				FD67773B195CB1E60072E0D3 /* JSDOMWindowCSS.cpp in Sources */,
30222
				FD67773B195CB1E60072E0D3 /* JSDOMCSSNamespace.cpp in Sources */,
30223
				BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
30223
				BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
30224
				BCBFB53C0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp in Sources */,
30224
				BCBFB53C0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp in Sources */,
30225
				FD7868B9136B999200D403DF /* JSDynamicsCompressorNode.cpp in Sources */,
30225
				FD7868B9136B999200D403DF /* JSDynamicsCompressorNode.cpp in Sources */,
- Source/WebCore/css/DOMCSSNamespace.cpp +85 lines
Line 0 Source/WebCore/css/DOMCSSNamespace.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Motorola Mobility Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above
11
 *    copyright notice, this list of conditions and the following disclaimer in
12
 *    the documentation and/or other materials provided with the distribution.
13
 * 3. Neither the name of Motorola Mobility Inc. nor the names of its
14
 *    contributors may be used to endorse or promote products derived from this
15
 *    software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29
30
#include "config.h"
31
#include "DOMWindowCSS.h"
32
33
#include "CSSParser.h"
34
#include "StyleProperties.h"
35
#include <wtf/text/WTFString.h>
36
37
namespace WebCore {
38
39
Ref<DOMWindowCSS> DOMWindowCSS::create()
40
{
41
    return adoptRef(*new DOMWindowCSS);
42
}
43
44
static String valueWithoutImportant(const String& value)
45
{
46
    if (!value.endsWith("important", false))
47
        return value;
48
49
    String newValue = value;
50
    int bangIndex = newValue.length() - 9 - 1;
51
    if (newValue[bangIndex] == ' ')
52
        bangIndex--;
53
    newValue = newValue.left(bangIndex);
54
55
    return newValue;
56
}
57
58
bool DOMWindowCSS::supports(const String& property, const String& value) const
59
{
60
    CSSPropertyID propertyID = cssPropertyID(property.stripWhiteSpace());
61
62
    if (propertyID == CSSPropertyInvalid)
63
        return false;
64
65
    // CSSParser::parseValue() won't work correctly if !important is present,
66
    // so just get rid of it. It doesn't matter to supports() if it's actually
67
    // there or not, provided how it's specified in the value is correct.
68
    String normalizedValue = value.stripWhiteSpace().simplifyWhiteSpace();
69
    normalizedValue = valueWithoutImportant(normalizedValue);
70
71
    if (normalizedValue.isEmpty())
72
        return false;
73
74
    RefPtr<MutableStyleProperties> dummyStyle = MutableStyleProperties::create();
75
    return CSSParser::parseValue(dummyStyle.get(), propertyID, normalizedValue, false, CSSStrictMode, nullptr) != CSSParser::ParseResult::Error;
76
}
77
78
bool DOMWindowCSS::supports(const String& conditionText) const
79
{
80
    CSSParserContext context(CSSStrictMode);
81
    CSSParser parser(context);
82
    return parser.parseSupportsCondition(conditionText);
83
}
84
85
}
- Source/WebCore/css/DOMCSSNamespace.cpp -8 / +3 lines
Lines 28-34 Source/WebCore/css/DOMCSSNamespace.cpp_sec1
28
 */
28
 */
29
29
30
#include "config.h"
30
#include "config.h"
31
#include "DOMWindowCSS.h"
31
#include "DOMCSSNamespace.h"
32
32
33
#include "CSSParser.h"
33
#include "CSSParser.h"
34
#include "StyleProperties.h"
34
#include "StyleProperties.h"
Lines 36-46 Source/WebCore/css/DOMCSSNamespace.cpp_sec2
36
36
37
namespace WebCore {
37
namespace WebCore {
38
38
39
Ref<DOMWindowCSS> DOMWindowCSS::create()
40
{
41
    return adoptRef(*new DOMWindowCSS);
42
}
43
44
static String valueWithoutImportant(const String& value)
39
static String valueWithoutImportant(const String& value)
45
{
40
{
46
    if (!value.endsWith("important", false))
41
    if (!value.endsWith("important", false))
Lines 55-61 static String valueWithoutImportant(cons Source/WebCore/css/DOMCSSNamespace.cpp_sec3
55
    return newValue;
50
    return newValue;
56
}
51
}
57
52
58
bool DOMWindowCSS::supports(const String& property, const String& value) const
53
bool DOMCSSNamespace::supports(const String& property, const String& value)
59
{
54
{
60
    CSSPropertyID propertyID = cssPropertyID(property.stripWhiteSpace());
55
    CSSPropertyID propertyID = cssPropertyID(property.stripWhiteSpace());
61
56
Lines 75-81 bool DOMWindowCSS::supports(const String Source/WebCore/css/DOMCSSNamespace.cpp_sec4
75
    return CSSParser::parseValue(dummyStyle.get(), propertyID, normalizedValue, false, CSSStrictMode, nullptr) != CSSParser::ParseResult::Error;
70
    return CSSParser::parseValue(dummyStyle.get(), propertyID, normalizedValue, false, CSSStrictMode, nullptr) != CSSParser::ParseResult::Error;
76
}
71
}
77
72
78
bool DOMWindowCSS::supports(const String& conditionText) const
73
bool DOMCSSNamespace::supports(const String& conditionText)
79
{
74
{
80
    CSSParserContext context(CSSStrictMode);
75
    CSSParserContext context(CSSStrictMode);
81
    CSSParser parser(context);
76
    CSSParser parser(context);
- Source/WebCore/css/DOMCSSNamespace.h +54 lines
Line 0 Source/WebCore/css/DOMCSSNamespace.h_sec1
1
/*
2
 * Copyright (C) 2012 Motorola Mobility Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above
11
 *    copyright notice, this list of conditions and the following disclaimer in
12
 *    the documentation and/or other materials provided with the distribution.
13
 * 3. Neither the name of Motorola Mobility Inc. nor the names of its
14
 *    contributors may be used to endorse or promote products derived from this
15
 *    software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29
30
#ifndef DOMWindowCSS_h
31
#define DOMWindowCSS_h
32
33
#include <wtf/Forward.h>
34
#include <wtf/Ref.h>
35
#include <wtf/RefCounted.h>
36
37
namespace WebCore {
38
39
class DOMWindowCSS : public RefCounted<DOMWindowCSS> {
40
public:
41
    WEBCORE_EXPORT static Ref<DOMWindowCSS> create();
42
43
    bool supports(const String& property, const String& value) const;
44
    bool supports(const String& conditionText) const;
45
46
private:
47
    DOMWindowCSS()
48
    {
49
    }
50
};
51
52
}
53
54
#endif
- Source/WebCore/css/DOMCSSNamespace.h -15 / +4 lines
Lines 27-54 Source/WebCore/css/DOMCSSNamespace.h_sec1
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
28
 */
29
29
30
#ifndef DOMWindowCSS_h
30
#pragma once
31
#define DOMWindowCSS_h
32
31
33
#include <wtf/Forward.h>
32
#include <wtf/Forward.h>
34
#include <wtf/Ref.h>
35
#include <wtf/RefCounted.h>
33
#include <wtf/RefCounted.h>
36
34
37
namespace WebCore {
35
namespace WebCore {
38
36
39
class DOMWindowCSS : public RefCounted<DOMWindowCSS> {
37
class DOMCSSNamespace : public RefCounted<DOMCSSNamespace> {
40
public:
38
public:
41
    WEBCORE_EXPORT static Ref<DOMWindowCSS> create();
39
    static bool supports(const String& property, const String& value);
42
40
    static bool supports(const String& conditionText);
43
    bool supports(const String& property, const String& value) const;
44
    bool supports(const String& conditionText) const;
45
46
private:
47
    DOMWindowCSS()
48
    {
49
    }
50
};
41
};
51
42
52
}
43
}
53
54
#endif
- Source/WebCore/css/DOMCSSNamespace.idl +40 lines
Line 0 Source/WebCore/css/DOMCSSNamespace.idl_sec1
1
/*
2
 * Copyright (C) 2012 Motorola Mobility Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above
11
 *    copyright notice, this list of conditions and the following disclaimer in
12
 *    the documentation and/or other materials provided with the distribution.
13
 * 3. Neither the name of Motorola Mobility Inc. nor the names of its
14
 *    contributors may be used to endorse or promote products derived from this
15
 *    software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29
30
[
31
    NoInterfaceObject,
32
    InterfaceName=CSS,
33
    ImplementationLacksVTable,
34
] interface DOMWindowCSS {
35
36
    boolean supports(DOMString property, DOMString value);
37
    boolean supports(DOMString conditionText);
38
39
};
40
- Source/WebCore/css/DOMCSSNamespace.idl -7 / +3 lines
Lines 28-40 Source/WebCore/css/DOMCSSNamespace.idl_sec1
28
 */
28
 */
29
29
30
[
30
[
31
    NoInterfaceObject,
32
    InterfaceName=CSS,
31
    InterfaceName=CSS,
33
    ImplementationLacksVTable,
32
    ImplementationLacksVTable,
34
] interface DOMWindowCSS {
33
] interface DOMCSSNamespace {
35
34
    static boolean supports(DOMString property, DOMString value);
36
    boolean supports(DOMString property, DOMString value);
35
    static boolean supports(DOMString conditionText);
37
    boolean supports(DOMString conditionText);
38
39
};
36
};
40
- Source/WebCore/css/DOMWindowCSS.cpp -85 lines
Lines 1-85 Source/WebCore/css/DOMWindowCSS.cpp_sec1
1
/*
2
 * Copyright (C) 2012 Motorola Mobility Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above
11
 *    copyright notice, this list of conditions and the following disclaimer in
12
 *    the documentation and/or other materials provided with the distribution.
13
 * 3. Neither the name of Motorola Mobility Inc. nor the names of its
14
 *    contributors may be used to endorse or promote products derived from this
15
 *    software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29
30
#include "config.h"
31
#include "DOMWindowCSS.h"
32
33
#include "CSSParser.h"
34
#include "StyleProperties.h"
35
#include <wtf/text/WTFString.h>
36
37
namespace WebCore {
38
39
Ref<DOMWindowCSS> DOMWindowCSS::create()
40
{
41
    return adoptRef(*new DOMWindowCSS);
42
}
43
44
static String valueWithoutImportant(const String& value)
45
{
46
    if (!value.endsWith("important", false))
47
        return value;
48
49
    String newValue = value;
50
    int bangIndex = newValue.length() - 9 - 1;
51
    if (newValue[bangIndex] == ' ')
52
        bangIndex--;
53
    newValue = newValue.left(bangIndex);
54
55
    return newValue;
56
}
57
58
bool DOMWindowCSS::supports(const String& property, const String& value) const
59
{
60
    CSSPropertyID propertyID = cssPropertyID(property.stripWhiteSpace());
61
62
    if (propertyID == CSSPropertyInvalid)
63
        return false;
64
65
    // CSSParser::parseValue() won't work correctly if !important is present,
66
    // so just get rid of it. It doesn't matter to supports() if it's actually
67
    // there or not, provided how it's specified in the value is correct.
68
    String normalizedValue = value.stripWhiteSpace().simplifyWhiteSpace();
69
    normalizedValue = valueWithoutImportant(normalizedValue);
70
71
    if (normalizedValue.isEmpty())
72
        return false;
73
74
    RefPtr<MutableStyleProperties> dummyStyle = MutableStyleProperties::create();
75
    return CSSParser::parseValue(dummyStyle.get(), propertyID, normalizedValue, false, CSSStrictMode, nullptr) != CSSParser::ParseResult::Error;
76
}
77
78
bool DOMWindowCSS::supports(const String& conditionText) const
79
{
80
    CSSParserContext context(CSSStrictMode);
81
    CSSParser parser(context);
82
    return parser.parseSupportsCondition(conditionText);
83
}
84
85
}
- Source/WebCore/css/DOMWindowCSS.h -54 lines
Lines 1-54 Source/WebCore/css/DOMWindowCSS.h_sec1
1
/*
2
 * Copyright (C) 2012 Motorola Mobility Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above
11
 *    copyright notice, this list of conditions and the following disclaimer in
12
 *    the documentation and/or other materials provided with the distribution.
13
 * 3. Neither the name of Motorola Mobility Inc. nor the names of its
14
 *    contributors may be used to endorse or promote products derived from this
15
 *    software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29
30
#ifndef DOMWindowCSS_h
31
#define DOMWindowCSS_h
32
33
#include <wtf/Forward.h>
34
#include <wtf/Ref.h>
35
#include <wtf/RefCounted.h>
36
37
namespace WebCore {
38
39
class DOMWindowCSS : public RefCounted<DOMWindowCSS> {
40
public:
41
    WEBCORE_EXPORT static Ref<DOMWindowCSS> create();
42
43
    bool supports(const String& property, const String& value) const;
44
    bool supports(const String& conditionText) const;
45
46
private:
47
    DOMWindowCSS()
48
    {
49
    }
50
};
51
52
}
53
54
#endif
- Source/WebCore/css/DOMWindowCSS.idl -40 lines
Lines 1-40 Source/WebCore/css/DOMWindowCSS.idl_sec1
1
/*
2
 * Copyright (C) 2012 Motorola Mobility Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above
11
 *    copyright notice, this list of conditions and the following disclaimer in
12
 *    the documentation and/or other materials provided with the distribution.
13
 * 3. Neither the name of Motorola Mobility Inc. nor the names of its
14
 *    contributors may be used to endorse or promote products derived from this
15
 *    software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29
30
[
31
    NoInterfaceObject,
32
    InterfaceName=CSS,
33
    ImplementationLacksVTable,
34
] interface DOMWindowCSS {
35
36
    boolean supports(DOMString property, DOMString value);
37
    boolean supports(DOMString conditionText);
38
39
};
40
- Source/WebCore/page/DOMWindow.cpp -8 lines
Lines 44-50 Source/WebCore/page/DOMWindow.cpp_sec1
44
#include "DOMTimer.h"
44
#include "DOMTimer.h"
45
#include "DOMTokenList.h"
45
#include "DOMTokenList.h"
46
#include "DOMURL.h"
46
#include "DOMURL.h"
47
#include "DOMWindowCSS.h"
48
#include "DOMWindowExtension.h"
47
#include "DOMWindowExtension.h"
49
#include "DOMWindowNotifications.h"
48
#include "DOMWindowNotifications.h"
50
#include "DeviceMotionController.h"
49
#include "DeviceMotionController.h"
Lines 1670-1682 void DOMWindow::cancelAnimationFrame(int Source/WebCore/page/DOMWindow.cpp_sec2
1670
}
1669
}
1671
#endif
1670
#endif
1672
1671
1673
DOMWindowCSS* DOMWindow::css()
1674
{
1675
    if (!m_css)
1676
        m_css = DOMWindowCSS::create();
1677
    return m_css.get();
1678
}
1679
1680
static void didAddStorageEventListener(DOMWindow* window)
1672
static void didAddStorageEventListener(DOMWindow* window)
1681
{
1673
{
1682
    // Creating these WebCore::Storage objects informs the system that we'd like to receive
1674
    // Creating these WebCore::Storage objects informs the system that we'd like to receive
- Source/WebCore/page/DOMWindow.h -5 lines
Lines 50-56 namespace WebCore { Source/WebCore/page/DOMWindow.h_sec1
50
    class DOMApplicationCache;
50
    class DOMApplicationCache;
51
    class DOMSelection;
51
    class DOMSelection;
52
    class DOMURL;
52
    class DOMURL;
53
    class DOMWindowCSS;
54
    class DOMWindowProperty;
53
    class DOMWindowProperty;
55
    class DOMWrapperWorld;
54
    class DOMWrapperWorld;
56
    class Database;
55
    class Database;
Lines 272-279 namespace WebCore { Source/WebCore/page/DOMWindow.h_sec2
272
        void cancelAnimationFrame(int id);
271
        void cancelAnimationFrame(int id);
273
#endif
272
#endif
274
273
275
        DOMWindowCSS* css();
276
277
        // Events
274
        // Events
278
        // EventTarget API
275
        // EventTarget API
279
        bool addEventListener(const AtomicString& eventType, RefPtr<EventListener>&&, bool useCapture) override;
276
        bool addEventListener(const AtomicString& eventType, RefPtr<EventListener>&&, bool useCapture) override;
Lines 417-424 namespace WebCore { Source/WebCore/page/DOMWindow.h_sec3
417
        mutable RefPtr<Performance> m_performance;
414
        mutable RefPtr<Performance> m_performance;
418
#endif
415
#endif
419
416
420
        mutable RefPtr<DOMWindowCSS> m_css;
421
422
#if ENABLE(USER_MESSAGE_HANDLERS)
417
#if ENABLE(USER_MESSAGE_HANDLERS)
423
        mutable RefPtr<WebKitNamespace> m_webkitNamespace;
418
        mutable RefPtr<WebKitNamespace> m_webkitNamespace;
424
#endif
419
#endif
- Source/WebCore/page/DOMWindow.idl -2 lines
Lines 179-186 Source/WebCore/page/DOMWindow.idl_sec1
179
    [Conditional=REQUEST_ANIMATION_FRAME, ImplementedAs=cancelAnimationFrame] void webkitCancelAnimationFrame(long id);
179
    [Conditional=REQUEST_ANIMATION_FRAME, ImplementedAs=cancelAnimationFrame] void webkitCancelAnimationFrame(long id);
180
    [Conditional=REQUEST_ANIMATION_FRAME, ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.
180
    [Conditional=REQUEST_ANIMATION_FRAME, ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.
181
181
182
    [Replaceable] readonly attribute DOMWindowCSS CSS;
183
184
    void captureEvents(/*in long eventFlags*/);
182
    void captureEvents(/*in long eventFlags*/);
185
    void releaseEvents(/*in long eventFlags*/);
183
    void releaseEvents(/*in long eventFlags*/);
186
184
- LayoutTests/ChangeLog +14 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2016-04-06  Sam Weinig  <sam@webkit.org>
2
3
        window.CSS should be a constructor with static functions
4
        https://bugs.webkit.org/show_bug.cgi?id=156294
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * platform/efl/js/dom/global-constructors-attributes-expected.txt:
9
        * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
10
        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
11
        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
12
        * platform/win/js/dom/global-constructors-attributes-expected.txt:
13
        Update for new CSS constructor property.
14
1
2016-04-06  Joanmarie Diggs  <jdiggs@igalia.com>
15
2016-04-06  Joanmarie Diggs  <jdiggs@igalia.com>
2
16
3
        REGRESSION(r195463): [GTK] accessibility/roles-computedRoleString.html and accessibility/roles-exposed.html failing
17
        REGRESSION(r195463): [GTK] accessibility/roles-computedRoleString.html and accessibility/roles-exposed.html failing
- LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt +5 lines
Lines 103-108 PASS Object.getOwnPropertyDescriptor(glo LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt_sec1
103
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
103
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
104
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
104
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
105
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
105
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
106
PASS Object.getOwnPropertyDescriptor(global, 'CSS').value is CSS
107
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('get') is false
108
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('set') is false
109
PASS Object.getOwnPropertyDescriptor(global, 'CSS').enumerable is false
110
PASS Object.getOwnPropertyDescriptor(global, 'CSS').configurable is true
106
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
111
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
107
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
112
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
108
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
113
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
- LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt +5 lines
Lines 103-108 PASS Object.getOwnPropertyDescriptor(glo LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt_sec1
103
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
103
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
104
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
104
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
105
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
105
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
106
PASS Object.getOwnPropertyDescriptor(global, 'CSS').value is CSS
107
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('get') is false
108
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('set') is false
109
PASS Object.getOwnPropertyDescriptor(global, 'CSS').enumerable is false
110
PASS Object.getOwnPropertyDescriptor(global, 'CSS').configurable is true
106
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
111
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
107
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
112
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
108
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
113
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
- LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt +5 lines
Lines 123-128 PASS Object.getOwnPropertyDescriptor(glo LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt_sec1
123
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
123
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
124
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
124
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
125
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
125
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
126
PASS Object.getOwnPropertyDescriptor(global, 'CSS').value is CSS
127
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('get') is false
128
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('set') is false
129
PASS Object.getOwnPropertyDescriptor(global, 'CSS').enumerable is false
130
PASS Object.getOwnPropertyDescriptor(global, 'CSS').configurable is true
126
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
131
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
127
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
132
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
128
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
133
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
- LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt +5 lines
Lines 123-128 PASS Object.getOwnPropertyDescriptor(glo LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt_sec1
123
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
123
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
124
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
124
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
125
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
125
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
126
PASS Object.getOwnPropertyDescriptor(global, 'CSS').value is CSS
127
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('get') is false
128
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('set') is false
129
PASS Object.getOwnPropertyDescriptor(global, 'CSS').enumerable is false
130
PASS Object.getOwnPropertyDescriptor(global, 'CSS').configurable is true
126
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
131
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
127
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
132
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
128
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
133
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
- LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt +5 lines
Lines 53-58 PASS Object.getOwnPropertyDescriptor(glo LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt_sec1
53
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
53
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
54
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
54
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').enumerable is false
55
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
55
PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').configurable is true
56
PASS Object.getOwnPropertyDescriptor(global, 'CSS').value is CSS
57
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('get') is false
58
PASS Object.getOwnPropertyDescriptor(global, 'CSS').hasOwnProperty('set') is false
59
PASS Object.getOwnPropertyDescriptor(global, 'CSS').enumerable is false
60
PASS Object.getOwnPropertyDescriptor(global, 'CSS').configurable is true
56
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
61
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').value is CSSCharsetRule
57
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
62
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('get') is false
58
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false
63
PASS Object.getOwnPropertyDescriptor(global, 'CSSCharsetRule').hasOwnProperty('set') is false

Return to Bug 156294