From 5dd0312de6141c88a66182f62629dad237b630f2 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 6 Sep 2011 23:49:12 +0100 Subject: Fix logic error in Android style version calculation. We need to update the style version on a width or height change, and also detect a transition from display:none to display:something (and vice versa) in which case WebKit will pass the display:none style as a null pointer. Bug: 5137070 Change-Id: I82fa3fbe990cfc4c733a2f4fed8be37f11e44ba4 --- Source/WebCore/dom/Element.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/WebCore') diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp index eef2419..64d3eed 100644 --- a/Source/WebCore/dom/Element.cpp +++ b/Source/WebCore/dom/Element.cpp @@ -1072,11 +1072,15 @@ bool Element::pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderS #ifdef ANDROID_STYLE_VERSION static bool displayDiff(const RenderStyle* s1, const RenderStyle* s2) { - if (!s1 || !s2) + if (!s1 && !s2) return false; + else if ((!s1 && s2) || (s1 && !s2)) + return true; + return s1->display() != s2->display() || s1->left() != s2->left() || s1->top() != s2->top() - || s1->right() != s2->right() || s1->bottom() != s2->bottom(); + || s1->right() != s2->right() || s1->bottom() != s2->bottom() + || s1->width() != s2->width() || s1->height() != s2->height(); } #endif -- cgit v1.1