forked from adobe/webkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose DOM interface for CSS Device Adaptation
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
1 parent
ab5aff7
commit 1371006
Showing
17 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS CSS Test: @viewport CSSOM - CSSRule.WEBKIT_VIEWPORT_RULE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.