diff options
author | Ben Murdoch <benm@google.com> | 2011-09-06 23:49:12 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-09-06 23:49:12 +0100 |
commit | 5dd0312de6141c88a66182f62629dad237b630f2 (patch) | |
tree | 56fceb50f95d02759a1f62a3af33d1e5ae209121 /Source/WebCore | |
parent | 8ad3ab0e47f0d5039e89c1873c178f538ec1b0df (diff) | |
download | external_webkit-5dd0312de6141c88a66182f62629dad237b630f2.zip external_webkit-5dd0312de6141c88a66182f62629dad237b630f2.tar.gz external_webkit-5dd0312de6141c88a66182f62629dad237b630f2.tar.bz2 |
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
Diffstat (limited to 'Source/WebCore')
-rw-r--r-- | Source/WebCore/dom/Element.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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 |