| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #include "core/style/ComputedStyle.h" | 59 #include "core/style/ComputedStyle.h" |
| 60 #include "platform/scroll/ScrollableArea.h" | 60 #include "platform/scroll/ScrollableArea.h" |
| 61 #include "platform/scroll/ScrollbarTheme.h" | 61 #include "platform/scroll/ScrollbarTheme.h" |
| 62 #include "platform/wtf/AutoReset.h" | 62 #include "platform/wtf/AutoReset.h" |
| 63 | 63 |
| 64 namespace blink { | 64 namespace blink { |
| 65 | 65 |
| 66 using namespace HTMLNames; | 66 using namespace HTMLNames; |
| 67 | 67 |
| 68 static bool IsFrameFocused(const Element& element) { | 68 static bool IsFrameFocused(const Element& element) { |
| 69 return element.GetDocument().GetFrame() && | 69 return element.GetDocument().GetFrame() && element.GetDocument() |
| 70 element.GetDocument().GetFrame()->Selection().IsFocusedAndActive(); | 70 .GetFrame() |
| 71 ->Selection() |
| 72 .FrameIsFocusedAndActive(); |
| 71 } | 73 } |
| 72 | 74 |
| 73 static bool MatchesSpatialNavigationFocusPseudoClass(const Element& element) { | 75 static bool MatchesSpatialNavigationFocusPseudoClass(const Element& element) { |
| 74 return isHTMLOptionElement(element) && | 76 return isHTMLOptionElement(element) && |
| 75 toHTMLOptionElement(element).SpatialNavigationFocused() && | 77 toHTMLOptionElement(element).SpatialNavigationFocused() && |
| 76 IsFrameFocused(element); | 78 IsFrameFocused(element); |
| 77 } | 79 } |
| 78 | 80 |
| 79 static bool MatchesListBoxPseudoClass(const Element& element) { | 81 static bool MatchesListBoxPseudoClass(const Element& element) { |
| 80 return isHTMLSelectElement(element) && | 82 return isHTMLSelectElement(element) && |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 bool SelectorChecker::MatchesFocusPseudoClass(const Element& element) { | 1374 bool SelectorChecker::MatchesFocusPseudoClass(const Element& element) { |
| 1373 bool force_pseudo_state = false; | 1375 bool force_pseudo_state = false; |
| 1374 probe::forcePseudoState(const_cast<Element*>(&element), | 1376 probe::forcePseudoState(const_cast<Element*>(&element), |
| 1375 CSSSelector::kPseudoFocus, &force_pseudo_state); | 1377 CSSSelector::kPseudoFocus, &force_pseudo_state); |
| 1376 if (force_pseudo_state) | 1378 if (force_pseudo_state) |
| 1377 return true; | 1379 return true; |
| 1378 return element.IsFocused() && IsFrameFocused(element); | 1380 return element.IsFocused() && IsFrameFocused(element); |
| 1379 } | 1381 } |
| 1380 | 1382 |
| 1381 } // namespace blink | 1383 } // namespace blink |
| OLD | NEW |