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 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 // Use FlatTreeTraversal to traverse a composed ancestor list of a given | 1172 // Use FlatTreeTraversal to traverse a composed ancestor list of a given |
1173 // element. | 1173 // element. |
1174 Element* nextElement = &element; | 1174 Element* nextElement = &element; |
1175 SelectorCheckingContext hostContext(subContext); | 1175 SelectorCheckingContext hostContext(subContext); |
1176 do { | 1176 do { |
1177 MatchResult subResult; | 1177 MatchResult subResult; |
1178 hostContext.element = nextElement; | 1178 hostContext.element = nextElement; |
1179 if (match(hostContext, subResult)) { | 1179 if (match(hostContext, subResult)) { |
1180 matched = true; | 1180 matched = true; |
1181 // Consider div:host(div:host(div:host(div:host...))). | 1181 // Consider div:host(div:host(div:host(div:host...))). |
1182 maxSpecificity = | 1182 maxSpecificity = std::max( |
1183 std::max(maxSpecificity, hostContext.selector->specificity() + | 1183 maxSpecificity, |
1184 subResult.specificity); | 1184 hostContext.selector->specificity() + subResult.specificity); |
1185 break; | 1185 break; |
1186 } | 1186 } |
1187 hostContext.treatShadowHostAsNormalScope = false; | 1187 hostContext.treatShadowHostAsNormalScope = false; |
1188 hostContext.scope = nullptr; | 1188 hostContext.scope = nullptr; |
1189 | 1189 |
1190 if (selector.getPseudoType() == CSSSelector::PseudoHost) | 1190 if (selector.getPseudoType() == CSSSelector::PseudoHost) |
1191 break; | 1191 break; |
1192 | 1192 |
1193 hostContext.inRightmostCompound = false; | 1193 hostContext.inRightmostCompound = false; |
1194 nextElement = FlatTreeTraversal::parentElement(*nextElement); | 1194 nextElement = FlatTreeTraversal::parentElement(*nextElement); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 } | 1308 } |
1309 | 1309 |
1310 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) { | 1310 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) { |
1311 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element), | 1311 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element), |
1312 CSSSelector::PseudoFocus)) | 1312 CSSSelector::PseudoFocus)) |
1313 return true; | 1313 return true; |
1314 return element.isFocused() && isFrameFocused(element); | 1314 return element.isFocused() && isFrameFocused(element); |
1315 } | 1315 } |
1316 | 1316 |
1317 } // namespace blink | 1317 } // namespace blink |
OLD | NEW |