| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 bool rendererWillChange = needsAttach() || renderer(); | 983 bool rendererWillChange = needsAttach() || renderer(); |
| 984 reattach(reattachContext); | 984 reattach(reattachContext); |
| 985 if (rendererWillChange || renderer()) | 985 if (rendererWillChange || renderer()) |
| 986 return Reattach; | 986 return Reattach; |
| 987 return ReattachNoRenderer; | 987 return ReattachNoRenderer; |
| 988 } | 988 } |
| 989 | 989 |
| 990 ASSERT(oldStyle); | 990 ASSERT(oldStyle); |
| 991 | 991 |
| 992 if (RenderObject* renderer = this->renderer()) { | 992 if (RenderObject* renderer = this->renderer()) { |
| 993 if (localChange != NoChange) { | 993 if (localChange != NoChange) |
| 994 renderer->setStyle(newStyle.get()); | 994 renderer->setStyle(newStyle.get()); |
| 995 } else { | |
| 996 // Although no change occurred, we use the new style so that the cou
sin style sharing code won't get | |
| 997 // fooled into believing this style is the same. | |
| 998 // FIXME: We may be able to remove this hack, see discussion in | |
| 999 // https://codereview.chromium.org/30453002/ | |
| 1000 renderer->setStyleInternal(newStyle.get()); | |
| 1001 } | |
| 1002 } | 995 } |
| 1003 | 996 |
| 1004 if (styleChangeType() >= SubtreeStyleChange) | 997 if (styleChangeType() >= SubtreeStyleChange) |
| 1005 return Force; | 998 return Force; |
| 1006 | 999 |
| 1007 if (change > Inherit || localChange > Inherit) | 1000 if (change > Inherit || localChange > Inherit) |
| 1008 return max(localChange, change); | 1001 return max(localChange, change); |
| 1009 | 1002 |
| 1010 return localChange; | 1003 return localChange; |
| 1011 } | 1004 } |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1830 return false; | 1823 return false; |
| 1831 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. | 1824 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. |
| 1832 // See comments in RenderObject::setStyle(). | 1825 // See comments in RenderObject::setStyle(). |
| 1833 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? | 1826 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? |
| 1834 if (isHTMLCanvasElement(*this)) | 1827 if (isHTMLCanvasElement(*this)) |
| 1835 return false; | 1828 return false; |
| 1836 return true; | 1829 return true; |
| 1837 } | 1830 } |
| 1838 | 1831 |
| 1839 } // namespace blink | 1832 } // namespace blink |
| OLD | NEW |