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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
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 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2053 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) | 2053 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) |
2054 { | 2054 { |
2055 return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNon IdenticalCursorListsEqual(a, b)); | 2055 return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNon IdenticalCursorListsEqual(a, b)); |
2056 } | 2056 } |
2057 | 2057 |
2058 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt yle) | 2058 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt yle) |
2059 { | 2059 { |
2060 if (s_affectsParentBlock) | 2060 if (s_affectsParentBlock) |
2061 handleDynamicFloatPositionChange(); | 2061 handleDynamicFloatPositionChange(); |
2062 | 2062 |
2063 if (RenderView* view = this->view()) { | |
esprehn
2013/10/25 22:25:51
You don't need to null check this, going through s
| |
2064 bool newStyleMayHaveViewportPercentage = style()->mayHaveViewportPercent ageProperty(); | |
2065 bool oldStyleMayHaveViewportPercentage = oldStyle && oldStyle->mayHaveVi ewportPercentageProperty(); | |
2066 if (newStyleMayHaveViewportPercentage != oldStyleMayHaveViewportPercenta ge) { | |
2067 if (newStyleMayHaveViewportPercentage) | |
2068 view->addViewportPercentageStyleObject(this); | |
2069 else | |
2070 view->removeViewportPercentageStyleObject(this); | |
2071 } | |
2072 } | |
2073 | |
2063 if (!m_parent) | 2074 if (!m_parent) |
2064 return; | 2075 return; |
2065 | 2076 |
2066 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout ) { | 2077 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout ) { |
2067 RenderCounter::rendererStyleChanged(this, oldStyle, m_style.get()); | 2078 RenderCounter::rendererStyleChanged(this, oldStyle, m_style.get()); |
2068 | 2079 |
2069 // If the object already needs layout, then setNeedsLayout won't do | 2080 // If the object already needs layout, then setNeedsLayout won't do |
2070 // any work. But if the containing block has changed, then we may need | 2081 // any work. But if the containing block has changed, then we may need |
2071 // to mark the new containing blocks for layout. The change that can | 2082 // to mark the new containing blocks for layout. The change that can |
2072 // directly affect the containing block of this object is a change to | 2083 // directly affect the containing block of this object is a change to |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2602 // FIXME: Would like to do this in RenderBoxModelObject, but the timing is s o complicated that this can't easily | 2613 // FIXME: Would like to do this in RenderBoxModelObject, but the timing is s o complicated that this can't easily |
2603 // be moved into RenderBoxModelObject::destroy. | 2614 // be moved into RenderBoxModelObject::destroy. |
2604 if (hasLayer()) { | 2615 if (hasLayer()) { |
2605 setHasLayer(false); | 2616 setHasLayer(false); |
2606 toRenderLayerModelObject(this)->destroyLayer(); | 2617 toRenderLayerModelObject(this)->destroyLayer(); |
2607 } | 2618 } |
2608 | 2619 |
2609 setAncestorLineBoxDirty(false); | 2620 setAncestorLineBoxDirty(false); |
2610 | 2621 |
2611 clearLayoutRootIfNeeded(); | 2622 clearLayoutRootIfNeeded(); |
2623 | |
2624 if (RenderView* view = this->view()) | |
2625 view->removeViewportPercentageStyleObject(this); | |
2612 } | 2626 } |
2613 | 2627 |
2614 void RenderObject::insertedIntoTree() | 2628 void RenderObject::insertedIntoTree() |
2615 { | 2629 { |
2616 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion. | 2630 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion. |
2617 | 2631 |
2618 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children | 2632 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children |
2619 // and don't have a layer attached to ourselves. | 2633 // and don't have a layer attached to ourselves. |
2620 RenderLayer* layer = 0; | 2634 RenderLayer* layer = 0; |
2621 if (firstChild() || hasLayer()) { | 2635 if (firstChild() || hasLayer()) { |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3395 { | 3409 { |
3396 if (object1) { | 3410 if (object1) { |
3397 const WebCore::RenderObject* root = object1; | 3411 const WebCore::RenderObject* root = object1; |
3398 while (root->parent()) | 3412 while (root->parent()) |
3399 root = root->parent(); | 3413 root = root->parent(); |
3400 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3414 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3401 } | 3415 } |
3402 } | 3416 } |
3403 | 3417 |
3404 #endif | 3418 #endif |
OLD | NEW |