| 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 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 if (!currentStyle) | 1533 if (!currentStyle) |
| 1534 return false; | 1534 return false; |
| 1535 | 1535 |
| 1536 const PseudoStyleCache* pseudoStyleCache = currentStyle->cachedPseudoStyles(
); | 1536 const PseudoStyleCache* pseudoStyleCache = currentStyle->cachedPseudoStyles(
); |
| 1537 if (!pseudoStyleCache) | 1537 if (!pseudoStyleCache) |
| 1538 return false; | 1538 return false; |
| 1539 | 1539 |
| 1540 size_t cacheSize = pseudoStyleCache->size(); | 1540 size_t cacheSize = pseudoStyleCache->size(); |
| 1541 for (size_t i = 0; i < cacheSize; ++i) { | 1541 for (size_t i = 0; i < cacheSize; ++i) { |
| 1542 RefPtr<ComputedStyle> newPseudoStyle; | 1542 RefPtr<ComputedStyle> newPseudoStyle; |
| 1543 PseudoId pseudoId = pseudoStyleCache->at(i)->styleType(); | 1543 RefPtr<ComputedStyle> oldPseudoStyle = pseudoStyleCache->at(i); |
| 1544 PseudoId pseudoId = oldPseudoStyle->styleType(); |
| 1544 if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) | 1545 if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) |
| 1545 newPseudoStyle = layoutObject()->uncachedFirstLineStyle(newStyle); | 1546 newPseudoStyle = layoutObject()->uncachedFirstLineStyle(newStyle); |
| 1546 else | 1547 else |
| 1547 newPseudoStyle = layoutObject()->getUncachedPseudoStyle(PseudoStyleR
equest(pseudoId), newStyle, newStyle); | 1548 newPseudoStyle = layoutObject()->getUncachedPseudoStyle(PseudoStyleR
equest(pseudoId), newStyle, newStyle); |
| 1548 if (!newPseudoStyle) | 1549 if (!newPseudoStyle) |
| 1549 return true; | 1550 return true; |
| 1550 if (*newPseudoStyle != *pseudoStyleCache->at(i)) { | 1551 if (*oldPseudoStyle != *newPseudoStyle || oldPseudoStyle->font().loading
CustomFonts() != newPseudoStyle->font().loadingCustomFonts()) { |
| 1551 if (pseudoId < FIRST_INTERNAL_PSEUDOID) | 1552 if (pseudoId < FIRST_INTERNAL_PSEUDOID) |
| 1552 newStyle->setHasPseudoStyle(pseudoId); | 1553 newStyle->setHasPseudoStyle(pseudoId); |
| 1553 newStyle->addCachedPseudoStyle(newPseudoStyle); | 1554 newStyle->addCachedPseudoStyle(newPseudoStyle); |
| 1554 if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) { | 1555 if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) |
| 1555 // FIXME: We should do an actual diff to determine whether a rep
aint vs. layout | 1556 layoutObject()->firstLineStyleDidChange(*oldPseudoStyle, *newPse
udoStyle); |
| 1556 // is needed, but for now just assume a layout will be required.
The diff code | |
| 1557 // in LayoutObject::setStyle would need to be factored out so th
at it could be reused. | |
| 1558 layoutObject()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInv
alidation(LayoutInvalidationReason::StyleChange); | |
| 1559 } | |
| 1560 return true; | 1557 return true; |
| 1561 } | 1558 } |
| 1562 } | 1559 } |
| 1563 return false; | 1560 return false; |
| 1564 } | 1561 } |
| 1565 | 1562 |
| 1566 PassRefPtr<ComputedStyle> Element::styleForLayoutObject() | 1563 PassRefPtr<ComputedStyle> Element::styleForLayoutObject() |
| 1567 { | 1564 { |
| 1568 ASSERT(document().inStyleRecalc()); | 1565 ASSERT(document().inStyleRecalc()); |
| 1569 | 1566 |
| (...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3432 { | 3429 { |
| 3433 #if ENABLE(OILPAN) | 3430 #if ENABLE(OILPAN) |
| 3434 if (hasRareData()) | 3431 if (hasRareData()) |
| 3435 visitor->trace(elementRareData()); | 3432 visitor->trace(elementRareData()); |
| 3436 visitor->trace(m_elementData); | 3433 visitor->trace(m_elementData); |
| 3437 #endif | 3434 #endif |
| 3438 ContainerNode::trace(visitor); | 3435 ContainerNode::trace(visitor); |
| 3439 } | 3436 } |
| 3440 | 3437 |
| 3441 } // namespace blink | 3438 } // namespace blink |
| OLD | NEW |