Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1412)

Side by Side Diff: third_party/WebKit/Source/core/css/SelectorChecker.cpp

Issue 2202493002: NOT FOR REVIEW: Fullscreen WIP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16 matching lines...) Expand all
27 * Boston, MA 02110-1301, USA. 27 * Boston, MA 02110-1301, USA.
28 */ 28 */
29 29
30 #include "core/css/SelectorChecker.h" 30 #include "core/css/SelectorChecker.h"
31 31
32 #include "core/HTMLNames.h" 32 #include "core/HTMLNames.h"
33 #include "core/css/CSSSelectorList.h" 33 #include "core/css/CSSSelectorList.h"
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/dom/Element.h" 35 #include "core/dom/Element.h"
36 #include "core/dom/ElementTraversal.h" 36 #include "core/dom/ElementTraversal.h"
37 #include "core/dom/Fullscreen.h"
38 #include "core/dom/NodeComputedStyle.h" 37 #include "core/dom/NodeComputedStyle.h"
39 #include "core/dom/NthIndexCache.h" 38 #include "core/dom/NthIndexCache.h"
40 #include "core/dom/StyleEngine.h" 39 #include "core/dom/StyleEngine.h"
41 #include "core/dom/Text.h" 40 #include "core/dom/Text.h"
42 #include "core/dom/shadow/FlatTreeTraversal.h" 41 #include "core/dom/shadow/FlatTreeTraversal.h"
43 #include "core/dom/shadow/InsertionPoint.h" 42 #include "core/dom/shadow/InsertionPoint.h"
44 #include "core/dom/shadow/ShadowRoot.h" 43 #include "core/dom/shadow/ShadowRoot.h"
45 #include "core/editing/FrameSelection.h" 44 #include "core/editing/FrameSelection.h"
46 #include "core/frame/LocalFrame.h" 45 #include "core/frame/LocalFrame.h"
47 #include "core/html/HTMLDocument.h" 46 #include "core/html/HTMLDocument.h"
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 const AtomicString& argument = selector.argument(); 957 const AtomicString& argument = selector.argument();
959 if (value.isEmpty() || 958 if (value.isEmpty() ||
960 !value.startsWith(argument, TextCaseASCIIInsensitive)) 959 !value.startsWith(argument, TextCaseASCIIInsensitive))
961 break; 960 break;
962 if (value.length() != argument.length() && 961 if (value.length() != argument.length() &&
963 value[argument.length()] != '-') 962 value[argument.length()] != '-')
964 break; 963 break;
965 return true; 964 return true;
966 } 965 }
967 case CSSSelector::PseudoFullScreen: 966 case CSSSelector::PseudoFullScreen:
968 // While a Document is in the fullscreen state, and the document's current 967 return element.isFullscreen();
969 // fullscreen element is an element in the document, the 'full-screen'
970 // pseudoclass applies to that element. Also, an <iframe>, <object> or
971 // <embed> element whose child browsing context's Document is in the
972 // fullscreen state has the 'full-screen' pseudoclass applied.
973 if (isHTMLFrameElementBase(element) &&
974 element.containsFullScreenElement())
975 return true;
976 return Fullscreen::isCurrentFullScreenElement(element);
977 case CSSSelector::PseudoFullScreenAncestor:
978 return element.containsFullScreenElement();
979 case CSSSelector::PseudoInRange: 968 case CSSSelector::PseudoInRange:
980 if (m_mode == ResolvingStyle) 969 if (m_mode == ResolvingStyle)
981 element.document().setContainsValidityStyleRules(); 970 element.document().setContainsValidityStyleRules();
982 return element.isInRange(); 971 return element.isInRange();
983 case CSSSelector::PseudoOutOfRange: 972 case CSSSelector::PseudoOutOfRange:
984 if (m_mode == ResolvingStyle) 973 if (m_mode == ResolvingStyle)
985 element.document().setContainsValidityStyleRules(); 974 element.document().setContainsValidityStyleRules();
986 return element.isOutOfRange(); 975 return element.isOutOfRange();
987 case CSSSelector::PseudoFutureCue: 976 case CSSSelector::PseudoFutureCue:
988 return element.isVTTElement() && !toVTTElement(element).isPastNode(); 977 return element.isVTTElement() && !toVTTElement(element).isPastNode();
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 } 1259 }
1271 1260
1272 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) { 1261 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) {
1273 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element), 1262 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element),
1274 CSSSelector::PseudoFocus)) 1263 CSSSelector::PseudoFocus))
1275 return true; 1264 return true;
1276 return element.isFocused() && isFrameFocused(element); 1265 return element.isFocused() && isFrameFocused(element);
1277 } 1266 }
1278 1267
1279 } // namespace blink 1268 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.cpp ('k') | third_party/WebKit/Source/core/css/fullscreen.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698