| 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 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 activeAnimations->setAnimationStyleChange(false); | 1416 activeAnimations->setAnimationStyleChange(false); |
| 1417 } | 1417 } |
| 1418 } | 1418 } |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 void Element::detach(const AttachContext& context) | 1421 void Element::detach(const AttachContext& context) |
| 1422 { | 1422 { |
| 1423 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 1423 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
| 1424 cancelFocusAppearanceUpdate(); | 1424 cancelFocusAppearanceUpdate(); |
| 1425 removeCallbackSelectors(); | 1425 removeCallbackSelectors(); |
| 1426 if (needsLayerUpdate()) | 1426 if (svgFilterNeedsLayerUpdate()) |
| 1427 document().unscheduleLayerUpdate(*this); | 1427 document().unscheduleSVGFilterLayerUpdateHack(*this); |
| 1428 if (hasRareData()) { | 1428 if (hasRareData()) { |
| 1429 ElementRareData* data = elementRareData(); | 1429 ElementRareData* data = elementRareData(); |
| 1430 data->clearPseudoElements(); | 1430 data->clearPseudoElements(); |
| 1431 | 1431 |
| 1432 // attach() will perform the below steps for us when inside recalcStyle. | 1432 // attach() will perform the below steps for us when inside recalcStyle. |
| 1433 if (!document().inStyleRecalc()) { | 1433 if (!document().inStyleRecalc()) { |
| 1434 data->resetStyleState(); | 1434 data->resetStyleState(); |
| 1435 data->clearComputedStyle(); | 1435 data->clearComputedStyle(); |
| 1436 } | 1436 } |
| 1437 | 1437 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1585 return Reattach; | 1585 return Reattach; |
| 1586 return ReattachNoRenderer; | 1586 return ReattachNoRenderer; |
| 1587 } | 1587 } |
| 1588 | 1588 |
| 1589 ASSERT(oldStyle); | 1589 ASSERT(oldStyle); |
| 1590 | 1590 |
| 1591 if (localChange != NoChange) | 1591 if (localChange != NoChange) |
| 1592 updateCallbackSelectors(oldStyle.get(), newStyle.get()); | 1592 updateCallbackSelectors(oldStyle.get(), newStyle.get()); |
| 1593 | 1593 |
| 1594 if (RenderObject* renderer = this->renderer()) { | 1594 if (RenderObject* renderer = this->renderer()) { |
| 1595 if (localChange != NoChange || pseudoStyleCacheIsInvalid(oldStyle.get(),
newStyle.get()) || needsLayerUpdate()) { | 1595 if (localChange != NoChange || pseudoStyleCacheIsInvalid(oldStyle.get(),
newStyle.get()) || svgFilterNeedsLayerUpdate()) { |
| 1596 renderer->setStyle(newStyle.get()); | 1596 renderer->setStyle(newStyle.get()); |
| 1597 } else { | 1597 } else { |
| 1598 // Although no change occurred, we use the new style so that the cou
sin style sharing code won't get | 1598 // Although no change occurred, we use the new style so that the cou
sin style sharing code won't get |
| 1599 // fooled into believing this style is the same. | 1599 // fooled into believing this style is the same. |
| 1600 // FIXME: We may be able to remove this hack, see discussion in | 1600 // FIXME: We may be able to remove this hack, see discussion in |
| 1601 // https://codereview.chromium.org/30453002/ | 1601 // https://codereview.chromium.org/30453002/ |
| 1602 renderer->setStyleInternal(newStyle.get()); | 1602 renderer->setStyleInternal(newStyle.get()); |
| 1603 } | 1603 } |
| 1604 } | 1604 } |
| 1605 | 1605 |
| (...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2928 } else if (type == SelectOptions) { | 2928 } else if (type == SelectOptions) { |
| 2929 ASSERT(isHTMLSelectElement(this)); | 2929 ASSERT(isHTMLSelectElement(this)); |
| 2930 return ensureRareData().ensureNodeLists().addCache<HTMLOptionsCollection
>(*this, type); | 2930 return ensureRareData().ensureNodeLists().addCache<HTMLOptionsCollection
>(*this, type); |
| 2931 } else if (type == FormControls) { | 2931 } else if (type == FormControls) { |
| 2932 ASSERT(isHTMLFormElement(this) || isHTMLFieldSetElement(this)); | 2932 ASSERT(isHTMLFormElement(this) || isHTMLFieldSetElement(this)); |
| 2933 return ensureRareData().ensureNodeLists().addCache<HTMLFormControlsColle
ction>(*this, type); | 2933 return ensureRareData().ensureNodeLists().addCache<HTMLFormControlsColle
ction>(*this, type); |
| 2934 } | 2934 } |
| 2935 return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(*this, ty
pe); | 2935 return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(*this, ty
pe); |
| 2936 } | 2936 } |
| 2937 | 2937 |
| 2938 void Element::scheduleLayerUpdate() | 2938 void Element::scheduleSVGFilterLayerUpdateHack() |
| 2939 { | 2939 { |
| 2940 document().scheduleLayerUpdate(*this); | 2940 document().scheduleSVGFilterLayerUpdateHack(*this); |
| 2941 } | 2941 } |
| 2942 | 2942 |
| 2943 HTMLCollection* Element::cachedHTMLCollection(CollectionType type) | 2943 HTMLCollection* Element::cachedHTMLCollection(CollectionType type) |
| 2944 { | 2944 { |
| 2945 return hasRareData() && rareData()->nodeLists() ? rareData()->nodeLists()->c
ached<HTMLCollection>(type) : 0; | 2945 return hasRareData() && rareData()->nodeLists() ? rareData()->nodeLists()->c
ached<HTMLCollection>(type) : 0; |
| 2946 } | 2946 } |
| 2947 | 2947 |
| 2948 IntSize Element::savedLayerScrollOffset() const | 2948 IntSize Element::savedLayerScrollOffset() const |
| 2949 { | 2949 { |
| 2950 return hasRareData() ? elementRareData()->savedLayerScrollOffset() : IntSize
(); | 2950 return hasRareData() ? elementRareData()->savedLayerScrollOffset() : IntSize
(); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3310 | 3310 |
| 3311 void Element::trace(Visitor* visitor) | 3311 void Element::trace(Visitor* visitor) |
| 3312 { | 3312 { |
| 3313 if (hasRareData()) | 3313 if (hasRareData()) |
| 3314 visitor->trace(elementRareData()); | 3314 visitor->trace(elementRareData()); |
| 3315 | 3315 |
| 3316 ContainerNode::trace(visitor); | 3316 ContainerNode::trace(visitor); |
| 3317 } | 3317 } |
| 3318 | 3318 |
| 3319 } // namespace WebCore | 3319 } // namespace WebCore |
| OLD | NEW |