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

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

Issue 18970003: Introduce isHTMLOptGroupElement and toHTMLOptGroupElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 26 matching lines...) Expand all
37 #include "core/dom/FullscreenController.h" 37 #include "core/dom/FullscreenController.h"
38 #include "core/dom/NodeRenderStyle.h" 38 #include "core/dom/NodeRenderStyle.h"
39 #include "core/dom/Text.h" 39 #include "core/dom/Text.h"
40 #include "core/dom/shadow/InsertionPoint.h" 40 #include "core/dom/shadow/InsertionPoint.h"
41 #include "core/dom/shadow/ShadowRoot.h" 41 #include "core/dom/shadow/ShadowRoot.h"
42 #include "core/editing/FrameSelection.h" 42 #include "core/editing/FrameSelection.h"
43 #include "core/html/HTMLAnchorElement.h" 43 #include "core/html/HTMLAnchorElement.h"
44 #include "core/html/HTMLDocument.h" 44 #include "core/html/HTMLDocument.h"
45 #include "core/html/HTMLFrameElementBase.h" 45 #include "core/html/HTMLFrameElementBase.h"
46 #include "core/html/HTMLInputElement.h" 46 #include "core/html/HTMLInputElement.h"
47 #include "core/html/HTMLOptGroupElement.h"
47 #include "core/html/HTMLOptionElement.h" 48 #include "core/html/HTMLOptionElement.h"
48 #include "core/html/parser/HTMLParserIdioms.h" 49 #include "core/html/parser/HTMLParserIdioms.h"
49 #include "core/inspector/InspectorInstrumentation.h" 50 #include "core/inspector/InspectorInstrumentation.h"
50 #include "core/page/FocusController.h" 51 #include "core/page/FocusController.h"
51 #include "core/page/Frame.h" 52 #include "core/page/Frame.h"
52 #include "core/page/Page.h" 53 #include "core/page/Page.h"
53 #include "core/platform/ScrollableArea.h" 54 #include "core/platform/ScrollableArea.h"
54 #include "core/platform/ScrollbarTheme.h" 55 #include "core/platform/ScrollbarTheme.h"
55 #include "core/rendering/RenderObject.h" 56 #include "core/rendering/RenderObject.h"
56 #include "core/rendering/RenderScrollbar.h" 57 #include "core/rendering/RenderScrollbar.h"
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 if (context.elementStyle) 611 if (context.elementStyle)
611 context.elementStyle->setAffectedByActive(); 612 context.elementStyle->setAffectedByActive();
612 else 613 else
613 element->setChildrenAffectedByActive(true); 614 element->setChildrenAffectedByActive(true);
614 } 615 }
615 if (element->active() || InspectorInstrumentation::forcePseudoSt ate(element, CSSSelector::PseudoActive)) 616 if (element->active() || InspectorInstrumentation::forcePseudoSt ate(element, CSSSelector::PseudoActive))
616 return true; 617 return true;
617 } 618 }
618 break; 619 break;
619 case CSSSelector::PseudoEnabled: 620 case CSSSelector::PseudoEnabled:
620 if (element && (element->isFormControlElement() || element->hasTagNa me(optionTag) || element->hasTagName(optgroupTag))) 621 if (element && (element->isFormControlElement() || element->hasTagNa me(optionTag) || isHTMLOptGroupElement(element)))
621 return !element->isDisabledFormControl(); 622 return !element->isDisabledFormControl();
622 break; 623 break;
623 case CSSSelector::PseudoFullPageMedia: 624 case CSSSelector::PseudoFullPageMedia:
624 return element && element->document() && element->document()->isMedi aDocument(); 625 return element && element->document() && element->document()->isMedi aDocument();
625 break; 626 break;
626 case CSSSelector::PseudoDefault: 627 case CSSSelector::PseudoDefault:
627 return element && element->isDefaultButtonForForm(); 628 return element && element->isDefaultButtonForForm();
628 case CSSSelector::PseudoDisabled: 629 case CSSSelector::PseudoDisabled:
629 if (element && (element->isFormControlElement() || element->hasTagNa me(optionTag) || element->hasTagName(optgroupTag))) 630 if (element && (element->isFormControlElement() || element->hasTagNa me(optionTag) || isHTMLOptGroupElement(element)))
630 return element->isDisabledFormControl(); 631 return element->isDisabledFormControl();
631 break; 632 break;
632 case CSSSelector::PseudoReadOnly: 633 case CSSSelector::PseudoReadOnly:
633 return element && element->matchesReadOnlyPseudoClass(); 634 return element && element->matchesReadOnlyPseudoClass();
634 case CSSSelector::PseudoReadWrite: 635 case CSSSelector::PseudoReadWrite:
635 return element && element->matchesReadWritePseudoClass(); 636 return element && element->matchesReadWritePseudoClass();
636 case CSSSelector::PseudoOptional: 637 case CSSSelector::PseudoOptional:
637 return element && element->isOptionalFormControl(); 638 return element && element->isOptionalFormControl();
638 case CSSSelector::PseudoRequired: 639 case CSSSelector::PseudoRequired:
639 return element && element->isRequiredFormControl(); 640 return element && element->isRequiredFormControl();
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 return element->focused() && isFrameFocused(element); 912 return element->focused() && isFrameFocused(element);
912 } 913 }
913 914
914 template 915 template
915 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps eudoId&, const DOMSiblingTraversalStrategy&) const; 916 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps eudoId&, const DOMSiblingTraversalStrategy&) const;
916 917
917 template 918 template
918 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps eudoId&, const ShadowDOMSiblingTraversalStrategy&) const; 919 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, Ps eudoId&, const ShadowDOMSiblingTraversalStrategy&) const;
919 920
920 } 921 }
OLDNEW
« no previous file with comments | « Source/core/accessibility/AccessibilityListBoxOption.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698