Commit b3de9be0 authored by darin@apple.com's avatar darin@apple.com

2008-10-12 Darin Adler <darin@apple.com>

        Reviewed by Mark Rowe.

        - fix https://bugs.webkit.org/show_bug.cgi?id=21557
          Bug 21557: REGRESSION: generated-layer-scrollbar-crash.html is crashing

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::getPseudoStyle): Keep walking up the parent chain
        until we hit an Element. Nowadays, Node::isElementNode() is just as efficient
        as RenderObject::isText(), and this guarantees that the node can be cast to
        Element*, which is done just below. The reason this is hit is that RenderLayer
        can call getPseudoStyle on a RenderView, which has the document as its
        element() -- and a document is neither a Text node nor an Element. A loose
        end is that this seems to mean you can't style the scrollbar corner or the
        resizer on a RenderView. Hyatt may want to look into that later.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8cf9e60e
2008-10-12 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
- fix https://bugs.webkit.org/show_bug.cgi?id=21557
Bug 21557: REGRESSION: generated-layer-scrollbar-crash.html is crashing
* rendering/RenderObject.cpp:
(WebCore::RenderObject::getPseudoStyle): Keep walking up the parent chain
until we hit an Element. Nowadays, Node::isElementNode() is just as efficient
as RenderObject::isText(), and this guarantees that the node can be cast to
Element*, which is done just below. The reason this is hit is that RenderLayer
can call getPseudoStyle on a RenderView, which has the document as its
element() -- and a document is neither a Text node nor an Element. A loose
end is that this seems to mean you can't style the scrollbar corner or the
resizer on a RenderView. Hyatt may want to look into that later.
2008-10-12 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
......
......@@ -2835,7 +2835,7 @@ RenderStyle* RenderObject::getPseudoStyle(RenderStyle::PseudoId pseudo, RenderSt
return result;
Node* node = element();
if (node && isText())
while (node && !node->isElementNode())
node = node->parentNode();
if (!node)
return 0;
......
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