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

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

Issue 1129313003: Compare :lang value case-insensitive in ASCII range (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use EXPECT instead of ASSERT Created 5 years, 7 months 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
« no previous file with comments | « LayoutTests/fast/css/case-sensitive-004-expected.xhtml ('k') | Source/wtf/text/StringImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. 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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 case CSSSelector::PseudoRoot: 957 case CSSSelector::PseudoRoot:
958 return element == element.document().documentElement(); 958 return element == element.document().documentElement();
959 case CSSSelector::PseudoLang: 959 case CSSSelector::PseudoLang:
960 { 960 {
961 AtomicString value; 961 AtomicString value;
962 if (element.isVTTElement()) 962 if (element.isVTTElement())
963 value = toVTTElement(element).language(); 963 value = toVTTElement(element).language();
964 else 964 else
965 value = element.computeInheritedLanguage(); 965 value = element.computeInheritedLanguage();
966 const AtomicString& argument = selector.argument(); 966 const AtomicString& argument = selector.argument();
967 if (value.isEmpty() || !value.startsWith(argument, TextCaseInsensiti ve)) 967 if (value.isEmpty() || !startsWithIgnoringASCIICase(value, argument) )
968 break; 968 break;
969 if (value.length() != argument.length() && value[argument.length()] != '-') 969 if (value.length() != argument.length() && value[argument.length()] != '-')
970 break; 970 break;
971 return true; 971 return true;
972 } 972 }
973 case CSSSelector::PseudoFullScreen: 973 case CSSSelector::PseudoFullScreen:
974 // While a Document is in the fullscreen state, and the document's curre nt fullscreen 974 // While a Document is in the fullscreen state, and the document's curre nt fullscreen
975 // element is an element in the document, the 'full-screen' pseudoclass applies to 975 // element is an element in the document, the 'full-screen' pseudoclass applies to
976 // that element. Also, an <iframe>, <object> or <embed> element whose ch ild browsing 976 // that element. Also, an <iframe>, <object> or <embed> element whose ch ild browsing
977 // context's Document is in the fullscreen state has the 'full-screen' p seudoclass applied. 977 // context's Document is in the fullscreen state has the 'full-screen' p seudoclass applied.
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 } 1200 }
1201 1201
1202 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) 1202 bool SelectorChecker::matchesFocusPseudoClass(const Element& element)
1203 { 1203 {
1204 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus)) 1204 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus))
1205 return true; 1205 return true;
1206 return element.focused() && isFrameFocused(element); 1206 return element.focused() && isFrameFocused(element);
1207 } 1207 }
1208 1208
1209 } 1209 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/case-sensitive-004-expected.xhtml ('k') | Source/wtf/text/StringImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698