Skip to content

Commit

Permalink
Expose DOM interface for CSS Device Adaptation
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=95966

Patch by Thiago Marcos P. Santos <[email protected]> on 2012-11-23
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Added V8 and JSC bindings for CSS Device Adapation.

Test: css3/device-adapt/opera/cssom-001.xhtml

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJS):
* bindings/objc/DOMCSS.mm:
(kitClass):
* bindings/v8/custom/V8CSSRuleCustom.cpp:
(WebCore::wrap):
* css/CSSRule.idl:
* css/WebKitCSSViewportRule.idl: Added.
* page/DOMWindow.idl:

LayoutTests:

Imported a test submitted by Opera that tests the exposed interface.

* css3/device-adapt/opera/cssom-001-expected.txt: Added.
* css3/device-adapt/opera/cssom-001.xhtml: Added.
* platform/efl/fast/js/global-constructors-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Nov 23, 2012
1 parent ab5aff7 commit 1371006
Show file tree
Hide file tree
Showing 17 changed files with 226 additions and 0 deletions.
13 changes: 13 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2012-11-23 Thiago Marcos P. Santos <[email protected]>

Expose DOM interface for CSS Device Adaptation
https://bugs.webkit.org/show_bug.cgi?id=95966

Reviewed by Kenneth Rohde Christiansen.

Imported a test submitted by Opera that tests the exposed interface.

* css3/device-adapt/opera/cssom-001-expected.txt: Added.
* css3/device-adapt/opera/cssom-001.xhtml: Added.
* platform/efl/fast/js/global-constructors-expected.txt:

2012-11-22 Sheriff Bot <[email protected]>

Unreviewed, rolling out r135549.
Expand Down
3 changes: 3 additions & 0 deletions LayoutTests/css3/device-adapt/opera/cssom-001-expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

PASS CSS Test: @viewport CSSOM - CSSRule.WEBKIT_VIEWPORT_RULE

84 changes: 84 additions & 0 deletions LayoutTests/css3/device-adapt/opera/cssom-001.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: @viewport CSSOM - CSSRule.WEBKIT_VIEWPORT_RULE</title>
<link rel="author" title="Rune Lillesveen" href="mailto:[email protected]"/>
<link rel="help" href="http://www.w3.org/TR/css-device-adapt/#dom-interfaces"/>
<meta name="flags" content="visual scroll dom" />
<meta name="assert" content="CSSRule.WEBKIT_VIEWPORT_RULE has the value 15, and the stylesheet contains a CSSViewportRule with type value 15."/>
<script src="../../../resources/testharness.js" type="text/javascript" />
<script src="../../../resources/testharnessreport.js" type="text/javascript" />
<style type="text/css"><![CDATA[
body { margin: 0; }
html, body, #test { width: 100%; height: 100%; }
#log { padding: 1em; display: none; }
/* Reset viewport values to initial values to ignore UA stylesheet. */
@-webkit-viewport {
width: auto;
height: auto;
zoom: auto;
min-zoom: auto;
max-zoom: auto;
user-zoom: zoom;
orientation: auto;
resolution: auto;
}
]]></style>
<style type="text/css"><![CDATA[
/* CSS for the test below. */
@-webkit-viewport { width: auto 1200px; min-height: 700px; max-zoom: 100% }
/* Set root element font-size to something different from the initial
font-size to make sure 'rem' and 'em' for @viewport is based on the
initial font-size, not the root element font-size. */
html { font-size: 2rem; }
body { font-size: 0.5rem; }
]]></style>
<script type="text/javascript"><![CDATA[
var test = async_test("CSS Test: @viewport CSSOM - CSSRule.WEBKIT_VIEWPORT_RULE");
window.onload = function(){

var testStyleSheet = document.styleSheets.item(1);

/* Disable the stylesheet that contains the @viewport to test. */
testStyleSheet.disabled = true;

/* Initialize an object to store viewport values to be used by the test
asserts. */
var viewport = new Object();

/* An element with the same size as the initial containing block. */
var testElm = document.getElementById("test");

/* Retrieve the initial viewport values before applying the @viewport to
test. */
viewport.initialWidth = testElm.offsetWidth;
viewport.initialHeight = testElm.offsetHeight;
viewport.fontSize = parseInt(getComputedStyle(testElm, "").fontSize);

/* Enable the stylesheet that contains the @viewport to test. */
testStyleSheet.disabled = false;

/* Retrieve the actual viewport values for the test. */
viewport.actualWidth = testElm.offsetWidth;
viewport.actualHeight = testElm.offsetHeight;
viewport.zoom = viewport.initialWidth / window.innerWidth;

/* Check viewport values. */
test.step(function(){
assert_equals(CSSRule.WEBKIT_VIEWPORT_RULE, 15); assert_equals(testStyleSheet.cssRules.item(0).type, 15);
});

/* Finished. Show the results. */
test.done();
testStyleSheet.disabled = true;
document.getElementById("log").style.display = "block";
}
]]></script>
</head>
<body>
<div id="test">
<div id="log"></div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ PASS WebKitCSSKeyframesRule.toString() is '[object WebKitCSSKeyframesRuleConstru
PASS WebKitCSSMatrix.toString() is '[object WebKitCSSMatrixConstructor]'
PASS WebKitCSSRegionRule.toString() is '[object WebKitCSSRegionRuleConstructor]'
PASS WebKitCSSTransformValue.toString() is '[object WebKitCSSTransformValueConstructor]'
PASS WebKitCSSViewportRule.toString() is '[object WebKitCSSViewportRuleConstructor]'
FAIL WebKitIntent.toString() should be [object WebKitIntentConstructor]. Was [object IntentConstructor].
FAIL WebKitMutationObserver.toString() should be [object WebKitMutationObserverConstructor]. Was [object MutationObserverConstructor].
PASS WebKitPoint.toString() is '[object WebKitPointConstructor]'
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ SET(WebCore_IDL_FILES
css/WebKitCSSMatrix.idl
css/WebKitCSSRegionRule.idl
css/WebKitCSSTransformValue.idl
css/WebKitCSSViewportRule.idl

dom/Attr.idl
dom/BeforeLoadEvent.idl
Expand Down
27 changes: 27 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
2012-11-23 Thiago Marcos P. Santos <[email protected]>

Expose DOM interface for CSS Device Adaptation
https://bugs.webkit.org/show_bug.cgi?id=95966

Reviewed by Kenneth Rohde Christiansen.

Added V8 and JSC bindings for CSS Device Adapation.

Test: css3/device-adapt/opera/cssom-001.xhtml

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJS):
* bindings/objc/DOMCSS.mm:
(kitClass):
* bindings/v8/custom/V8CSSRuleCustom.cpp:
(WebCore::wrap):
* css/CSSRule.idl:
* css/WebKitCSSViewportRule.idl: Added.
* page/DOMWindow.idl:

2012-11-22 Sheriff Bot <[email protected]>

Unreviewed, rolling out r135549.
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/DerivedSources.make
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ BINDING_IDLS = \
$(WebCore)/css/WebKitCSSMatrix.idl \
$(WebCore)/css/WebKitCSSRegionRule.idl \
$(WebCore)/css/WebKitCSSTransformValue.idl \
$(WebCore)/css/WebKitCSSViewportRule.idl \
$(WebCore)/dom/Attr.idl \
$(WebCore)/dom/BeforeLoadEvent.idl \
$(WebCore)/dom/CDATASection.idl \
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/DerivedSources.pri
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ IDL_BINDINGS += \
$$PWD/css/WebKitCSSMatrix.idl \
$$PWD/css/WebKitCSSRegionRule.idl \
$$PWD/css/WebKitCSSTransformValue.idl \
$$PWD/css/WebKitCSSViewportRule.idl \
$$PWD/dom/Attr.idl \
$$PWD/dom/BeforeLoadEvent.idl \
$$PWD/dom/CharacterData.idl \
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/GNUmakefile.list.am
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSWebKitCSSRegionRule.h \
DerivedSources/WebCore/JSWebKitCSSTransformValue.cpp \
DerivedSources/WebCore/JSWebKitCSSTransformValue.h \
DerivedSources/WebCore/JSWebKitCSSViewportRule.cpp \
DerivedSources/WebCore/JSWebKitCSSViewportRule.h \
DerivedSources/WebCore/JSWebKitNamedFlow.cpp \
DerivedSources/WebCore/JSWebKitNamedFlow.h \
DerivedSources/WebCore/JSWebKitPoint.cpp \
Expand Down Expand Up @@ -1336,6 +1338,7 @@ dom_binding_idls += \
$(WebCore)/css/WebKitCSSMatrix.idl \
$(WebCore)/css/WebKitCSSRegionRule.idl \
$(WebCore)/css/WebKitCSSTransformValue.idl \
$(WebCore)/css/WebKitCSSViewportRule.idl \
$(WebCore)/dom/Attr.idl \
$(WebCore)/dom/BeforeLoadEvent.idl \
$(WebCore)/dom/CDATASection.idl \
Expand Down
6 changes: 6 additions & 0 deletions Source/WebCore/WebCore.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,7 @@
'css/WebKitCSSMatrix.idl',
'css/WebKitCSSRegionRule.idl',
'css/WebKitCSSTransformValue.idl',
'css/WebKitCSSViewportRule.idl',
'dom/Attr.idl',
'dom/BeforeLoadEvent.idl',
'dom/CDATASection.idl',
Expand Down Expand Up @@ -7301,6 +7302,9 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMWebKitCSSTransformValue.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMWebKitCSSTransformValue.mm',
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMWebKitCSSTransformValueInternal.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMWebKitCSSViewportRule.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMWebKitCSSViewportRule.mm',
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMWebKitCSSViewportRuleInternal.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMWheelEvent.mm',
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMWheelEventInternal.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/DOMXPathExpression.mm',
Expand Down Expand Up @@ -8351,6 +8355,8 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitCSSRegionRule.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitCSSTransformValue.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitCSSTransformValue.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitCSSViewportRule.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitCSSViewportRule.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitPoint.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitPoint.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitNamedFlow.cpp',
Expand Down
22 changes: 22 additions & 0 deletions Source/WebCore/WebCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,11 @@
3AC648B2129E146500C3EB25 /* EditingBoundary.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AC648B1129E146500C3EB25 /* EditingBoundary.h */; settings = {ATTRIBUTES = (Private, ); }; };
3C244FEAA375AC633F88BE6F /* RenderLayerModelObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C244FE4A375AC633F88BE6F /* RenderLayerModelObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
3C244FEBA375AC633F88BE6F /* RenderLayerModelObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C244FE5A375AC633F88BE6F /* RenderLayerModelObject.cpp */; };
3F2B33EB165AF15600E3987C /* DOMWebKitCSSViewportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F2B33E6165AF15500E3987C /* DOMWebKitCSSViewportRule.h */; };
3F2B33EC165AF15600E3987C /* DOMWebKitCSSViewportRule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F2B33E7165AF15500E3987C /* DOMWebKitCSSViewportRule.mm */; };
3F2B33ED165AF15600E3987C /* DOMWebKitCSSViewportRuleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F2B33E8165AF15500E3987C /* DOMWebKitCSSViewportRuleInternal.h */; };
3F2B33EE165AF15600E3987C /* JSWebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F2B33E9165AF15500E3987C /* JSWebKitCSSViewportRule.cpp */; };
3F2B33EF165AF15600E3987C /* JSWebKitCSSViewportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F2B33EA165AF15500E3987C /* JSWebKitCSSViewportRule.h */; };
3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */; };
3FFFF9A9159D9A550020BBD5 /* WebKitCSSViewportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */; };
3FFFF9AD159D9B060020BBD5 /* ViewportStyleResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9AB159D9B060020BBD5 /* ViewportStyleResolver.cpp */; };
Expand Down Expand Up @@ -8217,6 +8222,12 @@
3AC648B1129E146500C3EB25 /* EditingBoundary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBoundary.h; sourceTree = "<group>"; };
3C244FE4A375AC633F88BE6F /* RenderLayerModelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderLayerModelObject.h; sourceTree = "<group>"; };
3C244FE5A375AC633F88BE6F /* RenderLayerModelObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderLayerModelObject.cpp; sourceTree = "<group>"; };
3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitCSSViewportRule.idl; sourceTree = "<group>"; };
3F2B33E6165AF15500E3987C /* DOMWebKitCSSViewportRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitCSSViewportRule.h; sourceTree = "<group>"; };
3F2B33E7165AF15500E3987C /* DOMWebKitCSSViewportRule.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitCSSViewportRule.mm; sourceTree = "<group>"; };
3F2B33E8165AF15500E3987C /* DOMWebKitCSSViewportRuleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitCSSViewportRuleInternal.h; sourceTree = "<group>"; };
3F2B33E9165AF15500E3987C /* JSWebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSViewportRule.cpp; sourceTree = "<group>"; };
3F2B33EA165AF15500E3987C /* JSWebKitCSSViewportRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitCSSViewportRule.h; sourceTree = "<group>"; };
3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSViewportRule.cpp; sourceTree = "<group>"; };
3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSViewportRule.h; sourceTree = "<group>"; };
3FFFF9AB159D9B060020BBD5 /* ViewportStyleResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewportStyleResolver.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -16250,6 +16261,9 @@
31611E5E0E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.h */,
31611E5F0E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm */,
31611E600E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h */,
3F2B33E6165AF15500E3987C /* DOMWebKitCSSViewportRule.h */,
3F2B33E7165AF15500E3987C /* DOMWebKitCSSViewportRule.mm */,
3F2B33E8165AF15500E3987C /* DOMWebKitCSSViewportRuleInternal.h */,
);
name = CSS;
sourceTree = "<group>";
Expand Down Expand Up @@ -19061,6 +19075,8 @@
8ACC24CE148E24B200EFCC0D /* JSWebKitCSSRegionRule.h */,
31611E580E1C4DE000F6A579 /* JSWebKitCSSTransformValue.cpp */,
31611E590E1C4DE000F6A579 /* JSWebKitCSSTransformValue.h */,
3F2B33E9165AF15500E3987C /* JSWebKitCSSViewportRule.cpp */,
3F2B33EA165AF15500E3987C /* JSWebKitCSSViewportRule.h */,
);
name = CSS;
sourceTree = "<group>";
Expand Down Expand Up @@ -21504,6 +21520,7 @@
31611E540E1C4D4A00F6A579 /* WebKitCSSTransformValue.idl */,
3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */,
3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */,
3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */,
);
path = css;
sourceTree = "<group>";
Expand Down Expand Up @@ -25778,6 +25795,9 @@
50D32858163B313F0016111E /* ValidatedCustomFilterOperation.h in Headers */,
3FFFF9AE159D9B060020BBD5 /* ViewportStyleResolver.h in Headers */,
3FFFF9A9159D9A550020BBD5 /* WebKitCSSViewportRule.h in Headers */,
3F2B33EB165AF15600E3987C /* DOMWebKitCSSViewportRule.h in Headers */,
3F2B33ED165AF15600E3987C /* DOMWebKitCSSViewportRuleInternal.h in Headers */,
3F2B33EF165AF15600E3987C /* JSWebKitCSSViewportRule.h in Headers */,
93C38BFF164473C700091EB2 /* ScrollingStateFixedNode.h in Headers */,
93C38C03164473DD00091EB2 /* ScrollingTreeFixedNode.h in Headers */,
E1424C8A164B3B4E00F32D40 /* PlatformCookieJar.h in Headers */,
Expand Down Expand Up @@ -28874,6 +28894,8 @@
1AA21250163F0DA80000E63F /* AtomicStringCF.cpp in Sources */,
50D32857163B313F0016111E /* ValidatedCustomFilterOperation.cpp in Sources */,
3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */,
3F2B33EC165AF15600E3987C /* DOMWebKitCSSViewportRule.mm in Sources */,
3F2B33EE165AF15600E3987C /* JSWebKitCSSViewportRule.cpp in Sources */,
4FFC022B1643B710004E1638 /* NodeRareData.cpp in Sources */,
4FFC022D1643B726004E1638 /* ElementRareData.cpp in Sources */,
93C38BFE164473C700091EB2 /* ScrollingStateFixedNode.cpp in Sources */,
Expand Down
7 changes: 7 additions & 0 deletions Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@
#include "JSWebKitCSSKeyframeRule.h"
#include "JSWebKitCSSKeyframesRule.h"
#include "JSWebKitCSSRegionRule.h"
#include "JSWebKitCSSViewportRule.h"
#include "WebKitCSSKeyframeRule.h"
#include "WebKitCSSKeyframesRule.h"
#include "WebKitCSSRegionRule.h"
#include "WebKitCSSViewportRule.h"

using namespace JSC;

Expand Down Expand Up @@ -94,6 +96,11 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, CSSRule* rule)
case CSSRule::WEBKIT_KEYFRAMES_RULE:
wrapper = CREATE_DOM_WRAPPER(exec, globalObject, WebKitCSSKeyframesRule, rule);
break;
#if ENABLE(CSS_DEVICE_ADAPTATION)
case CSSRule::WEBKIT_VIEWPORT_RULE:
wrapper = CREATE_DOM_WRAPPER(exec, globalObject, WebKitCSSViewportRule, rule);
break;
#endif
#if ENABLE(CSS_REGIONS)
case CSSRule::WEBKIT_REGION_RULE:
wrapper = CREATE_DOM_WRAPPER(exec, globalObject, WebKitCSSRegionRule, rule);
Expand Down
8 changes: 8 additions & 0 deletions Source/WebCore/bindings/objc/DOMCSS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
#import "DOMWebKitCSSRegionRule.h"
#endif

#if ENABLE(CSS_DEVICE_ADAPTATION)
#import "DOMWebKitCSSViewportRule.h"
#endif

#if ENABLE(SVG_DOM_OBJC_BINDINGS)
#import "DOMSVGPaint.h"
#endif
Expand Down Expand Up @@ -95,6 +99,10 @@ Class kitClass(WebCore::CSSRule* impl)
return [DOMWebKitCSSKeyframesRule class];
case DOM_WEBKIT_KEYFRAME_RULE:
return [DOMWebKitCSSKeyframeRule class];
#if ENABLE(CSS_DEVICE_ADAPTATION)
case DOM_WEBKIT_VIEWPORT_RULE:
return [DOMWebKitCSSViewportRule class];
#endif
#if ENABLE(CSS_REGIONS)
case DOM_WEBKIT_REGION_RULE:
return [DOMWebKitCSSRegionRule class];
Expand Down
8 changes: 8 additions & 0 deletions Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
#include "V8WebKitCSSKeyframesRule.h"
#include "V8WebKitCSSRegionRule.h"

#if ENABLE(CSS_DEVICE_ADAPTATION)
#include "V8WebKitCSSViewportRule.h"
#endif

namespace WebCore {

v8::Handle<v8::Object> wrap(CSSRule* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
Expand Down Expand Up @@ -68,6 +72,10 @@ v8::Handle<v8::Object> wrap(CSSRule* impl, v8::Handle<v8::Object> creationContex
return wrap(static_cast<WebKitCSSKeyframeRule*>(impl), creationContext, isolate);
case CSSRule::WEBKIT_KEYFRAMES_RULE:
return wrap(static_cast<WebKitCSSKeyframesRule*>(impl), creationContext, isolate);
#if ENABLE(CSS_DEVICE_ADAPTATION)
case CSSRule::WEBKIT_VIEWPORT_RULE:
return wrap(static_cast<WebKitCSSViewportRule*>(impl), creationContext, isolate);
#endif
case CSSRule::WEBKIT_REGION_RULE:
return wrap(static_cast<WebKitCSSRegionRule*>(impl), creationContext, isolate);
}
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/css/CSSRule.idl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
const unsigned short PAGE_RULE = 6;
const unsigned short WEBKIT_KEYFRAMES_RULE = 7;
const unsigned short WEBKIT_KEYFRAME_RULE = 8;
#if defined(ENABLE_CSS_DEVICE_ADAPTATION) && ENABLE_CSS_DEVICE_ADAPTATION
const unsigned short WEBKIT_VIEWPORT_RULE = 15;
#endif
#if defined(ENABLE_CSS_REGIONS) && ENABLE_CSS_REGIONS
const unsigned short WEBKIT_REGION_RULE = 16;
#endif
Expand Down
Loading

0 comments on commit 1371006

Please sign in to comment.