Commit 087377a2 authored by andersca's avatar andersca

WebCore:

2006-06-27  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Geoff.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9623
        REGRESSION: getComputedStyle should do a relayout
        
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::getComputedStyle):
        Do a relayout.

LayoutTests:

2006-06-27  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Geoff.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9623
        REGRESSION: getComputedStyle should do a relayout

        * fast/css/getComputedStyle-relayout-expected.txt: Added.
        * fast/css/getComputedStyle-relayout.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d37fc8a7
2006-06-27 Anders Carlsson <acarlsson@apple.com>
Reviewed by Geoff.
http://bugzilla.opendarwin.org/show_bug.cgi?id=9623
REGRESSION: getComputedStyle should do a relayout
* fast/css/getComputedStyle-relayout-expected.txt: Added.
* fast/css/getComputedStyle-relayout.html: Added.
2006-06-27 Beth Dakin <bdakin@apple.com>
Reviewed by Hyatt.
This tests that getComputedStyle does a relayout before returning the computed style.
SUCCESS
<html>
<head>
<script>
function runTest() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
var d = document.getElementById('theDiv');
d.style.display = 'block';
var style = document.defaultView.getComputedStyle(d, '');
if (style && style.display == 'block')
document.getElementById('result').innerHTML = 'SUCCESS';
}
</script>
</head>
<body onload="runTest()">
<div id="theDiv" style="display:none;"></div>
<div>This tests that getComputedStyle does a relayout before returning the computed style.</div>
<div id="result">FAILURE</div>
</body>
</html>
2006-06-27 Anders Carlsson <acarlsson@apple.com>
Reviewed by Geoff.
http://bugzilla.opendarwin.org/show_bug.cgi?id=9623
REGRESSION: getComputedStyle should do a relayout
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getComputedStyle):
Do a relayout.
2006-06-27 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adele
......
......@@ -66,11 +66,17 @@ Document* DOMWindow::document() const
PassRefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* elt, const String&) const
{
if (!elt)
return 0;
if (elt->inDocument())
elt->document()->updateLayoutIgnorePendingStylesheets();
// FIXME: This should work even if we do not have a renderer.
// FIXME: This needs to work with pseudo elements.
if (!elt || !elt->renderer())
if (!elt->renderer())
return 0;
return new CSSComputedStyleDeclaration(elt);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment