Added viewport at-rule to the CSS parser and tokenizer
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2012 22:22:07 +0000 (22:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2012 22:22:07 +0000 (22:22 +0000)
commitd2f0638ab76048b8346f0144c56b6a8326e9491e
tree977e4e05a41d6b7c80f26d32fb2c728507182bf0
parent5e1ef5f05ef224e9793a7bb66cd031e7df428183
Added viewport at-rule to the CSS parser and tokenizer
https://bugs.webkit.org/show_bug.cgi?id=95961

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-10-31
Reviewed by Kenneth Rohde Christiansen.

.:

Enable CSS Device Adaptation by default on EFL.

* Source/cmake/OptionsEfl.cmake:

Source/WebCore:

Add tokens and grammar rules to parse @-webkit-viewport blocks. Also add
the newly parsed rule to the rule list.

This parser now implements the following part of the CSS Device Adaptation
specification: http://www.w3.org/TR/css-device-adapt/#syntax

Test: css3/device-adapt/viewport-at-rule-parsing.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::detectAtToken):
(WebCore):
(WebCore::CSSParser::createViewportRule):
* css/CSSParser.h:
(CSSParser):
(WebCore::CSSParser::markViewportRuleBodyStart):
(WebCore::CSSParser::markViewportRuleBodyEnd):
(WebCore::CSSParser::inViewport):

    These methods are needed by the next patch validating the properties.
    Some viewport properties are common to other rules but have different
    semantics, and accepts different keywords. The validation needs to be
    done in a different code path.

* css/CSSPropertySourceData.h:
* css/CSSRule.cpp:
(WebCore):
(WebCore::CSSRule::cssText):
(WebCore::CSSRule::destroy):
(WebCore::CSSRule::reattach):
(WebCore::CSSRule::reportMemoryUsage):
* css/CSSRule.h:
(CSSRule):
(WebCore::CSSRule::isViewportRule):
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::reportMemoryUsage):
(WebCore::StyleRuleBase::destroy):
(WebCore::StyleRuleBase::copy):
(WebCore::StyleRuleBase::createCSSOMWrapper):
(WebCore):
(WebCore::StyleRuleViewport::StyleRuleViewport):
(WebCore::StyleRuleViewport::~StyleRuleViewport):
(WebCore::StyleRuleViewport::mutableProperties):
(WebCore::StyleRuleViewport::setProperties):
(WebCore::StyleRuleViewport::reportDescendantMemoryUsage):
* css/StyleRule.h:
(StyleRuleBase):
(WebCore::StyleRuleBase::isViewportRule):
(WebCore):
(StyleRuleViewport):
(WebCore::StyleRuleViewport::create):
(WebCore::StyleRuleViewport::properties):
(WebCore::StyleRuleViewport::copy):
* css/WebKitCSSViewportRule.cpp: Added.
(WebCore):
(WebCore::WebKitCSSViewportRule::WebKitCSSViewportRule):
(WebCore::WebKitCSSViewportRule::~WebKitCSSViewportRule):
(WebCore::WebKitCSSViewportRule::style):
(WebCore::WebKitCSSViewportRule::cssText):
(WebCore::WebKitCSSViewportRule::reattach):
(WebCore::WebKitCSSViewportRule::reportDescendantMemoryUsage):
* css/WebKitCSSViewportRule.h: Added.
(WebCore):

Tools:

Enable CSS Device Adaptation by default on EFL.

* Scripts/webkitperl/FeatureList.pm:

LayoutTests:

Added a test that detects if the @-webkit-viewport rule is being
parsed and skip the tests on all ports since the feature is disabled
by default for instance.

Note that this test doesn't do property validation, which will be
added in the next patch of the series.

* css3/device-adapt/viewport-at-rule-parsing-expected.txt: Added.
* css3/device-adapt/viewport-at-rule-parsing.html: Added.
* platform/chromium/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/css3/device-adapt/viewport-at-rule-parsing-expected.txt [new file with mode: 0644]
LayoutTests/css3/device-adapt/viewport-at-rule-parsing.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSGrammar.y.in
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSPropertySourceData.h
Source/WebCore/css/CSSRule.cpp
Source/WebCore/css/CSSRule.h
Source/WebCore/css/StyleRule.cpp
Source/WebCore/css/StyleRule.h
Source/WebCore/css/WebKitCSSViewportRule.cpp [new file with mode: 0644]
Source/WebCore/css/WebKitCSSViewportRule.h [new file with mode: 0644]
Source/cmake/OptionsEfl.cmake
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm