| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 for (ShadowRoot* shadowRoot = &shadow->youngestShadowRoot(); shadowRoot; | 172 for (ShadowRoot* shadowRoot = &shadow->youngestShadowRoot(); shadowRoot; |
| 173 shadowRoot = shadowRoot->olderShadowRoot()) { | 173 shadowRoot = shadowRoot->olderShadowRoot()) { |
| 174 if (shadowRoot->numberOfStyles() > 0) { | 174 if (shadowRoot->numberOfStyles() > 0) { |
| 175 if (ScopedStyleResolver* resolver = shadowRoot->scopedStyleResolver()) | 175 if (ScopedStyleResolver* resolver = shadowRoot->scopedStyleResolver()) |
| 176 resolvers.append(resolver); | 176 resolvers.append(resolver); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 StyleResolver::StyleResolver(Document& document) | 181 StyleResolver::StyleResolver(Document& document) |
| 182 : m_document(document), | 182 : m_document(document), m_printMediaType(false), m_styleSharingDepth(0) { |
| 183 m_printMediaType(false), | |
| 184 m_styleSharingDepth(0) { | |
| 185 FrameView* view = document.view(); | 183 FrameView* view = document.view(); |
| 186 DCHECK(view); | 184 DCHECK(view); |
| 187 m_medium = new MediaQueryEvaluator(&view->frame()); | 185 m_medium = new MediaQueryEvaluator(&view->frame()); |
| 188 m_printMediaType = | 186 m_printMediaType = |
| 189 equalIgnoringCase(view->mediaType(), MediaTypeNames::print); | 187 equalIgnoringCase(view->mediaType(), MediaTypeNames::print); |
| 190 } | 188 } |
| 191 | 189 |
| 192 StyleResolver::~StyleResolver() {} | 190 StyleResolver::~StyleResolver() {} |
| 193 | 191 |
| 194 void StyleResolver::dispose() { | 192 void StyleResolver::dispose() { |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 return nullptr; | 850 return nullptr; |
| 853 | 851 |
| 854 if (pseudoId == PseudoIdBackdrop && !parent.isInTopLayer()) | 852 if (pseudoId == PseudoIdBackdrop && !parent.isInTopLayer()) |
| 855 return nullptr; | 853 return nullptr; |
| 856 | 854 |
| 857 if (pseudoId == PseudoIdFirstLetter && | 855 if (pseudoId == PseudoIdFirstLetter && |
| 858 (parent.isSVGElement() || | 856 (parent.isSVGElement() || |
| 859 !FirstLetterPseudoElement::firstLetterTextLayoutObject(parent))) | 857 !FirstLetterPseudoElement::firstLetterTextLayoutObject(parent))) |
| 860 return nullptr; | 858 return nullptr; |
| 861 | 859 |
| 862 if (!canHaveGeneratedChildren(*parentLayoutObject)) | 860 // The backdrop pseudo element generates a new stacking context and its |
| 861 // layout object does not become a child of |parentLayoutObject|. The |
| 862 // exemption is needed so that replaced content also gets a backdrop. |
| 863 if (pseudoId != PseudoIdBackdrop && |
| 864 !canHaveGeneratedChildren(*parentLayoutObject)) |
| 863 return nullptr; | 865 return nullptr; |
| 864 | 866 |
| 865 ComputedStyle* parentStyle = parentLayoutObject->mutableStyle(); | 867 ComputedStyle* parentStyle = parentLayoutObject->mutableStyle(); |
| 866 if (ComputedStyle* cachedStyle = | 868 if (ComputedStyle* cachedStyle = |
| 867 parentStyle->getCachedPseudoStyle(pseudoId)) { | 869 parentStyle->getCachedPseudoStyle(pseudoId)) { |
| 868 if (!pseudoElementLayoutObjectIsNeeded(cachedStyle)) | 870 if (!pseudoElementLayoutObjectIsNeeded(cachedStyle)) |
| 869 return nullptr; | 871 return nullptr; |
| 870 return createPseudoElement(&parent, pseudoId); | 872 return createPseudoElement(&parent, pseudoId); |
| 871 } | 873 } |
| 872 | 874 |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1829 visitor->trace(m_medium); | 1831 visitor->trace(m_medium); |
| 1830 visitor->trace(m_viewportDependentMediaQueryResults); | 1832 visitor->trace(m_viewportDependentMediaQueryResults); |
| 1831 visitor->trace(m_deviceDependentMediaQueryResults); | 1833 visitor->trace(m_deviceDependentMediaQueryResults); |
| 1832 visitor->trace(m_selectorFilter); | 1834 visitor->trace(m_selectorFilter); |
| 1833 visitor->trace(m_styleSharingLists); | 1835 visitor->trace(m_styleSharingLists); |
| 1834 visitor->trace(m_pendingStyleSheets); | 1836 visitor->trace(m_pendingStyleSheets); |
| 1835 visitor->trace(m_document); | 1837 visitor->trace(m_document); |
| 1836 } | 1838 } |
| 1837 | 1839 |
| 1838 } // namespace blink | 1840 } // namespace blink |
| OLD | NEW |