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

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

Issue 1280423002: CSS4: Implement :placeholder-shown pseudo class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated testcase Created 5 years, 4 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
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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 if (ContainerNode* parent = element.parentElementOrDocumentFragment()) { 759 if (ContainerNode* parent = element.parentElementOrDocumentFragment()) {
760 if (m_mode == ResolvingStyle) { 760 if (m_mode == ResolvingStyle) {
761 parent->setChildrenAffectedByForwardPositionalRules(); 761 parent->setChildrenAffectedByForwardPositionalRules();
762 parent->setChildrenAffectedByBackwardPositionalRules(); 762 parent->setChildrenAffectedByBackwardPositionalRules();
763 } 763 }
764 if (!parent->isFinishedParsingChildren()) 764 if (!parent->isFinishedParsingChildren())
765 return false; 765 return false;
766 return isFirstOfType(element, element.tagQName()) && isLastOfType(el ement, element.tagQName()); 766 return isFirstOfType(element, element.tagQName()) && isLastOfType(el ement, element.tagQName());
767 } 767 }
768 break; 768 break;
769 case CSSSelector::PseudoPlaceholderShown:
770 if (isHTMLTextFormControlElement(element)) {
771 if (m_mode == ResolvingStyle) {
772 if (ComputedStyle* style = context.elementStyle ? context.elemen tStyle : element.mutableComputedStyle())
773 style->setUnique();
esprehn 2015/08/21 10:18:10 This should not make you unique, change SharedStyl
ramya.v 2015/08/25 10:24:45 Done.
774 }
775 return toHTMLTextFormControlElement(element).isPlaceholderVisible();
776 }
777 break;
769 case CSSSelector::PseudoNthChild: 778 case CSSSelector::PseudoNthChild:
770 if (ContainerNode* parent = element.parentElementOrDocumentFragment()) { 779 if (ContainerNode* parent = element.parentElementOrDocumentFragment()) {
771 if (m_mode == ResolvingStyle) 780 if (m_mode == ResolvingStyle)
772 parent->setChildrenAffectedByForwardPositionalRules(); 781 parent->setChildrenAffectedByForwardPositionalRules();
773 return selector.matchNth(nthChildIndex(element)); 782 return selector.matchNth(nthChildIndex(element));
774 } 783 }
775 break; 784 break;
776 case CSSSelector::PseudoNthOfType: 785 case CSSSelector::PseudoNthOfType:
777 if (ContainerNode* parent = element.parentElementOrDocumentFragment()) { 786 if (ContainerNode* parent = element.parentElementOrDocumentFragment()) {
778 if (m_mode == ResolvingStyle) 787 if (m_mode == ResolvingStyle)
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 } 1186 }
1178 1187
1179 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) 1188 bool SelectorChecker::matchesFocusPseudoClass(const Element& element)
1180 { 1189 {
1181 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus)) 1190 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus))
1182 return true; 1191 return true;
1183 return element.focused() && isFrameFocused(element); 1192 return element.focused() && isFrameFocused(element);
1184 } 1193 }
1185 1194
1186 } 1195 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698