| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return SelectorFailsLocally; | 147 return SelectorFailsLocally; |
| 148 } else if (context.selector->isContentPseudoElement()) { | 148 } else if (context.selector->isContentPseudoElement()) { |
| 149 if (!context.element->isInShadowTree() || !context.element->isInsert
ionPoint()) | 149 if (!context.element->isInShadowTree() || !context.element->isInsert
ionPoint()) |
| 150 return SelectorFailsLocally; | 150 return SelectorFailsLocally; |
| 151 } else { | 151 } else { |
| 152 if ((!context.elementStyle && m_mode == ResolvingStyle) || m_mode ==
QueryingRules) | 152 if ((!context.elementStyle && m_mode == ResolvingStyle) || m_mode ==
QueryingRules) |
| 153 return SelectorFailsLocally; | 153 return SelectorFailsLocally; |
| 154 | 154 |
| 155 PseudoId pseudoId = CSSSelector::pseudoId(context.selector->pseudoTy
pe()); | 155 PseudoId pseudoId = CSSSelector::pseudoId(context.selector->pseudoTy
pe()); |
| 156 if (pseudoId == FIRST_LETTER) | 156 if (pseudoId == FIRST_LETTER) |
| 157 context.element->document().styleSheetCollections()->setUsesFirs
tLetterRules(true); | 157 context.element->document().styleEngine()->setUsesFirstLetterRul
es(true); |
| 158 if (pseudoId != NOPSEUDO && m_mode != SharingRules) | 158 if (pseudoId != NOPSEUDO && m_mode != SharingRules) |
| 159 dynamicPseudo = pseudoId; | 159 dynamicPseudo = pseudoId; |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 // The rest of the selectors has to match | 163 // The rest of the selectors has to match |
| 164 CSSSelector::Relation relation = context.selector->relation(); | 164 CSSSelector::Relation relation = context.selector->relation(); |
| 165 | 165 |
| 166 // Prepare next selector | 166 // Prepare next selector |
| 167 const CSSSelector* historySelector = context.selector->tagHistory(); | 167 const CSSSelector* historySelector = context.selector->tagHistory(); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 if (!textNode->data().isEmpty()) { | 459 if (!textNode->data().isEmpty()) { |
| 460 result = false; | 460 result = false; |
| 461 break; | 461 break; |
| 462 } | 462 } |
| 463 } | 463 } |
| 464 } | 464 } |
| 465 if (m_mode == ResolvingStyle) { | 465 if (m_mode == ResolvingStyle) { |
| 466 element->setStyleAffectedByEmpty(); | 466 element->setStyleAffectedByEmpty(); |
| 467 if (context.elementStyle) | 467 if (context.elementStyle) |
| 468 context.elementStyle->setEmptyState(result); | 468 context.elementStyle->setEmptyState(result); |
| 469 else if (element->renderStyle() && (element->document().styl
eSheetCollections()->usesSiblingRules() || element->renderStyle()->unique())) | 469 else if (element->renderStyle() && (element->document().styl
eEngine()->usesSiblingRules() || element->renderStyle()->unique())) |
| 470 element->renderStyle()->setEmptyState(result); | 470 element->renderStyle()->setEmptyState(result); |
| 471 } | 471 } |
| 472 return result; | 472 return result; |
| 473 } | 473 } |
| 474 case CSSSelector::PseudoFirstChild: | 474 case CSSSelector::PseudoFirstChild: |
| 475 // first-child matches the first child that is an element | 475 // first-child matches the first child that is an element |
| 476 if (Element* parent = element->parentElement()) { | 476 if (Element* parent = element->parentElement()) { |
| 477 bool result = siblingTraversalStrategy.isFirstChild(element); | 477 bool result = siblingTraversalStrategy.isFirstChild(element); |
| 478 if (m_mode == ResolvingStyle) { | 478 if (m_mode == ResolvingStyle) { |
| 479 RenderStyle* childStyle = context.elementStyle ? context.ele
mentStyle : element->renderStyle(); | 479 RenderStyle* childStyle = context.elementStyle ? context.ele
mentStyle : element->renderStyle(); |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 return element->focused() && isFrameFocused(element); | 992 return element->focused() && isFrameFocused(element); |
| 993 } | 993 } |
| 994 | 994 |
| 995 template | 995 template |
| 996 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const DOMSiblingTraversalStrategy&) const; | 996 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const DOMSiblingTraversalStrategy&) const; |
| 997 | 997 |
| 998 template | 998 template |
| 999 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const ShadowDOMSiblingTraversalStrategy&) const; | 999 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps
eudoId&, const ShadowDOMSiblingTraversalStrategy&) const; |
| 1000 | 1000 |
| 1001 } | 1001 } |
| OLD | NEW |