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.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 PassRefPtr<LayoutStyle> StyleResolver::styleForElement(Element* element, LayoutS
tyle* defaultParent, StyleSharingBehavior sharingBehavior, | 530 PassRefPtr<LayoutStyle> StyleResolver::styleForElement(Element* element, LayoutS
tyle* defaultParent, StyleSharingBehavior sharingBehavior, |
531 RuleMatchingBehavior matchingBehavior) | 531 RuleMatchingBehavior matchingBehavior) |
532 { | 532 { |
533 ASSERT(document().frame()); | 533 ASSERT(document().frame()); |
534 ASSERT(document().settings()); | 534 ASSERT(document().settings()); |
535 ASSERT(!hasPendingAuthorStyleSheets()); | 535 ASSERT(!hasPendingAuthorStyleSheets()); |
536 ASSERT(!m_needCollectFeatures); | 536 ASSERT(!m_needCollectFeatures); |
537 | 537 |
538 // Once an element has a renderer, we don't try to destroy it, since otherwi
se the renderer | 538 // Once an element has a renderer, we don't try to destroy it, since otherwi
se the renderer |
539 // will vanish if a style recalc happens during loading. | 539 // will vanish if a style recalc happens during loading. |
540 if (sharingBehavior == AllowStyleSharing && !document().isRenderingReady() &
& !element->renderer()) { | 540 if (sharingBehavior == AllowStyleSharing && !document().isRenderingReady() &
& !element->layoutObject()) { |
541 if (!s_styleNotYetAvailable) { | 541 if (!s_styleNotYetAvailable) { |
542 s_styleNotYetAvailable = LayoutStyle::create().leakRef(); | 542 s_styleNotYetAvailable = LayoutStyle::create().leakRef(); |
543 s_styleNotYetAvailable->setDisplay(NONE); | 543 s_styleNotYetAvailable->setDisplay(NONE); |
544 s_styleNotYetAvailable->font().update(document().styleEngine()->font
Selector()); | 544 s_styleNotYetAvailable->font().update(document().styleEngine()->font
Selector()); |
545 } | 545 } |
546 | 546 |
547 document().setHasNodesWithPlaceholderStyle(); | 547 document().setHasNodesWithPlaceholderStyle(); |
548 return s_styleNotYetAvailable; | 548 return s_styleNotYetAvailable; |
549 } | 549 } |
550 | 550 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 | 710 |
711 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElement(Element
* parent, PseudoId pseudoId) | 711 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElement(Element
* parent, PseudoId pseudoId) |
712 { | 712 { |
713 if (pseudoId == FIRST_LETTER) | 713 if (pseudoId == FIRST_LETTER) |
714 return FirstLetterPseudoElement::create(parent); | 714 return FirstLetterPseudoElement::create(parent); |
715 return PseudoElement::create(parent, pseudoId); | 715 return PseudoElement::create(parent, pseudoId); |
716 } | 716 } |
717 | 717 |
718 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded
(Element& parent, PseudoId pseudoId) | 718 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded
(Element& parent, PseudoId pseudoId) |
719 { | 719 { |
720 LayoutObject* parentRenderer = parent.renderer(); | 720 LayoutObject* parentRenderer = parent.layoutObject(); |
721 if (!parentRenderer) | 721 if (!parentRenderer) |
722 return nullptr; | 722 return nullptr; |
723 | 723 |
724 // The first letter pseudo element has to look up the tree and see if any | 724 // The first letter pseudo element has to look up the tree and see if any |
725 // of the ancestors are first letter. | 725 // of the ancestors are first letter. |
726 if (pseudoId < FIRST_INTERNAL_PSEUDOID && pseudoId != FIRST_LETTER && !paren
tRenderer->style()->hasPseudoStyle(pseudoId)) | 726 if (pseudoId < FIRST_INTERNAL_PSEUDOID && pseudoId != FIRST_LETTER && !paren
tRenderer->style()->hasPseudoStyle(pseudoId)) |
727 return nullptr; | 727 return nullptr; |
728 | 728 |
729 if (pseudoId == BACKDROP && !parent.isInTopLayer()) | 729 if (pseudoId == BACKDROP && !parent.isInTopLayer()) |
730 return nullptr; | 730 return nullptr; |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1515 visitor->trace(m_uncommonAttributeRuleSet); | 1515 visitor->trace(m_uncommonAttributeRuleSet); |
1516 visitor->trace(m_watchedSelectorsRules); | 1516 visitor->trace(m_watchedSelectorsRules); |
1517 visitor->trace(m_treeBoundaryCrossingRules); | 1517 visitor->trace(m_treeBoundaryCrossingRules); |
1518 visitor->trace(m_styleSharingLists); | 1518 visitor->trace(m_styleSharingLists); |
1519 visitor->trace(m_pendingStyleSheets); | 1519 visitor->trace(m_pendingStyleSheets); |
1520 visitor->trace(m_document); | 1520 visitor->trace(m_document); |
1521 #endif | 1521 #endif |
1522 } | 1522 } |
1523 | 1523 |
1524 } // namespace blink | 1524 } // namespace blink |
OLD | NEW |