| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
| 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 348 |
| 349 inline Element* SharedStyleFinder::findElementForStyleSharing() const { | 349 inline Element* SharedStyleFinder::findElementForStyleSharing() const { |
| 350 StyleSharingList& styleSharingList = m_styleResolver->styleSharingList(); | 350 StyleSharingList& styleSharingList = m_styleResolver->styleSharingList(); |
| 351 for (StyleSharingList::iterator it = styleSharingList.begin(); | 351 for (StyleSharingList::iterator it = styleSharingList.begin(); |
| 352 it != styleSharingList.end(); ++it) { | 352 it != styleSharingList.end(); ++it) { |
| 353 Element& candidate = **it; | 353 Element& candidate = **it; |
| 354 if (!canShareStyleWithElement(candidate)) | 354 if (!canShareStyleWithElement(candidate)) |
| 355 continue; | 355 continue; |
| 356 if (it != styleSharingList.begin()) { | 356 if (it != styleSharingList.begin()) { |
| 357 // Move the element to the front of the LRU | 357 // Move the element to the front of the LRU |
| 358 styleSharingList.remove(it); | 358 styleSharingList.erase(it); |
| 359 styleSharingList.prepend(&candidate); | 359 styleSharingList.prepend(&candidate); |
| 360 } | 360 } |
| 361 return &candidate; | 361 return &candidate; |
| 362 } | 362 } |
| 363 m_styleResolver->addToStyleSharingList(element()); | 363 m_styleResolver->addToStyleSharingList(element()); |
| 364 return nullptr; | 364 return nullptr; |
| 365 } | 365 } |
| 366 | 366 |
| 367 bool SharedStyleFinder::matchesRuleSet(RuleSet* ruleSet) { | 367 bool SharedStyleFinder::matchesRuleSet(RuleSet* ruleSet) { |
| 368 if (!ruleSet) | 368 if (!ruleSet) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { | 413 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { |
| 414 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), | 414 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), |
| 415 sharedStyleRejectedByParent, 1); | 415 sharedStyleRejectedByParent, 1); |
| 416 return nullptr; | 416 return nullptr; |
| 417 } | 417 } |
| 418 | 418 |
| 419 return getElementStyle(*shareElement); | 419 return getElementStyle(*shareElement); |
| 420 } | 420 } |
| 421 | 421 |
| 422 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |