2006-06-06 Anders Carlsson <acarlsson@apple.com>
Reviewed by Darin.
http://bugzilla.opendarwin.org/show_bug.cgi?id=9325
clientWidth/clientHeight on document element in strict mode should return visible frame size
* dom/Element.cpp:
(WebCore::Element::clientWidth):
(WebCore::Element::clientHeight):
If we're the document element, and in strict mode, return the visible size of the frame.
LayoutTests:
2006-06-06 Anders Carlsson <acarlsson@apple.com>
Reviewed by Darin.
http://bugzilla.opendarwin.org/show_bug.cgi?id=9325
clientWidth/clientHeight on document element in strict mode should return visible frame size
* fast/dom/client-width-height-expected.txt: Added.
* fast/dom/client-width-height.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14744
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-06-06 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by Darin.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=9325
+ clientWidth/clientHeight on document element in strict mode should return visible frame size
+
+ * fast/dom/client-width-height-expected.txt: Added.
+ * fast/dom/client-width-height.html: Added.
+
2006-06-05 Rob Buis <buis@kde.org>
Reviewed by mjs.
--- /dev/null
+This tests that clientWidth/clientHeight on the document element in strict mode returns the visible size of the frame.
+SUCCESS!
+
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <script>
+ function debug(str) {
+ pre = document.getElementById('console');
+ pre.appendChild(document.createTextNode(str + '\n'));
+ }
+
+ function runTests() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ if (document.documentElement.clientWidth == window.innerWidth &&
+ document.documentElement.clientHeight == window.innerHeight)
+ debug("SUCCESS!");
+ else
+ debug("FAILURE!");
+ }
+ </script>
+</head>
+<body onload="runTests()">
+ This tests that clientWidth/clientHeight on the document element in strict mode returns the visible size of the frame.
+ <pre id="console"></pre>
+</body>
+</html>
+2006-06-06 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by Darin.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=9325
+ clientWidth/clientHeight on document element in strict mode should return visible frame size
+
+ * dom/Element.cpp:
+ (WebCore::Element::clientWidth):
+ (WebCore::Element::clientHeight):
+ If we're the document element, and in strict mode, return the visible size of the frame.
+
2006-06-06 Anders Carlsson <acarlsson@apple.com>
Reviewed by John.
int Element::clientWidth()
{
document()->updateLayoutIgnorePendingStylesheets();
+
+ // When in strict mode, clientWidth for the document
+ // element should return the width of the containing frame.
+ if (!document()->inCompatMode() && document()->documentElement() == this)
+ return document()->frame()->view()->visibleWidth();
+
if (RenderObject* rend = renderer())
return rend->clientWidth();
return 0;
int Element::clientHeight()
{
document()->updateLayoutIgnorePendingStylesheets();
+
+ // When in strict mode, clientHeight for the document
+ // element should return the height of the containing frame.
+ if (!document()->inCompatMode() && document()->documentElement() == this)
+ return document()->frame()->view()->visibleHeight();
+
if (RenderObject* rend = renderer())
return rend->clientHeight();
return 0;