Implement css-conditional's CSS.supports()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 13:45:05 +0000 (13:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 13:45:05 +0000 (13:45 +0000)
commita8c3bf0c51a0031fcd472edc3b08951590395fc8
treef244849f69ac6cace631a4a823033a392bc54427
parentbbe7add4fa1c558807a7430a88be3b0c1718397c
Implement css-conditional's CSS.supports()
https://bugs.webkit.org/show_bug.cgi?id=100324

Patch by Pablo Flouret <pablof@motorola.com> on 2013-02-13
Reviewed by Antti Koivisto.

Source/WebCore:

http://dev.w3.org/csswg/css3-conditional/#the-css-interface

The supports() method provides the css @supports rule's corresponding
dom api.
The patch also adds the CSS interface on DOMWindow, which holds "useful
CSS-related functions that do not belong elsewhere". This is where
supports() lives.

Test: css3/supports-dom-api.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/gobject/GNUmakefile.am:
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipFunction):
    Add DOMWindowCSS.* to the build systems.

* bindings/scripts/CodeGenerator.pm:
(WK_lcfirst):
    Handle CSS prefixes correctly (s/cSS/css/).

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::detectAtToken):
* css/CSSParser.h:
    webkit_supports_condition parses just the condition part of an
    @supports rule and evaluates it, outputting whether the condition
    is supported or not.

* css/CSSAllInOne.cpp:
* css/DOMWindowCSS.cpp: Added.
* css/DOMWindowCSS.h: Added.
* css/DOMWindowCSS.idl: Added.
    The CSS interface object.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::css):
* page/DOMWindow.h:
* page/DOMWindow.idl:
    window.CSS

LayoutTests:

* css3/supports-dom-api-expected.txt: Added.
* css3/supports-dom-api.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/supports-dom-api-expected.txt [new file with mode: 0644]
LayoutTests/css3/supports-dom-api.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
LayoutTests/platform/wk2/TestExpectations
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.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/gobject/GNUmakefile.am
Source/WebCore/bindings/scripts/CodeGenerator.pm
Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
Source/WebCore/css/CSSAllInOne.cpp
Source/WebCore/css/CSSGrammar.y.in
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/DOMWindowCSS.cpp [new file with mode: 0644]
Source/WebCore/css/DOMWindowCSS.h [new file with mode: 0644]
Source/WebCore/css/DOMWindowCSS.idl [new file with mode: 0644]
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/DOMWindow.idl