Changeset 133084 in webkit
- Timestamp:
- Oct 31, 2012 3:22:07 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r133033 r133084 1 2012-10-31 Thiago Marcos P. Santos <thiago.santos@intel.com> 2 3 Added viewport at-rule to the CSS parser and tokenizer 4 https://bugs.webkit.org/show_bug.cgi?id=95961 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Enable CSS Device Adaptation by default on EFL. 9 10 * Source/cmake/OptionsEfl.cmake: 11 1 12 2012-10-31 Ian Vollick <vollick@chromium.org> 2 13 -
trunk/LayoutTests/ChangeLog
r133083 r133084 1 2012-10-31 Thiago Marcos P. Santos <thiago.santos@intel.com> 2 3 Added viewport at-rule to the CSS parser and tokenizer 4 https://bugs.webkit.org/show_bug.cgi?id=95961 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Added a test that detects if the @-webkit-viewport rule is being 9 parsed and skip the tests on all ports since the feature is disabled 10 by default for instance. 11 12 Note that this test doesn't do property validation, which will be 13 added in the next patch of the series. 14 15 * css3/device-adapt/viewport-at-rule-parsing-expected.txt: Added. 16 * css3/device-adapt/viewport-at-rule-parsing.html: Added. 17 * platform/chromium/TestExpectations: 18 * platform/gtk/TestExpectations: 19 * platform/mac/TestExpectations: 20 * platform/qt/TestExpectations: 21 * platform/win/TestExpectations: 22 * platform/wincairo/TestExpectations: 23 1 24 2012-10-31 Max Vujovic <mvujovic@adobe.com> 2 25 -
trunk/LayoutTests/platform/chromium/TestExpectations
r133081 r133084 4028 4028 webkit.org/b/86146 css3/supports.html 4029 4029 4030 # CSS Device Adaptation is not enabled. 4031 webkit.org/b/95959 css3/device-adapt [ Skip ] 4032 4030 4033 # Require rebaselining after webkit.org/b/97800 4031 4034 webkit.org/b/89167 media/track/track-cue-rendering-horizontal.html [ Failure ] -
trunk/LayoutTests/platform/gtk/TestExpectations
r133037 r133084 1437 1437 # End of Tests failing 1438 1438 #//////////////////////////////////////////////////////////////////////////////////////// 1439 1440 # CSS Device Adaptation is not enabled. 1441 webkit.org/b/95959 css3/device-adapt [ Skip ] -
trunk/LayoutTests/platform/mac/TestExpectations
r133074 r133084 1317 1317 webkit.org/b/86146 css3/supports.html 1318 1318 1319 # CSS Device Adaptation is not enabled. 1320 webkit.org/b/95959 css3/device-adapt [ Skip ] 1321 1319 1322 # Hardware accelerated CSS transitions appear pixelated when scaled up using transform 1320 1323 webkit.org/b/27684 compositing/text-on-scaled-layer.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/qt/TestExpectations
r133074 r133084 2476 2476 webkit.org/b/86146 css3/supports.html 2477 2477 2478 # CSS Device Adaptation is not enabled. 2479 webkit.org/b/95969 css3/device-adapt [ Skip ] 2480 2478 2481 # Added by bug 89826 2479 2482 webkit.org/b/94005 css2.1/20110323/word-spacing-remove-space-003.htm [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/win/TestExpectations
r133037 r133084 880 880 # BlodBuilder is not enabled 881 881 http/tests/local/blob/send-data-blob.html 882 883 # CSS Device Adaptation is not enabled. 884 webkit.org/b/95959 css3/device-adapt [ Skip ] 882 885 883 886 # <https://bugs.webkit.org/show_bug.cgi?id=29289> -
trunk/LayoutTests/platform/wincairo/TestExpectations
r133030 r133084 2809 2809 http/tests/xmlhttprequest/range-test.html 2810 2810 2811 # CSS Device Adaptation is not enabled. 2812 webkit.org/b/95959 css3/device-adapt [ Skip ] 2813 2811 2814 # css3-conditionals support is not yet enabled. 2812 2815 webkit.org/b/86146 css3/supports.html -
trunk/Source/WebCore/CMakeLists.txt
r133028 r133084 1104 1104 css/WebKitCSSShaderValue.cpp 1105 1105 css/WebKitCSSTransformValue.cpp 1106 css/WebKitCSSViewportRule.cpp 1106 1107 1107 1108 dom/ActiveDOMObject.cpp -
trunk/Source/WebCore/ChangeLog
r133083 r133084 1 2012-10-31 Thiago Marcos P. Santos <thiago.santos@intel.com> 2 3 Added viewport at-rule to the CSS parser and tokenizer 4 https://bugs.webkit.org/show_bug.cgi?id=95961 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Add tokens and grammar rules to parse @-webkit-viewport blocks. Also add 9 the newly parsed rule to the rule list. 10 11 This parser now implements the following part of the CSS Device Adaptation 12 specification: http://www.w3.org/TR/css-device-adapt/#syntax 13 14 Test: css3/device-adapt/viewport-at-rule-parsing.html 15 16 * CMakeLists.txt: 17 * GNUmakefile.list.am: 18 * Target.pri: 19 * WebCore.gypi: 20 * WebCore.vcproj/WebCore.vcproj: 21 * WebCore.xcodeproj/project.pbxproj: 22 * css/CSSGrammar.y.in: 23 * css/CSSParser.cpp: 24 (WebCore::CSSParser::CSSParser): 25 (WebCore::CSSParser::detectAtToken): 26 (WebCore): 27 (WebCore::CSSParser::createViewportRule): 28 * css/CSSParser.h: 29 (CSSParser): 30 (WebCore::CSSParser::markViewportRuleBodyStart): 31 (WebCore::CSSParser::markViewportRuleBodyEnd): 32 (WebCore::CSSParser::inViewport): 33 34 These methods are needed by the next patch validating the properties. 35 Some viewport properties are common to other rules but have different 36 semantics, and accepts different keywords. The validation needs to be 37 done in a different code path. 38 39 * css/CSSPropertySourceData.h: 40 * css/CSSRule.cpp: 41 (WebCore): 42 (WebCore::CSSRule::cssText): 43 (WebCore::CSSRule::destroy): 44 (WebCore::CSSRule::reattach): 45 (WebCore::CSSRule::reportMemoryUsage): 46 * css/CSSRule.h: 47 (CSSRule): 48 (WebCore::CSSRule::isViewportRule): 49 * css/StyleRule.cpp: 50 (WebCore::StyleRuleBase::reportMemoryUsage): 51 (WebCore::StyleRuleBase::destroy): 52 (WebCore::StyleRuleBase::copy): 53 (WebCore::StyleRuleBase::createCSSOMWrapper): 54 (WebCore): 55 (WebCore::StyleRuleViewport::StyleRuleViewport): 56 (WebCore::StyleRuleViewport::~StyleRuleViewport): 57 (WebCore::StyleRuleViewport::mutableProperties): 58 (WebCore::StyleRuleViewport::setProperties): 59 (WebCore::StyleRuleViewport::reportDescendantMemoryUsage): 60 * css/StyleRule.h: 61 (StyleRuleBase): 62 (WebCore::StyleRuleBase::isViewportRule): 63 (WebCore): 64 (StyleRuleViewport): 65 (WebCore::StyleRuleViewport::create): 66 (WebCore::StyleRuleViewport::properties): 67 (WebCore::StyleRuleViewport::copy): 68 * css/WebKitCSSViewportRule.cpp: Added. 69 (WebCore): 70 (WebCore::WebKitCSSViewportRule::WebKitCSSViewportRule): 71 (WebCore::WebKitCSSViewportRule::~WebKitCSSViewportRule): 72 (WebCore::WebKitCSSViewportRule::style): 73 (WebCore::WebKitCSSViewportRule::cssText): 74 (WebCore::WebKitCSSViewportRule::reattach): 75 (WebCore::WebKitCSSViewportRule::reportDescendantMemoryUsage): 76 * css/WebKitCSSViewportRule.h: Added. 77 (WebCore): 78 1 79 2012-10-31 Max Vujovic <mvujovic@adobe.com> 2 80 -
trunk/Source/WebCore/GNUmakefile.list.am
r133028 r133084 2690 2690 Source/WebCore/css/WebKitCSSTransformValue.cpp \ 2691 2691 Source/WebCore/css/WebKitCSSTransformValue.h \ 2692 Source/WebCore/css/WebKitCSSViewportRule.cpp \ 2693 Source/WebCore/css/WebKitCSSViewportRule.h \ 2692 2694 Source/WebCore/dom/ActiveDOMObject.cpp \ 2693 2695 Source/WebCore/dom/ActiveDOMObject.h \ -
trunk/Source/WebCore/Target.pri
r133028 r133084 340 340 css/WebKitCSSShaderValue.cpp \ 341 341 css/WebKitCSSTransformValue.cpp \ 342 css/WebKitCSSViewportRule.cpp \ 342 343 dom/ActiveDOMObject.cpp \ 343 344 dom/Attr.cpp \ … … 1513 1514 css/WebKitCSSShaderValue.h \ 1514 1515 css/WebKitCSSTransformValue.h \ 1516 css/WebKitCSSViewportRule.h \ 1515 1517 dom/ActiveDOMObject.h \ 1516 1518 dom/Attr.h \ -
trunk/Source/WebCore/WebCore.gypi
r133028 r133084 2677 2677 'css/WebKitCSSSVGDocumentValue.h', 2678 2678 'css/WebKitCSSTransformValue.cpp', 2679 'css/WebKitCSSViewportRule.h', 2680 'css/WebKitCSSViewportRule.cpp', 2679 2681 'editing/AlternativeTextController.cpp', 2680 2682 'editing/AlternativeTextController.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r133028 r133084 38208 38208 </File> 38209 38209 <File 38210 RelativePath="..\css\WebKitCSSViewportRule.cpp" 38211 > 38212 </File> 38213 <File 38214 RelativePath="..\css\WebKitCSSViewportRule.h" 38215 > 38216 </File> 38217 <File 38210 38218 RelativePath="..\css\BasicShapeFunctions.h" 38211 38219 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r133028 r133084 1032 1032 3C244FEAA375AC633F88BE6F /* RenderLayerModelObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C244FE4A375AC633F88BE6F /* RenderLayerModelObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1033 1033 3C244FEBA375AC633F88BE6F /* RenderLayerModelObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C244FE5A375AC633F88BE6F /* RenderLayerModelObject.cpp */; }; 1034 3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */; }; 1035 3FFFF9A9159D9A550020BBD5 /* WebKitCSSViewportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */; }; 1034 1036 41002CCD0F66EDEF009E660D /* ScriptFunctionCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 41002CCB0F66EDEF009E660D /* ScriptFunctionCall.h */; }; 1035 1037 41002CCE0F66EDEF009E660D /* ScriptFunctionCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41002CCC0F66EDEF009E660D /* ScriptFunctionCall.cpp */; }; … … 8188 8190 3C244FE4A375AC633F88BE6F /* RenderLayerModelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderLayerModelObject.h; sourceTree = "<group>"; }; 8189 8191 3C244FE5A375AC633F88BE6F /* RenderLayerModelObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderLayerModelObject.cpp; sourceTree = "<group>"; }; 8192 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSViewportRule.cpp; sourceTree = "<group>"; }; 8193 3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSViewportRule.h; sourceTree = "<group>"; }; 8190 8194 41002CCB0F66EDEF009E660D /* ScriptFunctionCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFunctionCall.h; sourceTree = "<group>"; }; 8191 8195 41002CCC0F66EDEF009E660D /* ScriptFunctionCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptFunctionCall.cpp; sourceTree = "<group>"; }; … … 21427 21431 BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */, 21428 21432 31611E540E1C4D4A00F6A579 /* WebKitCSSTransformValue.idl */, 21433 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */, 21434 3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */, 21429 21435 ); 21430 21436 path = css; … … 25704 25710 50933350163B0E4300099A60 /* CustomFilterParameterList.h in Headers */, 25705 25711 50D32858163B313F0016111E /* ValidatedCustomFilterOperation.h in Headers */, 25712 3FFFF9A9159D9A550020BBD5 /* WebKitCSSViewportRule.h in Headers */, 25706 25713 ); 25707 25714 runOnlyForDeploymentPostprocessing = 0; … … 28789 28796 1AA21250163F0DA80000E63F /* AtomicStringCF.cpp in Sources */, 28790 28797 50D32857163B313F0016111E /* ValidatedCustomFilterOperation.cpp in Sources */, 28798 3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */, 28791 28799 ); 28792 28800 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/css/CSSGrammar.y.in
r132618 r133084 4 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 5 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2012 Intel Corporation. All rights reserved. 6 7 * 7 8 * This library is free software; you can redistribute it and/or … … 110 111 %token WEBKIT_SELECTOR_SYM 111 112 %token WEBKIT_REGION_RULE_SYM 113 %token WEBKIT_VIEWPORT_RULE_SYM 112 114 %token <marginBox> TOPLEFTCORNER_SYM 113 115 %token <marginBox> TOPLEFT_SYM … … 207 209 %type <rule> supports 208 210 #endif 211 #if ENABLE_CSS_DEVICE_ADAPTATION 212 %type <rule> viewport 213 #endif 209 214 210 215 %type <string> maybe_ns_prefix … … 412 417 | host 413 418 #endif 419 #if ENABLE_CSS_DEVICE_ADAPTATION 420 | viewport 421 #endif 414 422 ; 415 423 … … 440 448 | font_face 441 449 | keyframes 450 #if ENABLE_CSS_DEVICE_ADAPTATION 451 | viewport 452 #endif 442 453 ; 443 454 … … 928 939 } 929 940 ; 941 #endif 942 943 #if ENABLE_CSS_DEVICE_ADAPTATION 944 before_viewport_rule: 945 /* empty */ { 946 parser->markViewportRuleBodyStart(); 947 parser->markRuleHeaderStart(CSSRuleSourceData::VIEWPORT_RULE); 948 } 949 ; 950 951 viewport: 952 before_viewport_rule WEBKIT_VIEWPORT_RULE_SYM at_rule_header_end_maybe_space 953 '{' at_rule_body_start maybe_space_before_declaration declaration_list closing_brace { 954 $$ = parser->createViewportRule(); 955 parser->markViewportRuleBodyEnd(); 956 } 957 | before_viewport_rule WEBKIT_VIEWPORT_RULE_SYM error invalid_block { 958 $$ = 0; 959 parser->popRuleData(); 960 parser->markViewportRuleBodyEnd(); 961 } 962 | before_viewport_rule WEBKIT_VIEWPORT_RULE_SYM error ';' { 963 $$ = 0; 964 parser->popRuleData(); 965 parser->markViewportRuleBodyEnd(); 966 } 967 ; 930 968 #endif 931 969 -
trunk/Source/WebCore/css/CSSParser.cpp
r133029 r133084 270 270 , m_allowImportRules(true) 271 271 , m_allowNamespaceDeclarations(true) 272 #if ENABLE(CSS_DEVICE_ADAPTATION) 273 , m_inViewport(false) 274 #endif 272 275 , m_selectorVector(adoptPtr(new CSSSelectorVector)) 273 276 { … … 9319 9322 9320 9323 case 17: 9321 if (!hasEscape && isEqualToCSSIdentifier(name + 2, "webkit-selector")) 9324 if (hasEscape) 9325 return; 9326 9327 if (isASCIIAlphaCaselessEqual(name[16], 'r') && isEqualToCSSIdentifier(name + 2, "webkit-selecto")) 9322 9328 m_token = WEBKIT_SELECTOR_SYM; 9329 #if ENABLE(CSS_DEVICE_ADAPTATION) 9330 else if (isASCIIAlphaCaselessEqual(name[16], 't') && isEqualToCSSIdentifier(name + 2, "webkit-viewpor")) 9331 m_token = WEBKIT_VIEWPORT_RULE_SYM; 9332 #endif 9323 9333 return; 9324 9334 … … 10393 10403 } 10394 10404 10405 #if ENABLE(CSS_DEVICE_ADAPTATION) 10406 StyleRuleBase* CSSParser::createViewportRule() 10407 { 10408 m_allowImportRules = m_allowNamespaceDeclarations = false; 10409 10410 RefPtr<StyleRuleViewport> rule = StyleRuleViewport::create(); 10411 10412 rule->setProperties(createStylePropertySet()); 10413 clearProperties(); 10414 10415 StyleRuleViewport* result = rule.get(); 10416 m_parsedRules.append(rule.release()); 10417 processAndAddNewRuleToSourceTreeIfNeeded(); 10418 10419 return result; 10420 } 10421 #endif 10422 10395 10423 template <typename CharacterType> 10396 10424 static CSSPropertyID cssPropertyID(const CharacterType* propertyName, unsigned length) -
trunk/Source/WebCore/css/CSSParser.h
r132786 r133084 367 367 int token() { return m_token; } 368 368 369 #if ENABLE(CSS_DEVICE_ADAPTATION) 370 void markViewportRuleBodyStart() { m_inViewport = true; } 371 void markViewportRuleBodyEnd() { m_inViewport = false; } 372 StyleRuleBase* createViewportRule(); 373 #endif 374 369 375 PassRefPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSParserValue*); 370 376 PassRefPtr<CSSPrimitiveValue> createPrimitiveStringValue(CSSParserValue*); … … 514 520 bool m_allowNamespaceDeclarations; 515 521 522 #if ENABLE(CSS_DEVICE_ADAPTATION) 523 bool inViewport() const { return m_inViewport; } 524 bool m_inViewport; 525 #endif 526 516 527 int (CSSParser::*m_lexFunc)(void*); 517 528 -
trunk/Source/WebCore/css/CSSPropertySourceData.h
r132618 r133084 96 96 KEYFRAMES_RULE, 97 97 REGION_RULE, 98 HOST_RULE 98 HOST_RULE, 99 VIEWPORT_RULE 99 100 }; 100 101 -
trunk/Source/WebCore/css/CSSRule.cpp
r129365 r133084 31 31 #include "CSSStyleSheet.h" 32 32 #include "CSSUnknownRule.h" 33 #include "NotImplemented.h" 34 #include "StyleRule.h" 35 #include "StyleSheetContents.h" 33 36 #include "WebKitCSSKeyframeRule.h" 34 37 #include "WebKitCSSKeyframesRule.h" 35 38 #include "WebKitCSSRegionRule.h" 36 #include "NotImplemented.h" 37 #include "StyleRule.h" 38 #include "StyleSheetContents.h" 39 #include "WebKitCSSViewportRule.h" 39 40 40 41 namespace WebCore { … … 51 52 #endif 52 53 54 #if ENABLE(CSS_DEVICE_ADAPTATION) 55 COMPILE_ASSERT(StyleRuleBase::Viewport == static_cast<StyleRuleBase::Type>(CSSRule::WEBKIT_VIEWPORT_RULE), enums_should_match); 56 #endif 57 53 58 void CSSRule::setCssText(const String& /*cssText*/, ExceptionCode& /*ec*/) 54 59 { … … 77 82 case WEBKIT_KEYFRAME_RULE: 78 83 return static_cast<const WebKitCSSKeyframeRule*>(this)->cssText(); 84 #if ENABLE(CSS_DEVICE_ADAPTATION) 85 case WEBKIT_VIEWPORT_RULE: 86 return static_cast<const WebKitCSSViewportRule*>(this)->cssText(); 87 #endif 79 88 #if ENABLE(CSS_REGIONS) 80 89 case WEBKIT_REGION_RULE: … … 116 125 delete static_cast<WebKitCSSKeyframeRule*>(this); 117 126 return; 127 #if ENABLE(CSS_DEVICE_ADAPTATION) 128 case WEBKIT_VIEWPORT_RULE: 129 delete static_cast<WebKitCSSViewportRule*>(this); 130 return; 131 #endif 118 132 #if ENABLE(CSS_REGIONS) 119 133 case WEBKIT_REGION_RULE: … … 156 170 ASSERT_NOT_REACHED(); 157 171 return; 172 #if ENABLE(CSS_DEVICE_ADAPTATION) 173 case WEBKIT_VIEWPORT_RULE: 174 static_cast<WebKitCSSViewportRule*>(this)->reattach(static_cast<StyleRuleViewport*>(rule)); 175 return; 176 #endif 158 177 #if ENABLE(CSS_REGIONS) 159 178 case WEBKIT_REGION_RULE: … … 195 214 static_cast<const WebKitCSSKeyframeRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); 196 215 return; 216 #if ENABLE(CSS_DEVICE_ADAPTATION) 217 case WEBKIT_VIEWPORT_RULE: 218 static_cast<const WebKitCSSViewportRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); 219 return; 220 #endif 197 221 #if ENABLE(CSS_REGIONS) 198 222 case WEBKIT_REGION_RULE: -
trunk/Source/WebCore/css/CSSRule.h
r129365 r133084 58 58 WEBKIT_KEYFRAMES_RULE, 59 59 WEBKIT_KEYFRAME_RULE, 60 #if ENABLE(CSS_DEVICE_ADAPTATION) 61 WEBKIT_VIEWPORT_RULE = 15, 62 #endif 60 63 #if ENABLE(CSS_REGIONS) 61 64 WEBKIT_REGION_RULE = 16 … … 73 76 bool isStyleRule() const { return type() == STYLE_RULE; } 74 77 bool isImportRule() const { return type() == IMPORT_RULE; } 78 79 #if ENABLE(CSS_DEVICE_ADAPTATION) 80 bool isViewportRule() const { return type() == WEBKIT_VIEWPORT_RULE; } 81 #endif 75 82 76 83 #if ENABLE(CSS_REGIONS) -
trunk/Source/WebCore/css/StyleRule.cpp
r132618 r133084 34 34 #include "WebKitCSSKeyframesRule.h" 35 35 #include "WebKitCSSRegionRule.h" 36 #include "WebKitCSSViewportRule.h" 36 37 #include <wtf/MemoryInstrumentationVector.h> 37 38 … … 83 84 static_cast<const StyleRuleBlock*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); 84 85 return; 86 #if ENABLE(CSS_DEVICE_ADAPTATION) 87 case Viewport: 88 static_cast<const StyleRuleViewport*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); 89 return; 90 #endif 85 91 case Unknown: 86 92 case Charset: … … 124 130 delete static_cast<StyleRuleHost*>(this); 125 131 return; 132 #if ENABLE(CSS_DEVICE_ADAPTATION) 133 case Viewport: 134 delete static_cast<StyleRuleViewport*>(this); 135 return; 136 #endif 126 137 case Unknown: 127 138 case Charset: … … 159 170 case Host: 160 171 return static_cast<const StyleRuleHost*>(this)->copy(); 172 #if ENABLE(CSS_DEVICE_ADAPTATION) 173 case Viewport: 174 return static_cast<const StyleRuleViewport*>(this)->copy(); 175 #endif 161 176 case Unknown: 162 177 case Charset: … … 200 215 rule = WebKitCSSKeyframesRule::create(static_cast<StyleRuleKeyframes*>(self), parentSheet); 201 216 break; 217 #if ENABLE(CSS_DEVICE_ADAPTATION) 218 case Viewport: 219 rule = WebKitCSSViewportRule::create(static_cast<StyleRuleViewport*>(self), parentSheet); 220 break; 221 #endif 202 222 case Host: 203 223 case Unknown: … … 391 411 } 392 412 413 #if ENABLE(CSS_DEVICE_ADAPTATION) 414 StyleRuleViewport::StyleRuleViewport() 415 : StyleRuleBase(Viewport, 0) 416 { 417 } 418 419 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& o) 420 : StyleRuleBase(o) 421 , m_properties(o.m_properties->copy()) 422 { 423 } 424 425 StyleRuleViewport::~StyleRuleViewport() 426 { 427 } 428 429 StylePropertySet* StyleRuleViewport::mutableProperties() 430 { 431 if (!m_properties->isMutable()) 432 m_properties = m_properties->copy(); 433 return m_properties.get(); 434 } 435 436 void StyleRuleViewport::setProperties(PassRefPtr<StylePropertySet> properties) 437 { 438 m_properties = properties; 439 } 440 441 void StyleRuleViewport::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 442 { 443 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); 444 info.addMember(m_properties); 445 } 446 #endif // ENABLE(CSS_DEVICE_ADAPTATION) 447 393 448 } // namespace WebCore -
trunk/Source/WebCore/css/StyleRule.h
r132618 r133084 48 48 Keyframe, // Not used. These are internally non-rule StyleKeyframe objects. 49 49 Host, 50 #if ENABLE(CSS_DEVICE_ADAPTATION) 51 Viewport = 15, 52 #endif 50 53 Region = 16 51 54 }; … … 59 62 bool isStyleRule() const { return type() == Style; } 60 63 bool isRegionRule() const { return type() == Region; } 64 #if ENABLE(CSS_DEVICE_ADAPTATION) 65 bool isViewportRule() const { return type() == Viewport; } 66 #endif 61 67 bool isImportRule() const { return type() == Import; } 62 68 bool isHostRule() const { return type() == Host; } … … 240 246 }; 241 247 248 #if ENABLE(CSS_DEVICE_ADAPTATION) 249 class StyleRuleViewport : public StyleRuleBase { 250 public: 251 static PassRefPtr<StyleRuleViewport> create() { return adoptRef(new StyleRuleViewport); } 252 253 ~StyleRuleViewport(); 254 255 const StylePropertySet* properties() const { return m_properties.get(); } 256 StylePropertySet* mutableProperties(); 257 258 void setProperties(PassRefPtr<StylePropertySet>); 259 260 PassRefPtr<StyleRuleViewport> copy() const { return adoptRef(new StyleRuleViewport(*this)); } 261 262 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; 263 264 private: 265 StyleRuleViewport(); 266 StyleRuleViewport(const StyleRuleViewport&); 267 268 RefPtr<StylePropertySet> m_properties; 269 }; 270 #endif // ENABLE(CSS_DEVICE_ADAPTATION) 271 242 272 } // namespace WebCore 243 273 -
trunk/Source/cmake/OptionsEfl.cmake
r132627 r133084 57 57 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BLOB ON) 58 58 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS3_TEXT ON) 59 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_DEVICE_ADAPTATION ON) 59 60 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_IMAGE_SET ON) 60 61 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_STICKY_POSITION ON) -
trunk/Tools/ChangeLog
r133082 r133084 1 2012-10-31 Thiago Marcos P. Santos <thiago.santos@intel.com> 2 3 Added viewport at-rule to the CSS parser and tokenizer 4 https://bugs.webkit.org/show_bug.cgi?id=95961 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Enable CSS Device Adaptation by default on EFL. 9 10 * Scripts/webkitperl/FeatureList.pm: 11 1 12 2012-10-31 Terry Anderson <tdanderson@chromium.org> 2 13 -
trunk/Tools/Scripts/webkitperl/FeatureList.pm
r132600 r133084 168 168 169 169 { option => "css-device-adaptation", desc => "Toggle CSS Device Adaptation support", 170 define => "ENABLE_CSS_DEVICE_ADAPTATION", default => 0, value => \$cssDeviceAdaptation },170 define => "ENABLE_CSS_DEVICE_ADAPTATION", default => isEfl(), value => \$cssDeviceAdaptation }, 171 171 172 172 { option => "css-exclusions", desc => "Toggle CSS Exclusions support",
Note: See TracChangeset
for help on using the changeset viewer.