LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Jul 2007 17:51:28 +0000 (17:51 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Jul 2007 17:51:28 +0000 (17:51 +0000)
commit302ba888fe6208e31f7ee9bee582c700c23e11c2
tree504766b80375dfc803978d0f30a24c95790d8303
parent588df50db16ca5cb232d3b4f399a6514e5493b66
LayoutTests:

        Reviewed by Darin.

        - test for http://bugs.webkit.org/show_bug.cgi?id=12384
          getComputedStyle with td.style.display='none' reports '' for all properties except display

        * fast/css/computed-style-without-renderer-expected.txt: Added.
        * fast/css/computed-style-without-renderer.html: Added.

WebCore:

        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12384
          getComputedStyle with td.style.display='none' reports '' for all properties except display

        Test: fast/css/computed-style-without-renderer.html

        Implement rich computed style for elements that do not have a renderer.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::getPositionOffsetValue): Changed to take a RenderStyle instead of
        a RenderObject.
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Changed to
        use the computed style returned by the node instead of going through the
        renderer. Changed properties that compute by measuring the renderer to
        fall back on returning the length from the RenderStyle if a renderer does
        not exist.
        (WebCore::CSSComputedStyleDeclaration::length): Changed to return the number
        of properties we can compute even if the element has no renderer.
        (WebCore::CSSComputedStyleDeclaration::copyInheritableProperties): Changed
        to use the computed style returned by the node instead of going through the
        renderer.
        * dom/Element.cpp:
        (WebCore::ElementRareData::ElementRareData): Added a computed style member,
        used to cache computed style for elements that do not have a renderer.
        (WebCore::ElementRareData::resetComputedStyle): Added.
        (WebCore::Element::~Element): Delete the cached computed style.
        (WebCore::Element::recalcStyle): Added code to delete the cached computed
        style when necessary.
        (WebCore::Element::computedStyle): Added. Returns the style used in rendering
        the element, if available. Otherwise uses the style selector to compute style
        for the element.
        * dom/Element.h:
        * dom/Node.cpp:
        (WebCore::Node::computedStyle): Added. This method returns either the style
        used in rendering the node, or the style that would be used if the node
        had a renderer.
        * dom/Node.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/computed-style-without-renderer-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/computed-style-without-renderer.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/dom/Element.cpp
WebCore/dom/Element.h
WebCore/dom/Node.cpp
WebCore/dom/Node.h