| 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 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 case CSSSelector::Child: | 476 case CSSSelector::Child: |
| 477 { | 477 { |
| 478 ContainerNode* n = e->parentNode(); | 478 ContainerNode* n = e->parentNode(); |
| 479 if (!n || !n->isElementNode()) | 479 if (!n || !n->isElementNode()) |
| 480 return SelectorFailsCompletely; | 480 return SelectorFailsCompletely; |
| 481 e = static_cast<Element*>(n); | 481 e = static_cast<Element*>(n); |
| 482 return checkSelector(sel, e, dynamicPseudo, false, visitedMatchType)
; | 482 return checkSelector(sel, e, dynamicPseudo, false, visitedMatchType)
; |
| 483 } | 483 } |
| 484 case CSSSelector::DirectAdjacent: | 484 case CSSSelector::DirectAdjacent: |
| 485 { | 485 { |
| 486 if (!m_isCollectingRulesOnly) { | 486 if (!m_isCollectingRulesOnly && e->parentNode() && e->parentNode()->
isElementNode()) { |
| 487 RenderStyle* currentStyle = elementStyle ? elementStyle : e->ren
derStyle(); | 487 RenderStyle* parentStyle = elementStyle ? elementParentStyle : e
->parentNode()->renderStyle(); |
| 488 if (currentStyle) | 488 if (parentStyle) |
| 489 currentStyle->setAffectedByDirectAdjacentRules(); | 489 parentStyle->setChildrenAffectedByDirectAdjacentRules(); |
| 490 } | 490 } |
| 491 Node* n = e->previousSibling(); | 491 Node* n = e->previousSibling(); |
| 492 while (n && !n->isElementNode()) | 492 while (n && !n->isElementNode()) |
| 493 n = n->previousSibling(); | 493 n = n->previousSibling(); |
| 494 if (!n) | 494 if (!n) |
| 495 return SelectorFailsLocally; | 495 return SelectorFailsLocally; |
| 496 e = static_cast<Element*>(n); | 496 e = static_cast<Element*>(n); |
| 497 return checkSelector(sel, e, dynamicPseudo, false, visitedMatchType)
; | 497 return checkSelector(sel, e, dynamicPseudo, false, visitedMatchType)
; |
| 498 } | 498 } |
| 499 case CSSSelector::IndirectAdjacent: | 499 case CSSSelector::IndirectAdjacent: |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 } | 1371 } |
| 1372 return linkMatchType; | 1372 return linkMatchType; |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 bool SelectorChecker::isFrameFocused(const Element* element) | 1375 bool SelectorChecker::isFrameFocused(const Element* element) |
| 1376 { | 1376 { |
| 1377 return element->document()->frame() && element->document()->frame()->selecti
on()->isFocusedAndActive(); | 1377 return element->document()->frame() && element->document()->frame()->selecti
on()->isFocusedAndActive(); |
| 1378 } | 1378 } |
| 1379 | 1379 |
| 1380 } | 1380 } |
| OLD | NEW |